var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var _a, _b, _c2, _d, _e2, _f, _g, _h, _i, _j, _k2, _l, _m, _n2, _o2, _p, _q, _r2, _s2, _t2, _u2, _v, _w, _x, _y2, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N2, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X2, _Y, _Z, __2, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib, _Jb, _Kb, _Lb, _Mb, _Nb, _Ob, _Pb, _Qb, _Rb, _Sb, _Tb, _Ub, _Vb, _Wb, _Xb, _Yb, _Zb, __b, _$b, _ac, _bc, _cc, _dc, _ec, _fc, _gc, _hc, _ic, _jc, _kc, _lc, _mc, _nc, _oc, _pc, _qc, _rc, _sc, _tc, _uc, _vc, _wc, _xc, _yc, _zc, _Ac, _Bc, _Cc, _Dc, _Ec, _Fc, _Gc, _Hc, _Ic, _Jc, _Kc, _Lc, _Mc, _Nc, _Oc, _Pc, _Qc, _Rc, _Sc, _Tc, _Uc, _Vc, _Wc, _Xc, _Yc, _Zc, __c, _$c, _ad, _bd, _cd, _dd, _ed, _fd, _gd, _hd, _id, _jd, _kd, _ld, _md, _nd, _od, _pd, _qd, _rd, _sd, _td, _ud, _vd, _wd, _xd, _yd, _zd, _Ad, _Bd, _Cd, _Dd, _Ed, _Fd, _Gd, _Hd, _Id, _Jd, _Kd, _Ld, _Md, _Nd, _Od, _Pd, _Qd, _Rd, _Sd, _Td, _Ud, _Vd, _Wd, _Xd, _Yd, _Zd, __d, _$d, _ae2, _be2, _ce2, _de2, _ee2, _fe2, _ge2, _he2, _ie2, _je2, _ke2, _le2, _me2, _ne2, _oe2, _pe2, _qe, _re2, _se2, _te2, _ue2, _ve2, _we2, _xe2;
import { r as e } from "./chunk-DlkHe4MQ.js";
import { n as t, t as n } from "./dist-CdD61QBB.js";
import { n as r, t as i } from "./dist-YmA3yiKr.js";
function a(e206) {
  if (e206.length === 0) throw Error(`Invalid tail call`);
  return [e206.slice(0, e206.length - 1), e206[e206.length - 1]];
}
function o(e206, t10, n10 = (e207, t11) => e207 === t11) {
  if (e206 === t10) return true;
  if (!e206 || !t10 || e206.length !== t10.length) return false;
  for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) if (!n10(e206[r10], t10[r10])) return false;
  return true;
}
function s(e206, t10) {
  let n10 = e206.length - 1;
  t10 < n10 && (e206[t10] = e206[n10]), e206.pop();
}
function c(e206, t10, n10) {
  return l(e206.length, (r10) => n10(e206[r10], t10));
}
function l(e206, t10) {
  let n10 = 0, r10 = e206 - 1;
  for (; n10 <= r10; ) {
    let e207 = (n10 + r10) / 2 | 0, i10 = t10(e207);
    if (i10 < 0) n10 = e207 + 1;
    else if (i10 > 0) r10 = e207 - 1;
    else return e207;
  }
  return -(n10 + 1);
}
function u(e206, t10, n10) {
  if (e206 |= 0, e206 >= t10.length) throw TypeError(`invalid index`);
  let r10 = t10[Math.floor(t10.length * Math.random())], i10 = [], a10 = [], o10 = [];
  for (let e207 of t10) {
    let t11 = n10(e207, r10);
    t11 < 0 ? i10.push(e207) : t11 > 0 ? a10.push(e207) : o10.push(e207);
  }
  return e206 < i10.length ? u(e206, i10, n10) : e206 < i10.length + o10.length ? o10[0] : u(e206 - (i10.length + o10.length), a10, n10);
}
function d(e206, t10) {
  let n10 = [], r10;
  for (let i10 of e206.slice(0).sort(t10)) !r10 || t10(r10[0], i10) !== 0 ? (r10 = [i10], n10.push(r10)) : r10.push(i10);
  return n10;
}
function* f(e206, t10) {
  let n10, r10;
  for (let i10 of e206) r10 !== void 0 && t10(r10, i10) ? n10.push(i10) : (n10 && (yield n10), n10 = [i10]), r10 = i10;
  n10 && (yield n10);
}
function p(e206, t10) {
  for (let n10 = 0; n10 <= e206.length; n10++) t10(n10 === 0 ? void 0 : e206[n10 - 1], n10 === e206.length ? void 0 : e206[n10]);
}
function m(e206, t10) {
  for (let n10 = 0; n10 < e206.length; n10++) t10(n10 === 0 ? void 0 : e206[n10 - 1], e206[n10], n10 + 1 === e206.length ? void 0 : e206[n10 + 1]);
}
function h(e206) {
  return e206.filter((e207) => !!e207);
}
function g(e206) {
  let t10 = 0;
  for (let n10 = 0; n10 < e206.length; n10++) e206[n10] && (e206[t10] = e206[n10], t10 += 1);
  e206.length = t10;
}
function _(e206) {
  return !Array.isArray(e206) || e206.length === 0;
}
function v(e206) {
  return Array.isArray(e206) && e206.length > 0;
}
function y(e206, t10 = (e207) => e207) {
  let n10 = /* @__PURE__ */ new Set();
  return e206.filter((e207) => {
    let r10 = t10(e207);
    return n10.has(r10) ? false : (n10.add(r10), true);
  });
}
function b(e206, t10) {
  let n10 = typeof t10 == `number` ? e206 : 0;
  typeof t10 == `number` ? n10 = e206 : (n10 = 0, t10 = e206);
  let r10 = [];
  if (n10 <= t10) for (let e207 = n10; e207 < t10; e207++) r10.push(e207);
  else for (let e207 = n10; e207 > t10; e207--) r10.push(e207);
  return r10;
}
function x(e206, t10, n10) {
  let r10 = e206.slice(0, t10), i10 = e206.slice(t10);
  return r10.concat(n10, i10);
}
function S(e206, t10) {
  let n10 = e206.indexOf(t10);
  n10 > -1 && (e206.splice(n10, 1), e206.unshift(t10));
}
function ee(e206, t10) {
  let n10 = e206.indexOf(t10);
  n10 > -1 && (e206.splice(n10, 1), e206.push(t10));
}
function te(e206, t10) {
  for (let n10 of t10) e206.push(n10);
}
function ne(e206, t10) {
  let n10 = [];
  for (let r10 of e206) {
    let e207 = t10(r10);
    e207 !== void 0 && n10.push(e207);
  }
  return n10;
}
function re(e206) {
  return Array.isArray(e206) ? e206 : [e206];
}
function ie(e206, t10, n10) {
  let r10 = oe(e206, t10), i10 = e206.length, a10 = n10.length;
  e206.length = i10 + a10;
  for (let t11 = i10 - 1; t11 >= r10; t11--) e206[t11 + a10] = e206[t11];
  for (let t11 = 0; t11 < a10; t11++) e206[t11 + r10] = n10[t11];
}
function ae(e206, t10, n10, r10) {
  let i10 = oe(e206, t10), a10 = e206.splice(i10, n10);
  return a10 === void 0 && (a10 = []), ie(e206, i10, r10), a10;
}
function oe(e206, t10) {
  return t10 < 0 ? Math.max(t10 + e206.length, 0) : Math.min(t10, e206.length);
}
var se;
(function(e206) {
  function t10(e207) {
    return e207 < 0;
  }
  e206.isLessThan = t10;
  function n10(e207) {
    return e207 <= 0;
  }
  e206.isLessThanOrEqual = n10;
  function r10(e207) {
    return e207 > 0;
  }
  e206.isGreaterThan = r10;
  function i10(e207) {
    return e207 === 0;
  }
  e206.isNeitherLessOrGreaterThan = i10, e206.greaterThan = 1, e206.lessThan = -1, e206.neitherLessOrGreaterThan = 0;
})(se || (se = {}));
function ce(e206, t10) {
  return (n10, r10) => t10(e206(n10), e206(r10));
}
function le(...e206) {
  return (t10, n10) => {
    for (let r10 of e206) {
      let e207 = r10(t10, n10);
      if (!se.isNeitherLessOrGreaterThan(e207)) return e207;
    }
    return se.neitherLessOrGreaterThan;
  };
}
var ue = (e206, t10) => e206 - t10, de = (e206, t10) => ue(+!!e206, +!!t10);
function fe(e206) {
  return (t10, n10) => -e206(t10, n10);
}
function pe(e206) {
  return (t10, n10) => t10 === void 0 ? n10 === void 0 ? se.neitherLessOrGreaterThan : se.lessThan : n10 === void 0 ? se.greaterThan : e206(t10, n10);
}
var me = class {
  constructor(e206) {
    this.firstIdx = 0, this.items = e206, this.lastIdx = this.items.length - 1;
  }
  get length() {
    return this.lastIdx - this.firstIdx + 1;
  }
  takeWhile(e206) {
    let t10 = this.firstIdx;
    for (; t10 < this.items.length && e206(this.items[t10]); ) t10++;
    let n10 = t10 === this.firstIdx ? null : this.items.slice(this.firstIdx, t10);
    return this.firstIdx = t10, n10;
  }
  takeFromEndWhile(e206) {
    let t10 = this.lastIdx;
    for (; t10 >= 0 && e206(this.items[t10]); ) t10--;
    let n10 = t10 === this.lastIdx ? null : this.items.slice(t10 + 1, this.lastIdx + 1);
    return this.lastIdx = t10, n10;
  }
  peek() {
    if (this.length !== 0) return this.items[this.firstIdx];
  }
  dequeue() {
    let e206 = this.items[this.firstIdx];
    return this.firstIdx++, e206;
  }
  takeCount(e206) {
    let t10 = this.items.slice(this.firstIdx, this.firstIdx + e206);
    return this.firstIdx += e206, t10;
  }
}, he = (_a = class {
  constructor(e206) {
    this.iterate = e206;
  }
  toArray() {
    let e206 = [];
    return this.iterate((t10) => (e206.push(t10), true)), e206;
  }
  filter(t10) {
    return new _a((e206) => this.iterate((n10) => t10(n10) ? e206(n10) : true));
  }
  map(t10) {
    return new _a((e206) => this.iterate((n10) => e206(t10(n10))));
  }
  findLast(e206) {
    let t10;
    return this.iterate((n10) => (e206(n10) && (t10 = n10), true)), t10;
  }
  findLastMaxBy(e206) {
    let t10, n10 = true;
    return this.iterate((r10) => ((n10 || se.isGreaterThan(e206(r10, t10))) && (n10 = false, t10 = r10), true)), t10;
  }
}, _a.empty = new _a((e206) => {
}), _a), ge = class e2 {
  constructor(e206) {
    this._indexMap = e206;
  }
  static createSortPermutation(t10, n10) {
    return new e2(Array.from(t10.keys()).sort((e206, r10) => n10(t10[e206], t10[r10])));
  }
  apply(e206) {
    return e206.map((t10, n10) => e206[this._indexMap[n10]]);
  }
  inverse() {
    let t10 = this._indexMap.slice();
    for (let e206 = 0; e206 < this._indexMap.length; e206++) t10[this._indexMap[e206]] = e206;
    return new e2(t10);
  }
};
function _e(e206) {
  return e206.reduce((e207, t10) => e207 + t10, 0);
}
var ve = new class {
  constructor() {
    this.listeners = [], this.unexpectedErrorHandler = function(e206) {
      setTimeout(() => {
        throw e206.stack ? Ae.isErrorNoTelemetry(e206) ? new Ae(e206.message + `

` + e206.stack) : Error(e206.message + `

` + e206.stack) : e206;
      }, 0);
    };
  }
  emit(e206) {
    this.listeners.forEach((t10) => {
      t10(e206);
    });
  }
  onUnexpectedError(e206) {
    this.unexpectedErrorHandler(e206), this.emit(e206);
  }
  onUnexpectedExternalError(e206) {
    this.unexpectedErrorHandler(e206);
  }
}();
function ye(e206) {
  ve.onUnexpectedError(e206);
}
function be(e206) {
  we(e206) || ve.onUnexpectedError(e206);
}
function xe(e206) {
  we(e206) || ve.onUnexpectedExternalError(e206);
}
function Se(e206) {
  if (e206 instanceof Error) {
    let { name: t10, message: n10, cause: r10 } = e206;
    return { $isError: true, name: t10, message: n10, stack: e206.stacktrace || e206.stack, noTelemetry: Ae.isErrorNoTelemetry(e206), cause: r10 ? Se(r10) : void 0, code: e206.code };
  }
  return e206;
}
var Ce = `Canceled`;
function we(e206) {
  return e206 instanceof Te ? true : e206 instanceof Error && e206.name === `Canceled` && e206.message === `Canceled`;
}
var Te = class extends Error {
  constructor() {
    super(Ce), this.name = this.message;
  }
};
function Ee() {
  let e206 = Error(Ce);
  return e206.name = e206.message, e206;
}
function De(e206) {
  return Error(e206 ? `Illegal argument: ${e206}` : `Illegal argument`);
}
function Oe(e206) {
  return Error(e206 ? `Illegal state: ${e206}` : `Illegal state`);
}
var ke = class extends Error {
  constructor(e206) {
    super(`NotSupported`), e206 && (this.message = e206);
  }
}, Ae = class e3 extends Error {
  constructor(e206) {
    super(e206), this.name = `CodeExpectedError`;
  }
  static fromError(t10) {
    if (t10 instanceof e3) return t10;
    let n10 = new e3();
    return n10.message = t10.message, n10.stack = t10.stack, n10;
  }
  static isErrorNoTelemetry(e206) {
    return e206.name === `CodeExpectedError`;
  }
}, je = class e4 extends Error {
  constructor(t10) {
    super(t10 || `An unexpected bug occurred.`), Object.setPrototypeOf(this, e4.prototype);
  }
};
function Me(e206, t10) {
  if (!e206) throw Error(t10 ? `Assertion failed (${t10})` : `Assertion Failed`);
}
function Ne(e206, t10 = `Unreachable`) {
  throw Error(t10);
}
function Pe(e206, t10 = `unexpected state`) {
  if (!e206) throw typeof t10 == `string` ? new je(`Assertion Failed: ${t10}`) : t10;
}
function Fe(e206, t10 = `Soft Assertion Failed`) {
  e206 || be(new je(t10));
}
function Ie(e206) {
  e206() || (e206(), be(new je(`Assertion Failed`)));
}
function Le(e206, t10) {
  let n10 = 0;
  for (; n10 < e206.length - 1; ) {
    let r10 = e206[n10], i10 = e206[n10 + 1];
    if (!t10(r10, i10)) return false;
    n10++;
  }
  return true;
}
function Re(e206) {
  return typeof e206 == `string`;
}
function ze(e206, t10) {
  return Array.isArray(e206) && e206.every(t10);
}
function Be(e206) {
  return typeof e206 == `object` && !!e206 && !Array.isArray(e206) && !(e206 instanceof RegExp) && !(e206 instanceof Date);
}
function Ve(e206) {
  return typeof e206 == `object` && e206 instanceof Object.getPrototypeOf(Uint8Array);
}
function He(e206) {
  return typeof e206 == `number` && !isNaN(e206);
}
function Ue(e206) {
  return !!e206 && typeof e206[Symbol.iterator] == `function`;
}
function We(e206) {
  return e206 === true || e206 === false;
}
function Ge(e206) {
  return e206 === void 0;
}
function Ke(e206) {
  return !qe(e206);
}
function qe(e206) {
  return Ge(e206) || e206 === null;
}
function Je(e206, t10) {
  if (!e206) throw Error(t10 ? `Unexpected type, expected '${t10}'` : `Unexpected type`);
}
function Ye(e206) {
  return Pe(e206 != null, "Argument is `undefined` or `null`."), e206;
}
function Xe(e206) {
  return typeof e206 == `function`;
}
function Ze(e206, t10) {
  let n10 = Math.min(e206.length, t10.length);
  for (let r10 = 0; r10 < n10; r10++) Qe(e206[r10], t10[r10]);
}
function Qe(e206, t10) {
  if (Re(t10)) {
    if (typeof e206 !== t10) throw Error(`argument does not match constraint: typeof ${t10}`);
  } else if (Xe(t10)) {
    try {
      if (e206 instanceof t10) return;
    } catch {
    }
    if (!qe(e206) && e206.constructor === t10 || t10.length === 1 && t10.call(void 0, e206) === true) return;
    throw Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);
  }
}
function $e(e206) {
  return e206;
}
function et(e206) {
  if (!e206 || typeof e206 != `object` || e206 instanceof RegExp) return e206;
  let t10 = Array.isArray(e206) ? [] : {};
  return Object.entries(e206).forEach(([e207, n10]) => {
    t10[e207] = n10 && typeof n10 == `object` ? et(n10) : n10;
  }), t10;
}
function tt(e206) {
  if (!e206 || typeof e206 != `object`) return e206;
  let t10 = [e206];
  for (; t10.length > 0; ) {
    let e207 = t10.shift();
    Object.freeze(e207);
    for (let n10 in e207) if (nt.call(e207, n10)) {
      let r10 = e207[n10];
      typeof r10 == `object` && !Object.isFrozen(r10) && !Ve(r10) && t10.push(r10);
    }
  }
  return e206;
}
var nt = Object.prototype.hasOwnProperty;
function rt(e206, t10) {
  return it(e206, t10, /* @__PURE__ */ new Set());
}
function it(e206, t10, n10) {
  if (qe(e206)) return e206;
  let r10 = t10(e206);
  if (r10 !== void 0) return r10;
  if (Array.isArray(e206)) {
    let r11 = [];
    for (let i10 of e206) r11.push(it(i10, t10, n10));
    return r11;
  }
  if (Be(e206)) {
    if (n10.has(e206)) throw Error(`Cannot clone recursive data-structure`);
    n10.add(e206);
    let r11 = {};
    for (let i10 in e206) nt.call(e206, i10) && (r11[i10] = it(e206[i10], t10, n10));
    return n10.delete(e206), r11;
  }
  return e206;
}
function at(e206, t10, n10 = true) {
  return Be(e206) ? (Be(t10) && Object.keys(t10).forEach((r10) => {
    r10 in e206 ? n10 && (Be(e206[r10]) && Be(t10[r10]) ? at(e206[r10], t10[r10], n10) : e206[r10] = t10[r10]) : e206[r10] = t10[r10];
  }), e206) : t10;
}
function ot(e206, t10) {
  if (e206 === t10) return true;
  if (e206 == null || t10 == null || typeof e206 != typeof t10 || typeof e206 != `object` || Array.isArray(e206) !== Array.isArray(t10)) return false;
  let n10, r10;
  if (Array.isArray(e206)) {
    if (e206.length !== t10.length) return false;
    for (n10 = 0; n10 < e206.length; n10++) if (!ot(e206[n10], t10[n10])) return false;
  } else {
    let i10 = [];
    for (r10 in e206) i10.push(r10);
    i10.sort();
    let a10 = [];
    for (r10 in t10) a10.push(r10);
    if (a10.sort(), !ot(i10, a10)) return false;
    for (n10 = 0; n10 < i10.length; n10++) if (!ot(e206[i10[n10]], t10[i10[n10]])) return false;
  }
  return true;
}
i();
function st() {
  return globalThis._VSCODE_NLS_MESSAGES;
}
function ct() {
  return globalThis._VSCODE_NLS_LANGUAGE;
}
var lt = ct() === `pseudo` || typeof document < `u` && document.location && typeof document.location.hash == `string` && document.location.hash.indexOf(`pseudo=true`) >= 0;
function ut(e206, t10) {
  let n10;
  return n10 = t10.length === 0 ? e206 : e206.replace(/\{(\d+)\}/g, (e207, n11) => {
    let r10 = t10[n11[0]], i10 = e207;
    return typeof r10 == `string` ? i10 = r10 : (typeof r10 == `number` || typeof r10 == `boolean` || r10 == null) && (i10 = String(r10)), i10;
  }), lt && (n10 = `\uFF3B` + n10.replace(/[aouei]/g, `$&$&`) + `\uFF3D`), n10;
}
function C(e206, t10, ...n10) {
  return ut(typeof e206 == `number` ? dt(e206, t10) : t10, n10);
}
function dt(e206, t10) {
  let n10 = st()?.[e206];
  if (typeof n10 != `string`) {
    if (typeof t10 == `string`) return t10;
    throw Error(`!!! NLS MISSING: ${e206} !!!`);
  }
  return n10;
}
function w(e206, t10, ...n10) {
  let r10;
  r10 = typeof e206 == `number` ? dt(e206, t10) : t10;
  let i10 = ut(r10, n10);
  return { value: i10, original: t10 === r10 ? i10 : ut(t10, n10) };
}
var ft = false, pt = false, mt = false, ht = false, gt = false, _t = false, vt = false, yt = `en`, bt = void 0, xt = globalThis, St = void 0;
xt.vscode !== void 0 && xt.vscode.process !== void 0 ? St = xt.vscode.process : r !== void 0 && typeof r?.versions?.node == `string` && (St = r);
var eee = typeof St?.versions?.electron == `string` && St?.type === `renderer`;
if (typeof St == `object`) {
  ft = St.platform === `win32`, pt = St.platform === `darwin`, mt = St.platform === `linux`, mt && St.env.SNAP && St.env.SNAP_REVISION, St.env.CI || St.env.BUILD_ARTIFACTSTAGINGDIRECTORY || St.env.GITHUB_WORKSPACE, yt = `en`;
  let e206 = St.env.VSCODE_NLS_CONFIG;
  if (e206) try {
    let t10 = JSON.parse(e206);
    t10.userLocale, t10.osLocale, yt = t10.resolvedLanguage || `en`, t10.languagePack?.translationsConfigFile;
  } catch {
  }
  ht = true;
} else typeof navigator == `object` && !eee ? (bt = navigator.userAgent, ft = bt.indexOf(`Windows`) >= 0, pt = bt.indexOf(`Macintosh`) >= 0, _t = (bt.indexOf(`Macintosh`) >= 0 || bt.indexOf(`iPad`) >= 0 || bt.indexOf(`iPhone`) >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0, mt = bt.indexOf(`Linux`) >= 0, vt = bt?.indexOf(`Mobi`) >= 0, gt = true, yt = ct() || `en`, navigator.language.toLowerCase()) : console.error(`Unable to resolve platform.`);
var Ct = 0;
pt ? Ct = 1 : ft ? Ct = 3 : mt && (Ct = 2);
var wt = ft, Tt = pt, Et = mt, Dt = ht, Ot = gt, tee = gt && typeof xt.importScripts == `function` ? xt.origin : void 0, kt = _t, At = vt, jt = Ct, Mt = bt, nee = yt, ree = typeof xt.postMessage == `function` && !xt.importScripts, Nt = (() => {
  if (ree) {
    let e206 = [];
    xt.addEventListener(`message`, (t11) => {
      if (t11.data && t11.data.vscodeScheduleAsyncWork) for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
        let r11 = e206[n10];
        if (r11.id === t11.data.vscodeScheduleAsyncWork) {
          e206.splice(n10, 1), r11.callback();
          return;
        }
      }
    });
    let t10 = 0;
    return (n10) => {
      let r10 = ++t10;
      e206.push({ id: r10, callback: n10 }), xt.postMessage({ vscodeScheduleAsyncWork: r10 }, `*`);
    };
  }
  return (e206) => setTimeout(e206);
})(), Pt = pt || _t ? 2 : ft ? 1 : 3, Ft = true, It = false;
function Lt() {
  if (!It) {
    It = true;
    let e206 = new Uint8Array(2);
    e206[0] = 1, e206[1] = 2, Ft = new Uint16Array(e206.buffer)[0] === 513;
  }
  return Ft;
}
var Rt = !!(Mt && Mt.indexOf(`Chrome`) >= 0), zt = !!(Mt && Mt.indexOf(`Firefox`) >= 0), iee = !!(!Rt && Mt && Mt.indexOf(`Safari`) >= 0), Bt = !!(Mt && Mt.indexOf(`Edg/`) >= 0), Vt = !!(Mt && Mt.indexOf(`Android`) >= 0);
function Ht(e206, t10) {
  let n10 = this, r10 = false, i10;
  return function() {
    return r10 ? i10 : (r10 = true, i10 = e206.apply(n10, arguments), i10);
  };
}
var Ut;
(function(e206) {
  function t10(e207) {
    return !!e207 && typeof e207 == `object` && typeof e207[Symbol.iterator] == `function`;
  }
  e206.is = t10;
  let n10 = Object.freeze([]);
  function r10() {
    return n10;
  }
  e206.empty = r10;
  function* i10(e207) {
    yield e207;
  }
  e206.single = i10;
  function a10(e207) {
    return t10(e207) ? e207 : i10(e207);
  }
  e206.wrap = a10;
  function o10(e207) {
    return e207 || n10;
  }
  e206.from = o10;
  function* s10(e207) {
    for (let t11 = e207.length - 1; t11 >= 0; t11--) yield e207[t11];
  }
  e206.reverse = s10;
  function c10(e207) {
    return !e207 || e207[Symbol.iterator]().next().done === true;
  }
  e206.isEmpty = c10;
  function l10(e207) {
    return e207[Symbol.iterator]().next().value;
  }
  e206.first = l10;
  function u10(e207, t11) {
    let n11 = 0;
    for (let r11 of e207) if (t11(r11, n11++)) return true;
    return false;
  }
  e206.some = u10;
  function d10(e207, t11) {
    let n11 = 0;
    for (let r11 of e207) if (!t11(r11, n11++)) return false;
    return true;
  }
  e206.every = d10;
  function f10(e207, t11) {
    for (let n11 of e207) if (t11(n11)) return n11;
  }
  e206.find = f10;
  function* p10(e207, t11) {
    for (let n11 of e207) t11(n11) && (yield n11);
  }
  e206.filter = p10;
  function* m10(e207, t11) {
    let n11 = 0;
    for (let r11 of e207) yield t11(r11, n11++);
  }
  e206.map = m10;
  function* h10(e207, t11) {
    let n11 = 0;
    for (let r11 of e207) yield* t11(r11, n11++);
  }
  e206.flatMap = h10;
  function* g10(...e207) {
    for (let t11 of e207) Ue(t11) ? yield* t11 : yield t11;
  }
  e206.concat = g10;
  function _10(e207, t11, n11) {
    let r11 = n11;
    for (let n12 of e207) r11 = t11(r11, n12);
    return r11;
  }
  e206.reduce = _10;
  function v10(e207) {
    let t11 = 0;
    for (let n11 of e207) t11++;
    return t11;
  }
  e206.length = v10;
  function* y10(e207, t11, n11 = e207.length) {
    for (t11 < -e207.length && (t11 = 0), t11 < 0 && (t11 += e207.length), n11 < 0 ? n11 += e207.length : n11 > e207.length && (n11 = e207.length); t11 < n11; t11++) yield e207[t11];
  }
  e206.slice = y10;
  function b10(t11, n11 = 1 / 0) {
    let r11 = [];
    if (n11 === 0) return [r11, t11];
    let i11 = t11[Symbol.iterator]();
    for (let t12 = 0; t12 < n11; t12++) {
      let t13 = i11.next();
      if (t13.done) return [r11, e206.empty()];
      r11.push(t13.value);
    }
    return [r11, { [Symbol.iterator]() {
      return i11;
    } }];
  }
  e206.consume = b10;
  async function x10(e207) {
    let t11 = [];
    for await (let n11 of e207) t11.push(n11);
    return t11;
  }
  e206.asyncToArray = x10;
  async function S10(e207) {
    let t11 = [];
    for await (let n11 of e207) t11 = t11.concat(n11);
    return t11;
  }
  e206.asyncToArrayFlat = S10;
})(Ut || (Ut = {}));
function Wt(e206) {
  return e206;
}
function Gt(e206) {
  return typeof e206 == `object` && !!e206 && typeof e206.dispose == `function` && e206.dispose.length === 0;
}
function Kt(e206) {
  if (Ut.is(e206)) {
    let t10 = [];
    for (let n10 of e206) if (n10) try {
      n10.dispose();
    } catch (e207) {
      t10.push(e207);
    }
    if (t10.length === 1) throw t10[0];
    if (t10.length > 1) throw AggregateError(t10, `Encountered errors while disposing of store`);
    return Array.isArray(e206) ? [] : e206;
  } else if (e206) return e206.dispose(), e206;
}
function qt(...e206) {
  return T(() => Kt(e206));
}
var aee = class {
  constructor(e206) {
    this._isDisposed = false, this._fn = e206;
  }
  dispose() {
    if (!this._isDisposed) {
      if (!this._fn) throw Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`);
      this._isDisposed = true, this._fn();
    }
  }
};
function T(e206) {
  return new aee(e206);
}
var E = (_b = class {
  constructor() {
    this._toDispose = /* @__PURE__ */ new Set(), this._isDisposed = false;
  }
  dispose() {
    this._isDisposed || (this._isDisposed = true, this.clear());
  }
  get isDisposed() {
    return this._isDisposed;
  }
  clear() {
    if (this._toDispose.size !== 0) try {
      Kt(this._toDispose);
    } finally {
      this._toDispose.clear();
    }
  }
  add(t10) {
    if (!t10 || t10 === D.None) return t10;
    if (t10 === this) throw Error(`Cannot register a disposable on itself!`);
    return this._isDisposed ? _b.DISABLE_DISPOSED_WARNING || console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack) : this._toDispose.add(t10), t10;
  }
  delete(e206) {
    if (e206) {
      if (e206 === this) throw Error(`Cannot dispose a disposable on itself!`);
      this._toDispose.delete(e206), e206.dispose();
    }
  }
}, _b.DISABLE_DISPOSED_WARNING = false, _b), D = (_c2 = class {
  constructor() {
    this._store = new E(), this._store;
  }
  dispose() {
    this._store.dispose();
  }
  _register(e206) {
    if (e206 === this) throw Error(`Cannot register a disposable on itself!`);
    return this._store.add(e206);
  }
}, _c2.None = Object.freeze({ dispose() {
} }), _c2), Jt = class {
  constructor() {
    this._isDisposed = false;
  }
  get value() {
    return this._isDisposed ? void 0 : this._value;
  }
  set value(e206) {
    this._isDisposed || e206 === this._value || (this._value?.dispose(), this._value = e206);
  }
  clear() {
    this.value = void 0;
  }
  dispose() {
    this._isDisposed = true, this._value?.dispose(), this._value = void 0;
  }
}, Yt = class {
  constructor(e206) {
    this._disposable = e206, this._counter = 1;
  }
  acquire() {
    return this._counter++, this;
  }
  release() {
    return --this._counter === 0 && this._disposable.dispose(), this;
  }
}, oee = class {
  constructor(e206) {
    this.object = e206;
  }
  dispose() {
  }
}, Xt = class {
  constructor() {
    this._store = /* @__PURE__ */ new Map(), this._isDisposed = false;
  }
  dispose() {
    this._isDisposed = true, this.clearAndDisposeAll();
  }
  clearAndDisposeAll() {
    if (this._store.size) try {
      Kt(this._store.values());
    } finally {
      this._store.clear();
    }
  }
  get(e206) {
    return this._store.get(e206);
  }
  set(e206, t10, n10 = false) {
    this._isDisposed && console.warn(Error(`Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!`).stack), n10 || this._store.get(e206)?.dispose(), this._store.set(e206, t10);
  }
  deleteAndDispose(e206) {
    this._store.get(e206)?.dispose(), this._store.delete(e206);
  }
  values() {
    return this._store.values();
  }
  [Symbol.iterator]() {
    return this._store[Symbol.iterator]();
  }
}, Zt = (_d = class {
  constructor(t10) {
    this.element = t10, this.next = _d.Undefined, this.prev = _d.Undefined;
  }
}, _d.Undefined = new _d(void 0), _d), Qt = class {
  constructor() {
    this._first = Zt.Undefined, this._last = Zt.Undefined, this._size = 0;
  }
  get size() {
    return this._size;
  }
  isEmpty() {
    return this._first === Zt.Undefined;
  }
  clear() {
    let e206 = this._first;
    for (; e206 !== Zt.Undefined; ) {
      let t10 = e206.next;
      e206.prev = Zt.Undefined, e206.next = Zt.Undefined, e206 = t10;
    }
    this._first = Zt.Undefined, this._last = Zt.Undefined, this._size = 0;
  }
  unshift(e206) {
    return this._insert(e206, false);
  }
  push(e206) {
    return this._insert(e206, true);
  }
  _insert(e206, t10) {
    let n10 = new Zt(e206);
    if (this._first === Zt.Undefined) this._first = n10, this._last = n10;
    else if (t10) {
      let e207 = this._last;
      this._last = n10, n10.prev = e207, e207.next = n10;
    } else {
      let e207 = this._first;
      this._first = n10, n10.next = e207, e207.prev = n10;
    }
    this._size += 1;
    let r10 = false;
    return () => {
      r10 || (r10 = true, this._remove(n10));
    };
  }
  shift() {
    if (this._first !== Zt.Undefined) {
      let e206 = this._first.element;
      return this._remove(this._first), e206;
    }
  }
  pop() {
    if (this._last !== Zt.Undefined) {
      let e206 = this._last.element;
      return this._remove(this._last), e206;
    }
  }
  _remove(e206) {
    if (e206.prev !== Zt.Undefined && e206.next !== Zt.Undefined) {
      let t10 = e206.prev;
      t10.next = e206.next, e206.next.prev = t10;
    } else e206.prev === Zt.Undefined && e206.next === Zt.Undefined ? (this._first = Zt.Undefined, this._last = Zt.Undefined) : e206.next === Zt.Undefined ? (this._last = this._last.prev, this._last.next = Zt.Undefined) : e206.prev === Zt.Undefined && (this._first = this._first.next, this._first.prev = Zt.Undefined);
    --this._size;
  }
  *[Symbol.iterator]() {
    let e206 = this._first;
    for (; e206 !== Zt.Undefined; ) yield e206.element, e206 = e206.next;
  }
}, see = globalThis.performance.now.bind(globalThis.performance), $t = class e5 {
  static create(t10) {
    return new e5(t10);
  }
  constructor(e206) {
    this._now = e206 === false ? Date.now : see, this._startTime = this._now(), this._stopTime = -1;
  }
  stop() {
    this._stopTime = this._now();
  }
  reset() {
    this._startTime = this._now(), this._stopTime = -1;
  }
  elapsed() {
    return this._stopTime === -1 ? this._now() - this._startTime : this._stopTime - this._startTime;
  }
}, O;
(function(e206) {
  e206.None = () => D.None;
  function t10(e207, t11) {
    return f10(e207, () => void 0, 0, void 0, true, void 0, t11);
  }
  e206.defer = t10;
  function n10(e207) {
    return (t11, n11 = null, r11) => {
      let i11 = false, a11;
      return a11 = e207((e208) => {
        if (!i11) return a11 ? a11.dispose() : i11 = true, t11.call(n11, e208);
      }, null, r11), i11 && a11.dispose(), a11;
    };
  }
  e206.once = n10;
  function r10(t11, n11) {
    return e206.once(e206.filter(t11, n11));
  }
  e206.onceIf = r10;
  function i10(e207, t11, n11) {
    return u10((n12, r11 = null, i11) => e207((e208) => n12.call(r11, t11(e208)), null, i11), n11);
  }
  e206.map = i10;
  function a10(e207, t11, n11) {
    return u10((n12, r11 = null, i11) => e207((e208) => {
      t11(e208), n12.call(r11, e208);
    }, null, i11), n11);
  }
  e206.forEach = a10;
  function o10(e207, t11, n11) {
    return u10((n12, r11 = null, i11) => e207((e208) => t11(e208) && n12.call(r11, e208), null, i11), n11);
  }
  e206.filter = o10;
  function s10(e207) {
    return e207;
  }
  e206.signal = s10;
  function c10(...e207) {
    return (t11, n11 = null, r11) => d10(qt(...e207.map((e208) => e208((e209) => t11.call(n11, e209)))), r11);
  }
  e206.any = c10;
  function l10(e207, t11, n11, r11) {
    let a11 = n11;
    return i10(e207, (e208) => (a11 = t11(a11, e208), a11), r11);
  }
  e206.reduce = l10;
  function u10(e207, t11) {
    let n11, r11 = new k({ onWillAddFirstListener() {
      n11 = e207(r11.fire, r11);
    }, onDidRemoveLastListener() {
      n11?.dispose();
    } });
    return t11?.add(r11), r11.event;
  }
  function d10(e207, t11) {
    return t11 instanceof Array ? t11.push(e207) : t11 && t11.add(e207), e207;
  }
  function f10(e207, t11, n11 = 100, r11 = false, i11 = false, a11, o11) {
    let s11, c11, l11, u11 = 0, d11, f11 = new k({ leakWarningThreshold: a11, onWillAddFirstListener() {
      s11 = e207((e208) => {
        u11++, c11 = t11(c11, e208), r11 && !l11 && (f11.fire(c11), c11 = void 0), d11 = () => {
          let e209 = c11;
          c11 = void 0, l11 = void 0, (!r11 || u11 > 1) && f11.fire(e209), u11 = 0;
        }, typeof n11 == `number` ? (l11 && clearTimeout(l11), l11 = setTimeout(d11, n11)) : l11 === void 0 && (l11 = null, queueMicrotask(d11));
      });
    }, onWillRemoveListener() {
      i11 && u11 > 0 && d11?.();
    }, onDidRemoveLastListener() {
      d11 = void 0, s11.dispose();
    } });
    return o11?.add(f11), f11.event;
  }
  e206.debounce = f10;
  function p10(t11, n11 = 0, r11) {
    return e206.debounce(t11, (e207, t12) => e207 ? (e207.push(t12), e207) : [t12], n11, void 0, true, void 0, r11);
  }
  e206.accumulate = p10;
  function m10(e207, t11 = (e208, t12) => e208 === t12, n11) {
    let r11 = true, i11;
    return o10(e207, (e208) => {
      let n12 = r11 || !t11(e208, i11);
      return r11 = false, i11 = e208, n12;
    }, n11);
  }
  e206.latch = m10;
  function h10(t11, n11, r11) {
    return [e206.filter(t11, n11, r11), e206.filter(t11, (e207) => !n11(e207), r11)];
  }
  e206.split = h10;
  function g10(e207, t11 = false, n11 = [], r11) {
    let i11 = n11.slice(), a11 = e207((e208) => {
      i11 ? i11.push(e208) : s11.fire(e208);
    });
    r11 && r11.add(a11);
    let o11 = () => {
      i11?.forEach((e208) => s11.fire(e208)), i11 = null;
    }, s11 = new k({ onWillAddFirstListener() {
      a11 || (a11 = e207((e208) => s11.fire(e208)), r11 && r11.add(a11));
    }, onDidAddFirstListener() {
      i11 && (t11 ? setTimeout(o11) : o11());
    }, onDidRemoveLastListener() {
      a11 && a11.dispose(), a11 = null;
    } });
    return r11 && r11.add(s11), s11.event;
  }
  e206.buffer = g10;
  function _10(e207, t11) {
    return (n11, r11, i11) => {
      let a11 = t11(new y10());
      return e207(function(e208) {
        let t12 = a11.evaluate(e208);
        t12 !== v10 && n11.call(r11, t12);
      }, void 0, i11);
    };
  }
  e206.chain = _10;
  let v10 = /* @__PURE__ */ Symbol(`HaltChainable`);
  class y10 {
    constructor() {
      this.steps = [];
    }
    map(e207) {
      return this.steps.push(e207), this;
    }
    forEach(e207) {
      return this.steps.push((t11) => (e207(t11), t11)), this;
    }
    filter(e207) {
      return this.steps.push((t11) => e207(t11) ? t11 : v10), this;
    }
    reduce(e207, t11) {
      let n11 = t11;
      return this.steps.push((t12) => (n11 = e207(n11, t12), n11)), this;
    }
    latch(e207 = (e208, t11) => e208 === t11) {
      let t11 = true, n11;
      return this.steps.push((r11) => {
        let i11 = t11 || !e207(r11, n11);
        return t11 = false, n11 = r11, i11 ? r11 : v10;
      }), this;
    }
    evaluate(e207) {
      for (let t11 of this.steps) if (e207 = t11(e207), e207 === v10) break;
      return e207;
    }
  }
  function b10(e207, t11, n11 = (e208) => e208) {
    let r11 = (...e208) => i11.fire(n11(...e208)), i11 = new k({ onWillAddFirstListener: () => e207.on(t11, r11), onDidRemoveLastListener: () => e207.removeListener(t11, r11) });
    return i11.event;
  }
  e206.fromNodeEventEmitter = b10;
  function x10(e207, t11, n11 = (e208) => e208) {
    let r11 = (...e208) => i11.fire(n11(...e208)), i11 = new k({ onWillAddFirstListener: () => e207.addEventListener(t11, r11), onDidRemoveLastListener: () => e207.removeEventListener(t11, r11) });
    return i11.event;
  }
  e206.fromDOMEventEmitter = x10;
  function S10(e207, t11) {
    let r11, i11 = new Promise((i12, a11) => {
      let o11 = n10(e207)(i12, null, t11);
      r11 = () => o11.dispose();
    });
    return i11.cancel = r11, i11;
  }
  e206.toPromise = S10;
  function ee2(e207, t11) {
    return e207((e208) => t11.fire(e208));
  }
  e206.forward = ee2;
  function te2(e207, t11, n11) {
    return t11(n11), e207((e208) => t11(e208));
  }
  e206.runAndSubscribe = te2;
  class ne2 {
    constructor(e207, t11) {
      this._observable = e207, this._counter = 0, this._hasChanged = false, this.emitter = new k({ onWillAddFirstListener: () => {
        e207.addObserver(this), this._observable.reportChanges();
      }, onDidRemoveLastListener: () => {
        e207.removeObserver(this);
      } }), t11 && t11.add(this.emitter);
    }
    beginUpdate(e207) {
      this._counter++;
    }
    handlePossibleChange(e207) {
    }
    handleChange(e207, t11) {
      this._hasChanged = true;
    }
    endUpdate(e207) {
      this._counter--, this._counter === 0 && (this._observable.reportChanges(), this._hasChanged && (this._hasChanged = false, this.emitter.fire(this._observable.get())));
    }
  }
  function re2(e207, t11) {
    return new ne2(e207, t11).emitter.event;
  }
  e206.fromObservable = re2;
  function ie2(e207) {
    return (t11, n11, r11) => {
      let i11 = 0, a11 = false, o11 = { beginUpdate() {
        i11++;
      }, endUpdate() {
        i11--, i11 === 0 && (e207.reportChanges(), a11 && (a11 = false, t11.call(n11)));
      }, handlePossibleChange() {
      }, handleChange() {
        a11 = true;
      } };
      e207.addObserver(o11), e207.reportChanges();
      let s11 = { dispose() {
        e207.removeObserver(o11);
      } };
      return r11 instanceof E ? r11.add(s11) : Array.isArray(r11) && r11.push(s11), s11;
    };
  }
  e206.fromObservableLight = ie2;
})(O || (O = {}));
var en = (_e2 = class {
  constructor(t10) {
    this.listenerCount = 0, this.invocationCount = 0, this.elapsedOverall = 0, this.durations = [], this.name = `${t10}_${_e2._idPool++}`, _e2.all.add(this);
  }
  start(e206) {
    this._stopWatch = new $t(), this.listenerCount = e206;
  }
  stop() {
    if (this._stopWatch) {
      let e206 = this._stopWatch.elapsed();
      this.durations.push(e206), this.elapsedOverall += e206, this.invocationCount += 1, this._stopWatch = void 0;
    }
  }
}, _e2.all = /* @__PURE__ */ new Set(), _e2._idPool = 0, _e2), tn = -1, nn = (_f = class {
  constructor(t10, n10, r10 = (_f._idPool++).toString(16).padStart(3, `0`)) {
    this._errorHandler = t10, this.threshold = n10, this.name = r10, this._warnCountdown = 0;
  }
  dispose() {
    this._stacks?.clear();
  }
  check(e206, t10) {
    let n10 = this.threshold;
    if (n10 <= 0 || t10 < n10) return;
    this._stacks || (this._stacks = /* @__PURE__ */ new Map());
    let r10 = this._stacks.get(e206.value) || 0;
    if (this._stacks.set(e206.value, r10 + 1), --this._warnCountdown, this._warnCountdown <= 0) {
      this._warnCountdown = n10 * 0.5;
      let [e207, r11] = this.getMostFrequentStack(), i10 = `[${this.name}] potential listener LEAK detected, having ${t10} listeners already. MOST frequent listener (${r11}):`;
      console.warn(i10), console.warn(e207);
      let a10 = new an(i10, e207);
      this._errorHandler(a10);
    }
    return () => {
      let t11 = this._stacks.get(e206.value) || 0;
      this._stacks.set(e206.value, t11 - 1);
    };
  }
  getMostFrequentStack() {
    if (!this._stacks) return;
    let e206, t10 = 0;
    for (let [n10, r10] of this._stacks) (!e206 || t10 < r10) && (e206 = [n10, r10], t10 = r10);
    return e206;
  }
}, _f._idPool = 1, _f), rn = class e6 {
  static create() {
    return new e6(Error().stack ?? ``);
  }
  constructor(e206) {
    this.value = e206;
  }
  print() {
    console.warn(this.value.split(`
`).slice(2).join(`
`));
  }
}, an = class extends Error {
  constructor(e206, t10) {
    super(e206), this.name = `ListenerLeakError`, this.stack = t10;
  }
}, on = class extends Error {
  constructor(e206, t10) {
    super(e206), this.name = `ListenerRefusalError`, this.stack = t10;
  }
}, sn = class {
  constructor(e206) {
    this.value = e206;
  }
}, cee = 2, k = class {
  constructor(e206) {
    this._size = 0, this._options = e206, this._leakageMon = this._options?.leakWarningThreshold ? new nn(e206?.onListenerError ?? be, this._options?.leakWarningThreshold ?? tn) : void 0, this._perfMon = this._options?._profName ? new en(this._options._profName) : void 0, this._deliveryQueue = this._options?.deliveryQueue;
  }
  dispose() {
    this._disposed || (this._disposed = true, this._deliveryQueue?.current === this && this._deliveryQueue.reset(), this._listeners && (this._listeners = void 0, this._size = 0), this._options?.onDidRemoveLastListener?.(), this._leakageMon?.dispose());
  }
  get event() {
    return this._event ?? (this._event = (e206, t10, n10) => {
      if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
        let e207 = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
        console.warn(e207);
        let t11 = this._leakageMon.getMostFrequentStack() ?? [`UNKNOWN stack`, -1], n11 = new on(`${e207}. HINT: Stack shows most frequent listener (${t11[1]}-times)`, t11[0]);
        return (this._options?.onListenerError || be)(n11), D.None;
      }
      if (this._disposed) return D.None;
      t10 && (e206 = e206.bind(t10));
      let r10 = new sn(e206), i10;
      this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2) && (r10.stack = rn.create(), i10 = this._leakageMon.check(r10.stack, this._size + 1)), this._listeners ? this._listeners instanceof sn ? (this._deliveryQueue ?? (this._deliveryQueue = new cn()), this._listeners = [this._listeners, r10]) : this._listeners.push(r10) : (this._options?.onWillAddFirstListener?.(this), this._listeners = r10, this._options?.onDidAddFirstListener?.(this)), this._options?.onDidAddListener?.(this), this._size++;
      let a10 = T(() => {
        i10?.(), this._removeListener(r10);
      });
      return n10 instanceof E ? n10.add(a10) : Array.isArray(n10) && n10.push(a10), a10;
    }), this._event;
  }
  _removeListener(e206) {
    if (this._options?.onWillRemoveListener?.(this), !this._listeners) return;
    if (this._size === 1) {
      this._listeners = void 0, this._options?.onDidRemoveLastListener?.(this), this._size = 0;
      return;
    }
    let t10 = this._listeners, n10 = t10.indexOf(e206);
    if (n10 === -1) throw console.log(`disposed?`, this._disposed), console.log(`size?`, this._size), console.log(`arr?`, JSON.stringify(this._listeners)), Error(`Attempted to dispose unknown listener`);
    this._size--, t10[n10] = void 0;
    let r10 = this._deliveryQueue.current === this;
    if (this._size * cee <= t10.length) {
      let e207 = 0;
      for (let n11 = 0; n11 < t10.length; n11++) t10[n11] ? t10[e207++] = t10[n11] : r10 && e207 < this._deliveryQueue.end && (this._deliveryQueue.end--, e207 < this._deliveryQueue.i && this._deliveryQueue.i--);
      t10.length = e207;
    }
  }
  _deliver(e206, t10) {
    if (!e206) return;
    let n10 = this._options?.onListenerError || be;
    if (!n10) {
      e206.value(t10);
      return;
    }
    try {
      e206.value(t10);
    } catch (e207) {
      n10(e207);
    }
  }
  _deliverQueue(e206) {
    let t10 = e206.current._listeners;
    for (; e206.i < e206.end; ) this._deliver(t10[e206.i++], e206.value);
    e206.reset();
  }
  fire(e206) {
    if (this._deliveryQueue?.current && (this._deliverQueue(this._deliveryQueue), this._perfMon?.stop()), this._perfMon?.start(this._size), this._listeners) if (this._listeners instanceof sn) this._deliver(this._listeners, e206);
    else {
      let t10 = this._deliveryQueue;
      t10.enqueue(this, e206, this._listeners.length), this._deliverQueue(t10);
    }
    this._perfMon?.stop();
  }
  hasListeners() {
    return this._size > 0;
  }
}, lee = () => new cn(), cn = class {
  constructor() {
    this.i = -1, this.end = 0;
  }
  enqueue(e206, t10, n10) {
    this.i = 0, this.end = n10, this.current = e206, this.value = t10;
  }
  reset() {
    this.i = this.end, this.current = void 0, this.value = void 0;
  }
}, ln = class extends k {
  constructor(e206) {
    super(e206), this._isPaused = 0, this._eventQueue = new Qt(), this._mergeFn = e206?.merge;
  }
  pause() {
    this._isPaused++;
  }
  resume() {
    if (this._isPaused !== 0 && --this._isPaused === 0) if (this._mergeFn) {
      if (this._eventQueue.size > 0) {
        let e206 = Array.from(this._eventQueue);
        this._eventQueue.clear(), super.fire(this._mergeFn(e206));
      }
    } else for (; !this._isPaused && this._eventQueue.size !== 0; ) super.fire(this._eventQueue.shift());
  }
  fire(e206) {
    this._size && (this._isPaused === 0 ? super.fire(e206) : this._eventQueue.push(e206));
  }
}, un = class extends ln {
  constructor(e206) {
    super(e206), this._delay = e206.delay ?? 100;
  }
  fire(e206) {
    this._handle || (this._handle = (this.pause(), setTimeout(() => {
      this._handle = void 0, this.resume();
    }, this._delay))), super.fire(e206);
  }
}, uee = class extends k {
  constructor(e206) {
    super(e206), this._queuedEvents = [], this._mergeFn = e206?.merge;
  }
  fire(e206) {
    this.hasListeners() && (this._queuedEvents.push(e206), this._queuedEvents.length === 1 && queueMicrotask(() => {
      this._mergeFn ? super.fire(this._mergeFn(this._queuedEvents)) : this._queuedEvents.forEach((e207) => super.fire(e207)), this._queuedEvents = [];
    }));
  }
}, dee = class {
  constructor() {
    this.hasListeners = false, this.events = [], this.emitter = new k({ onWillAddFirstListener: () => this.onFirstListenerAdd(), onDidRemoveLastListener: () => this.onLastListenerRemove() });
  }
  get event() {
    return this.emitter.event;
  }
  add(e206) {
    let t10 = { event: e206, listener: null };
    return this.events.push(t10), this.hasListeners && this.hook(t10), T(Ht(() => {
      this.hasListeners && this.unhook(t10);
      let e207 = this.events.indexOf(t10);
      this.events.splice(e207, 1);
    }));
  }
  onFirstListenerAdd() {
    this.hasListeners = true, this.events.forEach((e206) => this.hook(e206));
  }
  onLastListenerRemove() {
    this.hasListeners = false, this.events.forEach((e206) => this.unhook(e206));
  }
  hook(e206) {
    e206.listener = e206.event((e207) => this.emitter.fire(e207));
  }
  unhook(e206) {
    e206.listener?.dispose(), e206.listener = null;
  }
  dispose() {
    this.emitter.dispose();
    for (let e206 of this.events) e206.listener?.dispose();
    this.events = [];
  }
}, dn = class {
  constructor() {
    this.data = [];
  }
  wrapEvent(e206, t10, n10) {
    return (r10, i10, a10) => e206((e207) => {
      let a11 = this.data[this.data.length - 1];
      if (!t10) {
        a11 ? a11.buffers.push(() => r10.call(i10, e207)) : r10.call(i10, e207);
        return;
      }
      let o10 = a11;
      if (!o10) {
        r10.call(i10, t10(n10, e207));
        return;
      }
      o10.items ?? (o10.items = []), o10.items.push(e207), o10.buffers.length === 0 && a11.buffers.push(() => {
        o10.reducedResult ?? (o10.reducedResult = n10 ? o10.items.reduce(t10, n10) : o10.items.reduce(t10)), r10.call(i10, o10.reducedResult);
      });
    }, void 0, a10);
  }
  bufferEvents(e206) {
    let t10 = { buffers: [] };
    this.data.push(t10);
    let n10 = e206();
    return this.data.pop(), t10.buffers.forEach((e207) => e207()), n10;
  }
}, fn = class {
  constructor() {
    this.listening = false, this.inputEvent = O.None, this.inputEventListener = D.None, this.emitter = new k({ onDidAddFirstListener: () => {
      this.listening = true, this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);
    }, onDidRemoveLastListener: () => {
      this.listening = false, this.inputEventListener.dispose();
    } }), this.event = this.emitter.event;
  }
  set input(e206) {
    this.inputEvent = e206, this.listening && (this.inputEventListener.dispose(), this.inputEventListener = e206(this.emitter.fire, this.emitter));
  }
  dispose() {
    this.inputEventListener.dispose(), this.emitter.dispose();
  }
}, pn = new class {
  constructor() {
    this._zoomLevel = 0, this._onDidChangeZoomLevel = new k(), this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event;
  }
  getZoomLevel() {
    return this._zoomLevel;
  }
  setZoomLevel(e206) {
    e206 = Math.min(Math.max(-5, e206), 20), this._zoomLevel !== e206 && (this._zoomLevel = e206, this._onDidChangeZoomLevel.fire(this._zoomLevel));
  }
}(), fee = Tt ? 1.5 : 1.35, mn = class e7 {
  static _create(t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    o10 === 0 ? o10 = fee * r10 : o10 < 8 && (o10 *= r10), o10 = Math.round(o10), o10 < 8 && (o10 = 8);
    let u10 = 1 + (l10 ? 0 : pn.getZoomLevel() * 0.1);
    return r10 *= u10, o10 *= u10, a10 === `translate` && (n10 === `normal` || n10 === `bold` ? a10 = gn : (a10 = `'wght' ${parseInt(n10, 10)}`, n10 = `normal`)), new e7({ pixelRatio: c10, fontFamily: t10, fontWeight: n10, fontSize: r10, fontFeatureSettings: i10, fontVariationSettings: a10, lineHeight: o10, letterSpacing: s10 });
  }
  constructor(e206) {
    this._bareFontInfoBrand = void 0, this.pixelRatio = e206.pixelRatio, this.fontFamily = String(e206.fontFamily), this.fontWeight = String(e206.fontWeight), this.fontSize = e206.fontSize, this.fontFeatureSettings = e206.fontFeatureSettings, this.fontVariationSettings = e206.fontVariationSettings, this.lineHeight = e206.lineHeight | 0, this.letterSpacing = e206.letterSpacing;
  }
  getId() {
    return `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;
  }
  getMassagedFontFamily() {
    let t10 = _n.fontFamily, n10 = e7._wrapInQuotes(this.fontFamily);
    return this.fontFamily === t10 ? n10 : `${n10}, ${t10}`;
  }
  static _wrapInQuotes(e206) {
    return /[,"']/.test(e206) ? e206 : /[+ ]/.test(e206) ? `"${e206}"` : e206;
  }
}, hn = class extends mn {
  constructor(e206, t10) {
    super(e206), this._editorStylingBrand = void 0, this.version = 2, this.isTrusted = t10, this.isMonospace = e206.isMonospace, this.typicalHalfwidthCharacterWidth = e206.typicalHalfwidthCharacterWidth, this.typicalFullwidthCharacterWidth = e206.typicalFullwidthCharacterWidth, this.canUseHalfwidthRightwardsArrow = e206.canUseHalfwidthRightwardsArrow, this.spaceWidth = e206.spaceWidth, this.middotWidth = e206.middotWidth, this.wsmiddotWidth = e206.wsmiddotWidth, this.maxDigitWidth = e206.maxDigitWidth;
  }
  equals(e206) {
    return this.fontFamily === e206.fontFamily && this.fontWeight === e206.fontWeight && this.fontSize === e206.fontSize && this.fontFeatureSettings === e206.fontFeatureSettings && this.fontVariationSettings === e206.fontVariationSettings && this.lineHeight === e206.lineHeight && this.letterSpacing === e206.letterSpacing && this.typicalHalfwidthCharacterWidth === e206.typicalHalfwidthCharacterWidth && this.typicalFullwidthCharacterWidth === e206.typicalFullwidthCharacterWidth && this.canUseHalfwidthRightwardsArrow === e206.canUseHalfwidthRightwardsArrow && this.spaceWidth === e206.spaceWidth && this.middotWidth === e206.middotWidth && this.wsmiddotWidth === e206.wsmiddotWidth && this.maxDigitWidth === e206.maxDigitWidth;
  }
}, gn = `normal`, pee = `translate`, _n = { fontFamily: Tt ? `Menlo, Monaco, 'Courier New', monospace` : wt ? `Consolas, 'Courier New', monospace` : `'Droid Sans Mono', 'monospace', monospace`, fontWeight: `normal`, fontSize: Tt ? 12 : 14, lineHeight: 0, letterSpacing: 0 }, vn = { tabSize: 4, indentSize: 4, insertSpaces: true, detectIndentation: true, trimAutoWhitespace: true, largeFileOptimizations: true, bracketPairColorizationOptions: { enabled: true, independentColorPoolPerBracketType: false } }, yn = `\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`;
function bn(e206 = ``) {
  let t10 = `(-?\\d*\\.\\d\\w*)|([^`;
  for (let n10 of yn) e206.indexOf(n10) >= 0 || (t10 += `\\` + n10);
  return t10 += `\\s]+)`, new RegExp(t10, `g`);
}
var xn = bn();
function Sn(e206) {
  let t10 = xn;
  if (e206 && e206 instanceof RegExp) if (e206.global) t10 = e206;
  else {
    let n10 = `g`;
    e206.ignoreCase && (n10 += `i`), e206.multiline && (n10 += `m`), e206.unicode && (n10 += `u`), t10 = new RegExp(e206.source, n10);
  }
  return t10.lastIndex = 0, t10;
}
var Cn = new Qt();
Cn.unshift({ maxLen: 1e3, windowSize: 15, timeBudget: 150 });
function wn(e206, t10, n10, r10, i10) {
  if (t10 = Sn(t10), i10 || (i10 = Ut.first(Cn)), n10.length > i10.maxLen) {
    let a11 = e206 - i10.maxLen / 2;
    return a11 < 0 ? a11 = 0 : r10 += a11, n10 = n10.substring(a11, e206 + i10.maxLen / 2), wn(e206, t10, n10, r10, i10);
  }
  let a10 = Date.now(), o10 = e206 - 1 - r10, s10 = -1, c10 = null;
  for (let e207 = 1; !(Date.now() - a10 >= i10.timeBudget); e207++) {
    let r11 = o10 - i10.windowSize * e207;
    t10.lastIndex = Math.max(0, r11);
    let a11 = Tn(t10, n10, o10, s10);
    if (!a11 && c10 || (c10 = a11, r11 <= 0)) break;
    s10 = r11;
  }
  if (c10) {
    let e207 = { word: c10[0], startColumn: r10 + 1 + c10.index, endColumn: r10 + 1 + c10.index + c10[0].length };
    return t10.lastIndex = 0, e207;
  }
  return null;
}
function Tn(e206, t10, n10, r10) {
  let i10;
  for (; i10 = e206.exec(t10); ) {
    let t11 = i10.index || 0;
    if (t11 <= n10 && e206.lastIndex >= n10) return i10;
    if (r10 > 0 && t11 > r10) return null;
  }
  return null;
}
var En = class {
  constructor(e206) {
    this._values = e206;
  }
  hasChanged(e206) {
    return this._values[e206];
  }
}, Dn = class {
  constructor() {
    this.stableMinimapLayoutInput = null, this.stableFitMaxMinimapScale = 0, this.stableFitRemainingWidth = 0;
  }
}, On = class {
  constructor(e206, t10, n10, r10) {
    this.id = e206, this.name = t10, this.defaultValue = n10, this.schema = r10;
  }
  applyUpdate(e206, t10) {
    return An(e206, t10);
  }
  compute(e206, t10, n10) {
    return n10;
  }
}, kn = class {
  constructor(e206, t10) {
    this.newValue = e206, this.didChange = t10;
  }
};
function An(e206, t10) {
  if (typeof e206 != `object` || typeof t10 != `object` || !e206 || !t10) return new kn(t10, e206 !== t10);
  if (Array.isArray(e206) || Array.isArray(t10)) return new kn(t10, !(Array.isArray(e206) && Array.isArray(t10) && o(e206, t10)));
  let n10 = false;
  for (let r10 in t10) if (t10.hasOwnProperty(r10)) {
    let i10 = An(e206[r10], t10[r10]);
    i10.didChange && (e206[r10] = i10.newValue, n10 = true);
  }
  return new kn(e206, n10);
}
var jn = class {
  constructor(e206, t10) {
    this.schema = void 0, this.id = e206, this.name = `_never_`, this.defaultValue = t10;
  }
  applyUpdate(e206, t10) {
    return An(e206, t10);
  }
  validate(e206) {
    return this.defaultValue;
  }
}, Mn = class {
  constructor(e206, t10, n10, r10) {
    this.id = e206, this.name = t10, this.defaultValue = n10, this.schema = r10;
  }
  applyUpdate(e206, t10) {
    return An(e206, t10);
  }
  compute(e206, t10, n10) {
    return n10;
  }
};
function Nn(e206, t10) {
  return e206 === void 0 ? t10 : e206 === `false` ? false : !!e206;
}
var Pn = class extends Mn {
  constructor(e206, t10, n10, r10 = void 0) {
    r10 !== void 0 && (r10.type = `boolean`, r10.default = n10), super(e206, t10, n10, r10);
  }
  validate(e206) {
    return Nn(e206, this.defaultValue);
  }
};
function Fn(e206, t10, n10, r10) {
  if (typeof e206 == `string` && (e206 = parseInt(e206, 10)), typeof e206 != `number` || isNaN(e206)) return t10;
  let i10 = e206;
  return i10 = Math.max(n10, i10), i10 = Math.min(r10, i10), i10 | 0;
}
var In = class e8 extends Mn {
  static clampedInt(e206, t10, n10, r10) {
    return Fn(e206, t10, n10, r10);
  }
  constructor(e206, t10, n10, r10, i10, a10 = void 0) {
    a10 !== void 0 && (a10.type = `integer`, a10.default = n10, a10.minimum = r10, a10.maximum = i10), super(e206, t10, n10, a10), this.minimum = r10, this.maximum = i10;
  }
  validate(t10) {
    return e8.clampedInt(t10, this.defaultValue, this.minimum, this.maximum);
  }
};
function Ln(e206, t10, n10, r10) {
  if (e206 === void 0) return t10;
  let i10 = Rn.float(e206, t10);
  return Rn.clamp(i10, n10, r10);
}
var Rn = class e9 extends Mn {
  static clamp(e206, t10, n10) {
    return e206 < t10 ? t10 : e206 > n10 ? n10 : e206;
  }
  static float(e206, t10) {
    return typeof e206 == `string` && (e206 = parseFloat(e206)), typeof e206 != `number` || isNaN(e206) ? t10 : e206;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    i10 !== void 0 && (i10.type = `number`, i10.default = n10, i10.minimum = a10, i10.maximum = o10), super(e206, t10, n10, i10), this.validationFn = r10, this.minimum = a10, this.maximum = o10;
  }
  validate(t10) {
    return this.validationFn(e9.float(t10, this.defaultValue));
  }
}, zn = class e10 extends Mn {
  static string(e206, t10) {
    return typeof e206 == `string` ? e206 : t10;
  }
  constructor(e206, t10, n10, r10 = void 0) {
    r10 !== void 0 && (r10.type = `string`, r10.default = n10), super(e206, t10, n10, r10);
  }
  validate(t10) {
    return e10.string(t10, this.defaultValue);
  }
};
function Bn(e206, t10, n10, r10) {
  return typeof e206 == `string` ? r10 && e206 in r10 ? r10[e206] : n10.indexOf(e206) === -1 ? t10 : e206 : t10;
}
var Vn = class extends Mn {
  constructor(e206, t10, n10, r10, i10 = void 0) {
    i10 !== void 0 && (i10.type = `string`, i10.enum = r10.slice(0), i10.default = n10), super(e206, t10, n10, i10), this._allowedValues = r10;
  }
  validate(e206) {
    return Bn(e206, this.defaultValue, this._allowedValues);
  }
}, Hn = class extends On {
  constructor(e206, t10, n10, r10, i10, a10, o10 = void 0) {
    o10 !== void 0 && (o10.type = `string`, o10.enum = i10, o10.default = r10), super(e206, t10, n10, o10), this._allowedValues = i10, this._convert = a10;
  }
  validate(e206) {
    return typeof e206 != `string` || this._allowedValues.indexOf(e206) === -1 ? this.defaultValue : this._convert(e206);
  }
};
function mee(e206) {
  switch (e206) {
    case `none`:
      return 0;
    case `keep`:
      return 1;
    case `brackets`:
      return 2;
    case `advanced`:
      return 3;
    case `full`:
      return 4;
  }
}
var hee = class extends On {
  constructor() {
    super(2, `accessibilitySupport`, 0, { type: `string`, enum: [`auto`, `on`, `off`], enumDescriptions: [C(201, `Use platform APIs to detect when a Screen Reader is attached.`), C(202, `Optimize for usage with a Screen Reader.`), C(203, `Assume a screen reader is not attached.`)], default: `auto`, tags: [`accessibility`], description: C(204, `Controls if the UI should run in a mode where it is optimized for screen readers.`) });
  }
  validate(e206) {
    switch (e206) {
      case `auto`:
        return 0;
      case `off`:
        return 1;
      case `on`:
        return 2;
    }
    return this.defaultValue;
  }
  compute(e206, t10, n10) {
    return n10 === 0 ? e206.accessibilitySupport : n10;
  }
}, gee = class extends On {
  constructor() {
    let e206 = { insertSpace: true, ignoreEmptyLines: true };
    super(29, `comments`, e206, { "editor.comments.insertSpace": { type: `boolean`, default: e206.insertSpace, description: C(205, `Controls whether a space character is inserted when commenting.`) }, "editor.comments.ignoreEmptyLines": { type: `boolean`, default: e206.ignoreEmptyLines, description: C(206, `Controls if empty lines should be ignored with toggle, add or remove actions for line comments.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { insertSpace: Nn(t10.insertSpace, this.defaultValue.insertSpace), ignoreEmptyLines: Nn(t10.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines) };
  }
};
function _ee(e206) {
  switch (e206) {
    case `blink`:
      return 1;
    case `smooth`:
      return 2;
    case `phase`:
      return 3;
    case `expand`:
      return 4;
    case `solid`:
      return 5;
  }
}
var Un;
(function(e206) {
  e206[e206.Line = 1] = `Line`, e206[e206.Block = 2] = `Block`, e206[e206.Underline = 3] = `Underline`, e206[e206.LineThin = 4] = `LineThin`, e206[e206.BlockOutline = 5] = `BlockOutline`, e206[e206.UnderlineThin = 6] = `UnderlineThin`;
})(Un || (Un = {}));
function Wn(e206) {
  switch (e206) {
    case `line`:
      return Un.Line;
    case `block`:
      return Un.Block;
    case `underline`:
      return Un.Underline;
    case `line-thin`:
      return Un.LineThin;
    case `block-outline`:
      return Un.BlockOutline;
    case `underline-thin`:
      return Un.UnderlineThin;
  }
}
var vee = class extends jn {
  constructor() {
    super(162, ``);
  }
  compute(e206, t10, n10) {
    let r10 = [`monaco-editor`];
    return t10.get(48) && r10.push(t10.get(48)), e206.extraEditorClassName && r10.push(e206.extraEditorClassName), t10.get(82) === `default` ? r10.push(`mouse-default`) : t10.get(82) === `copy` && r10.push(`mouse-copy`), t10.get(127) && r10.push(`showUnused`), t10.get(157) && r10.push(`showDeprecated`), r10.join(` `);
  }
}, yee = class extends Pn {
  constructor() {
    super(45, `emptySelectionClipboard`, true, { description: C(207, `Controls whether copying without a selection copies the current line.`) });
  }
  compute(e206, t10, n10) {
    return n10 && e206.emptySelectionClipboard;
  }
}, bee = class extends On {
  constructor() {
    let e206 = { cursorMoveOnType: true, findOnType: true, seedSearchStringFromSelection: `always`, autoFindInSelection: `never`, globalFindClipboard: false, addExtraSpaceOnTop: true, loop: true, history: `workspace`, replaceHistory: `workspace` };
    super(50, `find`, e206, { "editor.find.cursorMoveOnType": { type: `boolean`, default: e206.cursorMoveOnType, description: C(208, `Controls whether the cursor should jump to find matches while typing.`) }, "editor.find.seedSearchStringFromSelection": { type: `string`, enum: [`never`, `always`, `selection`], default: e206.seedSearchStringFromSelection, enumDescriptions: [C(209, `Never seed search string from the editor selection.`), C(210, `Always seed search string from the editor selection, including word at cursor position.`), C(211, `Only seed search string from the editor selection.`)], description: C(212, `Controls whether the search string in the Find Widget is seeded from the editor selection.`) }, "editor.find.autoFindInSelection": { type: `string`, enum: [`never`, `always`, `multiline`], default: e206.autoFindInSelection, enumDescriptions: [C(213, `Never turn on Find in Selection automatically (default).`), C(214, `Always turn on Find in Selection automatically.`), C(215, `Turn on Find in Selection automatically when multiple lines of content are selected.`)], description: C(216, `Controls the condition for turning on Find in Selection automatically.`) }, "editor.find.globalFindClipboard": { type: `boolean`, default: e206.globalFindClipboard, description: C(217, `Controls whether the Find Widget should read or modify the shared find clipboard on macOS.`), included: Tt }, "editor.find.addExtraSpaceOnTop": { type: `boolean`, default: e206.addExtraSpaceOnTop, description: C(218, `Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.`) }, "editor.find.loop": { type: `boolean`, default: e206.loop, description: C(219, `Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.`) }, "editor.find.history": { type: `string`, enum: [`never`, `workspace`], default: `workspace`, enumDescriptions: [C(220, `Do not store search history from the find widget.`), C(221, `Store search history across the active workspace`)], description: C(222, `Controls how the find widget history should be stored`) }, "editor.find.replaceHistory": { type: `string`, enum: [`never`, `workspace`], default: `workspace`, enumDescriptions: [C(223, `Do not store history from the replace widget.`), C(224, `Store replace history across the active workspace`)], description: C(225, `Controls how the replace widget history should be stored`) }, "editor.find.findOnType": { type: `boolean`, default: e206.findOnType, description: C(226, `Controls whether the Find Widget should search as you type.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { cursorMoveOnType: Nn(t10.cursorMoveOnType, this.defaultValue.cursorMoveOnType), findOnType: Nn(t10.findOnType, this.defaultValue.findOnType), seedSearchStringFromSelection: typeof t10.seedSearchStringFromSelection == `boolean` ? t10.seedSearchStringFromSelection ? `always` : `never` : Bn(t10.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection, [`never`, `always`, `selection`]), autoFindInSelection: typeof t10.autoFindInSelection == `boolean` ? t10.autoFindInSelection ? `always` : `never` : Bn(t10.autoFindInSelection, this.defaultValue.autoFindInSelection, [`never`, `always`, `multiline`]), globalFindClipboard: Nn(t10.globalFindClipboard, this.defaultValue.globalFindClipboard), addExtraSpaceOnTop: Nn(t10.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop), loop: Nn(t10.loop, this.defaultValue.loop), history: Bn(t10.history, this.defaultValue.history, [`never`, `workspace`]), replaceHistory: Bn(t10.replaceHistory, this.defaultValue.replaceHistory, [`never`, `workspace`]) };
  }
}, Gn = (_g = class extends On {
  constructor() {
    super(60, `fontLigatures`, _g.OFF, { anyOf: [{ type: `boolean`, description: C(227, `Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.`) }, { type: `string`, description: C(228, `Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.`) }], description: C(229, `Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property.`), default: false });
  }
  validate(t10) {
    return t10 === void 0 ? this.defaultValue : typeof t10 == `string` ? t10 === `false` || t10.length === 0 ? _g.OFF : t10 === `true` ? _g.ON : t10 : t10 ? _g.ON : _g.OFF;
  }
}, _g.OFF = `"liga" off, "calt" off`, _g.ON = `"liga" on, "calt" on`, _g), xee = (_h = class extends On {
  constructor() {
    super(63, `fontVariations`, _h.OFF, { anyOf: [{ type: `boolean`, description: C(230, `Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.`) }, { type: `string`, description: C(231, `Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.`) }], description: C(232, `Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property.`), default: false });
  }
  validate(t10) {
    return t10 === void 0 ? this.defaultValue : typeof t10 == `string` ? t10 === `false` ? _h.OFF : t10 === `true` ? _h.TRANSLATE : t10 : t10 ? _h.TRANSLATE : _h.OFF;
  }
  compute(e206, t10, n10) {
    return e206.fontInfo.fontVariationSettings;
  }
}, _h.OFF = gn, _h.TRANSLATE = pee, _h), See = class extends jn {
  constructor() {
    super(59, new hn({ pixelRatio: 0, fontFamily: ``, fontWeight: ``, fontSize: 0, fontFeatureSettings: ``, fontVariationSettings: ``, lineHeight: 0, letterSpacing: 0, isMonospace: false, typicalHalfwidthCharacterWidth: 0, typicalFullwidthCharacterWidth: 0, canUseHalfwidthRightwardsArrow: false, spaceWidth: 0, middotWidth: 0, wsmiddotWidth: 0, maxDigitWidth: 0 }, false));
  }
  compute(e206, t10, n10) {
    return e206.fontInfo;
  }
}, Cee = class extends jn {
  constructor() {
    super(161, Un.Line);
  }
  compute(e206, t10, n10) {
    return e206.inputMode === `overtype` ? t10.get(92) : t10.get(34);
  }
}, wee = class extends jn {
  constructor() {
    super(170, false);
  }
  compute(e206, t10) {
    return e206.editContextSupported && t10.get(44);
  }
}, Tee = class extends jn {
  constructor() {
    super(172, false);
  }
  compute(e206, t10) {
    return e206.accessibilitySupport === 2 ? t10.get(7) : t10.get(6);
  }
}, Eee = class extends Mn {
  constructor() {
    super(61, `fontSize`, _n.fontSize, { type: `number`, minimum: 6, maximum: 100, default: _n.fontSize, description: C(233, `Controls the font size in pixels.`) });
  }
  validate(e206) {
    let t10 = Rn.float(e206, this.defaultValue);
    return t10 === 0 ? _n.fontSize : Rn.clamp(t10, 6, 100);
  }
  compute(e206, t10, n10) {
    return e206.fontInfo.fontSize;
  }
}, Dee = (_i = class extends On {
  constructor() {
    super(62, `fontWeight`, _n.fontWeight, { anyOf: [{ type: `number`, minimum: _i.MINIMUM_VALUE, maximum: _i.MAXIMUM_VALUE, errorMessage: C(234, `Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.`) }, { type: `string`, pattern: `^(normal|bold|1000|[1-9][0-9]{0,2})$` }, { enum: _i.SUGGESTION_VALUES }], default: _n.fontWeight, description: C(235, `Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.`) });
  }
  validate(t10) {
    return t10 === `normal` || t10 === `bold` ? t10 : String(In.clampedInt(t10, _n.fontWeight, _i.MINIMUM_VALUE, _i.MAXIMUM_VALUE));
  }
}, _i.SUGGESTION_VALUES = [`normal`, `bold`, `100`, `200`, `300`, `400`, `500`, `600`, `700`, `800`, `900`], _i.MINIMUM_VALUE = 1, _i.MAXIMUM_VALUE = 1e3, _i), Oee = class extends On {
  constructor() {
    let e206 = { multiple: `peek`, multipleDefinitions: `peek`, multipleTypeDefinitions: `peek`, multipleDeclarations: `peek`, multipleImplementations: `peek`, multipleReferences: `peek`, multipleTests: `peek`, alternativeDefinitionCommand: `editor.action.goToReferences`, alternativeTypeDefinitionCommand: `editor.action.goToReferences`, alternativeDeclarationCommand: `editor.action.goToReferences`, alternativeImplementationCommand: ``, alternativeReferenceCommand: ``, alternativeTestsCommand: `` }, t10 = { type: `string`, enum: [`peek`, `gotoAndPeek`, `goto`], default: e206.multiple, enumDescriptions: [C(236, `Show Peek view of the results (default)`), C(237, `Go to the primary result and show a Peek view`), C(238, `Go to the primary result and enable Peek-less navigation to others`)] }, n10 = [``, `editor.action.referenceSearch.trigger`, `editor.action.goToReferences`, `editor.action.peekImplementation`, `editor.action.goToImplementation`, `editor.action.peekTypeDefinition`, `editor.action.goToTypeDefinition`, `editor.action.peekDeclaration`, `editor.action.revealDeclaration`, `editor.action.peekDefinition`, `editor.action.revealDefinitionAside`, `editor.action.revealDefinition`];
    super(67, `gotoLocation`, e206, { "editor.gotoLocation.multiple": { deprecationMessage: C(239, `This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.`) }, "editor.gotoLocation.multipleDefinitions": { description: C(240, `Controls the behavior the 'Go to Definition'-command when multiple target locations exist.`), ...t10 }, "editor.gotoLocation.multipleTypeDefinitions": { description: C(241, `Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.`), ...t10 }, "editor.gotoLocation.multipleDeclarations": { description: C(242, `Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.`), ...t10 }, "editor.gotoLocation.multipleImplementations": { description: C(243, `Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.`), ...t10 }, "editor.gotoLocation.multipleReferences": { description: C(244, `Controls the behavior the 'Go to References'-command when multiple target locations exist.`), ...t10 }, "editor.gotoLocation.alternativeDefinitionCommand": { type: `string`, default: e206.alternativeDefinitionCommand, enum: n10, description: C(245, `Alternative command id that is being executed when the result of 'Go to Definition' is the current location.`) }, "editor.gotoLocation.alternativeTypeDefinitionCommand": { type: `string`, default: e206.alternativeTypeDefinitionCommand, enum: n10, description: C(246, `Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.`) }, "editor.gotoLocation.alternativeDeclarationCommand": { type: `string`, default: e206.alternativeDeclarationCommand, enum: n10, description: C(247, `Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.`) }, "editor.gotoLocation.alternativeImplementationCommand": { type: `string`, default: e206.alternativeImplementationCommand, enum: n10, description: C(248, `Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.`) }, "editor.gotoLocation.alternativeReferenceCommand": { type: `string`, default: e206.alternativeReferenceCommand, enum: n10, description: C(249, `Alternative command id that is being executed when the result of 'Go to Reference' is the current location.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { multiple: Bn(t10.multiple, this.defaultValue.multiple, [`peek`, `gotoAndPeek`, `goto`]), multipleDefinitions: Bn(t10.multipleDefinitions, `peek`, [`peek`, `gotoAndPeek`, `goto`]), multipleTypeDefinitions: Bn(t10.multipleTypeDefinitions, `peek`, [`peek`, `gotoAndPeek`, `goto`]), multipleDeclarations: Bn(t10.multipleDeclarations, `peek`, [`peek`, `gotoAndPeek`, `goto`]), multipleImplementations: Bn(t10.multipleImplementations, `peek`, [`peek`, `gotoAndPeek`, `goto`]), multipleReferences: Bn(t10.multipleReferences, `peek`, [`peek`, `gotoAndPeek`, `goto`]), multipleTests: Bn(t10.multipleTests, `peek`, [`peek`, `gotoAndPeek`, `goto`]), alternativeDefinitionCommand: zn.string(t10.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand), alternativeTypeDefinitionCommand: zn.string(t10.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand), alternativeDeclarationCommand: zn.string(t10.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand), alternativeImplementationCommand: zn.string(t10.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand), alternativeReferenceCommand: zn.string(t10.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand), alternativeTestsCommand: zn.string(t10.alternativeTestsCommand, this.defaultValue.alternativeTestsCommand) };
  }
}, kee = class extends On {
  constructor() {
    let e206 = { enabled: true, delay: 300, hidingDelay: 300, sticky: true, above: true };
    super(69, `hover`, e206, { "editor.hover.enabled": { type: `boolean`, default: e206.enabled, description: C(250, `Controls whether the hover is shown.`) }, "editor.hover.delay": { type: `number`, default: e206.delay, minimum: 0, maximum: 1e4, description: C(251, `Controls the delay in milliseconds after which the hover is shown.`) }, "editor.hover.sticky": { type: `boolean`, default: e206.sticky, description: C(252, `Controls whether the hover should remain visible when mouse is moved over it.`) }, "editor.hover.hidingDelay": { type: `integer`, minimum: 0, default: e206.hidingDelay, markdownDescription: C(253, "Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.") }, "editor.hover.above": { type: `boolean`, default: e206.above, description: C(254, `Prefer showing hovers above the line, if there's space.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), delay: In.clampedInt(t10.delay, this.defaultValue.delay, 0, 1e4), sticky: Nn(t10.sticky, this.defaultValue.sticky), hidingDelay: In.clampedInt(t10.hidingDelay, this.defaultValue.hidingDelay, 0, 6e5), above: Nn(t10.above, this.defaultValue.above) };
  }
}, Kn = class e11 extends jn {
  constructor() {
    super(165, { width: 0, height: 0, glyphMarginLeft: 0, glyphMarginWidth: 0, glyphMarginDecorationLaneCount: 0, lineNumbersLeft: 0, lineNumbersWidth: 0, decorationsLeft: 0, decorationsWidth: 0, contentLeft: 0, contentWidth: 0, minimap: { renderMinimap: 0, minimapLeft: 0, minimapWidth: 0, minimapHeightIsEditorHeight: false, minimapIsSampling: false, minimapScale: 1, minimapLineHeight: 1, minimapCanvasInnerWidth: 0, minimapCanvasInnerHeight: 0, minimapCanvasOuterWidth: 0, minimapCanvasOuterHeight: 0 }, viewportColumn: 0, isWordWrapMinified: false, isViewportWrapping: false, wrappingColumn: -1, verticalScrollbarWidth: 0, horizontalScrollbarHeight: 0, overviewRuler: { top: 0, width: 0, height: 0, right: 0 } });
  }
  compute(t10, n10, r10) {
    return e11.computeLayout(n10, { memory: t10.memory, outerWidth: t10.outerWidth, outerHeight: t10.outerHeight, isDominatedByLongLines: t10.isDominatedByLongLines, lineHeight: t10.fontInfo.lineHeight, viewLineCount: t10.viewLineCount, lineNumbersDigitCount: t10.lineNumbersDigitCount, typicalHalfwidthCharacterWidth: t10.fontInfo.typicalHalfwidthCharacterWidth, maxDigitWidth: t10.fontInfo.maxDigitWidth, pixelRatio: t10.pixelRatio, glyphMarginDecorationLaneCount: t10.glyphMarginDecorationLaneCount });
  }
  static computeContainedMinimapLineCount(e206) {
    let t10 = e206.height / e206.lineHeight, n10 = Math.floor(e206.paddingTop / e206.lineHeight), r10 = Math.floor(e206.paddingBottom / e206.lineHeight);
    e206.scrollBeyondLastLine && (r10 = Math.max(r10, t10 - 1));
    let i10 = (n10 + e206.viewLineCount + r10) / (e206.pixelRatio * e206.height), a10 = Math.floor(e206.viewLineCount / i10);
    return { typicalViewportLineCount: t10, extraLinesBeforeFirstLine: n10, extraLinesBeyondLastLine: r10, desiredRatio: i10, minimapLineCount: a10 };
  }
  static _computeMinimapLayout(t10, n10) {
    let r10 = t10.outerWidth, i10 = t10.outerHeight, a10 = t10.pixelRatio;
    if (!t10.minimap.enabled) return { renderMinimap: 0, minimapLeft: 0, minimapWidth: 0, minimapHeightIsEditorHeight: false, minimapIsSampling: false, minimapScale: 1, minimapLineHeight: 1, minimapCanvasInnerWidth: 0, minimapCanvasInnerHeight: Math.floor(a10 * i10), minimapCanvasOuterWidth: 0, minimapCanvasOuterHeight: i10 };
    let o10 = n10.stableMinimapLayoutInput, s10 = o10 && t10.outerHeight === o10.outerHeight && t10.lineHeight === o10.lineHeight && t10.typicalHalfwidthCharacterWidth === o10.typicalHalfwidthCharacterWidth && t10.pixelRatio === o10.pixelRatio && t10.scrollBeyondLastLine === o10.scrollBeyondLastLine && t10.paddingTop === o10.paddingTop && t10.paddingBottom === o10.paddingBottom && t10.minimap.enabled === o10.minimap.enabled && t10.minimap.side === o10.minimap.side && t10.minimap.size === o10.minimap.size && t10.minimap.showSlider === o10.minimap.showSlider && t10.minimap.renderCharacters === o10.minimap.renderCharacters && t10.minimap.maxColumn === o10.minimap.maxColumn && t10.minimap.scale === o10.minimap.scale && t10.verticalScrollbarWidth === o10.verticalScrollbarWidth && t10.isViewportWrapping === o10.isViewportWrapping, c10 = t10.lineHeight, l10 = t10.typicalHalfwidthCharacterWidth, u10 = t10.scrollBeyondLastLine, d10 = t10.minimap.renderCharacters, f10 = a10 >= 2 ? Math.round(t10.minimap.scale * 2) : t10.minimap.scale, p10 = t10.minimap.maxColumn, m10 = t10.minimap.size, h10 = t10.minimap.side, g10 = t10.verticalScrollbarWidth, _10 = t10.viewLineCount, v10 = t10.remainingWidth, y10 = t10.isViewportWrapping, b10 = d10 ? 2 : 3, x10 = Math.floor(a10 * i10), S10 = x10 / a10, ee2 = false, te2 = false, ne2 = b10 * f10, re2 = f10 / a10, ie2 = 1;
    if (m10 === `fill` || m10 === `fit`) {
      let { typicalViewportLineCount: r11, extraLinesBeforeFirstLine: o11, extraLinesBeyondLastLine: l11, desiredRatio: d11, minimapLineCount: p11 } = e11.computeContainedMinimapLineCount({ viewLineCount: _10, scrollBeyondLastLine: u10, paddingTop: t10.paddingTop, paddingBottom: t10.paddingBottom, height: i10, lineHeight: c10, pixelRatio: a10 });
      if (_10 / p11 > 1) ee2 = true, te2 = true, f10 = 1, ne2 = 1, re2 = f10 / a10;
      else {
        let e206 = false, i11 = f10 + 1;
        if (m10 === `fit`) {
          let t11 = Math.ceil((o11 + _10 + l11) * ne2);
          y10 && s10 && v10 <= n10.stableFitRemainingWidth ? (e206 = true, i11 = n10.stableFitMaxMinimapScale) : e206 = t11 > x10;
        }
        if (m10 === `fill` || e206) {
          ee2 = true;
          let e207 = f10;
          ne2 = Math.min(c10 * a10, Math.max(1, Math.floor(1 / d11))), y10 && s10 && v10 <= n10.stableFitRemainingWidth && (i11 = n10.stableFitMaxMinimapScale), f10 = Math.min(i11, Math.max(1, Math.floor(ne2 / b10))), f10 > e207 && (ie2 = Math.min(2, f10 / e207)), re2 = f10 / a10 / ie2, x10 = Math.ceil(Math.max(r11, o11 + _10 + l11) * ne2), y10 ? (n10.stableMinimapLayoutInput = t10, n10.stableFitRemainingWidth = v10, n10.stableFitMaxMinimapScale = f10) : (n10.stableMinimapLayoutInput = null, n10.stableFitRemainingWidth = 0);
        }
      }
    }
    let ae2 = Math.floor(p10 * re2), oe2 = Math.min(ae2, Math.max(0, Math.floor((v10 - g10 - 2) * re2 / (l10 + re2))) + 8), se2 = Math.floor(a10 * oe2), ce2 = se2 / a10;
    return se2 = Math.floor(se2 * ie2), { renderMinimap: d10 ? 1 : 2, minimapLeft: h10 === `left` ? 0 : r10 - oe2 - g10, minimapWidth: oe2, minimapHeightIsEditorHeight: ee2, minimapIsSampling: te2, minimapScale: f10, minimapLineHeight: ne2, minimapCanvasInnerWidth: se2, minimapCanvasInnerHeight: x10, minimapCanvasOuterWidth: ce2, minimapCanvasOuterHeight: S10 };
  }
  static computeLayout(t10, n10) {
    let r10 = n10.outerWidth | 0, i10 = n10.outerHeight | 0, a10 = n10.lineHeight | 0, o10 = n10.lineNumbersDigitCount | 0, s10 = n10.typicalHalfwidthCharacterWidth, c10 = n10.maxDigitWidth, l10 = n10.pixelRatio, u10 = n10.viewLineCount, d10 = t10.get(154), f10 = d10 === `inherit` ? t10.get(153) : d10, p10 = f10 === `inherit` ? t10.get(149) : f10, m10 = t10.get(152), h10 = n10.isDominatedByLongLines, g10 = t10.get(66), _10 = t10.get(76).renderType !== 0, v10 = t10.get(77), y10 = t10.get(119), b10 = t10.get(96), x10 = t10.get(81), S10 = t10.get(117), ee2 = S10.verticalScrollbarSize, te2 = S10.verticalHasArrows, ne2 = S10.arrowSize, re2 = S10.horizontalScrollbarSize, ie2 = t10.get(52), ae2 = t10.get(126) !== `never`, oe2 = t10.get(74);
    ie2 && ae2 && (oe2 += 16);
    let se2 = 0;
    _10 && (se2 = Math.round(Math.max(o10, v10) * c10));
    let ce2 = 0;
    g10 && (ce2 = a10 * n10.glyphMarginDecorationLaneCount);
    let le2 = 0, ue2 = le2 + ce2, de2 = ue2 + se2, fe2 = de2 + oe2, pe2 = r10 - ce2 - se2 - oe2, me2 = false, he2 = false, ge2 = -1;
    t10.get(2) === 2 && f10 === `inherit` && h10 ? (me2 = true, he2 = true) : p10 === `on` || p10 === `bounded` ? he2 = true : p10 === `wordWrapColumn` && (ge2 = m10);
    let _e3 = e11._computeMinimapLayout({ outerWidth: r10, outerHeight: i10, lineHeight: a10, typicalHalfwidthCharacterWidth: s10, pixelRatio: l10, scrollBeyondLastLine: y10, paddingTop: b10.top, paddingBottom: b10.bottom, minimap: x10, verticalScrollbarWidth: ee2, viewLineCount: u10, remainingWidth: pe2, isViewportWrapping: he2 }, n10.memory || new Dn());
    _e3.renderMinimap !== 0 && _e3.minimapLeft === 0 && (le2 += _e3.minimapWidth, ue2 += _e3.minimapWidth, de2 += _e3.minimapWidth, fe2 += _e3.minimapWidth);
    let ve2 = pe2 - _e3.minimapWidth, ye2 = Math.max(1, Math.floor((ve2 - ee2 - 2) / s10)), be2 = te2 ? ne2 : 0;
    return he2 && (ge2 = Math.max(1, ye2), p10 === `bounded` && (ge2 = Math.min(ge2, m10))), { width: r10, height: i10, glyphMarginLeft: le2, glyphMarginWidth: ce2, glyphMarginDecorationLaneCount: n10.glyphMarginDecorationLaneCount, lineNumbersLeft: ue2, lineNumbersWidth: se2, decorationsLeft: de2, decorationsWidth: oe2, contentLeft: fe2, contentWidth: ve2, minimap: _e3, viewportColumn: ye2, isWordWrapMinified: me2, isViewportWrapping: he2, wrappingColumn: ge2, verticalScrollbarWidth: ee2, horizontalScrollbarHeight: re2, overviewRuler: { top: be2, width: ee2, height: i10 - 2 * be2, right: 0 } };
  }
}, qn = class extends On {
  constructor() {
    super(156, `wrappingStrategy`, `simple`, { "editor.wrappingStrategy": { enumDescriptions: [C(255, `Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.`), C(256, `Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.`)], type: `string`, enum: [`simple`, `advanced`], default: `simple`, description: C(257, `Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.`) } });
  }
  validate(e206) {
    return Bn(e206, `simple`, [`simple`, `advanced`]);
  }
  compute(e206, t10, n10) {
    return t10.get(2) === 2 ? `advanced` : n10;
  }
}, Jn;
(function(e206) {
  e206.Off = `off`, e206.OnCode = `onCode`, e206.On = `on`;
})(Jn || (Jn = {}));
var Yn = class extends On {
  constructor() {
    let e206 = { enabled: Jn.OnCode };
    super(73, `lightbulb`, e206, { "editor.lightbulb.enabled": { type: `string`, enum: [Jn.Off, Jn.OnCode, Jn.On], default: e206.enabled, enumDescriptions: [C(258, `Disable the code action menu.`), C(259, `Show the code action menu when the cursor is on lines with code.`), C(260, `Show the code action menu when the cursor is on lines with code or on empty lines.`)], description: C(261, `Enables the Code Action lightbulb in the editor.`) } });
  }
  validate(e206) {
    return !e206 || typeof e206 != `object` ? this.defaultValue : { enabled: Bn(e206.enabled, this.defaultValue.enabled, [Jn.Off, Jn.OnCode, Jn.On]) };
  }
}, Xn = class extends On {
  constructor() {
    let e206 = { enabled: true, maxLineCount: 5, defaultModel: `outlineModel`, scrollWithEditor: true };
    super(131, `stickyScroll`, e206, { "editor.stickyScroll.enabled": { type: `boolean`, default: e206.enabled, description: C(262, `Shows the nested current scopes during the scroll at the top of the editor.`) }, "editor.stickyScroll.maxLineCount": { type: `number`, default: e206.maxLineCount, minimum: 1, maximum: 20, description: C(263, `Defines the maximum number of sticky lines to show.`) }, "editor.stickyScroll.defaultModel": { type: `string`, enum: [`outlineModel`, `foldingProviderModel`, `indentationModel`], default: e206.defaultModel, description: C(264, `Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.`) }, "editor.stickyScroll.scrollWithEditor": { type: `boolean`, default: e206.scrollWithEditor, description: C(265, `Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), maxLineCount: In.clampedInt(t10.maxLineCount, this.defaultValue.maxLineCount, 1, 20), defaultModel: Bn(t10.defaultModel, this.defaultValue.defaultModel, [`outlineModel`, `foldingProviderModel`, `indentationModel`]), scrollWithEditor: Nn(t10.scrollWithEditor, this.defaultValue.scrollWithEditor) };
  }
}, Zn = class extends On {
  constructor() {
    let e206 = { enabled: `on`, fontSize: 0, fontFamily: ``, padding: false, maximumLength: 43 };
    super(159, `inlayHints`, e206, { "editor.inlayHints.enabled": { type: `string`, default: e206.enabled, description: C(266, `Enables the inlay hints in the editor.`), enum: [`on`, `onUnlessPressed`, `offUnlessPressed`, `off`], markdownEnumDescriptions: [C(267, `Inlay hints are enabled`), C(268, `Inlay hints are showing by default and hide when holding {0}`, Tt ? `Ctrl+Option` : `Ctrl+Alt`), C(269, `Inlay hints are hidden by default and show when holding {0}`, Tt ? `Ctrl+Option` : `Ctrl+Alt`), C(270, `Inlay hints are disabled`)] }, "editor.inlayHints.fontSize": { type: `number`, default: e206.fontSize, markdownDescription: C(271, `Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.`, "`#editor.fontSize#`", "`5`") }, "editor.inlayHints.fontFamily": { type: `string`, default: e206.fontFamily, markdownDescription: C(272, `Controls font family of inlay hints in the editor. When set to empty, the {0} is used.`, "`#editor.fontFamily#`") }, "editor.inlayHints.padding": { type: `boolean`, default: e206.padding, description: C(273, `Enables the padding around the inlay hints in the editor.`) }, "editor.inlayHints.maximumLength": { type: `number`, default: e206.maximumLength, markdownDescription: C(274, "Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate") } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return typeof t10.enabled == `boolean` && (t10.enabled = t10.enabled ? `on` : `off`), { enabled: Bn(t10.enabled, this.defaultValue.enabled, [`on`, `off`, `offUnlessPressed`, `onUnlessPressed`]), fontSize: In.clampedInt(t10.fontSize, this.defaultValue.fontSize, 0, 100), fontFamily: zn.string(t10.fontFamily, this.defaultValue.fontFamily), padding: Nn(t10.padding, this.defaultValue.padding), maximumLength: In.clampedInt(t10.maximumLength, this.defaultValue.maximumLength, 0, 2 ** 53 - 1) };
  }
}, Qn = class extends On {
  constructor() {
    super(74, `lineDecorationsWidth`, 10);
  }
  validate(e206) {
    return typeof e206 == `string` && /^\d+(\.\d+)?ch$/.test(e206) ? -parseFloat(e206.substring(0, e206.length - 2)) : In.clampedInt(e206, this.defaultValue, 0, 1e3);
  }
  compute(e206, t10, n10) {
    return n10 < 0 ? In.clampedInt(-n10 * e206.fontInfo.typicalHalfwidthCharacterWidth, this.defaultValue, 0, 1e3) : n10;
  }
}, $n = class extends Rn {
  constructor() {
    super(75, `lineHeight`, _n.lineHeight, (e206) => Rn.clamp(e206, 0, 150), { markdownDescription: C(275, `Controls the line height. 
 - Use 0 to automatically compute the line height from the font size.
 - Values between 0 and 8 will be used as a multiplier with the font size.
 - Values greater than or equal to 8 will be used as effective values.`) }, 0, 150);
  }
  compute(e206, t10, n10) {
    return e206.fontInfo.lineHeight;
  }
}, er = class extends On {
  constructor() {
    let e206 = { enabled: true, size: `proportional`, side: `right`, showSlider: `mouseover`, autohide: `none`, renderCharacters: true, maxColumn: 120, scale: 1, showRegionSectionHeaders: true, showMarkSectionHeaders: true, markSectionHeaderRegex: `\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$`, sectionHeaderFontSize: 9, sectionHeaderLetterSpacing: 1 };
    super(81, `minimap`, e206, { "editor.minimap.enabled": { type: `boolean`, default: e206.enabled, description: C(276, `Controls whether the minimap is shown.`) }, "editor.minimap.autohide": { type: `string`, enum: [`none`, `mouseover`, `scroll`], enumDescriptions: [C(277, `The minimap is always shown.`), C(278, `The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap.`), C(279, `The minimap is only shown when the editor is scrolled`)], default: e206.autohide, description: C(280, `Controls whether the minimap is hidden automatically.`) }, "editor.minimap.size": { type: `string`, enum: [`proportional`, `fill`, `fit`], enumDescriptions: [C(281, `The minimap has the same size as the editor contents (and might scroll).`), C(282, `The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).`), C(283, `The minimap will shrink as necessary to never be larger than the editor (no scrolling).`)], default: e206.size, description: C(284, `Controls the size of the minimap.`) }, "editor.minimap.side": { type: `string`, enum: [`left`, `right`], default: e206.side, description: C(285, `Controls the side where to render the minimap.`) }, "editor.minimap.showSlider": { type: `string`, enum: [`always`, `mouseover`], default: e206.showSlider, description: C(286, `Controls when the minimap slider is shown.`) }, "editor.minimap.scale": { type: `number`, default: e206.scale, minimum: 1, maximum: 3, enum: [1, 2, 3], description: C(287, `Scale of content drawn in the minimap: 1, 2 or 3.`) }, "editor.minimap.renderCharacters": { type: `boolean`, default: e206.renderCharacters, description: C(288, `Render the actual characters on a line as opposed to color blocks.`) }, "editor.minimap.maxColumn": { type: `number`, default: e206.maxColumn, description: C(289, `Limit the width of the minimap to render at most a certain number of columns.`) }, "editor.minimap.showRegionSectionHeaders": { type: `boolean`, default: e206.showRegionSectionHeaders, description: C(290, `Controls whether named regions are shown as section headers in the minimap.`) }, "editor.minimap.showMarkSectionHeaders": { type: `boolean`, default: e206.showMarkSectionHeaders, description: C(291, `Controls whether MARK: comments are shown as section headers in the minimap.`) }, "editor.minimap.markSectionHeaderRegex": { type: `string`, default: e206.markSectionHeaderRegex, description: C(292, "Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.") }, "editor.minimap.sectionHeaderFontSize": { type: `number`, default: e206.sectionHeaderFontSize, description: C(293, `Controls the font size of section headers in the minimap.`) }, "editor.minimap.sectionHeaderLetterSpacing": { type: `number`, default: e206.sectionHeaderLetterSpacing, description: C(294, `Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206, n10 = this.defaultValue.markSectionHeaderRegex, r10 = t10.markSectionHeaderRegex;
    if (typeof r10 == `string`) try {
      new RegExp(r10, `d`), n10 = r10;
    } catch {
    }
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), autohide: Bn(t10.autohide, this.defaultValue.autohide, [`none`, `mouseover`, `scroll`]), size: Bn(t10.size, this.defaultValue.size, [`proportional`, `fill`, `fit`]), side: Bn(t10.side, this.defaultValue.side, [`right`, `left`]), showSlider: Bn(t10.showSlider, this.defaultValue.showSlider, [`always`, `mouseover`]), renderCharacters: Nn(t10.renderCharacters, this.defaultValue.renderCharacters), scale: In.clampedInt(t10.scale, 1, 1, 3), maxColumn: In.clampedInt(t10.maxColumn, this.defaultValue.maxColumn, 1, 1e4), showRegionSectionHeaders: Nn(t10.showRegionSectionHeaders, this.defaultValue.showRegionSectionHeaders), showMarkSectionHeaders: Nn(t10.showMarkSectionHeaders, this.defaultValue.showMarkSectionHeaders), markSectionHeaderRegex: n10, sectionHeaderFontSize: Rn.clamp(Rn.float(t10.sectionHeaderFontSize, this.defaultValue.sectionHeaderFontSize), 4, 32), sectionHeaderLetterSpacing: Rn.clamp(Rn.float(t10.sectionHeaderLetterSpacing, this.defaultValue.sectionHeaderLetterSpacing), 0, 5) };
  }
};
function tr(e206) {
  return e206 === `ctrlCmd` ? Tt ? `metaKey` : `ctrlKey` : `altKey`;
}
var Aee = class extends On {
  constructor() {
    super(96, `padding`, { top: 0, bottom: 0 }, { "editor.padding.top": { type: `number`, default: 0, minimum: 0, maximum: 1e3, description: C(295, `Controls the amount of space between the top edge of the editor and the first line.`) }, "editor.padding.bottom": { type: `number`, default: 0, minimum: 0, maximum: 1e3, description: C(296, `Controls the amount of space between the bottom edge of the editor and the last line.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { top: In.clampedInt(t10.top, 0, 0, 1e3), bottom: In.clampedInt(t10.bottom, 0, 0, 1e3) };
  }
}, jee = class extends On {
  constructor() {
    let e206 = { enabled: true, cycle: true };
    super(98, `parameterHints`, e206, { "editor.parameterHints.enabled": { type: `boolean`, default: e206.enabled, description: C(297, `Enables a pop-up that shows parameter documentation and type information as you type.`) }, "editor.parameterHints.cycle": { type: `boolean`, default: e206.cycle, description: C(298, `Controls whether the parameter hints menu cycles or closes when reaching the end of the list.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), cycle: Nn(t10.cycle, this.defaultValue.cycle) };
  }
}, Mee = class extends jn {
  constructor() {
    super(163, 1);
  }
  compute(e206, t10, n10) {
    return e206.pixelRatio;
  }
}, Nee = class extends On {
  constructor() {
    super(100, `placeholder`, void 0);
  }
  validate(e206) {
    return e206 === void 0 ? this.defaultValue : typeof e206 == `string` ? e206 : this.defaultValue;
  }
}, Pee = class extends On {
  constructor() {
    let e206 = { other: `on`, comments: `off`, strings: `off` }, t10 = [{ type: `boolean` }, { type: `string`, enum: [`on`, `inline`, `off`], enumDescriptions: [C(299, `Quick suggestions show inside the suggest widget`), C(300, `Quick suggestions show as ghost text`), C(301, `Quick suggestions are disabled`)] }];
    super(102, `quickSuggestions`, e206, { type: `object`, additionalProperties: false, properties: { strings: { anyOf: t10, default: e206.strings, description: C(302, `Enable quick suggestions inside strings.`) }, comments: { anyOf: t10, default: e206.comments, description: C(303, `Enable quick suggestions inside comments.`) }, other: { anyOf: t10, default: e206.other, description: C(304, `Enable quick suggestions outside of strings and comments.`) } }, default: e206, markdownDescription: C(305, `Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.`, "`#editor.suggestOnTriggerCharacters#`") }), this.defaultValue = e206;
  }
  validate(e206) {
    if (typeof e206 == `boolean`) {
      let t11 = e206 ? `on` : `off`;
      return { comments: t11, strings: t11, other: t11 };
    }
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let { other: t10, comments: n10, strings: r10 } = e206, i10 = [`on`, `inline`, `off`], a10, o10, s10;
    return a10 = typeof t10 == `boolean` ? t10 ? `on` : `off` : Bn(t10, this.defaultValue.other, i10), o10 = typeof n10 == `boolean` ? n10 ? `on` : `off` : Bn(n10, this.defaultValue.comments, i10), s10 = typeof r10 == `boolean` ? r10 ? `on` : `off` : Bn(r10, this.defaultValue.strings, i10), { other: a10, comments: o10, strings: s10 };
  }
}, Fee = class extends On {
  constructor() {
    super(76, `lineNumbers`, { renderType: 1, renderFn: null }, { type: `string`, enum: [`off`, `on`, `relative`, `interval`], enumDescriptions: [C(306, `Line numbers are not rendered.`), C(307, `Line numbers are rendered as absolute number.`), C(308, `Line numbers are rendered as distance in lines to cursor position.`), C(309, `Line numbers are rendered every 10 lines.`)], default: `on`, description: C(310, `Controls the display of line numbers.`) });
  }
  validate(e206) {
    let t10 = this.defaultValue.renderType, n10 = this.defaultValue.renderFn;
    return e206 !== void 0 && (typeof e206 == `function` ? (t10 = 4, n10 = e206) : t10 = e206 === `interval` ? 3 : e206 === `relative` ? 2 : +(e206 === `on`)), { renderType: t10, renderFn: n10 };
  }
};
function nr(e206) {
  let t10 = e206.get(112);
  return t10 === `editable` ? e206.get(104) : t10 !== `on`;
}
function rr(e206) {
  return !e206.get(172);
}
var Iee = class extends On {
  constructor() {
    let e206 = [], t10 = { type: `number`, description: C(311, `Number of monospace characters at which this editor ruler will render.`) };
    super(116, `rulers`, e206, { type: `array`, items: { anyOf: [t10, { type: [`object`], properties: { column: t10, color: { type: `string`, description: C(312, `Color of this editor ruler.`), format: `color-hex` } } }] }, default: e206, description: C(313, `Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.`) });
  }
  validate(e206) {
    if (Array.isArray(e206)) {
      let t10 = [];
      for (let n10 of e206) if (typeof n10 == `number`) t10.push({ column: In.clampedInt(n10, 0, 0, 1e4), color: null });
      else if (n10 && typeof n10 == `object`) {
        let e207 = n10;
        t10.push({ column: In.clampedInt(e207.column, 0, 0, 1e4), color: e207.color });
      }
      return t10.sort((e207, t11) => e207.column - t11.column), t10;
    }
    return this.defaultValue;
  }
}, Lee = class extends On {
  constructor() {
    super(105, `readOnlyMessage`, void 0);
  }
  validate(e206) {
    return !e206 || typeof e206 != `object` ? this.defaultValue : e206;
  }
};
function ir(e206, t10) {
  if (typeof e206 != `string`) return t10;
  switch (e206) {
    case `hidden`:
      return 2;
    case `visible`:
      return 3;
    default:
      return 1;
  }
}
var Ree = class extends On {
  constructor() {
    let e206 = { vertical: 1, horizontal: 1, arrowSize: 11, useShadows: true, verticalHasArrows: false, horizontalHasArrows: false, horizontalScrollbarSize: 12, horizontalSliderSize: 12, verticalScrollbarSize: 14, verticalSliderSize: 14, handleMouseWheel: true, alwaysConsumeMouseWheel: true, scrollByPage: false, ignoreHorizontalScrollbarInContentHeight: false };
    super(117, `scrollbar`, e206, { "editor.scrollbar.vertical": { type: `string`, enum: [`auto`, `visible`, `hidden`], enumDescriptions: [C(314, `The vertical scrollbar will be visible only when necessary.`), C(315, `The vertical scrollbar will always be visible.`), C(316, `The vertical scrollbar will always be hidden.`)], default: `auto`, description: C(317, `Controls the visibility of the vertical scrollbar.`) }, "editor.scrollbar.horizontal": { type: `string`, enum: [`auto`, `visible`, `hidden`], enumDescriptions: [C(318, `The horizontal scrollbar will be visible only when necessary.`), C(319, `The horizontal scrollbar will always be visible.`), C(320, `The horizontal scrollbar will always be hidden.`)], default: `auto`, description: C(321, `Controls the visibility of the horizontal scrollbar.`) }, "editor.scrollbar.verticalScrollbarSize": { type: `number`, default: e206.verticalScrollbarSize, description: C(322, `The width of the vertical scrollbar.`) }, "editor.scrollbar.horizontalScrollbarSize": { type: `number`, default: e206.horizontalScrollbarSize, description: C(323, `The height of the horizontal scrollbar.`) }, "editor.scrollbar.scrollByPage": { type: `boolean`, default: e206.scrollByPage, description: C(324, `Controls whether clicks scroll by page or jump to click position.`) }, "editor.scrollbar.ignoreHorizontalScrollbarInContentHeight": { type: `boolean`, default: e206.ignoreHorizontalScrollbarInContentHeight, description: C(325, `When set, the horizontal scrollbar will not increase the size of the editor's content.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206, n10 = In.clampedInt(t10.horizontalScrollbarSize, this.defaultValue.horizontalScrollbarSize, 0, 1e3), r10 = In.clampedInt(t10.verticalScrollbarSize, this.defaultValue.verticalScrollbarSize, 0, 1e3);
    return { arrowSize: In.clampedInt(t10.arrowSize, this.defaultValue.arrowSize, 0, 1e3), vertical: ir(t10.vertical, this.defaultValue.vertical), horizontal: ir(t10.horizontal, this.defaultValue.horizontal), useShadows: Nn(t10.useShadows, this.defaultValue.useShadows), verticalHasArrows: Nn(t10.verticalHasArrows, this.defaultValue.verticalHasArrows), horizontalHasArrows: Nn(t10.horizontalHasArrows, this.defaultValue.horizontalHasArrows), handleMouseWheel: Nn(t10.handleMouseWheel, this.defaultValue.handleMouseWheel), alwaysConsumeMouseWheel: Nn(t10.alwaysConsumeMouseWheel, this.defaultValue.alwaysConsumeMouseWheel), horizontalScrollbarSize: n10, horizontalSliderSize: In.clampedInt(t10.horizontalSliderSize, n10, 0, 1e3), verticalScrollbarSize: r10, verticalSliderSize: In.clampedInt(t10.verticalSliderSize, r10, 0, 1e3), scrollByPage: Nn(t10.scrollByPage, this.defaultValue.scrollByPage), ignoreHorizontalScrollbarInContentHeight: Nn(t10.ignoreHorizontalScrollbarInContentHeight, this.defaultValue.ignoreHorizontalScrollbarInContentHeight) };
  }
}, ar = `inUntrustedWorkspace`, or = { allowedCharacters: `editor.unicodeHighlight.allowedCharacters`, invisibleCharacters: `editor.unicodeHighlight.invisibleCharacters`, nonBasicASCII: `editor.unicodeHighlight.nonBasicASCII`, ambiguousCharacters: `editor.unicodeHighlight.ambiguousCharacters`, includeComments: `editor.unicodeHighlight.includeComments`, includeStrings: `editor.unicodeHighlight.includeStrings`, allowedLocales: `editor.unicodeHighlight.allowedLocales` }, zee = class extends On {
  constructor() {
    let e206 = { nonBasicASCII: ar, invisibleCharacters: true, ambiguousCharacters: true, includeComments: ar, includeStrings: true, allowedCharacters: {}, allowedLocales: { _os: true, _vscode: true } };
    super(142, `unicodeHighlight`, e206, { [or.nonBasicASCII]: { restricted: true, type: [`boolean`, `string`], enum: [true, false, ar], default: e206.nonBasicASCII, description: C(326, `Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.`) }, [or.invisibleCharacters]: { restricted: true, type: `boolean`, default: e206.invisibleCharacters, description: C(327, `Controls whether characters that just reserve space or have no width at all are highlighted.`) }, [or.ambiguousCharacters]: { restricted: true, type: `boolean`, default: e206.ambiguousCharacters, description: C(328, `Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.`) }, [or.includeComments]: { restricted: true, type: [`boolean`, `string`], enum: [true, false, ar], default: e206.includeComments, description: C(329, `Controls whether characters in comments should also be subject to Unicode highlighting.`) }, [or.includeStrings]: { restricted: true, type: [`boolean`, `string`], enum: [true, false, ar], default: e206.includeStrings, description: C(330, `Controls whether characters in strings should also be subject to Unicode highlighting.`) }, [or.allowedCharacters]: { restricted: true, type: `object`, default: e206.allowedCharacters, description: C(331, `Defines allowed characters that are not being highlighted.`), additionalProperties: { type: `boolean` } }, [or.allowedLocales]: { restricted: true, type: `object`, additionalProperties: { type: `boolean` }, default: e206.allowedLocales, description: C(332, `Unicode characters that are common in allowed locales are not being highlighted.`) } });
  }
  applyUpdate(e206, t10) {
    let n10 = false;
    t10.allowedCharacters && e206 && (ot(e206.allowedCharacters, t10.allowedCharacters) || (e206 = { ...e206, allowedCharacters: t10.allowedCharacters }, n10 = true)), t10.allowedLocales && e206 && (ot(e206.allowedLocales, t10.allowedLocales) || (e206 = { ...e206, allowedLocales: t10.allowedLocales }, n10 = true));
    let r10 = super.applyUpdate(e206, t10);
    return n10 ? new kn(r10.newValue, true) : r10;
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { nonBasicASCII: sr(t10.nonBasicASCII, ar, [true, false, ar]), invisibleCharacters: Nn(t10.invisibleCharacters, this.defaultValue.invisibleCharacters), ambiguousCharacters: Nn(t10.ambiguousCharacters, this.defaultValue.ambiguousCharacters), includeComments: sr(t10.includeComments, ar, [true, false, ar]), includeStrings: sr(t10.includeStrings, ar, [true, false, ar]), allowedCharacters: this.validateBooleanMap(t10.allowedCharacters, this.defaultValue.allowedCharacters), allowedLocales: this.validateBooleanMap(t10.allowedLocales, this.defaultValue.allowedLocales) };
  }
  validateBooleanMap(e206, t10) {
    if (typeof e206 != `object` || !e206) return t10;
    let n10 = {};
    for (let [t11, r10] of Object.entries(e206)) r10 === true && (n10[t11] = true);
    return n10;
  }
}, Bee = class extends On {
  constructor() {
    let e206 = { enabled: true, mode: `subwordSmart`, showToolbar: `onHover`, suppressSuggestions: false, keepOnBlur: false, fontFamily: `default`, syntaxHighlightingEnabled: true, minShowDelay: 0, suppressInSnippetMode: true, edits: { enabled: true, showCollapsed: false, renderSideBySide: `auto`, allowCodeShifting: `always` }, triggerCommandOnProviderChange: false, experimental: { suppressInlineSuggestions: ``, showOnSuggestConflict: `never`, emptyResponseInformation: true } };
    super(71, `inlineSuggest`, e206, { "editor.inlineSuggest.enabled": { type: `boolean`, default: e206.enabled, description: C(333, `Controls whether to automatically show inline suggestions in the editor.`) }, "editor.inlineSuggest.showToolbar": { type: `string`, default: e206.showToolbar, enum: [`always`, `onHover`, `never`], enumDescriptions: [C(334, `Show the inline suggestion toolbar whenever an inline suggestion is shown.`), C(335, `Show the inline suggestion toolbar when hovering over an inline suggestion.`), C(336, `Never show the inline suggestion toolbar.`)], description: C(337, `Controls when to show the inline suggestion toolbar.`) }, "editor.inlineSuggest.syntaxHighlightingEnabled": { type: `boolean`, default: e206.syntaxHighlightingEnabled, description: C(338, `Controls whether to show syntax highlighting for inline suggestions in the editor.`) }, "editor.inlineSuggest.suppressSuggestions": { type: `boolean`, default: e206.suppressSuggestions, description: C(339, `Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.`) }, "editor.inlineSuggest.suppressInSnippetMode": { type: `boolean`, default: e206.suppressInSnippetMode, description: C(340, `Controls whether inline suggestions are suppressed when in snippet mode.`) }, "editor.inlineSuggest.minShowDelay": { type: `number`, default: 0, minimum: 0, maximum: 1e4, description: C(341, `Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.`) }, "editor.inlineSuggest.experimental.suppressInlineSuggestions": { type: `string`, default: e206.experimental.suppressInlineSuggestions, tags: [`experimental`], description: C(342, `Suppresses inline completions for specified extension IDs -- comma separated.`), experiment: { mode: `auto` } }, "editor.inlineSuggest.experimental.emptyResponseInformation": { type: `boolean`, default: e206.experimental.emptyResponseInformation, tags: [`experimental`], description: C(343, `Controls whether to send request information from the inline suggestion provider.`), experiment: { mode: `auto` } }, "editor.inlineSuggest.triggerCommandOnProviderChange": { type: `boolean`, default: e206.triggerCommandOnProviderChange, tags: [`experimental`], description: C(344, `Controls whether to trigger a command when the inline suggestion provider changes.`), experiment: { mode: `auto` } }, "editor.inlineSuggest.experimental.showOnSuggestConflict": { type: `string`, default: e206.experimental.showOnSuggestConflict, tags: [`experimental`], enum: [`always`, `never`, `whenSuggestListIsIncomplete`], description: C(345, `Controls whether to show inline suggestions when there is a suggest conflict.`), experiment: { mode: `auto` } }, "editor.inlineSuggest.fontFamily": { type: `string`, default: e206.fontFamily, description: C(346, `Controls the font family of the inline suggestions.`) }, "editor.inlineSuggest.edits.allowCodeShifting": { type: `string`, default: e206.edits.allowCodeShifting, description: C(347, `Controls whether showing a suggestion will shift the code to make space for the suggestion inline.`), enum: [`always`, `horizontal`, `never`], tags: [`nextEditSuggestions`] }, "editor.inlineSuggest.edits.renderSideBySide": { type: `string`, default: e206.edits.renderSideBySide, description: C(348, `Controls whether larger suggestions can be shown side by side.`), enum: [`auto`, `never`], enumDescriptions: [C(349, `Larger suggestions will show side by side if there is enough space, otherwise they will be shown below.`), C(350, `Larger suggestions are never shown side by side and will always be shown below.`)], tags: [`nextEditSuggestions`] }, "editor.inlineSuggest.edits.showCollapsed": { type: `boolean`, default: e206.edits.showCollapsed, description: C(351, `Controls whether the suggestion will show as collapsed until jumping to it.`), tags: [`nextEditSuggestions`] } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), mode: Bn(t10.mode, this.defaultValue.mode, [`prefix`, `subword`, `subwordSmart`]), showToolbar: Bn(t10.showToolbar, this.defaultValue.showToolbar, [`always`, `onHover`, `never`]), suppressSuggestions: Nn(t10.suppressSuggestions, this.defaultValue.suppressSuggestions), keepOnBlur: Nn(t10.keepOnBlur, this.defaultValue.keepOnBlur), fontFamily: zn.string(t10.fontFamily, this.defaultValue.fontFamily), syntaxHighlightingEnabled: Nn(t10.syntaxHighlightingEnabled, this.defaultValue.syntaxHighlightingEnabled), minShowDelay: In.clampedInt(t10.minShowDelay, 0, 0, 1e4), suppressInSnippetMode: Nn(t10.suppressInSnippetMode, this.defaultValue.suppressInSnippetMode), edits: this._validateEdits(t10.edits), triggerCommandOnProviderChange: Nn(t10.triggerCommandOnProviderChange, this.defaultValue.triggerCommandOnProviderChange), experimental: this._validateExperimental(t10.experimental) };
  }
  _validateEdits(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue.edits;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.edits.enabled), showCollapsed: Nn(t10.showCollapsed, this.defaultValue.edits.showCollapsed), allowCodeShifting: Bn(t10.allowCodeShifting, this.defaultValue.edits.allowCodeShifting, [`always`, `horizontal`, `never`]), renderSideBySide: Bn(t10.renderSideBySide, this.defaultValue.edits.renderSideBySide, [`never`, `auto`]) };
  }
  _validateExperimental(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue.experimental;
    let t10 = e206;
    return { suppressInlineSuggestions: zn.string(t10.suppressInlineSuggestions, this.defaultValue.experimental.suppressInlineSuggestions), showOnSuggestConflict: Bn(t10.showOnSuggestConflict, this.defaultValue.experimental.showOnSuggestConflict, [`always`, `never`, `whenSuggestListIsIncomplete`]), emptyResponseInformation: Nn(t10.emptyResponseInformation, this.defaultValue.experimental.emptyResponseInformation) };
  }
}, Vee = class extends On {
  constructor() {
    let e206 = { enabled: vn.bracketPairColorizationOptions.enabled, independentColorPoolPerBracketType: vn.bracketPairColorizationOptions.independentColorPoolPerBracketType };
    super(21, `bracketPairColorization`, e206, { "editor.bracketPairColorization.enabled": { type: `boolean`, default: e206.enabled, markdownDescription: C(352, `Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.`, "`#workbench.colorCustomizations#`") }, "editor.bracketPairColorization.independentColorPoolPerBracketType": { type: `boolean`, default: e206.independentColorPoolPerBracketType, description: C(353, `Controls whether each bracket type has its own independent color pool.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), independentColorPoolPerBracketType: Nn(t10.independentColorPoolPerBracketType, this.defaultValue.independentColorPoolPerBracketType) };
  }
}, Hee = class extends On {
  constructor() {
    let e206 = { bracketPairs: false, bracketPairsHorizontal: `active`, highlightActiveBracketPair: true, indentation: true, highlightActiveIndentation: true };
    super(22, `guides`, e206, { "editor.guides.bracketPairs": { type: [`boolean`, `string`], enum: [true, `active`, false], enumDescriptions: [C(354, `Enables bracket pair guides.`), C(355, `Enables bracket pair guides only for the active bracket pair.`), C(356, `Disables bracket pair guides.`)], default: e206.bracketPairs, description: C(357, `Controls whether bracket pair guides are enabled or not.`) }, "editor.guides.bracketPairsHorizontal": { type: [`boolean`, `string`], enum: [true, `active`, false], enumDescriptions: [C(358, `Enables horizontal guides as addition to vertical bracket pair guides.`), C(359, `Enables horizontal guides only for the active bracket pair.`), C(360, `Disables horizontal bracket pair guides.`)], default: e206.bracketPairsHorizontal, description: C(361, `Controls whether horizontal bracket pair guides are enabled or not.`) }, "editor.guides.highlightActiveBracketPair": { type: `boolean`, default: e206.highlightActiveBracketPair, description: C(362, `Controls whether the editor should highlight the active bracket pair.`) }, "editor.guides.indentation": { type: `boolean`, default: e206.indentation, description: C(363, `Controls whether the editor should render indent guides.`) }, "editor.guides.highlightActiveIndentation": { type: [`boolean`, `string`], enum: [true, `always`, false], enumDescriptions: [C(364, `Highlights the active indent guide.`), C(365, `Highlights the active indent guide even if bracket guides are highlighted.`), C(366, `Do not highlight the active indent guide.`)], default: e206.highlightActiveIndentation, description: C(367, `Controls whether the editor should highlight the active indent guide.`) } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { bracketPairs: sr(t10.bracketPairs, this.defaultValue.bracketPairs, [true, false, `active`]), bracketPairsHorizontal: sr(t10.bracketPairsHorizontal, this.defaultValue.bracketPairsHorizontal, [true, false, `active`]), highlightActiveBracketPair: Nn(t10.highlightActiveBracketPair, this.defaultValue.highlightActiveBracketPair), indentation: Nn(t10.indentation, this.defaultValue.indentation), highlightActiveIndentation: sr(t10.highlightActiveIndentation, this.defaultValue.highlightActiveIndentation, [true, false, `always`]) };
  }
};
function sr(e206, t10, n10) {
  let r10 = n10.indexOf(e206);
  return r10 === -1 ? t10 : n10[r10];
}
var Uee = class extends On {
  constructor() {
    let e206 = { insertMode: `insert`, filterGraceful: true, snippetsPreventQuickSuggestions: false, localityBonus: false, shareSuggestSelections: false, selectionMode: `always`, showIcons: true, showStatusBar: false, preview: false, previewMode: `subwordSmart`, showInlineDetails: true, showMethods: true, showFunctions: true, showConstructors: true, showDeprecated: true, matchOnWordStartOnly: true, showFields: true, showVariables: true, showClasses: true, showStructs: true, showInterfaces: true, showModules: true, showProperties: true, showEvents: true, showOperators: true, showUnits: true, showValues: true, showConstants: true, showEnums: true, showEnumMembers: true, showKeywords: true, showWords: true, showColors: true, showFiles: true, showReferences: true, showFolders: true, showTypeParameters: true, showSnippets: true, showUsers: true, showIssues: true };
    super(134, `suggest`, e206, { "editor.suggest.insertMode": { type: `string`, enum: [`insert`, `replace`], enumDescriptions: [C(368, `Insert suggestion without overwriting text right of the cursor.`), C(369, `Insert suggestion and overwrite text right of the cursor.`)], default: e206.insertMode, description: C(370, `Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.`) }, "editor.suggest.filterGraceful": { type: `boolean`, default: e206.filterGraceful, description: C(371, `Controls whether filtering and sorting suggestions accounts for small typos.`) }, "editor.suggest.localityBonus": { type: `boolean`, default: e206.localityBonus, description: C(372, `Controls whether sorting favors words that appear close to the cursor.`) }, "editor.suggest.shareSuggestSelections": { type: `boolean`, default: e206.shareSuggestSelections, markdownDescription: C(373, "Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).") }, "editor.suggest.selectionMode": { type: `string`, enum: [`always`, `never`, `whenTriggerCharacter`, `whenQuickSuggestion`], enumDescriptions: [C(374, `Always select a suggestion when automatically triggering IntelliSense.`), C(375, `Never select a suggestion when automatically triggering IntelliSense.`), C(376, `Select a suggestion only when triggering IntelliSense from a trigger character.`), C(377, `Select a suggestion only when triggering IntelliSense as you type.`)], default: e206.selectionMode, markdownDescription: C(378, "Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.", "`#editor.quickSuggestions#`", "`#editor.suggestOnTriggerCharacters#`") }, "editor.suggest.snippetsPreventQuickSuggestions": { type: `boolean`, default: e206.snippetsPreventQuickSuggestions, description: C(379, `Controls whether an active snippet prevents quick suggestions.`) }, "editor.suggest.showIcons": { type: `boolean`, default: e206.showIcons, description: C(380, `Controls whether to show or hide icons in suggestions.`) }, "editor.suggest.showStatusBar": { type: `boolean`, default: e206.showStatusBar, description: C(381, `Controls the visibility of the status bar at the bottom of the suggest widget.`) }, "editor.suggest.preview": { type: `boolean`, default: e206.preview, description: C(382, `Controls whether to preview the suggestion outcome in the editor.`) }, "editor.suggest.showInlineDetails": { type: `boolean`, default: e206.showInlineDetails, description: C(383, `Controls whether suggest details show inline with the label or only in the details widget.`) }, "editor.suggest.maxVisibleSuggestions": { type: `number`, deprecationMessage: C(384, `This setting is deprecated. The suggest widget can now be resized.`) }, "editor.suggest.filteredTypes": { type: `object`, deprecationMessage: C(385, `This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.`) }, "editor.suggest.showMethods": { type: `boolean`, default: true, markdownDescription: C(386, "When enabled IntelliSense shows `method`-suggestions.") }, "editor.suggest.showFunctions": { type: `boolean`, default: true, markdownDescription: C(387, "When enabled IntelliSense shows `function`-suggestions.") }, "editor.suggest.showConstructors": { type: `boolean`, default: true, markdownDescription: C(388, "When enabled IntelliSense shows `constructor`-suggestions.") }, "editor.suggest.showDeprecated": { type: `boolean`, default: true, markdownDescription: C(389, "When enabled IntelliSense shows `deprecated`-suggestions.") }, "editor.suggest.matchOnWordStartOnly": { type: `boolean`, default: true, markdownDescription: C(390, "When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.") }, "editor.suggest.showFields": { type: `boolean`, default: true, markdownDescription: C(391, "When enabled IntelliSense shows `field`-suggestions.") }, "editor.suggest.showVariables": { type: `boolean`, default: true, markdownDescription: C(392, "When enabled IntelliSense shows `variable`-suggestions.") }, "editor.suggest.showClasses": { type: `boolean`, default: true, markdownDescription: C(393, "When enabled IntelliSense shows `class`-suggestions.") }, "editor.suggest.showStructs": { type: `boolean`, default: true, markdownDescription: C(394, "When enabled IntelliSense shows `struct`-suggestions.") }, "editor.suggest.showInterfaces": { type: `boolean`, default: true, markdownDescription: C(395, "When enabled IntelliSense shows `interface`-suggestions.") }, "editor.suggest.showModules": { type: `boolean`, default: true, markdownDescription: C(396, "When enabled IntelliSense shows `module`-suggestions.") }, "editor.suggest.showProperties": { type: `boolean`, default: true, markdownDescription: C(397, "When enabled IntelliSense shows `property`-suggestions.") }, "editor.suggest.showEvents": { type: `boolean`, default: true, markdownDescription: C(398, "When enabled IntelliSense shows `event`-suggestions.") }, "editor.suggest.showOperators": { type: `boolean`, default: true, markdownDescription: C(399, "When enabled IntelliSense shows `operator`-suggestions.") }, "editor.suggest.showUnits": { type: `boolean`, default: true, markdownDescription: C(400, "When enabled IntelliSense shows `unit`-suggestions.") }, "editor.suggest.showValues": { type: `boolean`, default: true, markdownDescription: C(401, "When enabled IntelliSense shows `value`-suggestions.") }, "editor.suggest.showConstants": { type: `boolean`, default: true, markdownDescription: C(402, "When enabled IntelliSense shows `constant`-suggestions.") }, "editor.suggest.showEnums": { type: `boolean`, default: true, markdownDescription: C(403, "When enabled IntelliSense shows `enum`-suggestions.") }, "editor.suggest.showEnumMembers": { type: `boolean`, default: true, markdownDescription: C(404, "When enabled IntelliSense shows `enumMember`-suggestions.") }, "editor.suggest.showKeywords": { type: `boolean`, default: true, markdownDescription: C(405, "When enabled IntelliSense shows `keyword`-suggestions.") }, "editor.suggest.showWords": { type: `boolean`, default: true, markdownDescription: C(406, "When enabled IntelliSense shows `text`-suggestions.") }, "editor.suggest.showColors": { type: `boolean`, default: true, markdownDescription: C(407, "When enabled IntelliSense shows `color`-suggestions.") }, "editor.suggest.showFiles": { type: `boolean`, default: true, markdownDescription: C(408, "When enabled IntelliSense shows `file`-suggestions.") }, "editor.suggest.showReferences": { type: `boolean`, default: true, markdownDescription: C(409, "When enabled IntelliSense shows `reference`-suggestions.") }, "editor.suggest.showCustomcolors": { type: `boolean`, default: true, markdownDescription: C(410, "When enabled IntelliSense shows `customcolor`-suggestions.") }, "editor.suggest.showFolders": { type: `boolean`, default: true, markdownDescription: C(411, "When enabled IntelliSense shows `folder`-suggestions.") }, "editor.suggest.showTypeParameters": { type: `boolean`, default: true, markdownDescription: C(412, "When enabled IntelliSense shows `typeParameter`-suggestions.") }, "editor.suggest.showSnippets": { type: `boolean`, default: true, markdownDescription: C(413, "When enabled IntelliSense shows `snippet`-suggestions.") }, "editor.suggest.showUsers": { type: `boolean`, default: true, markdownDescription: C(414, "When enabled IntelliSense shows `user`-suggestions.") }, "editor.suggest.showIssues": { type: `boolean`, default: true, markdownDescription: C(415, "When enabled IntelliSense shows `issues`-suggestions.") } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { insertMode: Bn(t10.insertMode, this.defaultValue.insertMode, [`insert`, `replace`]), filterGraceful: Nn(t10.filterGraceful, this.defaultValue.filterGraceful), snippetsPreventQuickSuggestions: Nn(t10.snippetsPreventQuickSuggestions, this.defaultValue.filterGraceful), localityBonus: Nn(t10.localityBonus, this.defaultValue.localityBonus), shareSuggestSelections: Nn(t10.shareSuggestSelections, this.defaultValue.shareSuggestSelections), selectionMode: Bn(t10.selectionMode, this.defaultValue.selectionMode, [`always`, `never`, `whenQuickSuggestion`, `whenTriggerCharacter`]), showIcons: Nn(t10.showIcons, this.defaultValue.showIcons), showStatusBar: Nn(t10.showStatusBar, this.defaultValue.showStatusBar), preview: Nn(t10.preview, this.defaultValue.preview), previewMode: Bn(t10.previewMode, this.defaultValue.previewMode, [`prefix`, `subword`, `subwordSmart`]), showInlineDetails: Nn(t10.showInlineDetails, this.defaultValue.showInlineDetails), showMethods: Nn(t10.showMethods, this.defaultValue.showMethods), showFunctions: Nn(t10.showFunctions, this.defaultValue.showFunctions), showConstructors: Nn(t10.showConstructors, this.defaultValue.showConstructors), showDeprecated: Nn(t10.showDeprecated, this.defaultValue.showDeprecated), matchOnWordStartOnly: Nn(t10.matchOnWordStartOnly, this.defaultValue.matchOnWordStartOnly), showFields: Nn(t10.showFields, this.defaultValue.showFields), showVariables: Nn(t10.showVariables, this.defaultValue.showVariables), showClasses: Nn(t10.showClasses, this.defaultValue.showClasses), showStructs: Nn(t10.showStructs, this.defaultValue.showStructs), showInterfaces: Nn(t10.showInterfaces, this.defaultValue.showInterfaces), showModules: Nn(t10.showModules, this.defaultValue.showModules), showProperties: Nn(t10.showProperties, this.defaultValue.showProperties), showEvents: Nn(t10.showEvents, this.defaultValue.showEvents), showOperators: Nn(t10.showOperators, this.defaultValue.showOperators), showUnits: Nn(t10.showUnits, this.defaultValue.showUnits), showValues: Nn(t10.showValues, this.defaultValue.showValues), showConstants: Nn(t10.showConstants, this.defaultValue.showConstants), showEnums: Nn(t10.showEnums, this.defaultValue.showEnums), showEnumMembers: Nn(t10.showEnumMembers, this.defaultValue.showEnumMembers), showKeywords: Nn(t10.showKeywords, this.defaultValue.showKeywords), showWords: Nn(t10.showWords, this.defaultValue.showWords), showColors: Nn(t10.showColors, this.defaultValue.showColors), showFiles: Nn(t10.showFiles, this.defaultValue.showFiles), showReferences: Nn(t10.showReferences, this.defaultValue.showReferences), showFolders: Nn(t10.showFolders, this.defaultValue.showFolders), showTypeParameters: Nn(t10.showTypeParameters, this.defaultValue.showTypeParameters), showSnippets: Nn(t10.showSnippets, this.defaultValue.showSnippets), showUsers: Nn(t10.showUsers, this.defaultValue.showUsers), showIssues: Nn(t10.showIssues, this.defaultValue.showIssues) };
  }
}, Wee = class extends On {
  constructor() {
    super(129, `smartSelect`, { selectLeadingAndTrailingWhitespace: true, selectSubwords: true }, { "editor.smartSelect.selectLeadingAndTrailingWhitespace": { description: C(416, `Whether leading and trailing whitespace should always be selected.`), default: true, type: `boolean` }, "editor.smartSelect.selectSubwords": { description: C(417, `Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected.`), default: true, type: `boolean` } });
  }
  validate(e206) {
    return !e206 || typeof e206 != `object` ? this.defaultValue : { selectLeadingAndTrailingWhitespace: Nn(e206.selectLeadingAndTrailingWhitespace, this.defaultValue.selectLeadingAndTrailingWhitespace), selectSubwords: Nn(e206.selectSubwords, this.defaultValue.selectSubwords) };
  }
}, Gee = class extends On {
  constructor() {
    let e206 = [];
    super(147, `wordSegmenterLocales`, e206, { anyOf: [{ type: `string` }, { type: `array`, items: { type: `string` } }], description: C(418, `Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).`), type: `array`, items: { type: `string` }, default: e206 });
  }
  validate(e206) {
    if (typeof e206 == `string` && (e206 = [e206]), Array.isArray(e206)) {
      let t10 = [];
      for (let n10 of e206) if (typeof n10 == `string`) try {
        Intl.Segmenter.supportedLocalesOf(n10).length > 0 && t10.push(n10);
      } catch {
      }
      return t10;
    }
    return this.defaultValue;
  }
}, Kee = class extends On {
  constructor() {
    super(155, `wrappingIndent`, 1, { "editor.wrappingIndent": { type: `string`, enum: [`none`, `same`, `indent`, `deepIndent`], enumDescriptions: [C(419, `No indentation. Wrapped lines begin at column 1.`), C(420, `Wrapped lines get the same indentation as the parent.`), C(421, `Wrapped lines get +1 indentation toward the parent.`), C(422, `Wrapped lines get +2 indentation toward the parent.`)], description: C(423, `Controls the indentation of wrapped lines.`), default: `same` } });
  }
  validate(e206) {
    switch (e206) {
      case `none`:
        return 0;
      case `same`:
        return 1;
      case `indent`:
        return 2;
      case `deepIndent`:
        return 3;
    }
    return 1;
  }
  compute(e206, t10, n10) {
    return t10.get(2) === 2 ? 0 : n10;
  }
}, qee = class extends jn {
  constructor() {
    super(166, { isDominatedByLongLines: false, isWordWrapMinified: false, isViewportWrapping: false, wrappingColumn: -1 });
  }
  compute(e206, t10, n10) {
    let r10 = t10.get(165);
    return { isDominatedByLongLines: e206.isDominatedByLongLines, isWordWrapMinified: r10.isWordWrapMinified, isViewportWrapping: r10.isViewportWrapping, wrappingColumn: r10.wrappingColumn };
  }
}, Jee = class extends On {
  constructor() {
    let e206 = { enabled: true, showDropSelector: `afterDrop` };
    super(43, `dropIntoEditor`, e206, { "editor.dropIntoEditor.enabled": { type: `boolean`, default: e206.enabled, markdownDescription: C(424, "Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).") }, "editor.dropIntoEditor.showDropSelector": { type: `string`, markdownDescription: C(425, `Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped.`), enum: [`afterDrop`, `never`], enumDescriptions: [C(426, `Show the drop selector widget after a file is dropped into the editor.`), C(427, `Never show the drop selector widget. Instead the default drop provider is always used.`)], default: `afterDrop` } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), showDropSelector: Bn(t10.showDropSelector, this.defaultValue.showDropSelector, [`afterDrop`, `never`]) };
  }
}, Yee = class extends On {
  constructor() {
    let e206 = { enabled: true, showPasteSelector: `afterPaste` };
    super(97, `pasteAs`, e206, { "editor.pasteAs.enabled": { type: `boolean`, default: e206.enabled, markdownDescription: C(428, `Controls whether you can paste content in different ways.`) }, "editor.pasteAs.showPasteSelector": { type: `string`, markdownDescription: C(429, `Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted.`), enum: [`afterPaste`, `never`], enumDescriptions: [C(430, `Show the paste selector widget after content is pasted into the editor.`), C(431, `Never show the paste selector widget. Instead the default pasting behavior is always used.`)], default: `afterPaste` } });
  }
  validate(e206) {
    if (!e206 || typeof e206 != `object`) return this.defaultValue;
    let t10 = e206;
    return { enabled: Nn(t10.enabled, this.defaultValue.enabled), showPasteSelector: Bn(t10.showPasteSelector, this.defaultValue.showPasteSelector, [`afterPaste`, `never`]) };
  }
}, cr = [];
function A(e206) {
  return cr[e206.id] = e206, e206;
}
var lr = { acceptSuggestionOnCommitCharacter: A(new Pn(0, `acceptSuggestionOnCommitCharacter`, true, { markdownDescription: C(432, "Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.") })), acceptSuggestionOnEnter: A(new Vn(1, `acceptSuggestionOnEnter`, `on`, [`on`, `smart`, `off`], { markdownEnumDescriptions: [``, C(433, "Only accept a suggestion with `Enter` when it makes a textual change."), ``], markdownDescription: C(434, "Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.") })), accessibilitySupport: A(new hee()), accessibilityPageSize: A(new In(3, `accessibilityPageSize`, 500, 1, 1073741824, { description: C(435, `Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.`), tags: [`accessibility`] })), allowOverflow: A(new Pn(4, `allowOverflow`, true)), allowVariableLineHeights: A(new Pn(5, `allowVariableLineHeights`, true, { description: C(436, `Controls whether to allow using variable line heights in the editor.`) })), allowVariableFonts: A(new Pn(6, `allowVariableFonts`, true, { description: C(437, `Controls whether to allow using variable fonts in the editor.`) })), allowVariableFontsInAccessibilityMode: A(new Pn(7, `allowVariableFontsInAccessibilityMode`, false, { description: C(438, `Controls whether to allow using variable fonts in the editor in the accessibility mode.`), tags: [`accessibility`] })), ariaLabel: A(new zn(8, `ariaLabel`, C(439, `Editor content`))), ariaRequired: A(new Pn(9, `ariaRequired`, false, void 0)), screenReaderAnnounceInlineSuggestion: A(new Pn(12, `screenReaderAnnounceInlineSuggestion`, true, { description: C(440, `Control whether inline suggestions are announced by a screen reader.`), tags: [`accessibility`] })), autoClosingBrackets: A(new Vn(10, `autoClosingBrackets`, `languageDefined`, [`always`, `languageDefined`, `beforeWhitespace`, `never`], { enumDescriptions: [``, C(441, `Use language configurations to determine when to autoclose brackets.`), C(442, `Autoclose brackets only when the cursor is to the left of whitespace.`), ``], description: C(443, `Controls whether the editor should automatically close brackets after the user adds an opening bracket.`) })), autoClosingComments: A(new Vn(11, `autoClosingComments`, `languageDefined`, [`always`, `languageDefined`, `beforeWhitespace`, `never`], { enumDescriptions: [``, C(444, `Use language configurations to determine when to autoclose comments.`), C(445, `Autoclose comments only when the cursor is to the left of whitespace.`), ``], description: C(446, `Controls whether the editor should automatically close comments after the user adds an opening comment.`) })), autoClosingDelete: A(new Vn(13, `autoClosingDelete`, `auto`, [`always`, `auto`, `never`], { enumDescriptions: [``, C(447, `Remove adjacent closing quotes or brackets only if they were automatically inserted.`), ``], description: C(448, `Controls whether the editor should remove adjacent closing quotes or brackets when deleting.`) })), autoClosingOvertype: A(new Vn(14, `autoClosingOvertype`, `auto`, [`always`, `auto`, `never`], { enumDescriptions: [``, C(449, `Type over closing quotes or brackets only if they were automatically inserted.`), ``], description: C(450, `Controls whether the editor should type over closing quotes or brackets.`) })), autoClosingQuotes: A(new Vn(15, `autoClosingQuotes`, `languageDefined`, [`always`, `languageDefined`, `beforeWhitespace`, `never`], { enumDescriptions: [``, C(451, `Use language configurations to determine when to autoclose quotes.`), C(452, `Autoclose quotes only when the cursor is to the left of whitespace.`), ``], description: C(453, `Controls whether the editor should automatically close quotes after the user adds an opening quote.`) })), autoIndent: A(new Hn(16, `autoIndent`, 4, `full`, [`none`, `keep`, `brackets`, `advanced`, `full`], mee, { enumDescriptions: [C(454, `The editor will not insert indentation automatically.`), C(455, `The editor will keep the current line's indentation.`), C(456, `The editor will keep the current line's indentation and honor language defined brackets.`), C(457, `The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.`), C(458, `The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.`)], description: C(459, `Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.`) })), autoIndentOnPaste: A(new Pn(17, `autoIndentOnPaste`, false, { description: C(460, `Controls whether the editor should automatically auto-indent the pasted content.`) })), autoIndentOnPasteWithinString: A(new Pn(18, `autoIndentOnPasteWithinString`, true, { description: C(461, `Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.`) })), automaticLayout: A(new Pn(19, `automaticLayout`, false)), autoSurround: A(new Vn(20, `autoSurround`, `languageDefined`, [`languageDefined`, `quotes`, `brackets`, `never`], { enumDescriptions: [C(462, `Use language configurations to determine when to automatically surround selections.`), C(463, `Surround with quotes but not brackets.`), C(464, `Surround with brackets but not quotes.`), ``], description: C(465, `Controls whether the editor should automatically surround selections when typing quotes or brackets.`) })), bracketPairColorization: A(new Vee()), bracketPairGuides: A(new Hee()), stickyTabStops: A(new Pn(132, `stickyTabStops`, false, { description: C(466, `Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.`) })), codeLens: A(new Pn(23, `codeLens`, true, { description: C(467, `Controls whether the editor shows CodeLens.`) })), codeLensFontFamily: A(new zn(24, `codeLensFontFamily`, ``, { description: C(468, `Controls the font family for CodeLens.`) })), codeLensFontSize: A(new In(25, `codeLensFontSize`, 0, 0, 100, { type: `number`, default: 0, minimum: 0, maximum: 100, markdownDescription: C(469, "Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.") })), colorDecorators: A(new Pn(26, `colorDecorators`, true, { description: C(470, `Controls whether the editor should render the inline color decorators and color picker.`) })), colorDecoratorActivatedOn: A(new Vn(168, `colorDecoratorsActivatedOn`, `clickAndHover`, [`clickAndHover`, `hover`, `click`], { enumDescriptions: [C(471, `Make the color picker appear both on click and hover of the color decorator`), C(472, `Make the color picker appear on hover of the color decorator`), C(473, `Make the color picker appear on click of the color decorator`)], description: C(474, `Controls the condition to make a color picker appear from a color decorator.`) })), colorDecoratorsLimit: A(new In(27, `colorDecoratorsLimit`, 500, 1, 1e6, { markdownDescription: C(475, `Controls the max number of color decorators that can be rendered in an editor at once.`) })), columnSelection: A(new Pn(28, `columnSelection`, false, { description: C(476, `Enable that the selection with the mouse and keys is doing column selection.`) })), comments: A(new gee()), contextmenu: A(new Pn(30, `contextmenu`, true)), copyWithSyntaxHighlighting: A(new Pn(31, `copyWithSyntaxHighlighting`, true, { description: C(477, `Controls whether syntax highlighting should be copied into the clipboard.`) })), cursorBlinking: A(new Hn(32, `cursorBlinking`, 1, `blink`, [`blink`, `smooth`, `phase`, `expand`, `solid`], _ee, { description: C(478, `Control the cursor animation style.`) })), cursorSmoothCaretAnimation: A(new Vn(33, `cursorSmoothCaretAnimation`, `off`, [`off`, `explicit`, `on`], { enumDescriptions: [C(479, `Smooth caret animation is disabled.`), C(480, `Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture.`), C(481, `Smooth caret animation is always enabled.`)], description: C(482, `Controls whether the smooth caret animation should be enabled.`) })), cursorStyle: A(new Hn(34, `cursorStyle`, Un.Line, `line`, [`line`, `block`, `underline`, `line-thin`, `block-outline`, `underline-thin`], Wn, { description: C(483, `Controls the cursor style in insert input mode.`) })), overtypeCursorStyle: A(new Hn(92, `overtypeCursorStyle`, Un.Block, `block`, [`line`, `block`, `underline`, `line-thin`, `block-outline`, `underline-thin`], Wn, { description: C(484, `Controls the cursor style in overtype input mode.`) })), cursorSurroundingLines: A(new In(35, `cursorSurroundingLines`, 0, 0, 1073741824, { description: C(485, `Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.`) })), cursorSurroundingLinesStyle: A(new Vn(36, `cursorSurroundingLinesStyle`, `default`, [`default`, `all`], { enumDescriptions: [C(486, "`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."), C(487, "`cursorSurroundingLines` is enforced always.")], markdownDescription: C(488, "Controls when `#editor.cursorSurroundingLines#` should be enforced.") })), cursorWidth: A(new In(37, `cursorWidth`, 0, 0, 1073741824, { markdownDescription: C(489, "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.") })), cursorHeight: A(new In(38, `cursorHeight`, 0, 0, 1073741824, { markdownDescription: C(490, "Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.") })), disableLayerHinting: A(new Pn(39, `disableLayerHinting`, false)), disableMonospaceOptimizations: A(new Pn(40, `disableMonospaceOptimizations`, false)), domReadOnly: A(new Pn(41, `domReadOnly`, false)), dragAndDrop: A(new Pn(42, `dragAndDrop`, true, { description: C(491, `Controls whether the editor should allow moving selections via drag and drop.`) })), emptySelectionClipboard: A(new yee()), dropIntoEditor: A(new Jee()), editContext: A(new Pn(44, `editContext`, true, { description: C(492, `Sets whether the EditContext API should be used instead of the text area to power input in the editor.`), included: Rt || Bt || Dt })), renderRichScreenReaderContent: A(new Pn(107, `renderRichScreenReaderContent`, false, { markdownDescription: C(493, "Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.") })), stickyScroll: A(new Xn()), experimentalGpuAcceleration: A(new Vn(46, `experimentalGpuAcceleration`, `off`, [`off`, `on`], { tags: [`experimental`], enumDescriptions: [C(494, `Use regular DOM-based rendering.`), C(495, `Use GPU acceleration.`)], description: C(496, `Controls whether to use the experimental GPU acceleration to render the editor.`) })), experimentalWhitespaceRendering: A(new Vn(47, `experimentalWhitespaceRendering`, `svg`, [`svg`, `font`, `off`], { enumDescriptions: [C(497, `Use a new rendering method with svgs.`), C(498, `Use a new rendering method with font characters.`), C(499, `Use the stable rendering method.`)], description: C(500, `Controls whether whitespace is rendered with a new, experimental method.`) })), extraEditorClassName: A(new zn(48, `extraEditorClassName`, ``)), fastScrollSensitivity: A(new Rn(49, `fastScrollSensitivity`, 5, (e206) => e206 <= 0 ? 5 : e206, { markdownDescription: C(501, "Scrolling speed multiplier when pressing `Alt`.") })), find: A(new bee()), fixedOverflowWidgets: A(new Pn(51, `fixedOverflowWidgets`, false)), folding: A(new Pn(52, `folding`, true, { description: C(502, `Controls whether the editor has code folding enabled.`) })), foldingStrategy: A(new Vn(53, `foldingStrategy`, `auto`, [`auto`, `indentation`], { enumDescriptions: [C(503, `Use a language-specific folding strategy if available, else the indentation-based one.`), C(504, `Use the indentation-based folding strategy.`)], description: C(505, `Controls the strategy for computing folding ranges.`) })), foldingHighlight: A(new Pn(54, `foldingHighlight`, true, { description: C(506, `Controls whether the editor should highlight folded ranges.`) })), foldingImportsByDefault: A(new Pn(55, `foldingImportsByDefault`, false, { description: C(507, `Controls whether the editor automatically collapses import ranges.`) })), foldingMaximumRegions: A(new In(56, `foldingMaximumRegions`, 5e3, 10, 65e3, { description: C(508, `The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.`) })), unfoldOnClickAfterEndOfLine: A(new Pn(57, `unfoldOnClickAfterEndOfLine`, false, { description: C(509, `Controls whether clicking on the empty content after a folded line will unfold the line.`) })), fontFamily: A(new zn(58, `fontFamily`, _n.fontFamily, { description: C(510, `Controls the font family.`) })), fontInfo: A(new See()), fontLigatures2: A(new Gn()), fontSize: A(new Eee()), fontWeight: A(new Dee()), fontVariations: A(new xee()), formatOnPaste: A(new Pn(64, `formatOnPaste`, false, { description: C(511, `Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.`) })), formatOnType: A(new Pn(65, `formatOnType`, false, { description: C(512, `Controls whether the editor should automatically format the line after typing.`) })), glyphMargin: A(new Pn(66, `glyphMargin`, true, { description: C(513, `Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.`) })), gotoLocation: A(new Oee()), hideCursorInOverviewRuler: A(new Pn(68, `hideCursorInOverviewRuler`, false, { description: C(514, `Controls whether the cursor should be hidden in the overview ruler.`) })), hover: A(new kee()), inDiffEditor: A(new Pn(70, `inDiffEditor`, false)), inertialScroll: A(new Pn(158, `inertialScroll`, false, { description: C(515, `Make scrolling inertial - mostly useful with touchpad on linux.`) })), letterSpacing: A(new Rn(72, `letterSpacing`, _n.letterSpacing, (e206) => Rn.clamp(e206, -5, 20), { description: C(516, `Controls the letter spacing in pixels.`) })), lightbulb: A(new Yn()), lineDecorationsWidth: A(new Qn()), lineHeight: A(new $n()), lineNumbers: A(new Fee()), lineNumbersMinChars: A(new In(77, `lineNumbersMinChars`, 5, 1, 300)), linkedEditing: A(new Pn(78, `linkedEditing`, false, { description: C(517, `Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.`) })), links: A(new Pn(79, `links`, true, { description: C(518, `Controls whether the editor should detect links and make them clickable.`) })), matchBrackets: A(new Vn(80, `matchBrackets`, `always`, [`always`, `near`, `never`], { description: C(519, `Highlight matching brackets.`) })), minimap: A(new er()), mouseStyle: A(new Vn(82, `mouseStyle`, `text`, [`text`, `default`, `copy`])), mouseWheelScrollSensitivity: A(new Rn(83, `mouseWheelScrollSensitivity`, 1, (e206) => e206 === 0 ? 1 : e206, { markdownDescription: C(520, "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.") })), mouseWheelZoom: A(new Pn(84, `mouseWheelZoom`, false, { markdownDescription: Tt ? C(521, "Zoom the font of the editor when using mouse wheel and holding `Cmd`.") : C(522, "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.") })), multiCursorMergeOverlapping: A(new Pn(85, `multiCursorMergeOverlapping`, true, { description: C(523, `Merge multiple cursors when they are overlapping.`) })), multiCursorModifier: A(new Hn(86, `multiCursorModifier`, `altKey`, `alt`, [`ctrlCmd`, `alt`], tr, { markdownEnumDescriptions: [C(524, "Maps to `Control` on Windows and Linux and to `Command` on macOS."), C(525, "Maps to `Alt` on Windows and Linux and to `Option` on macOS.")], markdownDescription: C(526, `The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).`) })), mouseMiddleClickAction: A(new Vn(87, `mouseMiddleClickAction`, `default`, [`default`, `openLink`, `ctrlLeftClick`], { description: C(527, `Controls what happens when middle mouse button is clicked in the editor.`) })), multiCursorPaste: A(new Vn(88, `multiCursorPaste`, `spread`, [`spread`, `full`], { markdownEnumDescriptions: [C(528, `Each cursor pastes a single line of the text.`), C(529, `Each cursor pastes the full text.`)], markdownDescription: C(530, `Controls pasting when the line count of the pasted text matches the cursor count.`) })), multiCursorLimit: A(new In(89, `multiCursorLimit`, 1e4, 1, 1e5, { markdownDescription: C(531, `Controls the max number of cursors that can be in an active editor at once.`) })), occurrencesHighlight: A(new Vn(90, `occurrencesHighlight`, `singleFile`, [`off`, `singleFile`, `multiFile`], { markdownEnumDescriptions: [C(532, `Does not highlight occurrences.`), C(533, `Highlights occurrences only in the current file.`), C(534, `Experimental: Highlights occurrences across all valid open files.`)], markdownDescription: C(535, `Controls whether occurrences should be highlighted across open files.`) })), occurrencesHighlightDelay: A(new In(91, `occurrencesHighlightDelay`, 0, 0, 2e3, { description: C(536, `Controls the delay in milliseconds after which occurrences are highlighted.`), tags: [`preview`] })), overtypeOnPaste: A(new Pn(93, `overtypeOnPaste`, true, { description: C(537, `Controls whether pasting should overtype.`) })), overviewRulerBorder: A(new Pn(94, `overviewRulerBorder`, true, { description: C(538, `Controls whether a border should be drawn around the overview ruler.`) })), overviewRulerLanes: A(new In(95, `overviewRulerLanes`, 3, 0, 3)), padding: A(new Aee()), pasteAs: A(new Yee()), parameterHints: A(new jee()), peekWidgetDefaultFocus: A(new Vn(99, `peekWidgetDefaultFocus`, `tree`, [`tree`, `editor`], { enumDescriptions: [C(539, `Focus the tree when opening peek`), C(540, `Focus the editor when opening peek`)], description: C(541, `Controls whether to focus the inline editor or the tree in the peek widget.`) })), placeholder: A(new Nee()), definitionLinkOpensInPeek: A(new Pn(101, `definitionLinkOpensInPeek`, false, { description: C(542, `Controls whether the Go to Definition mouse gesture always opens the peek widget.`) })), quickSuggestions: A(new Pee()), quickSuggestionsDelay: A(new In(103, `quickSuggestionsDelay`, 10, 0, 1073741824, { description: C(543, `Controls the delay in milliseconds after which quick suggestions will show up.`), experiment: { mode: `auto` } })), readOnly: A(new Pn(104, `readOnly`, false)), readOnlyMessage: A(new Lee()), renameOnType: A(new Pn(106, `renameOnType`, false, { description: C(544, `Controls whether the editor auto renames on type.`), markdownDeprecationMessage: C(545, "Deprecated, use `#editor.linkedEditing#` instead.") })), renderControlCharacters: A(new Pn(108, `renderControlCharacters`, true, { description: C(546, `Controls whether the editor should render control characters.`), restricted: true })), renderFinalNewline: A(new Vn(109, `renderFinalNewline`, Et ? `dimmed` : `on`, [`off`, `on`, `dimmed`], { description: C(547, `Render last line number when the file ends with a newline.`) })), renderLineHighlight: A(new Vn(110, `renderLineHighlight`, `line`, [`none`, `gutter`, `line`, `all`], { enumDescriptions: [``, ``, ``, C(548, `Highlights both the gutter and the current line.`)], description: C(549, `Controls how the editor should render the current line highlight.`) })), renderLineHighlightOnlyWhenFocus: A(new Pn(111, `renderLineHighlightOnlyWhenFocus`, false, { description: C(550, `Controls if the editor should render the current line highlight only when the editor is focused.`) })), renderValidationDecorations: A(new Vn(112, `renderValidationDecorations`, `editable`, [`editable`, `on`, `off`])), renderWhitespace: A(new Vn(113, `renderWhitespace`, `selection`, [`none`, `boundary`, `selection`, `trailing`, `all`], { enumDescriptions: [``, C(551, `Render whitespace characters except for single spaces between words.`), C(552, `Render whitespace characters only on selected text.`), C(553, `Render only trailing whitespace characters.`), ``], description: C(554, `Controls how the editor should render whitespace characters.`) })), revealHorizontalRightPadding: A(new In(114, `revealHorizontalRightPadding`, 15, 0, 1e3)), roundedSelection: A(new Pn(115, `roundedSelection`, true, { description: C(555, `Controls whether selections should have rounded corners.`) })), rulers: A(new Iee()), scrollbar: A(new Ree()), scrollBeyondLastColumn: A(new In(118, `scrollBeyondLastColumn`, 4, 0, 1073741824, { description: C(556, `Controls the number of extra characters beyond which the editor will scroll horizontally.`) })), scrollBeyondLastLine: A(new Pn(119, `scrollBeyondLastLine`, true, { description: C(557, `Controls whether the editor will scroll beyond the last line.`) })), scrollOnMiddleClick: A(new Pn(171, `scrollOnMiddleClick`, false, { description: C(558, `Controls whether the editor will scroll when the middle button is pressed.`) })), scrollPredominantAxis: A(new Pn(120, `scrollPredominantAxis`, true, { description: C(559, `Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.`) })), selectionClipboard: A(new Pn(121, `selectionClipboard`, true, { description: C(560, `Controls whether the Linux primary clipboard should be supported.`), included: Et })), selectionHighlight: A(new Pn(122, `selectionHighlight`, true, { description: C(561, `Controls whether the editor should highlight matches similar to the selection.`) })), selectionHighlightMaxLength: A(new In(123, `selectionHighlightMaxLength`, 200, 0, 1073741824, { description: C(562, `Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.`) })), selectionHighlightMultiline: A(new Pn(124, `selectionHighlightMultiline`, false, { description: C(563, `Controls whether the editor should highlight selection matches that span multiple lines.`) })), selectOnLineNumbers: A(new Pn(125, `selectOnLineNumbers`, true)), showFoldingControls: A(new Vn(126, `showFoldingControls`, `mouseover`, [`always`, `never`, `mouseover`], { enumDescriptions: [C(564, `Always show the folding controls.`), C(565, `Never show the folding controls and reduce the gutter size.`), C(566, `Only show the folding controls when the mouse is over the gutter.`)], description: C(567, `Controls when the folding controls on the gutter are shown.`) })), showUnused: A(new Pn(127, `showUnused`, true, { description: C(568, `Controls fading out of unused code.`) })), showDeprecated: A(new Pn(157, `showDeprecated`, true, { description: C(569, `Controls strikethrough deprecated variables.`) })), inlayHints: A(new Zn()), snippetSuggestions: A(new Vn(128, `snippetSuggestions`, `inline`, [`top`, `bottom`, `inline`, `none`], { enumDescriptions: [C(570, `Show snippet suggestions on top of other suggestions.`), C(571, `Show snippet suggestions below other suggestions.`), C(572, `Show snippets suggestions with other suggestions.`), C(573, `Do not show snippet suggestions.`)], description: C(574, `Controls whether snippets are shown with other suggestions and how they are sorted.`) })), smartSelect: A(new Wee()), smoothScrolling: A(new Pn(130, `smoothScrolling`, false, { description: C(575, `Controls whether the editor will scroll using an animation.`) })), stopRenderingLineAfter: A(new In(133, `stopRenderingLineAfter`, 1e4, -1, 1073741824)), suggest: A(new Uee()), inlineSuggest: A(new Bee()), inlineCompletionsAccessibilityVerbose: A(new Pn(169, `inlineCompletionsAccessibilityVerbose`, false, { description: C(576, `Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.`) })), suggestFontSize: A(new In(135, `suggestFontSize`, 0, 0, 1e3, { markdownDescription: C(577, `Font size for the suggest widget. When set to {0}, the value of {1} is used.`, "`0`", "`#editor.fontSize#`") })), suggestLineHeight: A(new In(136, `suggestLineHeight`, 0, 0, 1e3, { markdownDescription: C(578, `Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.`, "`0`", "`#editor.lineHeight#`") })), suggestOnTriggerCharacters: A(new Pn(137, `suggestOnTriggerCharacters`, true, { description: C(579, `Controls whether suggestions should automatically show up when typing trigger characters.`) })), suggestSelection: A(new Vn(138, `suggestSelection`, `first`, [`first`, `recentlyUsed`, `recentlyUsedByPrefix`], { markdownEnumDescriptions: [C(580, `Always select the first suggestion.`), C(581, "Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."), C(582, "Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")], description: C(583, `Controls how suggestions are pre-selected when showing the suggest list.`) })), tabCompletion: A(new Vn(139, `tabCompletion`, `off`, [`on`, `off`, `onlySnippets`], { enumDescriptions: [C(584, `Tab complete will insert the best matching suggestion when pressing tab.`), C(585, `Disable tab completions.`), C(586, `Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.`)], description: C(587, `Enables tab completions.`) })), tabIndex: A(new In(140, `tabIndex`, 0, -1, 1073741824)), trimWhitespaceOnDelete: A(new Pn(141, `trimWhitespaceOnDelete`, false, { description: C(588, `Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.`) })), unicodeHighlight: A(new zee()), unusualLineTerminators: A(new Vn(143, `unusualLineTerminators`, `prompt`, [`auto`, `off`, `prompt`], { enumDescriptions: [C(589, `Unusual line terminators are automatically removed.`), C(590, `Unusual line terminators are ignored.`), C(591, `Unusual line terminators prompt to be removed.`)], description: C(592, `Remove unusual line terminators that might cause problems.`) })), useShadowDOM: A(new Pn(144, `useShadowDOM`, true)), useTabStops: A(new Pn(145, `useTabStops`, true, { description: C(593, `Spaces and tabs are inserted and deleted in alignment with tab stops.`) })), wordBreak: A(new Vn(146, `wordBreak`, `normal`, [`normal`, `keepAll`], { markdownEnumDescriptions: [C(594, `Use the default line break rule.`), C(595, `Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.`)], description: C(596, `Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.`) })), wordSegmenterLocales: A(new Gee()), wordSeparators: A(new zn(148, `wordSeparators`, yn, { description: C(597, `Characters that will be used as word separators when doing word related navigations or operations.`) })), wordWrap: A(new Vn(149, `wordWrap`, `off`, [`off`, `on`, `wordWrapColumn`, `bounded`], { markdownEnumDescriptions: [C(598, `Lines will never wrap.`), C(599, `Lines will wrap at the viewport width.`), C(600, "Lines will wrap at `#editor.wordWrapColumn#`."), C(601, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")], description: C(602, `Controls how lines should wrap.`) })), wordWrapBreakAfterCharacters: A(new zn(150, `wordWrapBreakAfterCharacters`, ` 	})]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63`)), wordWrapBreakBeforeCharacters: A(new zn(151, `wordWrapBreakBeforeCharacters`, `([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B`)), wordWrapColumn: A(new In(152, `wordWrapColumn`, 80, 1, 1073741824, { markdownDescription: C(603, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.") })), wordWrapOverride1: A(new Vn(153, `wordWrapOverride1`, `inherit`, [`off`, `on`, `inherit`])), wordWrapOverride2: A(new Vn(154, `wordWrapOverride2`, `inherit`, [`off`, `on`, `inherit`])), wrapOnEscapedLineFeeds: A(new Pn(160, `wrapOnEscapedLineFeeds`, false, { markdownDescription: C(604, 'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n           world"\n```') })), effectiveCursorStyle: A(new Cee()), editorClassName: A(new vee()), defaultColorDecorators: A(new Vn(167, `defaultColorDecorators`, `auto`, [`auto`, `always`, `never`], { enumDescriptions: [C(605, `Show default color decorators only when no extension provides colors decorators.`), C(606, `Always show default color decorators.`), C(607, `Never show default color decorators.`)], description: C(608, `Controls whether inline color decorations should be shown using the default document color provider.`) })), pixelRatio: A(new Mee()), tabFocusMode: A(new Pn(164, `tabFocusMode`, false, { markdownDescription: C(609, `Controls whether the editor receives tabs or defers them to the workbench for navigation.`) })), layoutInfo: A(new Kn()), wrappingInfo: A(new qee()), wrappingIndent: A(new Kee()), wrappingStrategy: A(new qn()), effectiveEditContextEnabled: A(new wee()), effectiveAllowVariableFonts: A(new Tee()) }, ur = Object.freeze(function(e206, t10) {
  let n10 = setTimeout(e206.bind(t10), 0);
  return { dispose() {
    clearTimeout(n10);
  } };
}), dr;
(function(e206) {
  function t10(t11) {
    return t11 === e206.None || t11 === e206.Cancelled || t11 instanceof fr ? true : !t11 || typeof t11 != `object` ? false : typeof t11.isCancellationRequested == `boolean` && typeof t11.onCancellationRequested == `function`;
  }
  e206.isCancellationToken = t10, e206.None = Object.freeze({ isCancellationRequested: false, onCancellationRequested: O.None }), e206.Cancelled = Object.freeze({ isCancellationRequested: true, onCancellationRequested: ur });
})(dr || (dr = {}));
var fr = class {
  constructor() {
    this._isCancelled = false, this._emitter = null;
  }
  cancel() {
    this._isCancelled || (this._isCancelled = true, this._emitter && (this._emitter.fire(void 0), this.dispose()));
  }
  get isCancellationRequested() {
    return this._isCancelled;
  }
  get onCancellationRequested() {
    return this._isCancelled ? ur : (this._emitter || (this._emitter = new k()), this._emitter.event);
  }
  dispose() {
    this._emitter && (this._emitter = (this._emitter.dispose(), null));
  }
}, pr = class {
  constructor(e206) {
    this._token = void 0, this._parentListener = void 0, this._parentListener = e206 && e206.onCancellationRequested(this.cancel, this);
  }
  get token() {
    return this._token || (this._token = new fr()), this._token;
  }
  cancel() {
    this._token ? this._token instanceof fr && this._token.cancel() : this._token = dr.Cancelled;
  }
  dispose(e206 = false) {
    e206 && this.cancel(), this._parentListener?.dispose(), this._token ? this._token instanceof fr && this._token.dispose() : this._token = dr.None;
  }
};
function mr(e206) {
  let t10 = new pr();
  return e206.add({ dispose() {
    t10.cancel();
  } }), t10.token;
}
var hr = class {
  constructor() {
    this._keyCodeToStr = [], this._strToKeyCode = /* @__PURE__ */ Object.create(null);
  }
  define(e206, t10) {
    this._keyCodeToStr[e206] = t10, this._strToKeyCode[t10.toLowerCase()] = e206;
  }
  keyCodeToStr(e206) {
    return this._keyCodeToStr[e206];
  }
  strToKeyCode(e206) {
    return this._strToKeyCode[e206.toLowerCase()] || 0;
  }
}, gr = new hr(), _r = new hr(), vr = new hr(), yr = Array(230), Xee = /* @__PURE__ */ Object.create(null), Zee = /* @__PURE__ */ Object.create(null), br = [];
for (let e206 = 0; e206 <= 193; e206++) br[e206] = -1;
(function() {
  let e206 = [[1, 0, `None`, 0, `unknown`, 0, `VK_UNKNOWN`, ``, ``], [1, 1, `Hyper`, 0, ``, 0, ``, ``, ``], [1, 2, `Super`, 0, ``, 0, ``, ``, ``], [1, 3, `Fn`, 0, ``, 0, ``, ``, ``], [1, 4, `FnLock`, 0, ``, 0, ``, ``, ``], [1, 5, `Suspend`, 0, ``, 0, ``, ``, ``], [1, 6, `Resume`, 0, ``, 0, ``, ``, ``], [1, 7, `Turbo`, 0, ``, 0, ``, ``, ``], [1, 8, `Sleep`, 0, ``, 0, `VK_SLEEP`, ``, ``], [1, 9, `WakeUp`, 0, ``, 0, ``, ``, ``], [0, 10, `KeyA`, 31, `A`, 65, `VK_A`, ``, ``], [0, 11, `KeyB`, 32, `B`, 66, `VK_B`, ``, ``], [0, 12, `KeyC`, 33, `C`, 67, `VK_C`, ``, ``], [0, 13, `KeyD`, 34, `D`, 68, `VK_D`, ``, ``], [0, 14, `KeyE`, 35, `E`, 69, `VK_E`, ``, ``], [0, 15, `KeyF`, 36, `F`, 70, `VK_F`, ``, ``], [0, 16, `KeyG`, 37, `G`, 71, `VK_G`, ``, ``], [0, 17, `KeyH`, 38, `H`, 72, `VK_H`, ``, ``], [0, 18, `KeyI`, 39, `I`, 73, `VK_I`, ``, ``], [0, 19, `KeyJ`, 40, `J`, 74, `VK_J`, ``, ``], [0, 20, `KeyK`, 41, `K`, 75, `VK_K`, ``, ``], [0, 21, `KeyL`, 42, `L`, 76, `VK_L`, ``, ``], [0, 22, `KeyM`, 43, `M`, 77, `VK_M`, ``, ``], [0, 23, `KeyN`, 44, `N`, 78, `VK_N`, ``, ``], [0, 24, `KeyO`, 45, `O`, 79, `VK_O`, ``, ``], [0, 25, `KeyP`, 46, `P`, 80, `VK_P`, ``, ``], [0, 26, `KeyQ`, 47, `Q`, 81, `VK_Q`, ``, ``], [0, 27, `KeyR`, 48, `R`, 82, `VK_R`, ``, ``], [0, 28, `KeyS`, 49, `S`, 83, `VK_S`, ``, ``], [0, 29, `KeyT`, 50, `T`, 84, `VK_T`, ``, ``], [0, 30, `KeyU`, 51, `U`, 85, `VK_U`, ``, ``], [0, 31, `KeyV`, 52, `V`, 86, `VK_V`, ``, ``], [0, 32, `KeyW`, 53, `W`, 87, `VK_W`, ``, ``], [0, 33, `KeyX`, 54, `X`, 88, `VK_X`, ``, ``], [0, 34, `KeyY`, 55, `Y`, 89, `VK_Y`, ``, ``], [0, 35, `KeyZ`, 56, `Z`, 90, `VK_Z`, ``, ``], [0, 36, `Digit1`, 22, `1`, 49, `VK_1`, ``, ``], [0, 37, `Digit2`, 23, `2`, 50, `VK_2`, ``, ``], [0, 38, `Digit3`, 24, `3`, 51, `VK_3`, ``, ``], [0, 39, `Digit4`, 25, `4`, 52, `VK_4`, ``, ``], [0, 40, `Digit5`, 26, `5`, 53, `VK_5`, ``, ``], [0, 41, `Digit6`, 27, `6`, 54, `VK_6`, ``, ``], [0, 42, `Digit7`, 28, `7`, 55, `VK_7`, ``, ``], [0, 43, `Digit8`, 29, `8`, 56, `VK_8`, ``, ``], [0, 44, `Digit9`, 30, `9`, 57, `VK_9`, ``, ``], [0, 45, `Digit0`, 21, `0`, 48, `VK_0`, ``, ``], [1, 46, `Enter`, 3, `Enter`, 13, `VK_RETURN`, ``, ``], [1, 47, `Escape`, 9, `Escape`, 27, `VK_ESCAPE`, ``, ``], [1, 48, `Backspace`, 1, `Backspace`, 8, `VK_BACK`, ``, ``], [1, 49, `Tab`, 2, `Tab`, 9, `VK_TAB`, ``, ``], [1, 50, `Space`, 10, `Space`, 32, `VK_SPACE`, ``, ``], [0, 51, `Minus`, 88, `-`, 189, `VK_OEM_MINUS`, `-`, `OEM_MINUS`], [0, 52, `Equal`, 86, `=`, 187, `VK_OEM_PLUS`, `=`, `OEM_PLUS`], [0, 53, `BracketLeft`, 92, `[`, 219, `VK_OEM_4`, `[`, `OEM_4`], [0, 54, `BracketRight`, 94, `]`, 221, `VK_OEM_6`, `]`, `OEM_6`], [0, 55, `Backslash`, 93, `\\`, 220, `VK_OEM_5`, `\\`, `OEM_5`], [0, 56, `IntlHash`, 0, ``, 0, ``, ``, ``], [0, 57, `Semicolon`, 85, `;`, 186, `VK_OEM_1`, `;`, `OEM_1`], [0, 58, `Quote`, 95, `'`, 222, `VK_OEM_7`, `'`, `OEM_7`], [0, 59, `Backquote`, 91, "`", 192, `VK_OEM_3`, "`", `OEM_3`], [0, 60, `Comma`, 87, `,`, 188, `VK_OEM_COMMA`, `,`, `OEM_COMMA`], [0, 61, `Period`, 89, `.`, 190, `VK_OEM_PERIOD`, `.`, `OEM_PERIOD`], [0, 62, `Slash`, 90, `/`, 191, `VK_OEM_2`, `/`, `OEM_2`], [1, 63, `CapsLock`, 8, `CapsLock`, 20, `VK_CAPITAL`, ``, ``], [1, 64, `F1`, 59, `F1`, 112, `VK_F1`, ``, ``], [1, 65, `F2`, 60, `F2`, 113, `VK_F2`, ``, ``], [1, 66, `F3`, 61, `F3`, 114, `VK_F3`, ``, ``], [1, 67, `F4`, 62, `F4`, 115, `VK_F4`, ``, ``], [1, 68, `F5`, 63, `F5`, 116, `VK_F5`, ``, ``], [1, 69, `F6`, 64, `F6`, 117, `VK_F6`, ``, ``], [1, 70, `F7`, 65, `F7`, 118, `VK_F7`, ``, ``], [1, 71, `F8`, 66, `F8`, 119, `VK_F8`, ``, ``], [1, 72, `F9`, 67, `F9`, 120, `VK_F9`, ``, ``], [1, 73, `F10`, 68, `F10`, 121, `VK_F10`, ``, ``], [1, 74, `F11`, 69, `F11`, 122, `VK_F11`, ``, ``], [1, 75, `F12`, 70, `F12`, 123, `VK_F12`, ``, ``], [1, 76, `PrintScreen`, 0, ``, 0, ``, ``, ``], [1, 77, `ScrollLock`, 84, `ScrollLock`, 145, `VK_SCROLL`, ``, ``], [1, 78, `Pause`, 7, `PauseBreak`, 19, `VK_PAUSE`, ``, ``], [1, 79, `Insert`, 19, `Insert`, 45, `VK_INSERT`, ``, ``], [1, 80, `Home`, 14, `Home`, 36, `VK_HOME`, ``, ``], [1, 81, `PageUp`, 11, `PageUp`, 33, `VK_PRIOR`, ``, ``], [1, 82, `Delete`, 20, `Delete`, 46, `VK_DELETE`, ``, ``], [1, 83, `End`, 13, `End`, 35, `VK_END`, ``, ``], [1, 84, `PageDown`, 12, `PageDown`, 34, `VK_NEXT`, ``, ``], [1, 85, `ArrowRight`, 17, `RightArrow`, 39, `VK_RIGHT`, `Right`, ``], [1, 86, `ArrowLeft`, 15, `LeftArrow`, 37, `VK_LEFT`, `Left`, ``], [1, 87, `ArrowDown`, 18, `DownArrow`, 40, `VK_DOWN`, `Down`, ``], [1, 88, `ArrowUp`, 16, `UpArrow`, 38, `VK_UP`, `Up`, ``], [1, 89, `NumLock`, 83, `NumLock`, 144, `VK_NUMLOCK`, ``, ``], [1, 90, `NumpadDivide`, 113, `NumPad_Divide`, 111, `VK_DIVIDE`, ``, ``], [1, 91, `NumpadMultiply`, 108, `NumPad_Multiply`, 106, `VK_MULTIPLY`, ``, ``], [1, 92, `NumpadSubtract`, 111, `NumPad_Subtract`, 109, `VK_SUBTRACT`, ``, ``], [1, 93, `NumpadAdd`, 109, `NumPad_Add`, 107, `VK_ADD`, ``, ``], [1, 94, `NumpadEnter`, 3, ``, 0, ``, ``, ``], [1, 95, `Numpad1`, 99, `NumPad1`, 97, `VK_NUMPAD1`, ``, ``], [1, 96, `Numpad2`, 100, `NumPad2`, 98, `VK_NUMPAD2`, ``, ``], [1, 97, `Numpad3`, 101, `NumPad3`, 99, `VK_NUMPAD3`, ``, ``], [1, 98, `Numpad4`, 102, `NumPad4`, 100, `VK_NUMPAD4`, ``, ``], [1, 99, `Numpad5`, 103, `NumPad5`, 101, `VK_NUMPAD5`, ``, ``], [1, 100, `Numpad6`, 104, `NumPad6`, 102, `VK_NUMPAD6`, ``, ``], [1, 101, `Numpad7`, 105, `NumPad7`, 103, `VK_NUMPAD7`, ``, ``], [1, 102, `Numpad8`, 106, `NumPad8`, 104, `VK_NUMPAD8`, ``, ``], [1, 103, `Numpad9`, 107, `NumPad9`, 105, `VK_NUMPAD9`, ``, ``], [1, 104, `Numpad0`, 98, `NumPad0`, 96, `VK_NUMPAD0`, ``, ``], [1, 105, `NumpadDecimal`, 112, `NumPad_Decimal`, 110, `VK_DECIMAL`, ``, ``], [0, 106, `IntlBackslash`, 97, `OEM_102`, 226, `VK_OEM_102`, ``, ``], [1, 107, `ContextMenu`, 58, `ContextMenu`, 93, ``, ``, ``], [1, 108, `Power`, 0, ``, 0, ``, ``, ``], [1, 109, `NumpadEqual`, 0, ``, 0, ``, ``, ``], [1, 110, `F13`, 71, `F13`, 124, `VK_F13`, ``, ``], [1, 111, `F14`, 72, `F14`, 125, `VK_F14`, ``, ``], [1, 112, `F15`, 73, `F15`, 126, `VK_F15`, ``, ``], [1, 113, `F16`, 74, `F16`, 127, `VK_F16`, ``, ``], [1, 114, `F17`, 75, `F17`, 128, `VK_F17`, ``, ``], [1, 115, `F18`, 76, `F18`, 129, `VK_F18`, ``, ``], [1, 116, `F19`, 77, `F19`, 130, `VK_F19`, ``, ``], [1, 117, `F20`, 78, `F20`, 131, `VK_F20`, ``, ``], [1, 118, `F21`, 79, `F21`, 132, `VK_F21`, ``, ``], [1, 119, `F22`, 80, `F22`, 133, `VK_F22`, ``, ``], [1, 120, `F23`, 81, `F23`, 134, `VK_F23`, ``, ``], [1, 121, `F24`, 82, `F24`, 135, `VK_F24`, ``, ``], [1, 122, `Open`, 0, ``, 0, ``, ``, ``], [1, 123, `Help`, 0, ``, 0, ``, ``, ``], [1, 124, `Select`, 0, ``, 0, ``, ``, ``], [1, 125, `Again`, 0, ``, 0, ``, ``, ``], [1, 126, `Undo`, 0, ``, 0, ``, ``, ``], [1, 127, `Cut`, 0, ``, 0, ``, ``, ``], [1, 128, `Copy`, 0, ``, 0, ``, ``, ``], [1, 129, `Paste`, 0, ``, 0, ``, ``, ``], [1, 130, `Find`, 0, ``, 0, ``, ``, ``], [1, 131, `AudioVolumeMute`, 117, `AudioVolumeMute`, 173, `VK_VOLUME_MUTE`, ``, ``], [1, 132, `AudioVolumeUp`, 118, `AudioVolumeUp`, 175, `VK_VOLUME_UP`, ``, ``], [1, 133, `AudioVolumeDown`, 119, `AudioVolumeDown`, 174, `VK_VOLUME_DOWN`, ``, ``], [1, 134, `NumpadComma`, 110, `NumPad_Separator`, 108, `VK_SEPARATOR`, ``, ``], [0, 135, `IntlRo`, 115, `ABNT_C1`, 193, `VK_ABNT_C1`, ``, ``], [1, 136, `KanaMode`, 0, ``, 0, ``, ``, ``], [0, 137, `IntlYen`, 0, ``, 0, ``, ``, ``], [1, 138, `Convert`, 0, ``, 0, ``, ``, ``], [1, 139, `NonConvert`, 0, ``, 0, ``, ``, ``], [1, 140, `Lang1`, 0, ``, 0, ``, ``, ``], [1, 141, `Lang2`, 0, ``, 0, ``, ``, ``], [1, 142, `Lang3`, 0, ``, 0, ``, ``, ``], [1, 143, `Lang4`, 0, ``, 0, ``, ``, ``], [1, 144, `Lang5`, 0, ``, 0, ``, ``, ``], [1, 145, `Abort`, 0, ``, 0, ``, ``, ``], [1, 146, `Props`, 0, ``, 0, ``, ``, ``], [1, 147, `NumpadParenLeft`, 0, ``, 0, ``, ``, ``], [1, 148, `NumpadParenRight`, 0, ``, 0, ``, ``, ``], [1, 149, `NumpadBackspace`, 0, ``, 0, ``, ``, ``], [1, 150, `NumpadMemoryStore`, 0, ``, 0, ``, ``, ``], [1, 151, `NumpadMemoryRecall`, 0, ``, 0, ``, ``, ``], [1, 152, `NumpadMemoryClear`, 0, ``, 0, ``, ``, ``], [1, 153, `NumpadMemoryAdd`, 0, ``, 0, ``, ``, ``], [1, 154, `NumpadMemorySubtract`, 0, ``, 0, ``, ``, ``], [1, 155, `NumpadClear`, 131, `Clear`, 12, `VK_CLEAR`, ``, ``], [1, 156, `NumpadClearEntry`, 0, ``, 0, ``, ``, ``], [1, 0, ``, 5, `Ctrl`, 17, `VK_CONTROL`, ``, ``], [1, 0, ``, 4, `Shift`, 16, `VK_SHIFT`, ``, ``], [1, 0, ``, 6, `Alt`, 18, `VK_MENU`, ``, ``], [1, 0, ``, 57, `Meta`, 91, `VK_COMMAND`, ``, ``], [1, 157, `ControlLeft`, 5, ``, 0, `VK_LCONTROL`, ``, ``], [1, 158, `ShiftLeft`, 4, ``, 0, `VK_LSHIFT`, ``, ``], [1, 159, `AltLeft`, 6, ``, 0, `VK_LMENU`, ``, ``], [1, 160, `MetaLeft`, 57, ``, 0, `VK_LWIN`, ``, ``], [1, 161, `ControlRight`, 5, ``, 0, `VK_RCONTROL`, ``, ``], [1, 162, `ShiftRight`, 4, ``, 0, `VK_RSHIFT`, ``, ``], [1, 163, `AltRight`, 6, ``, 0, `VK_RMENU`, ``, ``], [1, 164, `MetaRight`, 57, ``, 0, `VK_RWIN`, ``, ``], [1, 165, `BrightnessUp`, 0, ``, 0, ``, ``, ``], [1, 166, `BrightnessDown`, 0, ``, 0, ``, ``, ``], [1, 167, `MediaPlay`, 0, ``, 0, ``, ``, ``], [1, 168, `MediaRecord`, 0, ``, 0, ``, ``, ``], [1, 169, `MediaFastForward`, 0, ``, 0, ``, ``, ``], [1, 170, `MediaRewind`, 0, ``, 0, ``, ``, ``], [1, 171, `MediaTrackNext`, 124, `MediaTrackNext`, 176, `VK_MEDIA_NEXT_TRACK`, ``, ``], [1, 172, `MediaTrackPrevious`, 125, `MediaTrackPrevious`, 177, `VK_MEDIA_PREV_TRACK`, ``, ``], [1, 173, `MediaStop`, 126, `MediaStop`, 178, `VK_MEDIA_STOP`, ``, ``], [1, 174, `Eject`, 0, ``, 0, ``, ``, ``], [1, 175, `MediaPlayPause`, 127, `MediaPlayPause`, 179, `VK_MEDIA_PLAY_PAUSE`, ``, ``], [1, 176, `MediaSelect`, 128, `LaunchMediaPlayer`, 181, `VK_MEDIA_LAUNCH_MEDIA_SELECT`, ``, ``], [1, 177, `LaunchMail`, 129, `LaunchMail`, 180, `VK_MEDIA_LAUNCH_MAIL`, ``, ``], [1, 178, `LaunchApp2`, 130, `LaunchApp2`, 183, `VK_MEDIA_LAUNCH_APP2`, ``, ``], [1, 179, `LaunchApp1`, 0, ``, 0, `VK_MEDIA_LAUNCH_APP1`, ``, ``], [1, 180, `SelectTask`, 0, ``, 0, ``, ``, ``], [1, 181, `LaunchScreenSaver`, 0, ``, 0, ``, ``, ``], [1, 182, `BrowserSearch`, 120, `BrowserSearch`, 170, `VK_BROWSER_SEARCH`, ``, ``], [1, 183, `BrowserHome`, 121, `BrowserHome`, 172, `VK_BROWSER_HOME`, ``, ``], [1, 184, `BrowserBack`, 122, `BrowserBack`, 166, `VK_BROWSER_BACK`, ``, ``], [1, 185, `BrowserForward`, 123, `BrowserForward`, 167, `VK_BROWSER_FORWARD`, ``, ``], [1, 186, `BrowserStop`, 0, ``, 0, `VK_BROWSER_STOP`, ``, ``], [1, 187, `BrowserRefresh`, 0, ``, 0, `VK_BROWSER_REFRESH`, ``, ``], [1, 188, `BrowserFavorites`, 0, ``, 0, `VK_BROWSER_FAVORITES`, ``, ``], [1, 189, `ZoomToggle`, 0, ``, 0, ``, ``, ``], [1, 190, `MailReply`, 0, ``, 0, ``, ``, ``], [1, 191, `MailForward`, 0, ``, 0, ``, ``, ``], [1, 192, `MailSend`, 0, ``, 0, ``, ``, ``], [1, 0, ``, 114, `KeyInComposition`, 229, ``, ``, ``], [1, 0, ``, 116, `ABNT_C2`, 194, `VK_ABNT_C2`, ``, ``], [1, 0, ``, 96, `OEM_8`, 223, `VK_OEM_8`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_KANA`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_HANGUL`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_JUNJA`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_FINAL`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_HANJA`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_KANJI`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_CONVERT`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_NONCONVERT`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_ACCEPT`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_MODECHANGE`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_SELECT`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_PRINT`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_EXECUTE`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_SNAPSHOT`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_HELP`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_APPS`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_PROCESSKEY`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_PACKET`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_DBE_SBCSCHAR`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_DBE_DBCSCHAR`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_ATTN`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_CRSEL`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_EXSEL`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_EREOF`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_PLAY`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_ZOOM`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_NONAME`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_PA1`, ``, ``], [1, 0, ``, 0, ``, 0, `VK_OEM_CLEAR`, ``, ``]], t10 = [], n10 = [];
  for (let r10 of e206) {
    let [e207, i10, a10, o10, s10, c10, l10, u10, d10] = r10;
    if (n10[i10] || (n10[i10] = true, Xee[a10] = i10, Zee[a10.toLowerCase()] = i10, e207 && (br[i10] = o10)), !t10[o10]) {
      if (t10[o10] = true, !s10) throw Error(`String representation missing for key code ${o10} around scan code ${a10}`);
      gr.define(o10, s10), _r.define(o10, u10 || s10), vr.define(o10, d10 || u10 || s10);
    }
    c10 && (yr[c10] = o10);
  }
})();
var xr;
(function(e206) {
  function t10(e207) {
    return gr.keyCodeToStr(e207);
  }
  e206.toString = t10;
  function n10(e207) {
    return gr.strToKeyCode(e207);
  }
  e206.fromString = n10;
  function r10(e207) {
    return _r.keyCodeToStr(e207);
  }
  e206.toUserSettingsUS = r10;
  function i10(e207) {
    return vr.keyCodeToStr(e207);
  }
  e206.toUserSettingsGeneral = i10;
  function a10(e207) {
    return _r.strToKeyCode(e207) || vr.strToKeyCode(e207);
  }
  e206.fromUserSettings = a10;
  function o10(e207) {
    if (e207 >= 98 && e207 <= 113) return null;
    switch (e207) {
      case 16:
        return `Up`;
      case 18:
        return `Down`;
      case 15:
        return `Left`;
      case 17:
        return `Right`;
    }
    return gr.keyCodeToStr(e207);
  }
  e206.toElectronAccelerator = o10;
})(xr || (xr = {}));
function Sr(e206, t10) {
  return (e206 | (t10 & 65535) << 16 >>> 0) >>> 0;
}
i();
var Cr, wr = globalThis.vscode;
if (wr !== void 0 && wr.process !== void 0) {
  let e206 = wr.process;
  Cr = { get platform() {
    return e206.platform;
  }, get arch() {
    return e206.arch;
  }, get env() {
    return e206.env;
  }, cwd() {
    return e206.cwd();
  } };
} else Cr = r !== void 0 && typeof r?.versions?.node == `string` ? { get platform() {
  return r.platform;
}, get arch() {
  return r.arch;
}, get env() {
  return {};
}, cwd() {
  return {}.VSCODE_CWD || r.cwd();
} } : { get platform() {
  return wt ? `win32` : Tt ? `darwin` : `linux`;
}, get arch() {
}, get env() {
  return {};
}, cwd() {
  return `/`;
} };
var Tr = Cr.cwd, Er = Cr.env, Dr = Cr.platform, Or = 65, Qee = 97, $ee = 90, ete = 122, kr = 46, Ar = 47, jr = 92, Mr = 58, Nr = 63, Pr = class extends Error {
  constructor(e206, t10, n10) {
    let r10;
    typeof t10 == `string` && t10.indexOf(`not `) === 0 ? (r10 = `must not be`, t10 = t10.replace(/^not /, ``)) : r10 = `must be`;
    let i10 = `The "${e206}" ${e206.indexOf(`.`) === -1 ? `argument` : `property`} ${r10} of type ${t10}`;
    i10 += `. Received type ${typeof n10}`, super(i10), this.code = `ERR_INVALID_ARG_TYPE`;
  }
};
function Fr(e206, t10) {
  if (typeof e206 != `object` || !e206) throw new Pr(t10, `Object`, e206);
}
function Ir(e206, t10) {
  if (typeof e206 != `string`) throw new Pr(t10, `string`, e206);
}
var Lr = Dr === `win32`;
function Rr(e206) {
  return e206 === Ar || e206 === jr;
}
function zr(e206) {
  return e206 === Ar;
}
function Br(e206) {
  return e206 >= Or && e206 <= $ee || e206 >= Qee && e206 <= ete;
}
function Vr(e206, t10, n10, r10) {
  let i10 = ``, a10 = 0, o10 = -1, s10 = 0, c10 = 0;
  for (let l10 = 0; l10 <= e206.length; ++l10) {
    if (l10 < e206.length) c10 = e206.charCodeAt(l10);
    else if (r10(c10)) break;
    else c10 = Ar;
    if (r10(c10)) {
      if (!(o10 === l10 - 1 || s10 === 1)) if (s10 === 2) {
        if (i10.length < 2 || a10 !== 2 || i10.charCodeAt(i10.length - 1) !== kr || i10.charCodeAt(i10.length - 2) !== kr) {
          if (i10.length > 2) {
            let e207 = i10.lastIndexOf(n10);
            e207 === -1 ? (i10 = ``, a10 = 0) : (i10 = i10.slice(0, e207), a10 = i10.length - 1 - i10.lastIndexOf(n10)), o10 = l10, s10 = 0;
            continue;
          } else if (i10.length !== 0) {
            i10 = ``, a10 = 0, o10 = l10, s10 = 0;
            continue;
          }
        }
        t10 && (i10 += i10.length > 0 ? `${n10}..` : `..`, a10 = 2);
      } else i10.length > 0 ? i10 += `${n10}${e206.slice(o10 + 1, l10)}` : i10 = e206.slice(o10 + 1, l10), a10 = l10 - o10 - 1;
      o10 = l10, s10 = 0;
    } else c10 === kr && s10 !== -1 ? ++s10 : s10 = -1;
  }
  return i10;
}
function Hr(e206) {
  return e206 ? `${e206[0] === `.` ? `` : `.`}${e206}` : ``;
}
function Ur(e206, t10) {
  Fr(t10, `pathObject`);
  let n10 = t10.dir || t10.root, r10 = t10.base || `${t10.name || ``}${Hr(t10.ext)}`;
  return n10 ? n10 === t10.root ? `${n10}${r10}` : `${n10}${e206}${r10}` : r10;
}
var Wr = { resolve(...e206) {
  let t10 = ``, n10 = ``, r10 = false;
  for (let i10 = e206.length - 1; i10 >= -1; i10--) {
    let a10;
    if (i10 >= 0) {
      if (a10 = e206[i10], Ir(a10, `paths[${i10}]`), a10.length === 0) continue;
    } else t10.length === 0 ? a10 = Tr() : (a10 = Er[`=${t10}`] || Tr(), (a10 === void 0 || a10.slice(0, 2).toLowerCase() !== t10.toLowerCase() && a10.charCodeAt(2) === jr) && (a10 = `${t10}\\`));
    let o10 = a10.length, s10 = 0, c10 = ``, l10 = false, u10 = a10.charCodeAt(0);
    if (o10 === 1) Rr(u10) && (s10 = 1, l10 = true);
    else if (Rr(u10)) if (l10 = true, Rr(a10.charCodeAt(1))) {
      let e207 = 2, t11 = e207;
      for (; e207 < o10 && !Rr(a10.charCodeAt(e207)); ) e207++;
      if (e207 < o10 && e207 !== t11) {
        let n11 = a10.slice(t11, e207);
        for (t11 = e207; e207 < o10 && Rr(a10.charCodeAt(e207)); ) e207++;
        if (e207 < o10 && e207 !== t11) {
          for (t11 = e207; e207 < o10 && !Rr(a10.charCodeAt(e207)); ) e207++;
          (e207 === o10 || e207 !== t11) && (c10 = `\\\\${n11}\\${a10.slice(t11, e207)}`, s10 = e207);
        }
      }
    } else s10 = 1;
    else Br(u10) && a10.charCodeAt(1) === Mr && (c10 = a10.slice(0, 2), s10 = 2, o10 > 2 && Rr(a10.charCodeAt(2)) && (l10 = true, s10 = 3));
    if (c10.length > 0) if (t10.length > 0) {
      if (c10.toLowerCase() !== t10.toLowerCase()) continue;
    } else t10 = c10;
    if (r10) {
      if (t10.length > 0) break;
    } else if (n10 = `${a10.slice(s10)}\\${n10}`, r10 = l10, l10 && t10.length > 0) break;
  }
  return n10 = Vr(n10, !r10, `\\`, Rr), r10 ? `${t10}\\${n10}` : `${t10}${n10}` || `.`;
}, normalize(e206) {
  Ir(e206, `path`);
  let t10 = e206.length;
  if (t10 === 0) return `.`;
  let n10 = 0, r10, i10 = false, a10 = e206.charCodeAt(0);
  if (t10 === 1) return zr(a10) ? `\\` : e206;
  if (Rr(a10)) if (i10 = true, Rr(e206.charCodeAt(1))) {
    let i11 = 2, a11 = i11;
    for (; i11 < t10 && !Rr(e206.charCodeAt(i11)); ) i11++;
    if (i11 < t10 && i11 !== a11) {
      let o11 = e206.slice(a11, i11);
      for (a11 = i11; i11 < t10 && Rr(e206.charCodeAt(i11)); ) i11++;
      if (i11 < t10 && i11 !== a11) {
        for (a11 = i11; i11 < t10 && !Rr(e206.charCodeAt(i11)); ) i11++;
        if (i11 === t10) return `\\\\${o11}\\${e206.slice(a11)}\\`;
        i11 !== a11 && (r10 = `\\\\${o11}\\${e206.slice(a11, i11)}`, n10 = i11);
      }
    }
  } else n10 = 1;
  else Br(a10) && e206.charCodeAt(1) === Mr && (r10 = e206.slice(0, 2), n10 = 2, t10 > 2 && Rr(e206.charCodeAt(2)) && (i10 = true, n10 = 3));
  let o10 = n10 < t10 ? Vr(e206.slice(n10), !i10, `\\`, Rr) : ``;
  if (o10.length === 0 && !i10 && (o10 = `.`), o10.length > 0 && Rr(e206.charCodeAt(t10 - 1)) && (o10 += `\\`), !i10 && r10 === void 0 && e206.includes(`:`)) {
    if (o10.length >= 2 && Br(o10.charCodeAt(0)) && o10.charCodeAt(1) === Mr) return `.\\${o10}`;
    let n11 = e206.indexOf(`:`);
    do
      if (n11 === t10 - 1 || Rr(e206.charCodeAt(n11 + 1))) return `.\\${o10}`;
    while ((n11 = e206.indexOf(`:`, n11 + 1)) !== -1);
  }
  return r10 === void 0 ? i10 ? `\\${o10}` : o10 : i10 ? `${r10}\\${o10}` : `${r10}${o10}`;
}, isAbsolute(e206) {
  Ir(e206, `path`);
  let t10 = e206.length;
  if (t10 === 0) return false;
  let n10 = e206.charCodeAt(0);
  return Rr(n10) || t10 > 2 && Br(n10) && e206.charCodeAt(1) === Mr && Rr(e206.charCodeAt(2));
}, join(...e206) {
  if (e206.length === 0) return `.`;
  let t10, n10;
  for (let r11 = 0; r11 < e206.length; ++r11) {
    let i11 = e206[r11];
    Ir(i11, `path`), i11.length > 0 && (t10 === void 0 ? t10 = n10 = i11 : t10 += `\\${i11}`);
  }
  if (t10 === void 0) return `.`;
  let r10 = true, i10 = 0;
  if (typeof n10 == `string` && Rr(n10.charCodeAt(0))) {
    ++i10;
    let e207 = n10.length;
    e207 > 1 && Rr(n10.charCodeAt(1)) && (++i10, e207 > 2 && (Rr(n10.charCodeAt(2)) ? ++i10 : r10 = false));
  }
  if (r10) {
    for (; i10 < t10.length && Rr(t10.charCodeAt(i10)); ) i10++;
    i10 >= 2 && (t10 = `\\${t10.slice(i10)}`);
  }
  return Wr.normalize(t10);
}, relative(e206, t10) {
  if (Ir(e206, `from`), Ir(t10, `to`), e206 === t10) return ``;
  let n10 = Wr.resolve(e206), r10 = Wr.resolve(t10);
  if (n10 === r10 || (e206 = n10.toLowerCase(), t10 = r10.toLowerCase(), e206 === t10)) return ``;
  if (n10.length !== e206.length || r10.length !== t10.length) {
    let e207 = n10.split(`\\`), t11 = r10.split(`\\`);
    e207[e207.length - 1] === `` && e207.pop(), t11[t11.length - 1] === `` && t11.pop();
    let i11 = e207.length, a11 = t11.length, o11 = i11 < a11 ? i11 : a11, s11;
    for (s11 = 0; s11 < o11 && e207[s11].toLowerCase() === t11[s11].toLowerCase(); s11++) ;
    return s11 === 0 ? r10 : s11 === o11 ? a11 > o11 ? t11.slice(s11).join(`\\`) : i11 > o11 ? `..\\`.repeat(i11 - 1 - s11) + `..` : `` : `..\\`.repeat(i11 - s11) + t11.slice(s11).join(`\\`);
  }
  let i10 = 0;
  for (; i10 < e206.length && e206.charCodeAt(i10) === jr; ) i10++;
  let a10 = e206.length;
  for (; a10 - 1 > i10 && e206.charCodeAt(a10 - 1) === jr; ) a10--;
  let o10 = a10 - i10, s10 = 0;
  for (; s10 < t10.length && t10.charCodeAt(s10) === jr; ) s10++;
  let c10 = t10.length;
  for (; c10 - 1 > s10 && t10.charCodeAt(c10 - 1) === jr; ) c10--;
  let l10 = c10 - s10, u10 = o10 < l10 ? o10 : l10, d10 = -1, f10 = 0;
  for (; f10 < u10; f10++) {
    let n11 = e206.charCodeAt(i10 + f10);
    if (n11 !== t10.charCodeAt(s10 + f10)) break;
    n11 === jr && (d10 = f10);
  }
  if (f10 !== u10) {
    if (d10 === -1) return r10;
  } else {
    if (l10 > u10) {
      if (t10.charCodeAt(s10 + f10) === jr) return r10.slice(s10 + f10 + 1);
      if (f10 === 2) return r10.slice(s10 + f10);
    }
    o10 > u10 && (e206.charCodeAt(i10 + f10) === jr ? d10 = f10 : f10 === 2 && (d10 = 3)), d10 === -1 && (d10 = 0);
  }
  let p10 = ``;
  for (f10 = i10 + d10 + 1; f10 <= a10; ++f10) (f10 === a10 || e206.charCodeAt(f10) === jr) && (p10 += p10.length === 0 ? `..` : `\\..`);
  return s10 += d10, p10.length > 0 ? `${p10}${r10.slice(s10, c10)}` : (r10.charCodeAt(s10) === jr && ++s10, r10.slice(s10, c10));
}, toNamespacedPath(e206) {
  if (typeof e206 != `string` || e206.length === 0) return e206;
  let t10 = Wr.resolve(e206);
  if (t10.length <= 2) return e206;
  if (t10.charCodeAt(0) === jr) {
    if (t10.charCodeAt(1) === jr) {
      let e207 = t10.charCodeAt(2);
      if (e207 !== Nr && e207 !== kr) return `\\\\?\\UNC\\${t10.slice(2)}`;
    }
  } else if (Br(t10.charCodeAt(0)) && t10.charCodeAt(1) === Mr && t10.charCodeAt(2) === jr) return `\\\\?\\${t10}`;
  return t10;
}, dirname(e206) {
  Ir(e206, `path`);
  let t10 = e206.length;
  if (t10 === 0) return `.`;
  let n10 = -1, r10 = 0, i10 = e206.charCodeAt(0);
  if (t10 === 1) return Rr(i10) ? e206 : `.`;
  if (Rr(i10)) {
    if (n10 = r10 = 1, Rr(e206.charCodeAt(1))) {
      let i11 = 2, a11 = i11;
      for (; i11 < t10 && !Rr(e206.charCodeAt(i11)); ) i11++;
      if (i11 < t10 && i11 !== a11) {
        for (a11 = i11; i11 < t10 && Rr(e206.charCodeAt(i11)); ) i11++;
        if (i11 < t10 && i11 !== a11) {
          for (a11 = i11; i11 < t10 && !Rr(e206.charCodeAt(i11)); ) i11++;
          if (i11 === t10) return e206;
          i11 !== a11 && (n10 = r10 = i11 + 1);
        }
      }
    }
  } else Br(i10) && e206.charCodeAt(1) === Mr && (n10 = t10 > 2 && Rr(e206.charCodeAt(2)) ? 3 : 2, r10 = n10);
  let a10 = -1, o10 = true;
  for (let n11 = t10 - 1; n11 >= r10; --n11) if (Rr(e206.charCodeAt(n11))) {
    if (!o10) {
      a10 = n11;
      break;
    }
  } else o10 = false;
  if (a10 === -1) {
    if (n10 === -1) return `.`;
    a10 = n10;
  }
  return e206.slice(0, a10);
}, basename(e206, t10) {
  t10 !== void 0 && Ir(t10, `suffix`), Ir(e206, `path`);
  let n10 = 0, r10 = -1, i10 = true, a10;
  if (e206.length >= 2 && Br(e206.charCodeAt(0)) && e206.charCodeAt(1) === Mr && (n10 = 2), t10 !== void 0 && t10.length > 0 && t10.length <= e206.length) {
    if (t10 === e206) return ``;
    let o10 = t10.length - 1, s10 = -1;
    for (a10 = e206.length - 1; a10 >= n10; --a10) {
      let c10 = e206.charCodeAt(a10);
      if (Rr(c10)) {
        if (!i10) {
          n10 = a10 + 1;
          break;
        }
      } else s10 === -1 && (i10 = false, s10 = a10 + 1), o10 >= 0 && (c10 === t10.charCodeAt(o10) ? --o10 === -1 && (r10 = a10) : (o10 = -1, r10 = s10));
    }
    return n10 === r10 ? r10 = s10 : r10 === -1 && (r10 = e206.length), e206.slice(n10, r10);
  }
  for (a10 = e206.length - 1; a10 >= n10; --a10) if (Rr(e206.charCodeAt(a10))) {
    if (!i10) {
      n10 = a10 + 1;
      break;
    }
  } else r10 === -1 && (i10 = false, r10 = a10 + 1);
  return r10 === -1 ? `` : e206.slice(n10, r10);
}, extname(e206) {
  Ir(e206, `path`);
  let t10 = 0, n10 = -1, r10 = 0, i10 = -1, a10 = true, o10 = 0;
  e206.length >= 2 && e206.charCodeAt(1) === Mr && Br(e206.charCodeAt(0)) && (t10 = r10 = 2);
  for (let s10 = e206.length - 1; s10 >= t10; --s10) {
    let t11 = e206.charCodeAt(s10);
    if (Rr(t11)) {
      if (!a10) {
        r10 = s10 + 1;
        break;
      }
      continue;
    }
    i10 === -1 && (a10 = false, i10 = s10 + 1), t11 === kr ? n10 === -1 ? n10 = s10 : o10 !== 1 && (o10 = 1) : n10 !== -1 && (o10 = -1);
  }
  return n10 === -1 || i10 === -1 || o10 === 0 || o10 === 1 && n10 === i10 - 1 && n10 === r10 + 1 ? `` : e206.slice(n10, i10);
}, format: Ur.bind(null, `\\`), parse(e206) {
  Ir(e206, `path`);
  let t10 = { root: ``, dir: ``, base: ``, ext: ``, name: `` };
  if (e206.length === 0) return t10;
  let n10 = e206.length, r10 = 0, i10 = e206.charCodeAt(0);
  if (n10 === 1) return Rr(i10) ? (t10.root = t10.dir = e206, t10) : (t10.base = t10.name = e206, t10);
  if (Rr(i10)) {
    if (r10 = 1, Rr(e206.charCodeAt(1))) {
      let t11 = 2, i11 = t11;
      for (; t11 < n10 && !Rr(e206.charCodeAt(t11)); ) t11++;
      if (t11 < n10 && t11 !== i11) {
        for (i11 = t11; t11 < n10 && Rr(e206.charCodeAt(t11)); ) t11++;
        if (t11 < n10 && t11 !== i11) {
          for (i11 = t11; t11 < n10 && !Rr(e206.charCodeAt(t11)); ) t11++;
          t11 === n10 ? r10 = t11 : t11 !== i11 && (r10 = t11 + 1);
        }
      }
    }
  } else if (Br(i10) && e206.charCodeAt(1) === Mr) {
    if (n10 <= 2) return t10.root = t10.dir = e206, t10;
    if (r10 = 2, Rr(e206.charCodeAt(2))) {
      if (n10 === 3) return t10.root = t10.dir = e206, t10;
      r10 = 3;
    }
  }
  r10 > 0 && (t10.root = e206.slice(0, r10));
  let a10 = -1, o10 = r10, s10 = -1, c10 = true, l10 = e206.length - 1, u10 = 0;
  for (; l10 >= r10; --l10) {
    if (i10 = e206.charCodeAt(l10), Rr(i10)) {
      if (!c10) {
        o10 = l10 + 1;
        break;
      }
      continue;
    }
    s10 === -1 && (c10 = false, s10 = l10 + 1), i10 === kr ? a10 === -1 ? a10 = l10 : u10 !== 1 && (u10 = 1) : a10 !== -1 && (u10 = -1);
  }
  return s10 !== -1 && (a10 === -1 || u10 === 0 || u10 === 1 && a10 === s10 - 1 && a10 === o10 + 1 ? t10.base = t10.name = e206.slice(o10, s10) : (t10.name = e206.slice(o10, a10), t10.base = e206.slice(o10, s10), t10.ext = e206.slice(a10, s10))), o10 > 0 && o10 !== r10 ? t10.dir = e206.slice(0, o10 - 1) : t10.dir = t10.root, t10;
}, sep: `\\`, delimiter: `;`, win32: null, posix: null }, Gr = (() => {
  if (Lr) {
    let e206 = /\\/g;
    return () => {
      let t10 = Tr().replace(e206, `/`);
      return t10.slice(t10.indexOf(`/`));
    };
  }
  return () => Tr();
})(), Kr = { resolve(...e206) {
  let t10 = ``, n10 = false;
  for (let r10 = e206.length - 1; r10 >= 0 && !n10; r10--) {
    let i10 = e206[r10];
    Ir(i10, `paths[${r10}]`), i10.length !== 0 && (t10 = `${i10}/${t10}`, n10 = i10.charCodeAt(0) === Ar);
  }
  if (!n10) {
    let e207 = Gr();
    t10 = `${e207}/${t10}`, n10 = e207.charCodeAt(0) === Ar;
  }
  return t10 = Vr(t10, !n10, `/`, zr), n10 ? `/${t10}` : t10.length > 0 ? t10 : `.`;
}, normalize(e206) {
  if (Ir(e206, `path`), e206.length === 0) return `.`;
  let t10 = e206.charCodeAt(0) === Ar, n10 = e206.charCodeAt(e206.length - 1) === Ar;
  return e206 = Vr(e206, !t10, `/`, zr), e206.length === 0 ? t10 ? `/` : n10 ? `./` : `.` : (n10 && (e206 += `/`), t10 ? `/${e206}` : e206);
}, isAbsolute(e206) {
  return Ir(e206, `path`), e206.length > 0 && e206.charCodeAt(0) === Ar;
}, join(...e206) {
  if (e206.length === 0) return `.`;
  let t10 = [];
  for (let n10 = 0; n10 < e206.length; ++n10) {
    let r10 = e206[n10];
    Ir(r10, `path`), r10.length > 0 && t10.push(r10);
  }
  return t10.length === 0 ? `.` : Kr.normalize(t10.join(`/`));
}, relative(e206, t10) {
  if (Ir(e206, `from`), Ir(t10, `to`), e206 === t10 || (e206 = Kr.resolve(e206), t10 = Kr.resolve(t10), e206 === t10)) return ``;
  let n10 = e206.length, r10 = n10 - 1, i10 = t10.length - 1, a10 = r10 < i10 ? r10 : i10, o10 = -1, s10 = 0;
  for (; s10 < a10; s10++) {
    let n11 = e206.charCodeAt(1 + s10);
    if (n11 !== t10.charCodeAt(1 + s10)) break;
    n11 === Ar && (o10 = s10);
  }
  if (s10 === a10) if (i10 > a10) {
    if (t10.charCodeAt(1 + s10) === Ar) return t10.slice(1 + s10 + 1);
    if (s10 === 0) return t10.slice(1 + s10);
  } else r10 > a10 && (e206.charCodeAt(1 + s10) === Ar ? o10 = s10 : s10 === 0 && (o10 = 0));
  let c10 = ``;
  for (s10 = 1 + o10 + 1; s10 <= n10; ++s10) (s10 === n10 || e206.charCodeAt(s10) === Ar) && (c10 += c10.length === 0 ? `..` : `/..`);
  return `${c10}${t10.slice(1 + o10)}`;
}, toNamespacedPath(e206) {
  return e206;
}, dirname(e206) {
  if (Ir(e206, `path`), e206.length === 0) return `.`;
  let t10 = e206.charCodeAt(0) === Ar, n10 = -1, r10 = true;
  for (let t11 = e206.length - 1; t11 >= 1; --t11) if (e206.charCodeAt(t11) === Ar) {
    if (!r10) {
      n10 = t11;
      break;
    }
  } else r10 = false;
  return n10 === -1 ? t10 ? `/` : `.` : t10 && n10 === 1 ? `//` : e206.slice(0, n10);
}, basename(e206, t10) {
  t10 !== void 0 && Ir(t10, `suffix`), Ir(e206, `path`);
  let n10 = 0, r10 = -1, i10 = true, a10;
  if (t10 !== void 0 && t10.length > 0 && t10.length <= e206.length) {
    if (t10 === e206) return ``;
    let o10 = t10.length - 1, s10 = -1;
    for (a10 = e206.length - 1; a10 >= 0; --a10) {
      let c10 = e206.charCodeAt(a10);
      if (c10 === Ar) {
        if (!i10) {
          n10 = a10 + 1;
          break;
        }
      } else s10 === -1 && (i10 = false, s10 = a10 + 1), o10 >= 0 && (c10 === t10.charCodeAt(o10) ? --o10 === -1 && (r10 = a10) : (o10 = -1, r10 = s10));
    }
    return n10 === r10 ? r10 = s10 : r10 === -1 && (r10 = e206.length), e206.slice(n10, r10);
  }
  for (a10 = e206.length - 1; a10 >= 0; --a10) if (e206.charCodeAt(a10) === Ar) {
    if (!i10) {
      n10 = a10 + 1;
      break;
    }
  } else r10 === -1 && (i10 = false, r10 = a10 + 1);
  return r10 === -1 ? `` : e206.slice(n10, r10);
}, extname(e206) {
  Ir(e206, `path`);
  let t10 = -1, n10 = 0, r10 = -1, i10 = true, a10 = 0;
  for (let o10 = e206.length - 1; o10 >= 0; --o10) {
    let s10 = e206[o10];
    if (s10 === `/`) {
      if (!i10) {
        n10 = o10 + 1;
        break;
      }
      continue;
    }
    r10 === -1 && (i10 = false, r10 = o10 + 1), s10 === `.` ? t10 === -1 ? t10 = o10 : a10 !== 1 && (a10 = 1) : t10 !== -1 && (a10 = -1);
  }
  return t10 === -1 || r10 === -1 || a10 === 0 || a10 === 1 && t10 === r10 - 1 && t10 === n10 + 1 ? `` : e206.slice(t10, r10);
}, format: Ur.bind(null, `/`), parse(e206) {
  Ir(e206, `path`);
  let t10 = { root: ``, dir: ``, base: ``, ext: ``, name: `` };
  if (e206.length === 0) return t10;
  let n10 = e206.charCodeAt(0) === Ar, r10;
  n10 ? (t10.root = `/`, r10 = 1) : r10 = 0;
  let i10 = -1, a10 = 0, o10 = -1, s10 = true, c10 = e206.length - 1, l10 = 0;
  for (; c10 >= r10; --c10) {
    let t11 = e206.charCodeAt(c10);
    if (t11 === Ar) {
      if (!s10) {
        a10 = c10 + 1;
        break;
      }
      continue;
    }
    o10 === -1 && (s10 = false, o10 = c10 + 1), t11 === kr ? i10 === -1 ? i10 = c10 : l10 !== 1 && (l10 = 1) : i10 !== -1 && (l10 = -1);
  }
  if (o10 !== -1) {
    let r11 = a10 === 0 && n10 ? 1 : a10;
    i10 === -1 || l10 === 0 || l10 === 1 && i10 === o10 - 1 && i10 === a10 + 1 ? t10.base = t10.name = e206.slice(r11, o10) : (t10.name = e206.slice(r11, i10), t10.base = e206.slice(r11, o10), t10.ext = e206.slice(i10, o10));
  }
  return a10 > 0 ? t10.dir = e206.slice(0, a10 - 1) : n10 && (t10.dir = `/`), t10;
}, sep: `/`, delimiter: `:`, win32: null, posix: null };
Kr.win32 = Wr.win32 = Wr, Kr.posix = Wr.posix = Kr;
var qr = Lr ? Wr.normalize : Kr.normalize, tte = Lr ? Wr.resolve : Kr.resolve, nte = Lr ? Wr.relative : Kr.relative, Jr = Lr ? Wr.dirname : Kr.dirname, Yr = Lr ? Wr.basename : Kr.basename, rte = Lr ? Wr.extname : Kr.extname, Xr = Lr ? Wr.sep : Kr.sep, ite = /^\w[\w\d+.-]*$/, ate = /^\//, ote = /^\/\//;
function ste(e206, t10) {
  if (!e206.scheme && t10) throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e206.authority}", path: "${e206.path}", query: "${e206.query}", fragment: "${e206.fragment}"}`);
  if (e206.scheme && !ite.test(e206.scheme)) throw Error(`[UriError]: Scheme contains illegal characters.`);
  if (e206.path) {
    if (e206.authority) {
      if (!ate.test(e206.path)) throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`);
    } else if (ote.test(e206.path)) throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`);
  }
}
function cte(e206, t10) {
  return !e206 && !t10 ? `file` : e206;
}
function lte(e206, t10) {
  switch (e206) {
    case `https`:
    case `http`:
    case `file`:
      t10 ? t10[0] !== Qr && (t10 = Qr + t10) : t10 = Qr;
      break;
  }
  return t10;
}
var Zr = ``, Qr = `/`, ute = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, $r = class e12 {
  static isUri(t10) {
    return t10 instanceof e12 ? true : !t10 || typeof t10 != `object` ? false : typeof t10.authority == `string` && typeof t10.fragment == `string` && typeof t10.path == `string` && typeof t10.query == `string` && typeof t10.scheme == `string` && typeof t10.fsPath == `string` && typeof t10.with == `function` && typeof t10.toString == `function`;
  }
  constructor(e206, t10, n10, r10, i10, a10 = false) {
    typeof e206 == `object` ? (this.scheme = e206.scheme || Zr, this.authority = e206.authority || Zr, this.path = e206.path || Zr, this.query = e206.query || Zr, this.fragment = e206.fragment || Zr) : (this.scheme = cte(e206, a10), this.authority = t10 || Zr, this.path = lte(this.scheme, n10 || Zr), this.query = r10 || Zr, this.fragment = i10 || Zr, ste(this, a10));
  }
  get fsPath() {
    return ii(this, false);
  }
  with(e206) {
    if (!e206) return this;
    let { scheme: t10, authority: n10, path: r10, query: i10, fragment: a10 } = e206;
    return t10 === void 0 ? t10 = this.scheme : t10 === null && (t10 = Zr), n10 === void 0 ? n10 = this.authority : n10 === null && (n10 = Zr), r10 === void 0 ? r10 = this.path : r10 === null && (r10 = Zr), i10 === void 0 ? i10 = this.query : i10 === null && (i10 = Zr), a10 === void 0 ? a10 = this.fragment : a10 === null && (a10 = Zr), t10 === this.scheme && n10 === this.authority && r10 === this.path && i10 === this.query && a10 === this.fragment ? this : new ti(t10, n10, r10, i10, a10);
  }
  static parse(e206, t10 = false) {
    let n10 = ute.exec(e206);
    return n10 ? new ti(n10[2] || Zr, ci(n10[4] || Zr), ci(n10[5] || Zr), ci(n10[7] || Zr), ci(n10[9] || Zr), t10) : new ti(Zr, Zr, Zr, Zr, Zr);
  }
  static file(e206) {
    let t10 = Zr;
    if (wt && (e206 = e206.replace(/\\/g, Qr)), e206[0] === Qr && e206[1] === Qr) {
      let n10 = e206.indexOf(Qr, 2);
      n10 === -1 ? (t10 = e206.substring(2), e206 = Qr) : (t10 = e206.substring(2, n10), e206 = e206.substring(n10) || Qr);
    }
    return new ti(`file`, t10, e206, Zr, Zr);
  }
  static from(e206, t10) {
    return new ti(e206.scheme, e206.authority, e206.path, e206.query, e206.fragment, t10);
  }
  static joinPath(t10, ...n10) {
    if (!t10.path) throw Error(`[UriError]: cannot call joinPath on URI without path`);
    let r10;
    return r10 = wt && t10.scheme === `file` ? e12.file(Wr.join(ii(t10, true), ...n10)).path : Kr.join(t10.path, ...n10), t10.with({ path: r10 });
  }
  toString(e206 = false) {
    return ai(this, e206);
  }
  toJSON() {
    return this;
  }
  static revive(t10) {
    if (!t10 || t10 instanceof e12) return t10;
    {
      let e206 = new ti(t10);
      return e206._formatted = t10.external ?? null, e206._fsPath = t10._sep === ei ? t10.fsPath ?? null : null, e206;
    }
  }
}, ei = wt ? 1 : void 0, ti = class extends $r {
  constructor() {
    super(...arguments), this._formatted = null, this._fsPath = null;
  }
  get fsPath() {
    return this._fsPath || (this._fsPath = ii(this, false)), this._fsPath;
  }
  toString(e206 = false) {
    return e206 ? ai(this, true) : (this._formatted || (this._formatted = ai(this, false)), this._formatted);
  }
  toJSON() {
    let e206 = { $mid: 1 };
    return this._fsPath && (e206.fsPath = this._fsPath, e206._sep = ei), this._formatted && (e206.external = this._formatted), this.path && (e206.path = this.path), this.scheme && (e206.scheme = this.scheme), this.authority && (e206.authority = this.authority), this.query && (e206.query = this.query), this.fragment && (e206.fragment = this.fragment), e206;
  }
}, ni = { 58: `%3A`, 47: `%2F`, 63: `%3F`, 35: `%23`, 91: `%5B`, 93: `%5D`, 64: `%40`, 33: `%21`, 36: `%24`, 38: `%26`, 39: `%27`, 40: `%28`, 41: `%29`, 42: `%2A`, 43: `%2B`, 44: `%2C`, 59: `%3B`, 61: `%3D`, 32: `%20` };
function ri(e206, t10, n10) {
  let r10, i10 = -1;
  for (let a10 = 0; a10 < e206.length; a10++) {
    let o10 = e206.charCodeAt(a10);
    if (o10 >= 97 && o10 <= 122 || o10 >= 65 && o10 <= 90 || o10 >= 48 && o10 <= 57 || o10 === 45 || o10 === 46 || o10 === 95 || o10 === 126 || t10 && o10 === 47 || n10 && o10 === 91 || n10 && o10 === 93 || n10 && o10 === 58) i10 !== -1 && (r10 += encodeURIComponent(e206.substring(i10, a10)), i10 = -1), r10 !== void 0 && (r10 += e206.charAt(a10));
    else {
      r10 === void 0 && (r10 = e206.substr(0, a10));
      let t11 = ni[o10];
      t11 === void 0 ? i10 === -1 && (i10 = a10) : (i10 !== -1 && (r10 += encodeURIComponent(e206.substring(i10, a10)), i10 = -1), r10 += t11);
    }
  }
  return i10 !== -1 && (r10 += encodeURIComponent(e206.substring(i10))), r10 === void 0 ? e206 : r10;
}
function dte(e206) {
  let t10;
  for (let n10 = 0; n10 < e206.length; n10++) {
    let r10 = e206.charCodeAt(n10);
    r10 === 35 || r10 === 63 ? (t10 === void 0 && (t10 = e206.substr(0, n10)), t10 += ni[r10]) : t10 !== void 0 && (t10 += e206[n10]);
  }
  return t10 === void 0 ? e206 : t10;
}
function ii(e206, t10) {
  let n10;
  return n10 = e206.authority && e206.path.length > 1 && e206.scheme === `file` ? `//${e206.authority}${e206.path}` : e206.path.charCodeAt(0) === 47 && (e206.path.charCodeAt(1) >= 65 && e206.path.charCodeAt(1) <= 90 || e206.path.charCodeAt(1) >= 97 && e206.path.charCodeAt(1) <= 122) && e206.path.charCodeAt(2) === 58 ? t10 ? e206.path.substr(1) : e206.path[1].toLowerCase() + e206.path.substr(2) : e206.path, wt && (n10 = n10.replace(/\//g, `\\`)), n10;
}
function ai(e206, t10) {
  let n10 = t10 ? dte : ri, r10 = ``, { scheme: i10, authority: a10, path: o10, query: s10, fragment: c10 } = e206;
  if (i10 && (r10 += i10, r10 += `:`), (a10 || i10 === `file`) && (r10 += Qr, r10 += Qr), a10) {
    let e207 = a10.indexOf(`@`);
    if (e207 !== -1) {
      let t11 = a10.substr(0, e207);
      a10 = a10.substr(e207 + 1), e207 = t11.lastIndexOf(`:`), e207 === -1 ? r10 += n10(t11, false, false) : (r10 += n10(t11.substr(0, e207), false, false), r10 += `:`, r10 += n10(t11.substr(e207 + 1), false, true)), r10 += `@`;
    }
    a10 = a10.toLowerCase(), e207 = a10.lastIndexOf(`:`), e207 === -1 ? r10 += n10(a10, false, true) : (r10 += n10(a10.substr(0, e207), false, true), r10 += a10.substr(e207));
  }
  if (o10) {
    if (o10.length >= 3 && o10.charCodeAt(0) === 47 && o10.charCodeAt(2) === 58) {
      let e207 = o10.charCodeAt(1);
      e207 >= 65 && e207 <= 90 && (o10 = `/${String.fromCharCode(e207 + 32)}:${o10.substr(3)}`);
    } else if (o10.length >= 2 && o10.charCodeAt(1) === 58) {
      let e207 = o10.charCodeAt(0);
      e207 >= 65 && e207 <= 90 && (o10 = `${String.fromCharCode(e207 + 32)}:${o10.substr(2)}`);
    }
    r10 += n10(o10, true, false);
  }
  return s10 && (r10 += `?`, r10 += n10(s10, false, false)), c10 && (r10 += `#`, r10 += t10 ? c10 : ri(c10, false, false)), r10;
}
function oi(e206) {
  try {
    return decodeURIComponent(e206);
  } catch {
    return e206.length > 3 ? e206.substr(0, 3) + oi(e206.substr(3)) : e206;
  }
}
var si = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
function ci(e206) {
  return e206.match(si) ? e206.replace(si, (e207) => oi(e207)) : e206;
}
var j = class e13 {
  constructor(e206, t10) {
    this.lineNumber = e206, this.column = t10;
  }
  with(t10 = this.lineNumber, n10 = this.column) {
    return t10 === this.lineNumber && n10 === this.column ? this : new e13(t10, n10);
  }
  delta(e206 = 0, t10 = 0) {
    return this.with(Math.max(1, this.lineNumber + e206), Math.max(1, this.column + t10));
  }
  equals(t10) {
    return e13.equals(this, t10);
  }
  static equals(e206, t10) {
    return !e206 && !t10 ? true : !!e206 && !!t10 && e206.lineNumber === t10.lineNumber && e206.column === t10.column;
  }
  isBefore(t10) {
    return e13.isBefore(this, t10);
  }
  static isBefore(e206, t10) {
    return e206.lineNumber < t10.lineNumber ? true : t10.lineNumber < e206.lineNumber ? false : e206.column < t10.column;
  }
  isBeforeOrEqual(t10) {
    return e13.isBeforeOrEqual(this, t10);
  }
  static isBeforeOrEqual(e206, t10) {
    return e206.lineNumber < t10.lineNumber ? true : t10.lineNumber < e206.lineNumber ? false : e206.column <= t10.column;
  }
  static compare(e206, t10) {
    let n10 = e206.lineNumber | 0, r10 = t10.lineNumber | 0;
    return n10 === r10 ? (e206.column | 0) - (t10.column | 0) : n10 - r10;
  }
  clone() {
    return new e13(this.lineNumber, this.column);
  }
  toString() {
    return `(` + this.lineNumber + `,` + this.column + `)`;
  }
  static lift(t10) {
    return new e13(t10.lineNumber, t10.column);
  }
  static isIPosition(e206) {
    return !!e206 && typeof e206.lineNumber == `number` && typeof e206.column == `number`;
  }
  toJSON() {
    return { lineNumber: this.lineNumber, column: this.column };
  }
}, M = class e14 {
  constructor(e206, t10, n10, r10) {
    e206 > n10 || e206 === n10 && t10 > r10 ? (this.startLineNumber = n10, this.startColumn = r10, this.endLineNumber = e206, this.endColumn = t10) : (this.startLineNumber = e206, this.startColumn = t10, this.endLineNumber = n10, this.endColumn = r10);
  }
  isEmpty() {
    return e14.isEmpty(this);
  }
  static isEmpty(e206) {
    return e206.startLineNumber === e206.endLineNumber && e206.startColumn === e206.endColumn;
  }
  containsPosition(t10) {
    return e14.containsPosition(this, t10);
  }
  static containsPosition(e206, t10) {
    return !(t10.lineNumber < e206.startLineNumber || t10.lineNumber > e206.endLineNumber || t10.lineNumber === e206.startLineNumber && t10.column < e206.startColumn || t10.lineNumber === e206.endLineNumber && t10.column > e206.endColumn);
  }
  static strictContainsPosition(e206, t10) {
    return !(t10.lineNumber < e206.startLineNumber || t10.lineNumber > e206.endLineNumber || t10.lineNumber === e206.startLineNumber && t10.column <= e206.startColumn || t10.lineNumber === e206.endLineNumber && t10.column >= e206.endColumn);
  }
  containsRange(t10) {
    return e14.containsRange(this, t10);
  }
  static containsRange(e206, t10) {
    return !(t10.startLineNumber < e206.startLineNumber || t10.endLineNumber < e206.startLineNumber || t10.startLineNumber > e206.endLineNumber || t10.endLineNumber > e206.endLineNumber || t10.startLineNumber === e206.startLineNumber && t10.startColumn < e206.startColumn || t10.endLineNumber === e206.endLineNumber && t10.endColumn > e206.endColumn);
  }
  strictContainsRange(t10) {
    return e14.strictContainsRange(this, t10);
  }
  static strictContainsRange(e206, t10) {
    return !(t10.startLineNumber < e206.startLineNumber || t10.endLineNumber < e206.startLineNumber || t10.startLineNumber > e206.endLineNumber || t10.endLineNumber > e206.endLineNumber || t10.startLineNumber === e206.startLineNumber && t10.startColumn <= e206.startColumn || t10.endLineNumber === e206.endLineNumber && t10.endColumn >= e206.endColumn);
  }
  plusRange(t10) {
    return e14.plusRange(this, t10);
  }
  static plusRange(t10, n10) {
    let r10, i10, a10, o10;
    return n10.startLineNumber < t10.startLineNumber ? (r10 = n10.startLineNumber, i10 = n10.startColumn) : n10.startLineNumber === t10.startLineNumber ? (r10 = n10.startLineNumber, i10 = Math.min(n10.startColumn, t10.startColumn)) : (r10 = t10.startLineNumber, i10 = t10.startColumn), n10.endLineNumber > t10.endLineNumber ? (a10 = n10.endLineNumber, o10 = n10.endColumn) : n10.endLineNumber === t10.endLineNumber ? (a10 = n10.endLineNumber, o10 = Math.max(n10.endColumn, t10.endColumn)) : (a10 = t10.endLineNumber, o10 = t10.endColumn), new e14(r10, i10, a10, o10);
  }
  intersectRanges(t10) {
    return e14.intersectRanges(this, t10);
  }
  static intersectRanges(t10, n10) {
    let r10 = t10.startLineNumber, i10 = t10.startColumn, a10 = t10.endLineNumber, o10 = t10.endColumn, s10 = n10.startLineNumber, c10 = n10.startColumn, l10 = n10.endLineNumber, u10 = n10.endColumn;
    return r10 < s10 ? (r10 = s10, i10 = c10) : r10 === s10 && (i10 = Math.max(i10, c10)), a10 > l10 ? (a10 = l10, o10 = u10) : a10 === l10 && (o10 = Math.min(o10, u10)), r10 > a10 || r10 === a10 && i10 > o10 ? null : new e14(r10, i10, a10, o10);
  }
  equalsRange(t10) {
    return e14.equalsRange(this, t10);
  }
  static equalsRange(e206, t10) {
    return !e206 && !t10 ? true : !!e206 && !!t10 && e206.startLineNumber === t10.startLineNumber && e206.startColumn === t10.startColumn && e206.endLineNumber === t10.endLineNumber && e206.endColumn === t10.endColumn;
  }
  getEndPosition() {
    return e14.getEndPosition(this);
  }
  static getEndPosition(e206) {
    return new j(e206.endLineNumber, e206.endColumn);
  }
  getStartPosition() {
    return e14.getStartPosition(this);
  }
  static getStartPosition(e206) {
    return new j(e206.startLineNumber, e206.startColumn);
  }
  toString() {
    return `[` + this.startLineNumber + `,` + this.startColumn + ` -> ` + this.endLineNumber + `,` + this.endColumn + `]`;
  }
  setEndPosition(t10, n10) {
    return new e14(this.startLineNumber, this.startColumn, t10, n10);
  }
  setStartPosition(t10, n10) {
    return new e14(t10, n10, this.endLineNumber, this.endColumn);
  }
  collapseToStart() {
    return e14.collapseToStart(this);
  }
  static collapseToStart(t10) {
    return new e14(t10.startLineNumber, t10.startColumn, t10.startLineNumber, t10.startColumn);
  }
  collapseToEnd() {
    return e14.collapseToEnd(this);
  }
  static collapseToEnd(t10) {
    return new e14(t10.endLineNumber, t10.endColumn, t10.endLineNumber, t10.endColumn);
  }
  delta(t10) {
    return new e14(this.startLineNumber + t10, this.startColumn, this.endLineNumber + t10, this.endColumn);
  }
  isSingleLine() {
    return this.startLineNumber === this.endLineNumber;
  }
  static fromPositions(t10, n10 = t10) {
    return new e14(t10.lineNumber, t10.column, n10.lineNumber, n10.column);
  }
  static lift(t10) {
    return t10 ? new e14(t10.startLineNumber, t10.startColumn, t10.endLineNumber, t10.endColumn) : null;
  }
  static isIRange(e206) {
    return !!e206 && typeof e206.startLineNumber == `number` && typeof e206.startColumn == `number` && typeof e206.endLineNumber == `number` && typeof e206.endColumn == `number`;
  }
  static areIntersectingOrTouching(e206, t10) {
    return !(e206.endLineNumber < t10.startLineNumber || e206.endLineNumber === t10.startLineNumber && e206.endColumn < t10.startColumn || t10.endLineNumber < e206.startLineNumber || t10.endLineNumber === e206.startLineNumber && t10.endColumn < e206.startColumn);
  }
  static areIntersecting(e206, t10) {
    return !(e206.endLineNumber < t10.startLineNumber || e206.endLineNumber === t10.startLineNumber && e206.endColumn <= t10.startColumn || t10.endLineNumber < e206.startLineNumber || t10.endLineNumber === e206.startLineNumber && t10.endColumn <= e206.startColumn);
  }
  static areOnlyIntersecting(e206, t10) {
    return !(e206.endLineNumber < t10.startLineNumber - 1 || e206.endLineNumber === t10.startLineNumber && e206.endColumn < t10.startColumn - 1 || t10.endLineNumber < e206.startLineNumber - 1 || t10.endLineNumber === e206.startLineNumber && t10.endColumn < e206.startColumn - 1);
  }
  static compareRangesUsingStarts(e206, t10) {
    if (e206 && t10) {
      let n10 = e206.startLineNumber | 0, r10 = t10.startLineNumber | 0;
      if (n10 === r10) {
        let n11 = e206.startColumn | 0, r11 = t10.startColumn | 0;
        if (n11 === r11) {
          let n12 = e206.endLineNumber | 0, r12 = t10.endLineNumber | 0;
          return n12 === r12 ? (e206.endColumn | 0) - (t10.endColumn | 0) : n12 - r12;
        }
        return n11 - r11;
      }
      return n10 - r10;
    }
    return !!e206 - +!!t10;
  }
  static compareRangesUsingEnds(e206, t10) {
    return e206.endLineNumber === t10.endLineNumber ? e206.endColumn === t10.endColumn ? e206.startLineNumber === t10.startLineNumber ? e206.startColumn - t10.startColumn : e206.startLineNumber - t10.startLineNumber : e206.endColumn - t10.endColumn : e206.endLineNumber - t10.endLineNumber;
  }
  static spansMultipleLines(e206) {
    return e206.endLineNumber > e206.startLineNumber;
  }
  toJSON() {
    return this;
  }
}, N = class e15 extends M {
  constructor(e206, t10, n10, r10) {
    super(e206, t10, n10, r10), this.selectionStartLineNumber = e206, this.selectionStartColumn = t10, this.positionLineNumber = n10, this.positionColumn = r10;
  }
  toString() {
    return `[` + this.selectionStartLineNumber + `,` + this.selectionStartColumn + ` -> ` + this.positionLineNumber + `,` + this.positionColumn + `]`;
  }
  equalsSelection(t10) {
    return e15.selectionsEqual(this, t10);
  }
  static selectionsEqual(e206, t10) {
    return e206.selectionStartLineNumber === t10.selectionStartLineNumber && e206.selectionStartColumn === t10.selectionStartColumn && e206.positionLineNumber === t10.positionLineNumber && e206.positionColumn === t10.positionColumn;
  }
  getDirection() {
    return this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn ? 0 : 1;
  }
  setEndPosition(t10, n10) {
    return this.getDirection() === 0 ? new e15(this.startLineNumber, this.startColumn, t10, n10) : new e15(t10, n10, this.startLineNumber, this.startColumn);
  }
  getPosition() {
    return new j(this.positionLineNumber, this.positionColumn);
  }
  getSelectionStart() {
    return new j(this.selectionStartLineNumber, this.selectionStartColumn);
  }
  setStartPosition(t10, n10) {
    return this.getDirection() === 0 ? new e15(t10, n10, this.endLineNumber, this.endColumn) : new e15(this.endLineNumber, this.endColumn, t10, n10);
  }
  static fromPositions(t10, n10 = t10) {
    return new e15(t10.lineNumber, t10.column, n10.lineNumber, n10.column);
  }
  static fromRange(t10, n10) {
    return n10 === 0 ? new e15(t10.startLineNumber, t10.startColumn, t10.endLineNumber, t10.endColumn) : new e15(t10.endLineNumber, t10.endColumn, t10.startLineNumber, t10.startColumn);
  }
  static liftSelection(t10) {
    return new e15(t10.selectionStartLineNumber, t10.selectionStartColumn, t10.positionLineNumber, t10.positionColumn);
  }
  static selectionsArrEqual(e206, t10) {
    if (e206 && !t10 || !e206 && t10) return false;
    if (!e206 && !t10) return true;
    if (e206.length !== t10.length) return false;
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) if (!this.selectionsEqual(e206[n10], t10[n10])) return false;
    return true;
  }
  static isISelection(e206) {
    return !!e206 && typeof e206.selectionStartLineNumber == `number` && typeof e206.selectionStartColumn == `number` && typeof e206.positionLineNumber == `number` && typeof e206.positionColumn == `number`;
  }
  static createWithDirection(t10, n10, r10, i10, a10) {
    return a10 === 0 ? new e15(t10, n10, r10, i10) : new e15(r10, i10, t10, n10);
  }
}, li = /* @__PURE__ */ Object.create(null);
function P(e206, t10) {
  if (Re(t10)) {
    let n10 = li[t10];
    if (n10 === void 0) throw Error(`${e206} references an unknown codicon: ${t10}`);
    t10 = n10;
  }
  return li[e206] = t10, { id: e206 };
}
function ui() {
  return li;
}
var fte = { add: P(`add`, 6e4), plus: P(`plus`, 6e4), gistNew: P(`gist-new`, 6e4), repoCreate: P(`repo-create`, 6e4), lightbulb: P(`lightbulb`, 60001), lightBulb: P(`light-bulb`, 60001), repo: P(`repo`, 60002), repoDelete: P(`repo-delete`, 60002), gistFork: P(`gist-fork`, 60003), repoForked: P(`repo-forked`, 60003), gitPullRequest: P(`git-pull-request`, 60004), gitPullRequestAbandoned: P(`git-pull-request-abandoned`, 60004), recordKeys: P(`record-keys`, 60005), keyboard: P(`keyboard`, 60005), tag: P(`tag`, 60006), gitPullRequestLabel: P(`git-pull-request-label`, 60006), tagAdd: P(`tag-add`, 60006), tagRemove: P(`tag-remove`, 60006), person: P(`person`, 60007), personFollow: P(`person-follow`, 60007), personOutline: P(`person-outline`, 60007), personFilled: P(`person-filled`, 60007), sourceControl: P(`source-control`, 60008), mirror: P(`mirror`, 60009), mirrorPublic: P(`mirror-public`, 60009), star: P(`star`, 60010), starAdd: P(`star-add`, 60010), starDelete: P(`star-delete`, 60010), starEmpty: P(`star-empty`, 60010), comment: P(`comment`, 60011), commentAdd: P(`comment-add`, 60011), alert: P(`alert`, 60012), warning: P(`warning`, 60012), search: P(`search`, 60013), searchSave: P(`search-save`, 60013), logOut: P(`log-out`, 60014), signOut: P(`sign-out`, 60014), logIn: P(`log-in`, 60015), signIn: P(`sign-in`, 60015), eye: P(`eye`, 60016), eyeUnwatch: P(`eye-unwatch`, 60016), eyeWatch: P(`eye-watch`, 60016), circleFilled: P(`circle-filled`, 60017), primitiveDot: P(`primitive-dot`, 60017), closeDirty: P(`close-dirty`, 60017), debugBreakpoint: P(`debug-breakpoint`, 60017), debugBreakpointDisabled: P(`debug-breakpoint-disabled`, 60017), debugHint: P(`debug-hint`, 60017), terminalDecorationSuccess: P(`terminal-decoration-success`, 60017), primitiveSquare: P(`primitive-square`, 60018), edit: P(`edit`, 60019), pencil: P(`pencil`, 60019), info: P(`info`, 60020), issueOpened: P(`issue-opened`, 60020), gistPrivate: P(`gist-private`, 60021), gitForkPrivate: P(`git-fork-private`, 60021), lock: P(`lock`, 60021), mirrorPrivate: P(`mirror-private`, 60021), close: P(`close`, 60022), removeClose: P(`remove-close`, 60022), x: P(`x`, 60022), repoSync: P(`repo-sync`, 60023), sync: P(`sync`, 60023), clone: P(`clone`, 60024), desktopDownload: P(`desktop-download`, 60024), beaker: P(`beaker`, 60025), microscope: P(`microscope`, 60025), vm: P(`vm`, 60026), deviceDesktop: P(`device-desktop`, 60026), file: P(`file`, 60027), more: P(`more`, 60028), ellipsis: P(`ellipsis`, 60028), kebabHorizontal: P(`kebab-horizontal`, 60028), mailReply: P(`mail-reply`, 60029), reply: P(`reply`, 60029), organization: P(`organization`, 60030), organizationFilled: P(`organization-filled`, 60030), organizationOutline: P(`organization-outline`, 60030), newFile: P(`new-file`, 60031), fileAdd: P(`file-add`, 60031), newFolder: P(`new-folder`, 60032), fileDirectoryCreate: P(`file-directory-create`, 60032), trash: P(`trash`, 60033), trashcan: P(`trashcan`, 60033), history: P(`history`, 60034), clock: P(`clock`, 60034), folder: P(`folder`, 60035), fileDirectory: P(`file-directory`, 60035), symbolFolder: P(`symbol-folder`, 60035), logoGithub: P(`logo-github`, 60036), markGithub: P(`mark-github`, 60036), github: P(`github`, 60036), terminal: P(`terminal`, 60037), console: P(`console`, 60037), repl: P(`repl`, 60037), zap: P(`zap`, 60038), symbolEvent: P(`symbol-event`, 60038), error: P(`error`, 60039), stop: P(`stop`, 60039), variable: P(`variable`, 60040), symbolVariable: P(`symbol-variable`, 60040), array: P(`array`, 60042), symbolArray: P(`symbol-array`, 60042), symbolModule: P(`symbol-module`, 60043), symbolPackage: P(`symbol-package`, 60043), symbolNamespace: P(`symbol-namespace`, 60043), symbolObject: P(`symbol-object`, 60043), symbolMethod: P(`symbol-method`, 60044), symbolFunction: P(`symbol-function`, 60044), symbolConstructor: P(`symbol-constructor`, 60044), symbolBoolean: P(`symbol-boolean`, 60047), symbolNull: P(`symbol-null`, 60047), symbolNumeric: P(`symbol-numeric`, 60048), symbolNumber: P(`symbol-number`, 60048), symbolStructure: P(`symbol-structure`, 60049), symbolStruct: P(`symbol-struct`, 60049), symbolParameter: P(`symbol-parameter`, 60050), symbolTypeParameter: P(`symbol-type-parameter`, 60050), symbolKey: P(`symbol-key`, 60051), symbolText: P(`symbol-text`, 60051), symbolReference: P(`symbol-reference`, 60052), goToFile: P(`go-to-file`, 60052), symbolEnum: P(`symbol-enum`, 60053), symbolValue: P(`symbol-value`, 60053), symbolRuler: P(`symbol-ruler`, 60054), symbolUnit: P(`symbol-unit`, 60054), activateBreakpoints: P(`activate-breakpoints`, 60055), archive: P(`archive`, 60056), arrowBoth: P(`arrow-both`, 60057), arrowDown: P(`arrow-down`, 60058), arrowLeft: P(`arrow-left`, 60059), arrowRight: P(`arrow-right`, 60060), arrowSmallDown: P(`arrow-small-down`, 60061), arrowSmallLeft: P(`arrow-small-left`, 60062), arrowSmallRight: P(`arrow-small-right`, 60063), arrowSmallUp: P(`arrow-small-up`, 60064), arrowUp: P(`arrow-up`, 60065), bell: P(`bell`, 60066), bold: P(`bold`, 60067), book: P(`book`, 60068), bookmark: P(`bookmark`, 60069), debugBreakpointConditionalUnverified: P(`debug-breakpoint-conditional-unverified`, 60070), debugBreakpointConditional: P(`debug-breakpoint-conditional`, 60071), debugBreakpointConditionalDisabled: P(`debug-breakpoint-conditional-disabled`, 60071), debugBreakpointDataUnverified: P(`debug-breakpoint-data-unverified`, 60072), debugBreakpointData: P(`debug-breakpoint-data`, 60073), debugBreakpointDataDisabled: P(`debug-breakpoint-data-disabled`, 60073), debugBreakpointLogUnverified: P(`debug-breakpoint-log-unverified`, 60074), debugBreakpointLog: P(`debug-breakpoint-log`, 60075), debugBreakpointLogDisabled: P(`debug-breakpoint-log-disabled`, 60075), briefcase: P(`briefcase`, 60076), broadcast: P(`broadcast`, 60077), browser: P(`browser`, 60078), bug: P(`bug`, 60079), calendar: P(`calendar`, 60080), caseSensitive: P(`case-sensitive`, 60081), check: P(`check`, 60082), checklist: P(`checklist`, 60083), chevronDown: P(`chevron-down`, 60084), chevronLeft: P(`chevron-left`, 60085), chevronRight: P(`chevron-right`, 60086), chevronUp: P(`chevron-up`, 60087), chromeClose: P(`chrome-close`, 60088), chromeMaximize: P(`chrome-maximize`, 60089), chromeMinimize: P(`chrome-minimize`, 60090), chromeRestore: P(`chrome-restore`, 60091), circleOutline: P(`circle-outline`, 60092), circle: P(`circle`, 60092), debugBreakpointUnverified: P(`debug-breakpoint-unverified`, 60092), terminalDecorationIncomplete: P(`terminal-decoration-incomplete`, 60092), circleSlash: P(`circle-slash`, 60093), circuitBoard: P(`circuit-board`, 60094), clearAll: P(`clear-all`, 60095), clippy: P(`clippy`, 60096), closeAll: P(`close-all`, 60097), cloudDownload: P(`cloud-download`, 60098), cloudUpload: P(`cloud-upload`, 60099), code: P(`code`, 60100), collapseAll: P(`collapse-all`, 60101), colorMode: P(`color-mode`, 60102), commentDiscussion: P(`comment-discussion`, 60103), creditCard: P(`credit-card`, 60105), dash: P(`dash`, 60108), dashboard: P(`dashboard`, 60109), database: P(`database`, 60110), debugContinue: P(`debug-continue`, 60111), debugDisconnect: P(`debug-disconnect`, 60112), debugPause: P(`debug-pause`, 60113), debugRestart: P(`debug-restart`, 60114), debugStart: P(`debug-start`, 60115), debugStepInto: P(`debug-step-into`, 60116), debugStepOut: P(`debug-step-out`, 60117), debugStepOver: P(`debug-step-over`, 60118), debugStop: P(`debug-stop`, 60119), debug: P(`debug`, 60120), deviceCameraVideo: P(`device-camera-video`, 60121), deviceCamera: P(`device-camera`, 60122), deviceMobile: P(`device-mobile`, 60123), diffAdded: P(`diff-added`, 60124), diffIgnored: P(`diff-ignored`, 60125), diffModified: P(`diff-modified`, 60126), diffRemoved: P(`diff-removed`, 60127), diffRenamed: P(`diff-renamed`, 60128), diff: P(`diff`, 60129), diffSidebyside: P(`diff-sidebyside`, 60129), discard: P(`discard`, 60130), editorLayout: P(`editor-layout`, 60131), emptyWindow: P(`empty-window`, 60132), exclude: P(`exclude`, 60133), extensions: P(`extensions`, 60134), eyeClosed: P(`eye-closed`, 60135), fileBinary: P(`file-binary`, 60136), fileCode: P(`file-code`, 60137), fileMedia: P(`file-media`, 60138), filePdf: P(`file-pdf`, 60139), fileSubmodule: P(`file-submodule`, 60140), fileSymlinkDirectory: P(`file-symlink-directory`, 60141), fileSymlinkFile: P(`file-symlink-file`, 60142), fileZip: P(`file-zip`, 60143), files: P(`files`, 60144), filter: P(`filter`, 60145), flame: P(`flame`, 60146), foldDown: P(`fold-down`, 60147), foldUp: P(`fold-up`, 60148), fold: P(`fold`, 60149), folderActive: P(`folder-active`, 60150), folderOpened: P(`folder-opened`, 60151), gear: P(`gear`, 60152), gift: P(`gift`, 60153), gistSecret: P(`gist-secret`, 60154), gist: P(`gist`, 60155), gitCommit: P(`git-commit`, 60156), gitCompare: P(`git-compare`, 60157), compareChanges: P(`compare-changes`, 60157), gitMerge: P(`git-merge`, 60158), githubAction: P(`github-action`, 60159), githubAlt: P(`github-alt`, 60160), globe: P(`globe`, 60161), grabber: P(`grabber`, 60162), graph: P(`graph`, 60163), gripper: P(`gripper`, 60164), heart: P(`heart`, 60165), home: P(`home`, 60166), horizontalRule: P(`horizontal-rule`, 60167), hubot: P(`hubot`, 60168), inbox: P(`inbox`, 60169), issueReopened: P(`issue-reopened`, 60171), issues: P(`issues`, 60172), italic: P(`italic`, 60173), jersey: P(`jersey`, 60174), json: P(`json`, 60175), kebabVertical: P(`kebab-vertical`, 60176), key: P(`key`, 60177), law: P(`law`, 60178), lightbulbAutofix: P(`lightbulb-autofix`, 60179), linkExternal: P(`link-external`, 60180), link: P(`link`, 60181), listOrdered: P(`list-ordered`, 60182), listUnordered: P(`list-unordered`, 60183), liveShare: P(`live-share`, 60184), loading: P(`loading`, 60185), location: P(`location`, 60186), mailRead: P(`mail-read`, 60187), mail: P(`mail`, 60188), markdown: P(`markdown`, 60189), megaphone: P(`megaphone`, 60190), mention: P(`mention`, 60191), milestone: P(`milestone`, 60192), gitPullRequestMilestone: P(`git-pull-request-milestone`, 60192), mortarBoard: P(`mortar-board`, 60193), move: P(`move`, 60194), multipleWindows: P(`multiple-windows`, 60195), mute: P(`mute`, 60196), noNewline: P(`no-newline`, 60197), note: P(`note`, 60198), octoface: P(`octoface`, 60199), openPreview: P(`open-preview`, 60200), package: P(`package`, 60201), paintcan: P(`paintcan`, 60202), pin: P(`pin`, 60203), play: P(`play`, 60204), run: P(`run`, 60204), plug: P(`plug`, 60205), preserveCase: P(`preserve-case`, 60206), preview: P(`preview`, 60207), project: P(`project`, 60208), pulse: P(`pulse`, 60209), question: P(`question`, 60210), quote: P(`quote`, 60211), radioTower: P(`radio-tower`, 60212), reactions: P(`reactions`, 60213), references: P(`references`, 60214), refresh: P(`refresh`, 60215), regex: P(`regex`, 60216), remoteExplorer: P(`remote-explorer`, 60217), remote: P(`remote`, 60218), remove: P(`remove`, 60219), replaceAll: P(`replace-all`, 60220), replace: P(`replace`, 60221), repoClone: P(`repo-clone`, 60222), repoForcePush: P(`repo-force-push`, 60223), repoPull: P(`repo-pull`, 60224), repoPush: P(`repo-push`, 60225), report: P(`report`, 60226), requestChanges: P(`request-changes`, 60227), rocket: P(`rocket`, 60228), rootFolderOpened: P(`root-folder-opened`, 60229), rootFolder: P(`root-folder`, 60230), rss: P(`rss`, 60231), ruby: P(`ruby`, 60232), saveAll: P(`save-all`, 60233), saveAs: P(`save-as`, 60234), save: P(`save`, 60235), screenFull: P(`screen-full`, 60236), screenNormal: P(`screen-normal`, 60237), searchStop: P(`search-stop`, 60238), server: P(`server`, 60240), settingsGear: P(`settings-gear`, 60241), settings: P(`settings`, 60242), shield: P(`shield`, 60243), smiley: P(`smiley`, 60244), sortPrecedence: P(`sort-precedence`, 60245), splitHorizontal: P(`split-horizontal`, 60246), splitVertical: P(`split-vertical`, 60247), squirrel: P(`squirrel`, 60248), starFull: P(`star-full`, 60249), starHalf: P(`star-half`, 60250), symbolClass: P(`symbol-class`, 60251), symbolColor: P(`symbol-color`, 60252), symbolConstant: P(`symbol-constant`, 60253), symbolEnumMember: P(`symbol-enum-member`, 60254), symbolField: P(`symbol-field`, 60255), symbolFile: P(`symbol-file`, 60256), symbolInterface: P(`symbol-interface`, 60257), symbolKeyword: P(`symbol-keyword`, 60258), symbolMisc: P(`symbol-misc`, 60259), symbolOperator: P(`symbol-operator`, 60260), symbolProperty: P(`symbol-property`, 60261), wrench: P(`wrench`, 60261), wrenchSubaction: P(`wrench-subaction`, 60261), symbolSnippet: P(`symbol-snippet`, 60262), tasklist: P(`tasklist`, 60263), telescope: P(`telescope`, 60264), textSize: P(`text-size`, 60265), threeBars: P(`three-bars`, 60266), thumbsdown: P(`thumbsdown`, 60267), thumbsup: P(`thumbsup`, 60268), tools: P(`tools`, 60269), triangleDown: P(`triangle-down`, 60270), triangleLeft: P(`triangle-left`, 60271), triangleRight: P(`triangle-right`, 60272), triangleUp: P(`triangle-up`, 60273), twitter: P(`twitter`, 60274), unfold: P(`unfold`, 60275), unlock: P(`unlock`, 60276), unmute: P(`unmute`, 60277), unverified: P(`unverified`, 60278), verified: P(`verified`, 60279), versions: P(`versions`, 60280), vmActive: P(`vm-active`, 60281), vmOutline: P(`vm-outline`, 60282), vmRunning: P(`vm-running`, 60283), watch: P(`watch`, 60284), whitespace: P(`whitespace`, 60285), wholeWord: P(`whole-word`, 60286), window: P(`window`, 60287), wordWrap: P(`word-wrap`, 60288), zoomIn: P(`zoom-in`, 60289), zoomOut: P(`zoom-out`, 60290), listFilter: P(`list-filter`, 60291), listFlat: P(`list-flat`, 60292), listSelection: P(`list-selection`, 60293), selection: P(`selection`, 60293), listTree: P(`list-tree`, 60294), debugBreakpointFunctionUnverified: P(`debug-breakpoint-function-unverified`, 60295), debugBreakpointFunction: P(`debug-breakpoint-function`, 60296), debugBreakpointFunctionDisabled: P(`debug-breakpoint-function-disabled`, 60296), debugStackframeActive: P(`debug-stackframe-active`, 60297), circleSmallFilled: P(`circle-small-filled`, 60298), debugStackframeDot: P(`debug-stackframe-dot`, 60298), terminalDecorationMark: P(`terminal-decoration-mark`, 60298), debugStackframe: P(`debug-stackframe`, 60299), debugStackframeFocused: P(`debug-stackframe-focused`, 60299), debugBreakpointUnsupported: P(`debug-breakpoint-unsupported`, 60300), symbolString: P(`symbol-string`, 60301), debugReverseContinue: P(`debug-reverse-continue`, 60302), debugStepBack: P(`debug-step-back`, 60303), debugRestartFrame: P(`debug-restart-frame`, 60304), debugAlt: P(`debug-alt`, 60305), callIncoming: P(`call-incoming`, 60306), callOutgoing: P(`call-outgoing`, 60307), menu: P(`menu`, 60308), expandAll: P(`expand-all`, 60309), feedback: P(`feedback`, 60310), gitPullRequestReviewer: P(`git-pull-request-reviewer`, 60310), groupByRefType: P(`group-by-ref-type`, 60311), ungroupByRefType: P(`ungroup-by-ref-type`, 60312), account: P(`account`, 60313), gitPullRequestAssignee: P(`git-pull-request-assignee`, 60313), bellDot: P(`bell-dot`, 60314), debugConsole: P(`debug-console`, 60315), library: P(`library`, 60316), output: P(`output`, 60317), runAll: P(`run-all`, 60318), syncIgnored: P(`sync-ignored`, 60319), pinned: P(`pinned`, 60320), githubInverted: P(`github-inverted`, 60321), serverProcess: P(`server-process`, 60322), serverEnvironment: P(`server-environment`, 60323), pass: P(`pass`, 60324), issueClosed: P(`issue-closed`, 60324), stopCircle: P(`stop-circle`, 60325), playCircle: P(`play-circle`, 60326), record: P(`record`, 60327), debugAltSmall: P(`debug-alt-small`, 60328), vmConnect: P(`vm-connect`, 60329), cloud: P(`cloud`, 60330), merge: P(`merge`, 60331), export: P(`export`, 60332), graphLeft: P(`graph-left`, 60333), magnet: P(`magnet`, 60334), notebook: P(`notebook`, 60335), redo: P(`redo`, 60336), checkAll: P(`check-all`, 60337), pinnedDirty: P(`pinned-dirty`, 60338), passFilled: P(`pass-filled`, 60339), circleLargeFilled: P(`circle-large-filled`, 60340), circleLarge: P(`circle-large`, 60341), circleLargeOutline: P(`circle-large-outline`, 60341), combine: P(`combine`, 60342), gather: P(`gather`, 60342), table: P(`table`, 60343), variableGroup: P(`variable-group`, 60344), typeHierarchy: P(`type-hierarchy`, 60345), typeHierarchySub: P(`type-hierarchy-sub`, 60346), typeHierarchySuper: P(`type-hierarchy-super`, 60347), gitPullRequestCreate: P(`git-pull-request-create`, 60348), runAbove: P(`run-above`, 60349), runBelow: P(`run-below`, 60350), notebookTemplate: P(`notebook-template`, 60351), debugRerun: P(`debug-rerun`, 60352), workspaceTrusted: P(`workspace-trusted`, 60353), workspaceUntrusted: P(`workspace-untrusted`, 60354), workspaceUnknown: P(`workspace-unknown`, 60355), terminalCmd: P(`terminal-cmd`, 60356), terminalDebian: P(`terminal-debian`, 60357), terminalLinux: P(`terminal-linux`, 60358), terminalPowershell: P(`terminal-powershell`, 60359), terminalTmux: P(`terminal-tmux`, 60360), terminalUbuntu: P(`terminal-ubuntu`, 60361), terminalBash: P(`terminal-bash`, 60362), arrowSwap: P(`arrow-swap`, 60363), copy: P(`copy`, 60364), personAdd: P(`person-add`, 60365), filterFilled: P(`filter-filled`, 60366), wand: P(`wand`, 60367), debugLineByLine: P(`debug-line-by-line`, 60368), inspect: P(`inspect`, 60369), layers: P(`layers`, 60370), layersDot: P(`layers-dot`, 60371), layersActive: P(`layers-active`, 60372), compass: P(`compass`, 60373), compassDot: P(`compass-dot`, 60374), compassActive: P(`compass-active`, 60375), azure: P(`azure`, 60376), issueDraft: P(`issue-draft`, 60377), gitPullRequestClosed: P(`git-pull-request-closed`, 60378), gitPullRequestDraft: P(`git-pull-request-draft`, 60379), debugAll: P(`debug-all`, 60380), debugCoverage: P(`debug-coverage`, 60381), runErrors: P(`run-errors`, 60382), folderLibrary: P(`folder-library`, 60383), debugContinueSmall: P(`debug-continue-small`, 60384), beakerStop: P(`beaker-stop`, 60385), graphLine: P(`graph-line`, 60386), graphScatter: P(`graph-scatter`, 60387), pieChart: P(`pie-chart`, 60388), bracket: P(`bracket`, 60175), bracketDot: P(`bracket-dot`, 60389), bracketError: P(`bracket-error`, 60390), lockSmall: P(`lock-small`, 60391), azureDevops: P(`azure-devops`, 60392), verifiedFilled: P(`verified-filled`, 60393), newline: P(`newline`, 60394), layout: P(`layout`, 60395), layoutActivitybarLeft: P(`layout-activitybar-left`, 60396), layoutActivitybarRight: P(`layout-activitybar-right`, 60397), layoutPanelLeft: P(`layout-panel-left`, 60398), layoutPanelCenter: P(`layout-panel-center`, 60399), layoutPanelJustify: P(`layout-panel-justify`, 60400), layoutPanelRight: P(`layout-panel-right`, 60401), layoutPanel: P(`layout-panel`, 60402), layoutSidebarLeft: P(`layout-sidebar-left`, 60403), layoutSidebarRight: P(`layout-sidebar-right`, 60404), layoutStatusbar: P(`layout-statusbar`, 60405), layoutMenubar: P(`layout-menubar`, 60406), layoutCentered: P(`layout-centered`, 60407), target: P(`target`, 60408), indent: P(`indent`, 60409), recordSmall: P(`record-small`, 60410), errorSmall: P(`error-small`, 60411), terminalDecorationError: P(`terminal-decoration-error`, 60411), arrowCircleDown: P(`arrow-circle-down`, 60412), arrowCircleLeft: P(`arrow-circle-left`, 60413), arrowCircleRight: P(`arrow-circle-right`, 60414), arrowCircleUp: P(`arrow-circle-up`, 60415), layoutSidebarRightOff: P(`layout-sidebar-right-off`, 60416), layoutPanelOff: P(`layout-panel-off`, 60417), layoutSidebarLeftOff: P(`layout-sidebar-left-off`, 60418), blank: P(`blank`, 60419), heartFilled: P(`heart-filled`, 60420), map: P(`map`, 60421), mapHorizontal: P(`map-horizontal`, 60421), foldHorizontal: P(`fold-horizontal`, 60421), mapFilled: P(`map-filled`, 60422), mapHorizontalFilled: P(`map-horizontal-filled`, 60422), foldHorizontalFilled: P(`fold-horizontal-filled`, 60422), circleSmall: P(`circle-small`, 60423), bellSlash: P(`bell-slash`, 60424), bellSlashDot: P(`bell-slash-dot`, 60425), commentUnresolved: P(`comment-unresolved`, 60426), gitPullRequestGoToChanges: P(`git-pull-request-go-to-changes`, 60427), gitPullRequestNewChanges: P(`git-pull-request-new-changes`, 60428), searchFuzzy: P(`search-fuzzy`, 60429), commentDraft: P(`comment-draft`, 60430), send: P(`send`, 60431), sparkle: P(`sparkle`, 60432), insert: P(`insert`, 60433), mic: P(`mic`, 60434), thumbsdownFilled: P(`thumbsdown-filled`, 60435), thumbsupFilled: P(`thumbsup-filled`, 60436), coffee: P(`coffee`, 60437), snake: P(`snake`, 60438), game: P(`game`, 60439), vr: P(`vr`, 60440), chip: P(`chip`, 60441), piano: P(`piano`, 60442), music: P(`music`, 60443), micFilled: P(`mic-filled`, 60444), repoFetch: P(`repo-fetch`, 60445), copilot: P(`copilot`, 60446), lightbulbSparkle: P(`lightbulb-sparkle`, 60447), robot: P(`robot`, 60448), sparkleFilled: P(`sparkle-filled`, 60449), diffSingle: P(`diff-single`, 60450), diffMultiple: P(`diff-multiple`, 60451), surroundWith: P(`surround-with`, 60452), share: P(`share`, 60453), gitStash: P(`git-stash`, 60454), gitStashApply: P(`git-stash-apply`, 60455), gitStashPop: P(`git-stash-pop`, 60456), vscode: P(`vscode`, 60457), vscodeInsiders: P(`vscode-insiders`, 60458), codeOss: P(`code-oss`, 60459), runCoverage: P(`run-coverage`, 60460), runAllCoverage: P(`run-all-coverage`, 60461), coverage: P(`coverage`, 60462), githubProject: P(`github-project`, 60463), mapVertical: P(`map-vertical`, 60464), foldVertical: P(`fold-vertical`, 60464), mapVerticalFilled: P(`map-vertical-filled`, 60465), foldVerticalFilled: P(`fold-vertical-filled`, 60465), goToSearch: P(`go-to-search`, 60466), percentage: P(`percentage`, 60467), sortPercentage: P(`sort-percentage`, 60467), attach: P(`attach`, 60468), goToEditingSession: P(`go-to-editing-session`, 60469), editSession: P(`edit-session`, 60470), codeReview: P(`code-review`, 60471), copilotWarning: P(`copilot-warning`, 60472), python: P(`python`, 60473), copilotLarge: P(`copilot-large`, 60474), copilotWarningLarge: P(`copilot-warning-large`, 60475), keyboardTab: P(`keyboard-tab`, 60476), copilotBlocked: P(`copilot-blocked`, 60477), copilotNotConnected: P(`copilot-not-connected`, 60478), flag: P(`flag`, 60479), lightbulbEmpty: P(`lightbulb-empty`, 60480), symbolMethodArrow: P(`symbol-method-arrow`, 60481), copilotUnavailable: P(`copilot-unavailable`, 60482), repoPinned: P(`repo-pinned`, 60483), keyboardTabAbove: P(`keyboard-tab-above`, 60484), keyboardTabBelow: P(`keyboard-tab-below`, 60485), gitPullRequestDone: P(`git-pull-request-done`, 60486), mcp: P(`mcp`, 60487), extensionsLarge: P(`extensions-large`, 60488), layoutPanelDock: P(`layout-panel-dock`, 60489), layoutSidebarLeftDock: P(`layout-sidebar-left-dock`, 60490), layoutSidebarRightDock: P(`layout-sidebar-right-dock`, 60491), copilotInProgress: P(`copilot-in-progress`, 60492), copilotError: P(`copilot-error`, 60493), copilotSuccess: P(`copilot-success`, 60494), chatSparkle: P(`chat-sparkle`, 60495), searchSparkle: P(`search-sparkle`, 60496), editSparkle: P(`edit-sparkle`, 60497), copilotSnooze: P(`copilot-snooze`, 60498), sendToRemoteAgent: P(`send-to-remote-agent`, 60499), commentDiscussionSparkle: P(`comment-discussion-sparkle`, 60500), chatSparkleWarning: P(`chat-sparkle-warning`, 60501), chatSparkleError: P(`chat-sparkle-error`, 60502), collection: P(`collection`, 60503), newCollection: P(`new-collection`, 60504), thinking: P(`thinking`, 60505), build: P(`build`, 60506), commentDiscussionQuote: P(`comment-discussion-quote`, 60507), cursor: P(`cursor`, 60508), eraser: P(`eraser`, 60509), fileText: P(`file-text`, 60510), gitLens: P(`git-lens`, 60511), quotes: P(`quotes`, 60512), rename: P(`rename`, 60513), runWithDeps: P(`run-with-deps`, 60514), debugConnected: P(`debug-connected`, 60515), strikethrough: P(`strikethrough`, 60516), openInProduct: P(`open-in-product`, 60517), indexZero: P(`index-zero`, 60518), agent: P(`agent`, 60519), editCode: P(`edit-code`, 60520), repoSelected: P(`repo-selected`, 60521), skip: P(`skip`, 60522), mergeInto: P(`merge-into`, 60523), gitBranchChanges: P(`git-branch-changes`, 60524), gitBranchStagedChanges: P(`git-branch-staged-changes`, 60525), gitBranchConflicts: P(`git-branch-conflicts`, 60526), gitBranch: P(`git-branch`, 60527), gitBranchCreate: P(`git-branch-create`, 60527), gitBranchDelete: P(`git-branch-delete`, 60527), searchLarge: P(`search-large`, 60528), terminalGitBash: P(`terminal-git-bash`, 60529) }, pte = { dialogError: P(`dialog-error`, `error`), dialogWarning: P(`dialog-warning`, `warning`), dialogInfo: P(`dialog-info`, `info`), dialogClose: P(`dialog-close`, `close`), treeItemExpanded: P(`tree-item-expanded`, `chevron-down`), treeFilterOnTypeOn: P(`tree-filter-on-type-on`, `list-filter`), treeFilterOnTypeOff: P(`tree-filter-on-type-off`, `list-selection`), treeFilterClear: P(`tree-filter-clear`, `close`), treeItemLoading: P(`tree-item-loading`, `loading`), menuSelection: P(`menu-selection`, `check`), menuSubmenu: P(`menu-submenu`, `chevron-right`), menuBarMore: P(`menubar-more`, `more`), scrollbarButtonLeft: P(`scrollbar-button-left`, `triangle-left`), scrollbarButtonRight: P(`scrollbar-button-right`, `triangle-right`), scrollbarButtonUp: P(`scrollbar-button-up`, `triangle-up`), scrollbarButtonDown: P(`scrollbar-button-down`, `triangle-down`), toolBarMore: P(`toolbar-more`, `more`), quickInputBack: P(`quick-input-back`, `arrow-left`), dropDownButton: P(`drop-down-button`, 60084), symbolCustomColor: P(`symbol-customcolor`, 60252), exportIcon: P(`export`, 60332), workspaceUnspecified: P(`workspace-unspecified`, 60355), newLine: P(`newline`, 60394), thumbsDownFilled: P(`thumbsdown-filled`, 60435), thumbsUpFilled: P(`thumbsup-filled`, 60436), gitFetch: P(`git-fetch`, 60445), lightbulbSparkleAutofix: P(`lightbulb-sparkle-autofix`, 60447), debugBreakpointPending: P(`debug-breakpoint-pending`, 60377) }, F = { ...fte, ...pte }, mte = class {
  constructor() {
    this._tokenizationSupports = /* @__PURE__ */ new Map(), this._factories = /* @__PURE__ */ new Map(), this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._colorMap = null;
  }
  handleChange(e206) {
    this._onDidChange.fire({ changedLanguages: e206, changedColorMap: false });
  }
  register(e206, t10) {
    return this._tokenizationSupports.set(e206, t10), this.handleChange([e206]), T(() => {
      this._tokenizationSupports.get(e206) === t10 && (this._tokenizationSupports.delete(e206), this.handleChange([e206]));
    });
  }
  get(e206) {
    return this._tokenizationSupports.get(e206) || null;
  }
  registerFactory(e206, t10) {
    this._factories.get(e206)?.dispose();
    let n10 = new hte(this, e206, t10);
    return this._factories.set(e206, n10), T(() => {
      let t11 = this._factories.get(e206);
      !t11 || t11 !== n10 || (this._factories.delete(e206), t11.dispose());
    });
  }
  async getOrCreate(e206) {
    let t10 = this.get(e206);
    if (t10) return t10;
    let n10 = this._factories.get(e206);
    return !n10 || n10.isResolved ? null : (await n10.resolve(), this.get(e206));
  }
  isResolved(e206) {
    if (this.get(e206)) return true;
    let t10 = this._factories.get(e206);
    return !!(!t10 || t10.isResolved);
  }
  setColorMap(e206) {
    this._colorMap = e206, this._onDidChange.fire({ changedLanguages: Array.from(this._tokenizationSupports.keys()), changedColorMap: true });
  }
  getColorMap() {
    return this._colorMap;
  }
  getDefaultBackground() {
    return this._colorMap && this._colorMap.length > 2 ? this._colorMap[2] : null;
  }
}, hte = class extends D {
  get isResolved() {
    return this._isResolved;
  }
  constructor(e206, t10, n10) {
    super(), this._registry = e206, this._languageId = t10, this._factory = n10, this._isDisposed = false, this._resolvePromise = null, this._isResolved = false;
  }
  dispose() {
    this._isDisposed = true, super.dispose();
  }
  async resolve() {
    return this._resolvePromise || (this._resolvePromise = this._create()), this._resolvePromise;
  }
  async _create() {
    let e206 = await this._factory.tokenizationSupport;
    this._isResolved = true, e206 && !this._isDisposed && this._register(this._registry.register(this._languageId, e206));
  }
}, di = class {
  constructor(e206, t10, n10) {
    this.offset = e206, this.type = t10, this.language = n10, this._tokenBrand = void 0;
  }
  toString() {
    return `(` + this.offset + `, ` + this.type + `)`;
  }
}, fi = class {
  constructor(e206, t10) {
    this.tokens = e206, this.endState = t10, this._tokenizationResultBrand = void 0;
  }
}, pi = class {
  constructor(e206, t10) {
    this.tokens = e206, this.endState = t10, this._encodedTokenizationResultBrand = void 0;
  }
}, mi;
(function(e206) {
  e206[e206.Increase = 0] = `Increase`, e206[e206.Decrease = 1] = `Decrease`;
})(mi || (mi = {}));
var hi;
(function(e206) {
  let t10 = /* @__PURE__ */ new Map();
  t10.set(0, F.symbolMethod), t10.set(1, F.symbolFunction), t10.set(2, F.symbolConstructor), t10.set(3, F.symbolField), t10.set(4, F.symbolVariable), t10.set(5, F.symbolClass), t10.set(6, F.symbolStruct), t10.set(7, F.symbolInterface), t10.set(8, F.symbolModule), t10.set(9, F.symbolProperty), t10.set(10, F.symbolEvent), t10.set(11, F.symbolOperator), t10.set(12, F.symbolUnit), t10.set(13, F.symbolValue), t10.set(15, F.symbolEnum), t10.set(14, F.symbolConstant), t10.set(15, F.symbolEnum), t10.set(16, F.symbolEnumMember), t10.set(17, F.symbolKeyword), t10.set(28, F.symbolSnippet), t10.set(18, F.symbolText), t10.set(19, F.symbolColor), t10.set(20, F.symbolFile), t10.set(21, F.symbolReference), t10.set(22, F.symbolCustomColor), t10.set(23, F.symbolFolder), t10.set(24, F.symbolTypeParameter), t10.set(25, F.account), t10.set(26, F.issues), t10.set(27, F.tools);
  function n10(e207) {
    let n11 = t10.get(e207);
    return n11 || (n11 = (console.info(`No codicon found for CompletionItemKind ` + e207), F.symbolProperty)), n11;
  }
  e206.toIcon = n10;
  function r10(e207) {
    switch (e207) {
      case 0:
        return C(728, `Method`);
      case 1:
        return C(729, `Function`);
      case 2:
        return C(730, `Constructor`);
      case 3:
        return C(731, `Field`);
      case 4:
        return C(732, `Variable`);
      case 5:
        return C(733, `Class`);
      case 6:
        return C(734, `Struct`);
      case 7:
        return C(735, `Interface`);
      case 8:
        return C(736, `Module`);
      case 9:
        return C(737, `Property`);
      case 10:
        return C(738, `Event`);
      case 11:
        return C(739, `Operator`);
      case 12:
        return C(740, `Unit`);
      case 13:
        return C(741, `Value`);
      case 14:
        return C(742, `Constant`);
      case 15:
        return C(743, `Enum`);
      case 16:
        return C(744, `Enum Member`);
      case 17:
        return C(745, `Keyword`);
      case 18:
        return C(746, `Text`);
      case 19:
        return C(747, `Color`);
      case 20:
        return C(748, `File`);
      case 21:
        return C(749, `Reference`);
      case 22:
        return C(750, `Custom Color`);
      case 23:
        return C(751, `Folder`);
      case 24:
        return C(752, `Type Parameter`);
      case 25:
        return C(753, `User`);
      case 26:
        return C(754, `Issue`);
      case 27:
        return C(755, `Tool`);
      case 28:
        return C(756, `Snippet`);
      default:
        return ``;
    }
  }
  e206.toLabel = r10;
  let i10 = /* @__PURE__ */ new Map();
  i10.set(`method`, 0), i10.set(`function`, 1), i10.set(`constructor`, 2), i10.set(`field`, 3), i10.set(`variable`, 4), i10.set(`class`, 5), i10.set(`struct`, 6), i10.set(`interface`, 7), i10.set(`module`, 8), i10.set(`property`, 9), i10.set(`event`, 10), i10.set(`operator`, 11), i10.set(`unit`, 12), i10.set(`value`, 13), i10.set(`constant`, 14), i10.set(`enum`, 15), i10.set(`enum-member`, 16), i10.set(`enumMember`, 16), i10.set(`keyword`, 17), i10.set(`snippet`, 28), i10.set(`text`, 18), i10.set(`color`, 19), i10.set(`file`, 20), i10.set(`reference`, 21), i10.set(`customcolor`, 22), i10.set(`folder`, 23), i10.set(`type-parameter`, 24), i10.set(`typeParameter`, 24), i10.set(`account`, 25), i10.set(`issue`, 26), i10.set(`tool`, 27);
  function a10(e207, t11) {
    let n11 = i10.get(e207);
    return n11 === void 0 && !t11 && (n11 = 9), n11;
  }
  e206.fromString = a10;
})(hi || (hi = {}));
var gi;
(function(e206) {
  e206[e206.Automatic = 0] = `Automatic`, e206[e206.Explicit = 1] = `Explicit`;
})(gi || (gi = {}));
var _i2 = class {
  constructor(e206, t10, n10, r10) {
    this.range = e206, this.text = t10, this.completionKind = n10, this.isSnippetText = r10;
  }
  equals(e206) {
    return M.lift(this.range).equalsRange(e206.range) && this.text === e206.text && this.completionKind === e206.completionKind && this.isSnippetText === e206.isSnippetText;
  }
}, vi;
(function(e206) {
  e206[e206.Code = 1] = `Code`, e206[e206.Label = 2] = `Label`;
})(vi || (vi = {}));
var yi = class e16 {
  static fromExtensionId(t10) {
    return new e16(t10, void 0, void 0);
  }
  constructor(e206, t10, n10) {
    this.extensionId = e206, this.extensionVersion = t10, this.providerId = n10;
  }
  toString() {
    let e206 = ``;
    return this.extensionId && (e206 += this.extensionId), this.extensionVersion && (e206 += `@${this.extensionVersion}`), this.providerId && (e206 += `:${this.providerId}`), e206.length === 0 && (e206 = `unknown`), e206;
  }
  toStringWithoutVersion() {
    let e206 = ``;
    return this.extensionId && (e206 += this.extensionId), this.providerId && (e206 += `:${this.providerId}`), e206;
  }
}, bi;
(function(e206) {
  e206[e206.Accepted = 0] = `Accepted`, e206[e206.Rejected = 1] = `Rejected`, e206[e206.Ignored = 2] = `Ignored`;
})(bi || (bi = {}));
var xi;
(function(e206) {
  e206[e206.Automatic = 0] = `Automatic`, e206[e206.PasteAs = 1] = `PasteAs`;
})(xi || (xi = {}));
var Si;
(function(e206) {
  e206[e206.Invoke = 1] = `Invoke`, e206[e206.TriggerCharacter = 2] = `TriggerCharacter`, e206[e206.ContentChange = 3] = `ContentChange`;
})(Si || (Si = {}));
var Ci;
(function(e206) {
  e206[e206.Text = 0] = `Text`, e206[e206.Read = 1] = `Read`, e206[e206.Write = 2] = `Write`;
})(Ci || (Ci = {}));
function wi(e206) {
  return !!e206 && $r.isUri(e206.uri) && M.isIRange(e206.range) && (M.isIRange(e206.originSelectionRange) || M.isIRange(e206.targetSelectionRange));
}
var Ti = { 17: C(757, `array`), 16: C(758, `boolean`), 4: C(759, `class`), 13: C(760, `constant`), 8: C(761, `constructor`), 9: C(762, `enumeration`), 21: C(763, `enumeration member`), 23: C(764, `event`), 7: C(765, `field`), 0: C(766, `file`), 11: C(767, `function`), 10: C(768, `interface`), 19: C(769, `key`), 5: C(770, `method`), 1: C(771, `module`), 2: C(772, `namespace`), 20: C(773, `null`), 15: C(774, `number`), 18: C(775, `object`), 24: C(776, `operator`), 3: C(777, `package`), 6: C(778, `property`), 14: C(779, `string`), 22: C(780, `struct`), 25: C(781, `type parameter`), 12: C(782, `variable`) };
function Ei(e206, t10) {
  return C(783, `{0} ({1})`, e206, Ti[t10]);
}
var Di;
(function(e206) {
  let t10 = /* @__PURE__ */ new Map();
  t10.set(0, F.symbolFile), t10.set(1, F.symbolModule), t10.set(2, F.symbolNamespace), t10.set(3, F.symbolPackage), t10.set(4, F.symbolClass), t10.set(5, F.symbolMethod), t10.set(6, F.symbolProperty), t10.set(7, F.symbolField), t10.set(8, F.symbolConstructor), t10.set(9, F.symbolEnum), t10.set(10, F.symbolInterface), t10.set(11, F.symbolFunction), t10.set(12, F.symbolVariable), t10.set(13, F.symbolConstant), t10.set(14, F.symbolString), t10.set(15, F.symbolNumber), t10.set(16, F.symbolBoolean), t10.set(17, F.symbolArray), t10.set(18, F.symbolObject), t10.set(19, F.symbolKey), t10.set(20, F.symbolNull), t10.set(21, F.symbolEnumMember), t10.set(22, F.symbolStruct), t10.set(23, F.symbolEvent), t10.set(24, F.symbolOperator), t10.set(25, F.symbolTypeParameter);
  function n10(e207) {
    let n11 = t10.get(e207);
    return n11 || (n11 = (console.info(`No codicon found for SymbolKind ` + e207), F.symbolProperty)), n11;
  }
  e206.toIcon = n10;
  let r10 = /* @__PURE__ */ new Map();
  r10.set(0, 20), r10.set(1, 8), r10.set(2, 8), r10.set(3, 8), r10.set(4, 5), r10.set(5, 0), r10.set(6, 9), r10.set(7, 3), r10.set(8, 2), r10.set(9, 15), r10.set(10, 7), r10.set(11, 1), r10.set(12, 4), r10.set(13, 14), r10.set(14, 18), r10.set(15, 13), r10.set(16, 13), r10.set(17, 13), r10.set(18, 13), r10.set(19, 17), r10.set(20, 13), r10.set(21, 16), r10.set(22, 6), r10.set(23, 10), r10.set(24, 11), r10.set(25, 24);
  function i10(e207) {
    let t11 = r10.get(e207);
    return t11 === void 0 && (console.info(`No completion kind found for SymbolKind ` + e207), t11 = 20), t11;
  }
  e206.toCompletionKind = i10;
})(Di || (Di = {}));
var Oi = (_j = class {
  static fromValue(t10) {
    switch (t10) {
      case `comment`:
        return _j.Comment;
      case `imports`:
        return _j.Imports;
      case `region`:
        return _j.Region;
    }
    return new _j(t10);
  }
  constructor(e206) {
    this.value = e206;
  }
}, _j.Comment = new _j(`comment`), _j.Imports = new _j(`imports`), _j.Region = new _j(`region`), _j), ki;
(function(e206) {
  e206[e206.AIGenerated = 1] = `AIGenerated`;
})(ki || (ki = {}));
var Ai;
(function(e206) {
  e206[e206.Invoke = 0] = `Invoke`, e206[e206.Automatic = 1] = `Automatic`;
})(Ai || (Ai = {}));
var ji;
(function(e206) {
  function t10(e207) {
    return !e207 || typeof e207 != `object` ? false : typeof e207.id == `string` && typeof e207.title == `string`;
  }
  e206.is = t10;
})(ji || (ji = {}));
var Mi;
(function(e206) {
  e206[e206.Type = 1] = `Type`, e206[e206.Parameter = 2] = `Parameter`;
})(Mi || (Mi = {}));
var Ni = class {
  constructor(e206) {
    this.createSupport = e206, this._tokenizationSupport = null;
  }
  dispose() {
    this._tokenizationSupport && this._tokenizationSupport.then((e206) => {
      e206 && e206.dispose();
    });
  }
  get tokenizationSupport() {
    return this._tokenizationSupport || (this._tokenizationSupport = this.createSupport()), this._tokenizationSupport;
  }
}, Pi = new mte(), Fi;
(function(e206) {
  e206[e206.Unknown = 0] = `Unknown`, e206[e206.Disabled = 1] = `Disabled`, e206[e206.Enabled = 2] = `Enabled`;
})(Fi || (Fi = {}));
var Ii;
(function(e206) {
  e206[e206.Invoke = 1] = `Invoke`, e206[e206.Auto = 2] = `Auto`;
})(Ii || (Ii = {}));
var Li;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.KeepWhitespace = 1] = `KeepWhitespace`, e206[e206.InsertAsSnippet = 4] = `InsertAsSnippet`;
})(Li || (Li = {}));
var Ri;
(function(e206) {
  e206[e206.Method = 0] = `Method`, e206[e206.Function = 1] = `Function`, e206[e206.Constructor = 2] = `Constructor`, e206[e206.Field = 3] = `Field`, e206[e206.Variable = 4] = `Variable`, e206[e206.Class = 5] = `Class`, e206[e206.Struct = 6] = `Struct`, e206[e206.Interface = 7] = `Interface`, e206[e206.Module = 8] = `Module`, e206[e206.Property = 9] = `Property`, e206[e206.Event = 10] = `Event`, e206[e206.Operator = 11] = `Operator`, e206[e206.Unit = 12] = `Unit`, e206[e206.Value = 13] = `Value`, e206[e206.Constant = 14] = `Constant`, e206[e206.Enum = 15] = `Enum`, e206[e206.EnumMember = 16] = `EnumMember`, e206[e206.Keyword = 17] = `Keyword`, e206[e206.Text = 18] = `Text`, e206[e206.Color = 19] = `Color`, e206[e206.File = 20] = `File`, e206[e206.Reference = 21] = `Reference`, e206[e206.Customcolor = 22] = `Customcolor`, e206[e206.Folder = 23] = `Folder`, e206[e206.TypeParameter = 24] = `TypeParameter`, e206[e206.User = 25] = `User`, e206[e206.Issue = 26] = `Issue`, e206[e206.Tool = 27] = `Tool`, e206[e206.Snippet = 28] = `Snippet`;
})(Ri || (Ri = {}));
var zi;
(function(e206) {
  e206[e206.Deprecated = 1] = `Deprecated`;
})(zi || (zi = {}));
var Bi;
(function(e206) {
  e206[e206.Invoke = 0] = `Invoke`, e206[e206.TriggerCharacter = 1] = `TriggerCharacter`, e206[e206.TriggerForIncompleteCompletions = 2] = `TriggerForIncompleteCompletions`;
})(Bi || (Bi = {}));
var Vi;
(function(e206) {
  e206[e206.EXACT = 0] = `EXACT`, e206[e206.ABOVE = 1] = `ABOVE`, e206[e206.BELOW = 2] = `BELOW`;
})(Vi || (Vi = {}));
var Hi;
(function(e206) {
  e206[e206.NotSet = 0] = `NotSet`, e206[e206.ContentFlush = 1] = `ContentFlush`, e206[e206.RecoverFromMarkers = 2] = `RecoverFromMarkers`, e206[e206.Explicit = 3] = `Explicit`, e206[e206.Paste = 4] = `Paste`, e206[e206.Undo = 5] = `Undo`, e206[e206.Redo = 6] = `Redo`;
})(Hi || (Hi = {}));
var Ui;
(function(e206) {
  e206[e206.LF = 1] = `LF`, e206[e206.CRLF = 2] = `CRLF`;
})(Ui || (Ui = {}));
var Wi;
(function(e206) {
  e206[e206.Text = 0] = `Text`, e206[e206.Read = 1] = `Read`, e206[e206.Write = 2] = `Write`;
})(Wi || (Wi = {}));
var Gi;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.Keep = 1] = `Keep`, e206[e206.Brackets = 2] = `Brackets`, e206[e206.Advanced = 3] = `Advanced`, e206[e206.Full = 4] = `Full`;
})(Gi || (Gi = {}));
var Ki;
(function(e206) {
  e206[e206.acceptSuggestionOnCommitCharacter = 0] = `acceptSuggestionOnCommitCharacter`, e206[e206.acceptSuggestionOnEnter = 1] = `acceptSuggestionOnEnter`, e206[e206.accessibilitySupport = 2] = `accessibilitySupport`, e206[e206.accessibilityPageSize = 3] = `accessibilityPageSize`, e206[e206.allowOverflow = 4] = `allowOverflow`, e206[e206.allowVariableLineHeights = 5] = `allowVariableLineHeights`, e206[e206.allowVariableFonts = 6] = `allowVariableFonts`, e206[e206.allowVariableFontsInAccessibilityMode = 7] = `allowVariableFontsInAccessibilityMode`, e206[e206.ariaLabel = 8] = `ariaLabel`, e206[e206.ariaRequired = 9] = `ariaRequired`, e206[e206.autoClosingBrackets = 10] = `autoClosingBrackets`, e206[e206.autoClosingComments = 11] = `autoClosingComments`, e206[e206.screenReaderAnnounceInlineSuggestion = 12] = `screenReaderAnnounceInlineSuggestion`, e206[e206.autoClosingDelete = 13] = `autoClosingDelete`, e206[e206.autoClosingOvertype = 14] = `autoClosingOvertype`, e206[e206.autoClosingQuotes = 15] = `autoClosingQuotes`, e206[e206.autoIndent = 16] = `autoIndent`, e206[e206.autoIndentOnPaste = 17] = `autoIndentOnPaste`, e206[e206.autoIndentOnPasteWithinString = 18] = `autoIndentOnPasteWithinString`, e206[e206.automaticLayout = 19] = `automaticLayout`, e206[e206.autoSurround = 20] = `autoSurround`, e206[e206.bracketPairColorization = 21] = `bracketPairColorization`, e206[e206.guides = 22] = `guides`, e206[e206.codeLens = 23] = `codeLens`, e206[e206.codeLensFontFamily = 24] = `codeLensFontFamily`, e206[e206.codeLensFontSize = 25] = `codeLensFontSize`, e206[e206.colorDecorators = 26] = `colorDecorators`, e206[e206.colorDecoratorsLimit = 27] = `colorDecoratorsLimit`, e206[e206.columnSelection = 28] = `columnSelection`, e206[e206.comments = 29] = `comments`, e206[e206.contextmenu = 30] = `contextmenu`, e206[e206.copyWithSyntaxHighlighting = 31] = `copyWithSyntaxHighlighting`, e206[e206.cursorBlinking = 32] = `cursorBlinking`, e206[e206.cursorSmoothCaretAnimation = 33] = `cursorSmoothCaretAnimation`, e206[e206.cursorStyle = 34] = `cursorStyle`, e206[e206.cursorSurroundingLines = 35] = `cursorSurroundingLines`, e206[e206.cursorSurroundingLinesStyle = 36] = `cursorSurroundingLinesStyle`, e206[e206.cursorWidth = 37] = `cursorWidth`, e206[e206.cursorHeight = 38] = `cursorHeight`, e206[e206.disableLayerHinting = 39] = `disableLayerHinting`, e206[e206.disableMonospaceOptimizations = 40] = `disableMonospaceOptimizations`, e206[e206.domReadOnly = 41] = `domReadOnly`, e206[e206.dragAndDrop = 42] = `dragAndDrop`, e206[e206.dropIntoEditor = 43] = `dropIntoEditor`, e206[e206.editContext = 44] = `editContext`, e206[e206.emptySelectionClipboard = 45] = `emptySelectionClipboard`, e206[e206.experimentalGpuAcceleration = 46] = `experimentalGpuAcceleration`, e206[e206.experimentalWhitespaceRendering = 47] = `experimentalWhitespaceRendering`, e206[e206.extraEditorClassName = 48] = `extraEditorClassName`, e206[e206.fastScrollSensitivity = 49] = `fastScrollSensitivity`, e206[e206.find = 50] = `find`, e206[e206.fixedOverflowWidgets = 51] = `fixedOverflowWidgets`, e206[e206.folding = 52] = `folding`, e206[e206.foldingStrategy = 53] = `foldingStrategy`, e206[e206.foldingHighlight = 54] = `foldingHighlight`, e206[e206.foldingImportsByDefault = 55] = `foldingImportsByDefault`, e206[e206.foldingMaximumRegions = 56] = `foldingMaximumRegions`, e206[e206.unfoldOnClickAfterEndOfLine = 57] = `unfoldOnClickAfterEndOfLine`, e206[e206.fontFamily = 58] = `fontFamily`, e206[e206.fontInfo = 59] = `fontInfo`, e206[e206.fontLigatures = 60] = `fontLigatures`, e206[e206.fontSize = 61] = `fontSize`, e206[e206.fontWeight = 62] = `fontWeight`, e206[e206.fontVariations = 63] = `fontVariations`, e206[e206.formatOnPaste = 64] = `formatOnPaste`, e206[e206.formatOnType = 65] = `formatOnType`, e206[e206.glyphMargin = 66] = `glyphMargin`, e206[e206.gotoLocation = 67] = `gotoLocation`, e206[e206.hideCursorInOverviewRuler = 68] = `hideCursorInOverviewRuler`, e206[e206.hover = 69] = `hover`, e206[e206.inDiffEditor = 70] = `inDiffEditor`, e206[e206.inlineSuggest = 71] = `inlineSuggest`, e206[e206.letterSpacing = 72] = `letterSpacing`, e206[e206.lightbulb = 73] = `lightbulb`, e206[e206.lineDecorationsWidth = 74] = `lineDecorationsWidth`, e206[e206.lineHeight = 75] = `lineHeight`, e206[e206.lineNumbers = 76] = `lineNumbers`, e206[e206.lineNumbersMinChars = 77] = `lineNumbersMinChars`, e206[e206.linkedEditing = 78] = `linkedEditing`, e206[e206.links = 79] = `links`, e206[e206.matchBrackets = 80] = `matchBrackets`, e206[e206.minimap = 81] = `minimap`, e206[e206.mouseStyle = 82] = `mouseStyle`, e206[e206.mouseWheelScrollSensitivity = 83] = `mouseWheelScrollSensitivity`, e206[e206.mouseWheelZoom = 84] = `mouseWheelZoom`, e206[e206.multiCursorMergeOverlapping = 85] = `multiCursorMergeOverlapping`, e206[e206.multiCursorModifier = 86] = `multiCursorModifier`, e206[e206.mouseMiddleClickAction = 87] = `mouseMiddleClickAction`, e206[e206.multiCursorPaste = 88] = `multiCursorPaste`, e206[e206.multiCursorLimit = 89] = `multiCursorLimit`, e206[e206.occurrencesHighlight = 90] = `occurrencesHighlight`, e206[e206.occurrencesHighlightDelay = 91] = `occurrencesHighlightDelay`, e206[e206.overtypeCursorStyle = 92] = `overtypeCursorStyle`, e206[e206.overtypeOnPaste = 93] = `overtypeOnPaste`, e206[e206.overviewRulerBorder = 94] = `overviewRulerBorder`, e206[e206.overviewRulerLanes = 95] = `overviewRulerLanes`, e206[e206.padding = 96] = `padding`, e206[e206.pasteAs = 97] = `pasteAs`, e206[e206.parameterHints = 98] = `parameterHints`, e206[e206.peekWidgetDefaultFocus = 99] = `peekWidgetDefaultFocus`, e206[e206.placeholder = 100] = `placeholder`, e206[e206.definitionLinkOpensInPeek = 101] = `definitionLinkOpensInPeek`, e206[e206.quickSuggestions = 102] = `quickSuggestions`, e206[e206.quickSuggestionsDelay = 103] = `quickSuggestionsDelay`, e206[e206.readOnly = 104] = `readOnly`, e206[e206.readOnlyMessage = 105] = `readOnlyMessage`, e206[e206.renameOnType = 106] = `renameOnType`, e206[e206.renderRichScreenReaderContent = 107] = `renderRichScreenReaderContent`, e206[e206.renderControlCharacters = 108] = `renderControlCharacters`, e206[e206.renderFinalNewline = 109] = `renderFinalNewline`, e206[e206.renderLineHighlight = 110] = `renderLineHighlight`, e206[e206.renderLineHighlightOnlyWhenFocus = 111] = `renderLineHighlightOnlyWhenFocus`, e206[e206.renderValidationDecorations = 112] = `renderValidationDecorations`, e206[e206.renderWhitespace = 113] = `renderWhitespace`, e206[e206.revealHorizontalRightPadding = 114] = `revealHorizontalRightPadding`, e206[e206.roundedSelection = 115] = `roundedSelection`, e206[e206.rulers = 116] = `rulers`, e206[e206.scrollbar = 117] = `scrollbar`, e206[e206.scrollBeyondLastColumn = 118] = `scrollBeyondLastColumn`, e206[e206.scrollBeyondLastLine = 119] = `scrollBeyondLastLine`, e206[e206.scrollPredominantAxis = 120] = `scrollPredominantAxis`, e206[e206.selectionClipboard = 121] = `selectionClipboard`, e206[e206.selectionHighlight = 122] = `selectionHighlight`, e206[e206.selectionHighlightMaxLength = 123] = `selectionHighlightMaxLength`, e206[e206.selectionHighlightMultiline = 124] = `selectionHighlightMultiline`, e206[e206.selectOnLineNumbers = 125] = `selectOnLineNumbers`, e206[e206.showFoldingControls = 126] = `showFoldingControls`, e206[e206.showUnused = 127] = `showUnused`, e206[e206.snippetSuggestions = 128] = `snippetSuggestions`, e206[e206.smartSelect = 129] = `smartSelect`, e206[e206.smoothScrolling = 130] = `smoothScrolling`, e206[e206.stickyScroll = 131] = `stickyScroll`, e206[e206.stickyTabStops = 132] = `stickyTabStops`, e206[e206.stopRenderingLineAfter = 133] = `stopRenderingLineAfter`, e206[e206.suggest = 134] = `suggest`, e206[e206.suggestFontSize = 135] = `suggestFontSize`, e206[e206.suggestLineHeight = 136] = `suggestLineHeight`, e206[e206.suggestOnTriggerCharacters = 137] = `suggestOnTriggerCharacters`, e206[e206.suggestSelection = 138] = `suggestSelection`, e206[e206.tabCompletion = 139] = `tabCompletion`, e206[e206.tabIndex = 140] = `tabIndex`, e206[e206.trimWhitespaceOnDelete = 141] = `trimWhitespaceOnDelete`, e206[e206.unicodeHighlighting = 142] = `unicodeHighlighting`, e206[e206.unusualLineTerminators = 143] = `unusualLineTerminators`, e206[e206.useShadowDOM = 144] = `useShadowDOM`, e206[e206.useTabStops = 145] = `useTabStops`, e206[e206.wordBreak = 146] = `wordBreak`, e206[e206.wordSegmenterLocales = 147] = `wordSegmenterLocales`, e206[e206.wordSeparators = 148] = `wordSeparators`, e206[e206.wordWrap = 149] = `wordWrap`, e206[e206.wordWrapBreakAfterCharacters = 150] = `wordWrapBreakAfterCharacters`, e206[e206.wordWrapBreakBeforeCharacters = 151] = `wordWrapBreakBeforeCharacters`, e206[e206.wordWrapColumn = 152] = `wordWrapColumn`, e206[e206.wordWrapOverride1 = 153] = `wordWrapOverride1`, e206[e206.wordWrapOverride2 = 154] = `wordWrapOverride2`, e206[e206.wrappingIndent = 155] = `wrappingIndent`, e206[e206.wrappingStrategy = 156] = `wrappingStrategy`, e206[e206.showDeprecated = 157] = `showDeprecated`, e206[e206.inertialScroll = 158] = `inertialScroll`, e206[e206.inlayHints = 159] = `inlayHints`, e206[e206.wrapOnEscapedLineFeeds = 160] = `wrapOnEscapedLineFeeds`, e206[e206.effectiveCursorStyle = 161] = `effectiveCursorStyle`, e206[e206.editorClassName = 162] = `editorClassName`, e206[e206.pixelRatio = 163] = `pixelRatio`, e206[e206.tabFocusMode = 164] = `tabFocusMode`, e206[e206.layoutInfo = 165] = `layoutInfo`, e206[e206.wrappingInfo = 166] = `wrappingInfo`, e206[e206.defaultColorDecorators = 167] = `defaultColorDecorators`, e206[e206.colorDecoratorsActivatedOn = 168] = `colorDecoratorsActivatedOn`, e206[e206.inlineCompletionsAccessibilityVerbose = 169] = `inlineCompletionsAccessibilityVerbose`, e206[e206.effectiveEditContext = 170] = `effectiveEditContext`, e206[e206.scrollOnMiddleClick = 171] = `scrollOnMiddleClick`, e206[e206.effectiveAllowVariableFonts = 172] = `effectiveAllowVariableFonts`;
})(Ki || (Ki = {}));
var qi;
(function(e206) {
  e206[e206.TextDefined = 0] = `TextDefined`, e206[e206.LF = 1] = `LF`, e206[e206.CRLF = 2] = `CRLF`;
})(qi || (qi = {}));
var Ji;
(function(e206) {
  e206[e206.LF = 0] = `LF`, e206[e206.CRLF = 1] = `CRLF`;
})(Ji || (Ji = {}));
var Yi;
(function(e206) {
  e206[e206.Left = 1] = `Left`, e206[e206.Center = 2] = `Center`, e206[e206.Right = 3] = `Right`;
})(Yi || (Yi = {}));
var Xi;
(function(e206) {
  e206[e206.Increase = 0] = `Increase`, e206[e206.Decrease = 1] = `Decrease`;
})(Xi || (Xi = {}));
var Zi;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.Indent = 1] = `Indent`, e206[e206.IndentOutdent = 2] = `IndentOutdent`, e206[e206.Outdent = 3] = `Outdent`;
})(Zi || (Zi = {}));
var Qi;
(function(e206) {
  e206[e206.Both = 0] = `Both`, e206[e206.Right = 1] = `Right`, e206[e206.Left = 2] = `Left`, e206[e206.None = 3] = `None`;
})(Qi || (Qi = {}));
var $i;
(function(e206) {
  e206[e206.Type = 1] = `Type`, e206[e206.Parameter = 2] = `Parameter`;
})($i || ($i = {}));
var ea;
(function(e206) {
  e206[e206.Accepted = 0] = `Accepted`, e206[e206.Rejected = 1] = `Rejected`, e206[e206.Ignored = 2] = `Ignored`;
})(ea || (ea = {}));
var ta;
(function(e206) {
  e206[e206.Code = 1] = `Code`, e206[e206.Label = 2] = `Label`;
})(ta || (ta = {}));
var na;
(function(e206) {
  e206[e206.Automatic = 0] = `Automatic`, e206[e206.Explicit = 1] = `Explicit`;
})(na || (na = {}));
var ra;
(function(e206) {
  e206[e206.DependsOnKbLayout = -1] = `DependsOnKbLayout`, e206[e206.Unknown = 0] = `Unknown`, e206[e206.Backspace = 1] = `Backspace`, e206[e206.Tab = 2] = `Tab`, e206[e206.Enter = 3] = `Enter`, e206[e206.Shift = 4] = `Shift`, e206[e206.Ctrl = 5] = `Ctrl`, e206[e206.Alt = 6] = `Alt`, e206[e206.PauseBreak = 7] = `PauseBreak`, e206[e206.CapsLock = 8] = `CapsLock`, e206[e206.Escape = 9] = `Escape`, e206[e206.Space = 10] = `Space`, e206[e206.PageUp = 11] = `PageUp`, e206[e206.PageDown = 12] = `PageDown`, e206[e206.End = 13] = `End`, e206[e206.Home = 14] = `Home`, e206[e206.LeftArrow = 15] = `LeftArrow`, e206[e206.UpArrow = 16] = `UpArrow`, e206[e206.RightArrow = 17] = `RightArrow`, e206[e206.DownArrow = 18] = `DownArrow`, e206[e206.Insert = 19] = `Insert`, e206[e206.Delete = 20] = `Delete`, e206[e206.Digit0 = 21] = `Digit0`, e206[e206.Digit1 = 22] = `Digit1`, e206[e206.Digit2 = 23] = `Digit2`, e206[e206.Digit3 = 24] = `Digit3`, e206[e206.Digit4 = 25] = `Digit4`, e206[e206.Digit5 = 26] = `Digit5`, e206[e206.Digit6 = 27] = `Digit6`, e206[e206.Digit7 = 28] = `Digit7`, e206[e206.Digit8 = 29] = `Digit8`, e206[e206.Digit9 = 30] = `Digit9`, e206[e206.KeyA = 31] = `KeyA`, e206[e206.KeyB = 32] = `KeyB`, e206[e206.KeyC = 33] = `KeyC`, e206[e206.KeyD = 34] = `KeyD`, e206[e206.KeyE = 35] = `KeyE`, e206[e206.KeyF = 36] = `KeyF`, e206[e206.KeyG = 37] = `KeyG`, e206[e206.KeyH = 38] = `KeyH`, e206[e206.KeyI = 39] = `KeyI`, e206[e206.KeyJ = 40] = `KeyJ`, e206[e206.KeyK = 41] = `KeyK`, e206[e206.KeyL = 42] = `KeyL`, e206[e206.KeyM = 43] = `KeyM`, e206[e206.KeyN = 44] = `KeyN`, e206[e206.KeyO = 45] = `KeyO`, e206[e206.KeyP = 46] = `KeyP`, e206[e206.KeyQ = 47] = `KeyQ`, e206[e206.KeyR = 48] = `KeyR`, e206[e206.KeyS = 49] = `KeyS`, e206[e206.KeyT = 50] = `KeyT`, e206[e206.KeyU = 51] = `KeyU`, e206[e206.KeyV = 52] = `KeyV`, e206[e206.KeyW = 53] = `KeyW`, e206[e206.KeyX = 54] = `KeyX`, e206[e206.KeyY = 55] = `KeyY`, e206[e206.KeyZ = 56] = `KeyZ`, e206[e206.Meta = 57] = `Meta`, e206[e206.ContextMenu = 58] = `ContextMenu`, e206[e206.F1 = 59] = `F1`, e206[e206.F2 = 60] = `F2`, e206[e206.F3 = 61] = `F3`, e206[e206.F4 = 62] = `F4`, e206[e206.F5 = 63] = `F5`, e206[e206.F6 = 64] = `F6`, e206[e206.F7 = 65] = `F7`, e206[e206.F8 = 66] = `F8`, e206[e206.F9 = 67] = `F9`, e206[e206.F10 = 68] = `F10`, e206[e206.F11 = 69] = `F11`, e206[e206.F12 = 70] = `F12`, e206[e206.F13 = 71] = `F13`, e206[e206.F14 = 72] = `F14`, e206[e206.F15 = 73] = `F15`, e206[e206.F16 = 74] = `F16`, e206[e206.F17 = 75] = `F17`, e206[e206.F18 = 76] = `F18`, e206[e206.F19 = 77] = `F19`, e206[e206.F20 = 78] = `F20`, e206[e206.F21 = 79] = `F21`, e206[e206.F22 = 80] = `F22`, e206[e206.F23 = 81] = `F23`, e206[e206.F24 = 82] = `F24`, e206[e206.NumLock = 83] = `NumLock`, e206[e206.ScrollLock = 84] = `ScrollLock`, e206[e206.Semicolon = 85] = `Semicolon`, e206[e206.Equal = 86] = `Equal`, e206[e206.Comma = 87] = `Comma`, e206[e206.Minus = 88] = `Minus`, e206[e206.Period = 89] = `Period`, e206[e206.Slash = 90] = `Slash`, e206[e206.Backquote = 91] = `Backquote`, e206[e206.BracketLeft = 92] = `BracketLeft`, e206[e206.Backslash = 93] = `Backslash`, e206[e206.BracketRight = 94] = `BracketRight`, e206[e206.Quote = 95] = `Quote`, e206[e206.OEM_8 = 96] = `OEM_8`, e206[e206.IntlBackslash = 97] = `IntlBackslash`, e206[e206.Numpad0 = 98] = `Numpad0`, e206[e206.Numpad1 = 99] = `Numpad1`, e206[e206.Numpad2 = 100] = `Numpad2`, e206[e206.Numpad3 = 101] = `Numpad3`, e206[e206.Numpad4 = 102] = `Numpad4`, e206[e206.Numpad5 = 103] = `Numpad5`, e206[e206.Numpad6 = 104] = `Numpad6`, e206[e206.Numpad7 = 105] = `Numpad7`, e206[e206.Numpad8 = 106] = `Numpad8`, e206[e206.Numpad9 = 107] = `Numpad9`, e206[e206.NumpadMultiply = 108] = `NumpadMultiply`, e206[e206.NumpadAdd = 109] = `NumpadAdd`, e206[e206.NUMPAD_SEPARATOR = 110] = `NUMPAD_SEPARATOR`, e206[e206.NumpadSubtract = 111] = `NumpadSubtract`, e206[e206.NumpadDecimal = 112] = `NumpadDecimal`, e206[e206.NumpadDivide = 113] = `NumpadDivide`, e206[e206.KEY_IN_COMPOSITION = 114] = `KEY_IN_COMPOSITION`, e206[e206.ABNT_C1 = 115] = `ABNT_C1`, e206[e206.ABNT_C2 = 116] = `ABNT_C2`, e206[e206.AudioVolumeMute = 117] = `AudioVolumeMute`, e206[e206.AudioVolumeUp = 118] = `AudioVolumeUp`, e206[e206.AudioVolumeDown = 119] = `AudioVolumeDown`, e206[e206.BrowserSearch = 120] = `BrowserSearch`, e206[e206.BrowserHome = 121] = `BrowserHome`, e206[e206.BrowserBack = 122] = `BrowserBack`, e206[e206.BrowserForward = 123] = `BrowserForward`, e206[e206.MediaTrackNext = 124] = `MediaTrackNext`, e206[e206.MediaTrackPrevious = 125] = `MediaTrackPrevious`, e206[e206.MediaStop = 126] = `MediaStop`, e206[e206.MediaPlayPause = 127] = `MediaPlayPause`, e206[e206.LaunchMediaPlayer = 128] = `LaunchMediaPlayer`, e206[e206.LaunchMail = 129] = `LaunchMail`, e206[e206.LaunchApp2 = 130] = `LaunchApp2`, e206[e206.Clear = 131] = `Clear`, e206[e206.MAX_VALUE = 132] = `MAX_VALUE`;
})(ra || (ra = {}));
var ia;
(function(e206) {
  e206[e206.Hint = 1] = `Hint`, e206[e206.Info = 2] = `Info`, e206[e206.Warning = 4] = `Warning`, e206[e206.Error = 8] = `Error`;
})(ia || (ia = {}));
var aa;
(function(e206) {
  e206[e206.Unnecessary = 1] = `Unnecessary`, e206[e206.Deprecated = 2] = `Deprecated`;
})(aa || (aa = {}));
var oa;
(function(e206) {
  e206[e206.Inline = 1] = `Inline`, e206[e206.Gutter = 2] = `Gutter`;
})(oa || (oa = {}));
var sa;
(function(e206) {
  e206[e206.Normal = 1] = `Normal`, e206[e206.Underlined = 2] = `Underlined`;
})(sa || (sa = {}));
var ca;
(function(e206) {
  e206[e206.UNKNOWN = 0] = `UNKNOWN`, e206[e206.TEXTAREA = 1] = `TEXTAREA`, e206[e206.GUTTER_GLYPH_MARGIN = 2] = `GUTTER_GLYPH_MARGIN`, e206[e206.GUTTER_LINE_NUMBERS = 3] = `GUTTER_LINE_NUMBERS`, e206[e206.GUTTER_LINE_DECORATIONS = 4] = `GUTTER_LINE_DECORATIONS`, e206[e206.GUTTER_VIEW_ZONE = 5] = `GUTTER_VIEW_ZONE`, e206[e206.CONTENT_TEXT = 6] = `CONTENT_TEXT`, e206[e206.CONTENT_EMPTY = 7] = `CONTENT_EMPTY`, e206[e206.CONTENT_VIEW_ZONE = 8] = `CONTENT_VIEW_ZONE`, e206[e206.CONTENT_WIDGET = 9] = `CONTENT_WIDGET`, e206[e206.OVERVIEW_RULER = 10] = `OVERVIEW_RULER`, e206[e206.SCROLLBAR = 11] = `SCROLLBAR`, e206[e206.OVERLAY_WIDGET = 12] = `OVERLAY_WIDGET`, e206[e206.OUTSIDE_EDITOR = 13] = `OUTSIDE_EDITOR`;
})(ca || (ca = {}));
var la;
(function(e206) {
  e206[e206.AIGenerated = 1] = `AIGenerated`;
})(la || (la = {}));
var ua;
(function(e206) {
  e206[e206.Invoke = 0] = `Invoke`, e206[e206.Automatic = 1] = `Automatic`;
})(ua || (ua = {}));
var da;
(function(e206) {
  e206[e206.TOP_RIGHT_CORNER = 0] = `TOP_RIGHT_CORNER`, e206[e206.BOTTOM_RIGHT_CORNER = 1] = `BOTTOM_RIGHT_CORNER`, e206[e206.TOP_CENTER = 2] = `TOP_CENTER`;
})(da || (da = {}));
var fa;
(function(e206) {
  e206[e206.Left = 1] = `Left`, e206[e206.Center = 2] = `Center`, e206[e206.Right = 4] = `Right`, e206[e206.Full = 7] = `Full`;
})(fa || (fa = {}));
var pa;
(function(e206) {
  e206[e206.Word = 0] = `Word`, e206[e206.Line = 1] = `Line`, e206[e206.Suggest = 2] = `Suggest`;
})(pa || (pa = {}));
var ma;
(function(e206) {
  e206[e206.Left = 0] = `Left`, e206[e206.Right = 1] = `Right`, e206[e206.None = 2] = `None`, e206[e206.LeftOfInjectedText = 3] = `LeftOfInjectedText`, e206[e206.RightOfInjectedText = 4] = `RightOfInjectedText`;
})(ma || (ma = {}));
var ha;
(function(e206) {
  e206[e206.Off = 0] = `Off`, e206[e206.On = 1] = `On`, e206[e206.Relative = 2] = `Relative`, e206[e206.Interval = 3] = `Interval`, e206[e206.Custom = 4] = `Custom`;
})(ha || (ha = {}));
var ga;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.Text = 1] = `Text`, e206[e206.Blocks = 2] = `Blocks`;
})(ga || (ga = {}));
var _a2;
(function(e206) {
  e206[e206.Smooth = 0] = `Smooth`, e206[e206.Immediate = 1] = `Immediate`;
})(_a2 || (_a2 = {}));
var va;
(function(e206) {
  e206[e206.Auto = 1] = `Auto`, e206[e206.Hidden = 2] = `Hidden`, e206[e206.Visible = 3] = `Visible`;
})(va || (va = {}));
var ya;
(function(e206) {
  e206[e206.LTR = 0] = `LTR`, e206[e206.RTL = 1] = `RTL`;
})(ya || (ya = {}));
var ba;
(function(e206) {
  e206.Off = `off`, e206.OnCode = `onCode`, e206.On = `on`;
})(ba || (ba = {}));
var xa;
(function(e206) {
  e206[e206.Invoke = 1] = `Invoke`, e206[e206.TriggerCharacter = 2] = `TriggerCharacter`, e206[e206.ContentChange = 3] = `ContentChange`;
})(xa || (xa = {}));
var Sa;
(function(e206) {
  e206[e206.File = 0] = `File`, e206[e206.Module = 1] = `Module`, e206[e206.Namespace = 2] = `Namespace`, e206[e206.Package = 3] = `Package`, e206[e206.Class = 4] = `Class`, e206[e206.Method = 5] = `Method`, e206[e206.Property = 6] = `Property`, e206[e206.Field = 7] = `Field`, e206[e206.Constructor = 8] = `Constructor`, e206[e206.Enum = 9] = `Enum`, e206[e206.Interface = 10] = `Interface`, e206[e206.Function = 11] = `Function`, e206[e206.Variable = 12] = `Variable`, e206[e206.Constant = 13] = `Constant`, e206[e206.String = 14] = `String`, e206[e206.Number = 15] = `Number`, e206[e206.Boolean = 16] = `Boolean`, e206[e206.Array = 17] = `Array`, e206[e206.Object = 18] = `Object`, e206[e206.Key = 19] = `Key`, e206[e206.Null = 20] = `Null`, e206[e206.EnumMember = 21] = `EnumMember`, e206[e206.Struct = 22] = `Struct`, e206[e206.Event = 23] = `Event`, e206[e206.Operator = 24] = `Operator`, e206[e206.TypeParameter = 25] = `TypeParameter`;
})(Sa || (Sa = {}));
var Ca;
(function(e206) {
  e206[e206.Deprecated = 1] = `Deprecated`;
})(Ca || (Ca = {}));
var wa;
(function(e206) {
  e206[e206.LTR = 0] = `LTR`, e206[e206.RTL = 1] = `RTL`;
})(wa || (wa = {}));
var Ta;
(function(e206) {
  e206[e206.Hidden = 0] = `Hidden`, e206[e206.Blink = 1] = `Blink`, e206[e206.Smooth = 2] = `Smooth`, e206[e206.Phase = 3] = `Phase`, e206[e206.Expand = 4] = `Expand`, e206[e206.Solid = 5] = `Solid`;
})(Ta || (Ta = {}));
var Ea;
(function(e206) {
  e206[e206.Line = 1] = `Line`, e206[e206.Block = 2] = `Block`, e206[e206.Underline = 3] = `Underline`, e206[e206.LineThin = 4] = `LineThin`, e206[e206.BlockOutline = 5] = `BlockOutline`, e206[e206.UnderlineThin = 6] = `UnderlineThin`;
})(Ea || (Ea = {}));
var Da;
(function(e206) {
  e206[e206.AlwaysGrowsWhenTypingAtEdges = 0] = `AlwaysGrowsWhenTypingAtEdges`, e206[e206.NeverGrowsWhenTypingAtEdges = 1] = `NeverGrowsWhenTypingAtEdges`, e206[e206.GrowsOnlyWhenTypingBefore = 2] = `GrowsOnlyWhenTypingBefore`, e206[e206.GrowsOnlyWhenTypingAfter = 3] = `GrowsOnlyWhenTypingAfter`;
})(Da || (Da = {}));
var Oa;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.Same = 1] = `Same`, e206[e206.Indent = 2] = `Indent`, e206[e206.DeepIndent = 3] = `DeepIndent`;
})(Oa || (Oa = {}));
var gte = (_k2 = class {
  static chord(e206, t10) {
    return Sr(e206, t10);
  }
}, _k2.CtrlCmd = 2048, _k2.Shift = 1024, _k2.Alt = 512, _k2.WinCtrl = 256, _k2);
function ka() {
  return { editor: void 0, languages: void 0, CancellationTokenSource: pr, Emitter: k, KeyCode: ra, KeyMod: gte, Position: j, Range: M, Selection: N, SelectionDirection: ya, MarkerSeverity: ia, MarkerTag: aa, Uri: $r, Token: di };
}
function _te(e206, t10) {
  let n10 = e206;
  typeof n10.vscodeWindowId != `number` && Object.defineProperty(n10, `vscodeWindowId`, { get: () => t10 });
}
var Aa = window;
function ja(e206) {
  return e206;
}
var Ma = class {
  constructor(e206, t10) {
    this.lastCache = void 0, this.lastArgKey = void 0, typeof e206 == `function` ? (this._fn = e206, this._computeKey = ja) : (this._fn = t10, this._computeKey = e206.getCacheKey);
  }
  get(e206) {
    let t10 = this._computeKey(e206);
    return this.lastArgKey !== t10 && (this.lastArgKey = t10, this.lastCache = this._fn(e206)), this.lastCache;
  }
}, Na = class {
  get cachedValues() {
    return this._map;
  }
  constructor(e206, t10) {
    this._map = /* @__PURE__ */ new Map(), this._map2 = /* @__PURE__ */ new Map(), typeof e206 == `function` ? (this._fn = e206, this._computeKey = ja) : (this._fn = t10, this._computeKey = e206.getCacheKey);
  }
  get(e206) {
    let t10 = this._computeKey(e206);
    if (this._map2.has(t10)) return this._map2.get(t10);
    let n10 = this._fn(e206);
    return this._map.set(e206, n10), this._map2.set(t10, n10), n10;
  }
}, Pa;
(function(e206) {
  e206[e206.Uninitialized = 0] = `Uninitialized`, e206[e206.Running = 1] = `Running`, e206[e206.Completed = 2] = `Completed`;
})(Pa || (Pa = {}));
var Fa = class {
  constructor(e206) {
    this.executor = e206, this._state = Pa.Uninitialized;
  }
  get value() {
    if (this._state === Pa.Uninitialized) {
      this._state = Pa.Running;
      try {
        this._value = this.executor();
      } catch (e206) {
        this._error = e206;
      } finally {
        this._state = Pa.Completed;
      }
    } else if (this._state === Pa.Running) throw Error(`Cannot read the value of a lazy that is being initialized`);
    if (this._error) throw this._error;
    return this._value;
  }
  get rawValue() {
    return this._value;
  }
};
function Ia(e206) {
  return !e206 || typeof e206 != `string` ? true : e206.trim().length === 0;
}
var vte = /{(\d+)}/g;
function La(e206, ...t10) {
  return t10.length === 0 ? e206 : e206.replace(vte, function(e207, n10) {
    let r10 = parseInt(n10, 10);
    return isNaN(r10) || r10 < 0 || r10 >= t10.length ? e207 : t10[r10];
  });
}
function yte(e206) {
  return e206.replace(/[<>"'&]/g, (e207) => {
    switch (e207) {
      case `<`:
        return `&lt;`;
      case `>`:
        return `&gt;`;
      case `"`:
        return `&quot;`;
      case `'`:
        return `&apos;`;
      case `&`:
        return `&amp;`;
    }
    return e207;
  });
}
function Ra(e206) {
  return e206.replace(/[<>&]/g, function(e207) {
    switch (e207) {
      case `<`:
        return `&lt;`;
      case `>`:
        return `&gt;`;
      case `&`:
        return `&amp;`;
      default:
        return e207;
    }
  });
}
function za(e206) {
  return e206.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, `\\$&`);
}
function bte(e206, t10 = ` `) {
  return Va(Ba(e206, t10), t10);
}
function Ba(e206, t10) {
  if (!e206 || !t10) return e206;
  let n10 = t10.length;
  if (n10 === 0 || e206.length === 0) return e206;
  let r10 = 0;
  for (; e206.indexOf(t10, r10) === r10; ) r10 += n10;
  return e206.substring(r10);
}
function Va(e206, t10) {
  if (!e206 || !t10) return e206;
  let n10 = t10.length, r10 = e206.length;
  if (n10 === 0 || r10 === 0) return e206;
  let i10 = r10, a10 = -1;
  for (; a10 = e206.lastIndexOf(t10, i10 - 1), !(a10 === -1 || a10 + n10 !== i10); ) {
    if (a10 === 0) return ``;
    i10 = a10;
  }
  return e206.substring(0, i10);
}
function xte(e206) {
  return e206.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, `\\$&`).replace(/[\*]/g, `.*`);
}
function Ha(e206, t10, n10 = {}) {
  if (!e206) throw Error(`Cannot create regex from empty string`);
  t10 || (e206 = za(e206)), n10.wholeWord && (/\B/.test(e206.charAt(0)) || (e206 = `\\b` + e206), /\B/.test(e206.charAt(e206.length - 1)) || (e206 += `\\b`));
  let r10 = ``;
  return n10.global && (r10 += `g`), n10.matchCase || (r10 += `i`), n10.multiline && (r10 += `m`), n10.unicode && (r10 += `u`), new RegExp(e206, r10);
}
function Ua(e206) {
  return e206.source === `^` || e206.source === `^$` || e206.source === `$` || e206.source === `^\\s*$` ? false : !!(e206.exec(``) && e206.lastIndex === 0);
}
function Wa(e206) {
  return e206.split(/\r\n|\r|\n/);
}
function Ga(e206) {
  for (let t10 = 0, n10 = e206.length; t10 < n10; t10++) {
    let n11 = e206.charCodeAt(t10);
    if (n11 !== 32 && n11 !== 9) return t10;
  }
  return -1;
}
function Ka(e206, t10 = 0, n10 = e206.length) {
  for (let r10 = t10; r10 < n10; r10++) {
    let n11 = e206.charCodeAt(r10);
    if (n11 !== 32 && n11 !== 9) return e206.substring(t10, r10);
  }
  return e206.substring(t10, n10);
}
function qa(e206, t10 = e206.length - 1) {
  for (let n10 = t10; n10 >= 0; n10--) {
    let t11 = e206.charCodeAt(n10);
    if (t11 !== 32 && t11 !== 9) return n10;
  }
  return -1;
}
function Ja(e206, t10) {
  return e206 < t10 ? -1 : +(e206 > t10);
}
function Ya(e206, t10, n10 = 0, r10 = e206.length, i10 = 0, a10 = t10.length) {
  for (; n10 < r10 && i10 < a10; n10++, i10++) {
    let r11 = e206.charCodeAt(n10), a11 = t10.charCodeAt(i10);
    if (r11 < a11) return -1;
    if (r11 > a11) return 1;
  }
  let o10 = r10 - n10, s10 = a10 - i10;
  return o10 < s10 ? -1 : +(o10 > s10);
}
function Xa(e206, t10) {
  return Za(e206, t10, 0, e206.length, 0, t10.length);
}
function Za(e206, t10, n10 = 0, r10 = e206.length, i10 = 0, a10 = t10.length) {
  for (; n10 < r10 && i10 < a10; n10++, i10++) {
    let o11 = e206.charCodeAt(n10), s11 = t10.charCodeAt(i10);
    if (o11 === s11) continue;
    if (o11 >= 128 || s11 >= 128) return Ya(e206.toLowerCase(), t10.toLowerCase(), n10, r10, i10, a10);
    $a(o11) && (o11 -= 32), $a(s11) && (s11 -= 32);
    let c10 = o11 - s11;
    if (c10 !== 0) return c10;
  }
  let o10 = r10 - n10, s10 = a10 - i10;
  return o10 < s10 ? -1 : +(o10 > s10);
}
function Qa(e206) {
  return e206 >= 48 && e206 <= 57;
}
function $a(e206) {
  return e206 >= 97 && e206 <= 122;
}
function eo(e206) {
  return e206 >= 65 && e206 <= 90;
}
function to(e206, t10) {
  return e206.length === t10.length && Za(e206, t10) === 0;
}
function no(e206, t10) {
  let n10 = t10.length;
  return n10 <= e206.length && Za(e206, t10, 0, n10) === 0;
}
function Ste(e206, t10) {
  let n10 = e206.length, r10 = n10 - t10.length;
  return r10 >= 0 && Za(e206, t10, r10, n10) === 0;
}
function ro(e206, t10) {
  let n10 = Math.min(e206.length, t10.length), r10;
  for (r10 = 0; r10 < n10; r10++) if (e206.charCodeAt(r10) !== t10.charCodeAt(r10)) return r10;
  return n10;
}
function io(e206, t10) {
  let n10 = Math.min(e206.length, t10.length), r10, i10 = e206.length - 1, a10 = t10.length - 1;
  for (r10 = 0; r10 < n10; r10++) if (e206.charCodeAt(i10 - r10) !== t10.charCodeAt(a10 - r10)) return r10;
  return n10;
}
function ao(e206) {
  return 55296 <= e206 && e206 <= 56319;
}
function oo(e206) {
  return 56320 <= e206 && e206 <= 57343;
}
function so(e206, t10) {
  return (e206 - 55296 << 10) + (t10 - 56320) + 65536;
}
function co(e206, t10, n10) {
  let r10 = e206.charCodeAt(n10);
  if (ao(r10) && n10 + 1 < t10) {
    let t11 = e206.charCodeAt(n10 + 1);
    if (oo(t11)) return so(r10, t11);
  }
  return r10;
}
function Cte(e206, t10) {
  let n10 = e206.charCodeAt(t10 - 1);
  if (oo(n10) && t10 > 1) {
    let r10 = e206.charCodeAt(t10 - 2);
    if (ao(r10)) return so(r10, n10);
  }
  return n10;
}
var lo = class {
  get offset() {
    return this._offset;
  }
  constructor(e206, t10 = 0) {
    this._str = e206, this._len = e206.length, this._offset = t10;
  }
  setOffset(e206) {
    this._offset = e206;
  }
  prevCodePoint() {
    let e206 = Cte(this._str, this._offset);
    return this._offset -= e206 >= 65536 ? 2 : 1, e206;
  }
  nextCodePoint() {
    let e206 = co(this._str, this._len, this._offset);
    return this._offset += e206 >= 65536 ? 2 : 1, e206;
  }
  eol() {
    return this._offset >= this._len;
  }
}, uo = class {
  get offset() {
    return this._iterator.offset;
  }
  constructor(e206, t10 = 0) {
    this._iterator = new lo(e206, t10);
  }
  nextGraphemeLength() {
    let e206 = wo.getInstance(), t10 = this._iterator, n10 = t10.offset, r10 = e206.getGraphemeBreakType(t10.nextCodePoint());
    for (; !t10.eol(); ) {
      let n11 = t10.offset, i10 = e206.getGraphemeBreakType(t10.nextCodePoint());
      if (Co(r10, i10)) {
        t10.setOffset(n11);
        break;
      }
      r10 = i10;
    }
    return t10.offset - n10;
  }
  prevGraphemeLength() {
    let e206 = wo.getInstance(), t10 = this._iterator, n10 = t10.offset, r10 = e206.getGraphemeBreakType(t10.prevCodePoint());
    for (; t10.offset > 0; ) {
      let n11 = t10.offset, i10 = e206.getGraphemeBreakType(t10.prevCodePoint());
      if (Co(i10, r10)) {
        t10.setOffset(n11);
        break;
      }
      r10 = i10;
    }
    return n10 - t10.offset;
  }
  eol() {
    return this._iterator.eol();
  }
};
function fo(e206, t10) {
  return new uo(e206, t10).nextGraphemeLength();
}
function po(e206, t10) {
  return new uo(e206, t10).prevGraphemeLength();
}
function wte(e206, t10) {
  t10 > 0 && oo(e206.charCodeAt(t10)) && t10--;
  let n10 = t10 + fo(e206, t10);
  return [n10 - po(e206, n10), n10];
}
var mo = void 0;
function Tte() {
  return /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;
}
function ho(e206) {
  return mo || (mo = Tte()), mo.test(e206);
}
var Ete = /^[\t\n\r\x20-\x7E]*$/;
function go(e206) {
  return Ete.test(e206);
}
var _o = /[\u2028\u2029]/;
function vo(e206) {
  return _o.test(e206);
}
function yo(e206) {
  return e206 >= 11904 && e206 <= 55215 || e206 >= 63744 && e206 <= 64255 || e206 >= 65281 && e206 <= 65374;
}
function bo(e206) {
  return e206 >= 127462 && e206 <= 127487 || e206 === 8986 || e206 === 8987 || e206 === 9200 || e206 === 9203 || e206 >= 9728 && e206 <= 10175 || e206 === 11088 || e206 === 11093 || e206 >= 127744 && e206 <= 128591 || e206 >= 128640 && e206 <= 128764 || e206 >= 128992 && e206 <= 129008 || e206 >= 129280 && e206 <= 129535 || e206 >= 129648 && e206 <= 129782;
}
function xo(e206) {
  return !!(e206 && e206.length > 0 && e206.charCodeAt(0) === 65279);
}
function Dte(e206, t10 = false) {
  return e206 ? (t10 && (e206 = e206.replace(/\\./g, ``)), e206.toLowerCase() !== e206) : false;
}
function So(e206) {
  return e206 %= 52, e206 < 26 ? String.fromCharCode(97 + e206) : String.fromCharCode(65 + e206 - 26);
}
function Co(e206, t10) {
  return e206 === 0 ? t10 !== 5 && t10 !== 7 : e206 === 2 && t10 === 3 ? false : e206 === 4 || e206 === 2 || e206 === 3 || t10 === 4 || t10 === 2 || t10 === 3 ? true : !(e206 === 8 && (t10 === 8 || t10 === 9 || t10 === 11 || t10 === 12) || (e206 === 11 || e206 === 9) && (t10 === 9 || t10 === 10) || (e206 === 12 || e206 === 10) && t10 === 10 || t10 === 5 || t10 === 13 || t10 === 7 || e206 === 1 || e206 === 13 && t10 === 14 || e206 === 6 && t10 === 6);
}
var wo = (_l = class {
  static getInstance() {
    return _l._INSTANCE || (_l._INSTANCE = new _l()), _l._INSTANCE;
  }
  constructor() {
    this._data = Ote();
  }
  getGraphemeBreakType(e206) {
    if (e206 < 32) return e206 === 10 ? 3 : e206 === 13 ? 2 : 4;
    if (e206 < 127) return 0;
    let t10 = this._data, n10 = t10.length / 3, r10 = 1;
    for (; r10 <= n10; ) if (e206 < t10[3 * r10]) r10 = 2 * r10;
    else if (e206 > t10[3 * r10 + 1]) r10 = 2 * r10 + 1;
    else return t10[3 * r10 + 2];
    return 0;
  }
}, _l._INSTANCE = null, _l);
function Ote() {
  return JSON.parse(`[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]`);
}
function kte(e206, t10) {
  if (e206 === 0) return 0;
  let n10 = Ate(e206, t10);
  if (n10 !== void 0) return n10;
  let r10 = new lo(t10, e206);
  return r10.prevCodePoint(), r10.offset;
}
function Ate(e206, t10) {
  let n10 = new lo(t10, e206), r10 = n10.prevCodePoint();
  for (; To(r10) || r10 === 65039 || r10 === 8419; ) {
    if (n10.offset === 0) return;
    r10 = n10.prevCodePoint();
  }
  if (!bo(r10)) return;
  let i10 = n10.offset;
  return i10 > 0 && n10.prevCodePoint() === 8205 && (i10 = n10.offset), i10;
}
function To(e206) {
  return 127995 <= e206 && e206 <= 127999;
}
var Eo = (_m = class {
  static getInstance(t10) {
    return _m.cache.get(Array.from(t10));
  }
  static getLocales() {
    return _m._locales.value;
  }
  constructor(e206) {
    this.confusableDictionary = e206;
  }
  isAmbiguous(e206) {
    return this.confusableDictionary.has(e206);
  }
  getPrimaryConfusable(e206) {
    return this.confusableDictionary.get(e206);
  }
  getConfusableCodePoints() {
    return new Set(this.confusableDictionary.keys());
  }
}, _m.ambiguousCharacterData = new Fa(() => JSON.parse(`{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}`)), _m.cache = new Ma({ getCacheKey: JSON.stringify }, (t10) => {
  function n10(e206) {
    let t11 = /* @__PURE__ */ new Map();
    for (let n11 = 0; n11 < e206.length; n11 += 2) t11.set(e206[n11], e206[n11 + 1]);
    return t11;
  }
  function r10(e206, t11) {
    let n11 = new Map(e206);
    for (let [e207, r11] of t11) n11.set(e207, r11);
    return n11;
  }
  function i10(e206, t11) {
    if (!e206) return t11;
    let n11 = /* @__PURE__ */ new Map();
    for (let [r11, i11] of e206) t11.has(r11) && n11.set(r11, i11);
    return n11;
  }
  let a10 = _m.ambiguousCharacterData.value, o10 = t10.filter((e206) => !e206.startsWith(`_`) && Object.hasOwn(a10, e206));
  o10.length === 0 && (o10 = [`_default`]);
  let s10;
  for (let e206 of o10) {
    let t11 = n10(a10[e206]);
    s10 = i10(s10, t11);
  }
  return new _m(r10(n10(a10._common), s10));
}), _m._locales = new Fa(() => Object.keys(_m.ambiguousCharacterData.value).filter((e206) => !e206.startsWith(`_`))), _m), Do = (_n2 = class {
  static getRawData() {
    return JSON.parse(`{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}`);
  }
  static getData() {
    return this._data || (this._data = new Set([...Object.values(_n2.getRawData())].flat())), this._data;
  }
  static isInvisibleCharacter(t10) {
    return _n2.getData().has(t10);
  }
  static get codePoints() {
    return _n2.getData();
  }
}, _n2._data = void 0, _n2), Oo = (_o2 = class {
  constructor() {
    this.mapWindowIdToZoomFactor = /* @__PURE__ */ new Map();
  }
  getZoomFactor(e206) {
    return this.mapWindowIdToZoomFactor.get(this.getWindowId(e206)) ?? 1;
  }
  getWindowId(e206) {
    return e206.vscodeWindowId;
  }
}, _o2.INSTANCE = new _o2(), _o2);
function ko(e206, t10, n10) {
  typeof t10 == `string` && (t10 = e206.matchMedia(t10)), t10.addEventListener(`change`, n10);
}
function Ao(e206) {
  return Oo.INSTANCE.getZoomFactor(e206);
}
var jo = navigator.userAgent, Mo = jo.indexOf(`Firefox`) >= 0, No = jo.indexOf(`AppleWebKit`) >= 0, Po = jo.indexOf(`Chrome`) >= 0, Fo = !Po && jo.indexOf(`Safari`) >= 0, Io = !Po && !Fo && No;
jo.indexOf(`Electron/`);
var Lo = jo.indexOf(`Android`) >= 0, Ro = false;
if (typeof Aa.matchMedia == `function`) {
  let e206 = Aa.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`), t10 = Aa.matchMedia(`(display-mode: fullscreen)`);
  Ro = e206.matches, ko(Aa, e206, ({ matches: e207 }) => {
    Ro && t10.matches || (Ro = e207);
  });
}
function zo() {
  return globalThis.MonacoEnvironment;
}
var Bo = { clipboard: { writeText: Dt || document.queryCommandSupported && document.queryCommandSupported(`copy`) || !!(navigator && navigator.clipboard && navigator.clipboard.writeText), readText: Dt || !!(navigator && navigator.clipboard && navigator.clipboard.readText) }, pointerEvents: Aa.PointerEvent && (`ontouchstart` in Aa || navigator.maxTouchPoints > 0) };
function Vo(e206, t10) {
  if (typeof e206 == `number`) {
    if (e206 === 0) return null;
    let n10 = (e206 & 65535) >>> 0, r10 = (e206 & 4294901760) >>> 16;
    return r10 === 0 ? new Wo([Ho(n10, t10)]) : new Wo([Ho(n10, t10), Ho(r10, t10)]);
  } else {
    let n10 = [];
    for (let r10 = 0; r10 < e206.length; r10++) n10.push(Ho(e206[r10], t10));
    return new Wo(n10);
  }
}
function Ho(e206, t10) {
  let n10 = !!(e206 & 2048), r10 = !!(e206 & 256);
  return new Uo(t10 === 2 ? r10 : n10, !!(e206 & 1024), !!(e206 & 512), t10 === 2 ? n10 : r10, e206 & 255);
}
var Uo = class e17 {
  constructor(e206, t10, n10, r10, i10) {
    this.ctrlKey = e206, this.shiftKey = t10, this.altKey = n10, this.metaKey = r10, this.keyCode = i10;
  }
  equals(t10) {
    return t10 instanceof e17 && this.ctrlKey === t10.ctrlKey && this.shiftKey === t10.shiftKey && this.altKey === t10.altKey && this.metaKey === t10.metaKey && this.keyCode === t10.keyCode;
  }
  isModifierKey() {
    return this.keyCode === 0 || this.keyCode === 5 || this.keyCode === 57 || this.keyCode === 6 || this.keyCode === 4;
  }
  isDuplicateModifierCase() {
    return this.ctrlKey && this.keyCode === 5 || this.shiftKey && this.keyCode === 4 || this.altKey && this.keyCode === 6 || this.metaKey && this.keyCode === 57;
  }
}, Wo = class {
  constructor(e206) {
    if (e206.length === 0) throw De(`chords`);
    this.chords = e206;
  }
}, Go = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this.ctrlKey = e206, this.shiftKey = t10, this.altKey = n10, this.metaKey = r10, this.keyLabel = i10, this.keyAriaLabel = a10;
  }
}, Ko = class {
};
function qo(e206) {
  if (e206.charCode) {
    let t11 = String.fromCharCode(e206.charCode).toUpperCase();
    return xr.fromString(t11);
  }
  let t10 = e206.keyCode;
  if (t10 === 3) return 7;
  if (Mo) switch (t10) {
    case 59:
      return 85;
    case 60:
      if (Et) return 97;
      break;
    case 61:
      return 86;
    case 107:
      return 109;
    case 109:
      return 111;
    case 173:
      return 88;
    case 224:
      if (Tt) return 57;
      break;
  }
  else if (No && (Tt && t10 === 93 || !Tt && t10 === 92)) return 57;
  return yr[t10] || 0;
}
var jte = Tt ? 256 : 2048, Mte = 512, Nte = 1024, Pte = Tt ? 2048 : 256, Jo = class {
  constructor(e206) {
    this._standardKeyboardEventBrand = true;
    let t10 = e206;
    this.browserEvent = t10, this.target = t10.target, this.ctrlKey = t10.ctrlKey, this.shiftKey = t10.shiftKey, this.altKey = t10.altKey, this.metaKey = t10.metaKey, this.altGraphKey = t10.getModifierState?.(`AltGraph`), this.keyCode = qo(t10), this.code = t10.code, this.ctrlKey = this.ctrlKey || this.keyCode === 5, this.altKey = this.altKey || this.keyCode === 6, this.shiftKey = this.shiftKey || this.keyCode === 4, this.metaKey = this.metaKey || this.keyCode === 57, this._asKeybinding = this._computeKeybinding(), this._asKeyCodeChord = this._computeKeyCodeChord();
  }
  preventDefault() {
    this.browserEvent && this.browserEvent.preventDefault && this.browserEvent.preventDefault();
  }
  stopPropagation() {
    this.browserEvent && this.browserEvent.stopPropagation && this.browserEvent.stopPropagation();
  }
  toKeyCodeChord() {
    return this._asKeyCodeChord;
  }
  equals(e206) {
    return this._asKeybinding === e206;
  }
  _computeKeybinding() {
    let e206 = 0;
    this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57 && (e206 = this.keyCode);
    let t10 = 0;
    return this.ctrlKey && (t10 |= jte), this.altKey && (t10 |= Mte), this.shiftKey && (t10 |= Nte), this.metaKey && (t10 |= Pte), t10 |= e206, t10;
  }
  _computeKeyCodeChord() {
    let e206 = 0;
    return this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57 && (e206 = this.keyCode), new Uo(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, e206);
  }
}, Yo = /* @__PURE__ */ new WeakMap();
function Fte(e206) {
  if (!e206.parent || e206.parent === e206) return null;
  try {
    let t10 = e206.location, n10 = e206.parent.location;
    if (t10.origin !== `null` && n10.origin !== `null` && t10.origin !== n10.origin) return null;
  } catch {
    return null;
  }
  return e206.parent;
}
var Ite = class {
  static getSameOriginWindowChain(e206) {
    let t10 = Yo.get(e206);
    if (!t10) {
      t10 = [], Yo.set(e206, t10);
      let n10 = e206, r10;
      do
        r10 = Fte(n10), r10 ? t10.push({ window: new WeakRef(n10), iframeElement: n10.frameElement || null }) : t10.push({ window: new WeakRef(n10), iframeElement: null }), n10 = r10;
      while (n10);
    }
    return t10.slice(0);
  }
  static getPositionOfChildWindowRelativeToAncestorWindow(e206, t10) {
    if (!t10 || e206 === t10) return { top: 0, left: 0 };
    let n10 = 0, r10 = 0, i10 = this.getSameOriginWindowChain(e206);
    for (let e207 of i10) {
      let i11 = e207.window.deref();
      if (n10 += i11?.scrollY ?? 0, r10 += i11?.scrollX ?? 0, i11 === t10 || !e207.iframeElement) break;
      let a10 = e207.iframeElement.getBoundingClientRect();
      n10 += a10.top, r10 += a10.left;
    }
    return { top: n10, left: r10 };
  }
}, Xo = class {
  constructor(e206, t10) {
    this.timestamp = Date.now(), this.browserEvent = t10, this.leftButton = t10.button === 0, this.middleButton = t10.button === 1, this.rightButton = t10.button === 2, this.buttons = t10.buttons, this.defaultPrevented = t10.defaultPrevented, this.target = t10.target, this.detail = t10.detail || 1, t10.type === `dblclick` && (this.detail = 2), this.ctrlKey = t10.ctrlKey, this.shiftKey = t10.shiftKey, this.altKey = t10.altKey, this.metaKey = t10.metaKey, typeof t10.pageX == `number` ? (this.posx = t10.pageX, this.posy = t10.pageY) : (this.posx = t10.clientX + this.target.ownerDocument.body.scrollLeft + this.target.ownerDocument.documentElement.scrollLeft, this.posy = t10.clientY + this.target.ownerDocument.body.scrollTop + this.target.ownerDocument.documentElement.scrollTop);
    let n10 = Ite.getPositionOfChildWindowRelativeToAncestorWindow(e206, t10.view);
    this.posx -= n10.left, this.posy -= n10.top;
  }
  preventDefault() {
    this.browserEvent.preventDefault();
  }
  stopPropagation() {
    this.browserEvent.stopPropagation();
  }
}, Zo = class {
  constructor(e206, t10 = 0, n10 = 0) {
    this.browserEvent = e206 || null, this.target = e206 ? e206.target || e206.targetNode || e206.srcElement : null, this.deltaY = n10, this.deltaX = t10;
    let r10 = false;
    if (Po) {
      let e207 = navigator.userAgent.match(/Chrome\/(\d+)/);
      r10 = (e207 ? parseInt(e207[1]) : 123) <= 122;
    }
    if (e206) {
      let t11 = e206, n11 = e206, i10 = e206.view?.devicePixelRatio || 1;
      if (t11.wheelDeltaY !== void 0) r10 ? this.deltaY = t11.wheelDeltaY / (120 * i10) : this.deltaY = t11.wheelDeltaY / 120;
      else if (n11.VERTICAL_AXIS !== void 0 && n11.axis === n11.VERTICAL_AXIS) this.deltaY = -n11.detail / 3;
      else if (e206.type === `wheel`) {
        let t12 = e206;
        t12.deltaMode === t12.DOM_DELTA_LINE ? Mo && !Tt ? this.deltaY = -e206.deltaY / 3 : this.deltaY = -e206.deltaY : this.deltaY = -e206.deltaY / 40;
      }
      if (t11.wheelDeltaX !== void 0) Fo && wt ? this.deltaX = -(t11.wheelDeltaX / 120) : r10 ? this.deltaX = t11.wheelDeltaX / (120 * i10) : this.deltaX = t11.wheelDeltaX / 120;
      else if (n11.HORIZONTAL_AXIS !== void 0 && n11.axis === n11.HORIZONTAL_AXIS) this.deltaX = -e206.detail / 3;
      else if (e206.type === `wheel`) {
        let t12 = e206;
        t12.deltaMode === t12.DOM_DELTA_LINE ? Mo && !Tt ? this.deltaX = -e206.deltaX / 3 : this.deltaX = -e206.deltaX : this.deltaX = -e206.deltaX / 40;
      }
      this.deltaY === 0 && this.deltaX === 0 && e206.wheelDelta && (r10 ? this.deltaY = e206.wheelDelta / (120 * i10) : this.deltaY = e206.wheelDelta / 120);
    }
  }
  preventDefault() {
    this.browserEvent?.preventDefault();
  }
  stopPropagation() {
    this.browserEvent?.stopPropagation();
  }
}, Qo = /* @__PURE__ */ Symbol(`MicrotaskDelay`);
function $o(e206) {
  return !!e206 && typeof e206.then == `function`;
}
function es(e206) {
  let t10 = new pr(), n10 = e206(t10.token), r10 = false, i10 = new Promise((e207, i11) => {
    let a10 = t10.token.onCancellationRequested(() => {
      r10 = true, a10.dispose(), i11(new Te());
    });
    Promise.resolve(n10).then((n11) => {
      a10.dispose(), t10.dispose(), r10 ? Gt(n11) && n11.dispose() : e207(n11);
    }, (e208) => {
      a10.dispose(), t10.dispose(), i11(e208);
    });
  });
  return new class {
    cancel() {
      t10.cancel(), t10.dispose();
    }
    then(e207, t11) {
      return i10.then(e207, t11);
    }
    catch(e207) {
      return this.then(void 0, e207);
    }
    finally(e207) {
      return i10.finally(e207);
    }
  }();
}
function ts(e206, t10, n10) {
  return new Promise((r10, i10) => {
    let a10 = t10.onCancellationRequested(() => {
      a10.dispose(), r10(n10);
    });
    e206.then(r10, i10).finally(() => a10.dispose());
  });
}
function Lte(e206, t10) {
  return new Promise((n10, r10) => {
    let i10 = t10.onCancellationRequested(() => {
      i10.dispose(), r10(new Te());
    });
    e206.then(n10, r10).finally(() => i10.dispose());
  });
}
var Rte = class {
  constructor() {
    this.activePromise = null, this.queuedPromise = null, this.queuedPromiseFactory = null, this.cancellationTokenSource = new pr();
  }
  queue(e206) {
    if (this.cancellationTokenSource.token.isCancellationRequested) return Promise.reject(Error(`Throttler is disposed`));
    if (this.activePromise) {
      if (this.queuedPromiseFactory = e206, !this.queuedPromise) {
        let e207 = () => {
          if (this.queuedPromise = null, this.cancellationTokenSource.token.isCancellationRequested) return;
          let e208 = this.queue(this.queuedPromiseFactory);
          return this.queuedPromiseFactory = null, e208;
        };
        this.queuedPromise = new Promise((t10) => {
          this.activePromise.then(e207, e207).then(t10);
        });
      }
      return new Promise((e207, t10) => {
        this.queuedPromise.then(e207, t10);
      });
    }
    return this.activePromise = e206(this.cancellationTokenSource.token), new Promise((e207, t10) => {
      this.activePromise.then((t11) => {
        this.activePromise = null, e207(t11);
      }, (e208) => {
        this.activePromise = null, t10(e208);
      });
    });
  }
  dispose() {
    this.cancellationTokenSource.cancel();
  }
}, zte = (e206, t10) => {
  let n10 = true, r10 = setTimeout(() => {
    n10 = false, t10();
  }, e206);
  return { isTriggered: () => n10, dispose: () => {
    clearTimeout(r10), n10 = false;
  } };
}, Bte = (e206) => {
  let t10 = true;
  return queueMicrotask(() => {
    t10 && (t10 = false, e206());
  }), { isTriggered: () => t10, dispose: () => {
    t10 = false;
  } };
}, ns = class {
  constructor(e206) {
    this.defaultDelay = e206, this.deferred = null, this.completionPromise = null, this.doResolve = null, this.doReject = null, this.task = null;
  }
  trigger(e206, t10 = this.defaultDelay) {
    this.task = e206, this.cancelTimeout(), this.completionPromise || (this.completionPromise = new Promise((e207, t11) => {
      this.doResolve = e207, this.doReject = t11;
    }).then(() => {
      if (this.completionPromise = null, this.doResolve = null, this.task) {
        let e207 = this.task;
        return this.task = null, e207();
      }
    }));
    let n10 = () => {
      this.deferred = null, this.doResolve?.(null);
    };
    return this.deferred = t10 === Qo ? Bte(n10) : zte(t10, n10), this.completionPromise;
  }
  isTriggered() {
    return !!this.deferred?.isTriggered();
  }
  cancel() {
    this.cancelTimeout(), this.completionPromise && (this.completionPromise = (this.doReject?.(new Te()), null));
  }
  cancelTimeout() {
    this.deferred?.dispose(), this.deferred = null;
  }
  dispose() {
    this.cancel();
  }
}, rs = class {
  constructor(e206) {
    this.delayer = new ns(e206), this.throttler = new Rte();
  }
  trigger(e206, t10) {
    return this.delayer.trigger(() => this.throttler.queue(e206), t10);
  }
  cancel() {
    this.delayer.cancel();
  }
  dispose() {
    this.delayer.dispose(), this.throttler.dispose();
  }
};
function is(e206, t10) {
  return t10 ? new Promise((n10, r10) => {
    let i10 = setTimeout(() => {
      a10.dispose(), n10();
    }, e206), a10 = t10.onCancellationRequested(() => {
      clearTimeout(i10), a10.dispose(), r10(new Te());
    });
  }) : es((t11) => is(e206, t11));
}
function as(e206, t10 = 0, n10) {
  let r10 = setTimeout(() => {
    e206(), n10 && i10.dispose();
  }, t10), i10 = T(() => {
    clearTimeout(r10), n10?.delete(i10);
  });
  return n10?.add(i10), i10;
}
function os(e206, t10 = (e207) => !!e207, n10 = null) {
  let r10 = 0, i10 = e206.length, a10 = () => {
    if (r10 >= i10) return Promise.resolve(n10);
    let o10 = e206[r10++];
    return Promise.resolve(o10()).then((e207) => t10(e207) ? Promise.resolve(e207) : a10());
  };
  return a10();
}
var ss = class {
  constructor() {
    this._runningTask = void 0, this._pendingTasks = [];
  }
  schedule(e206) {
    let t10 = new hs();
    return this._pendingTasks.push({ task: e206, deferred: t10, setUndefinedWhenCleared: false }), this._runIfNotRunning(), t10.p;
  }
  _runIfNotRunning() {
    this._runningTask === void 0 && this._processQueue();
  }
  async _processQueue() {
    if (this._pendingTasks.length === 0) return;
    let e206 = this._pendingTasks.shift();
    if (e206) {
      if (this._runningTask) throw new je();
      this._runningTask = e206.task;
      try {
        let t10 = await e206.task();
        e206.deferred.complete(t10);
      } catch (t10) {
        e206.deferred.error(t10);
      } finally {
        this._runningTask = void 0, this._processQueue();
      }
    }
  }
  clearPending() {
    let e206 = this._pendingTasks;
    this._pendingTasks = [];
    for (let t10 of e206) t10.setUndefinedWhenCleared ? t10.deferred.complete(void 0) : t10.deferred.error(new Te());
  }
}, cs = class {
  constructor(e206, t10) {
    this._isDisposed = false, this._token = void 0, typeof e206 == `function` && typeof t10 == `number` && this.setIfNotSet(e206, t10);
  }
  dispose() {
    this.cancel(), this._isDisposed = true;
  }
  cancel() {
    this._token !== void 0 && (clearTimeout(this._token), this._token = void 0);
  }
  cancelAndSet(e206, t10) {
    if (this._isDisposed) throw new je(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);
    this.cancel(), this._token = setTimeout(() => {
      this._token = void 0, e206();
    }, t10);
  }
  setIfNotSet(e206, t10) {
    if (this._isDisposed) throw new je(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);
    this._token === void 0 && (this._token = setTimeout(() => {
      this._token = void 0, e206();
    }, t10));
  }
}, ls = class {
  constructor() {
    this.disposable = void 0, this.isDisposed = false;
  }
  cancel() {
    this.disposable?.dispose(), this.disposable = void 0;
  }
  cancelAndSet(e206, t10, n10 = globalThis) {
    if (this.isDisposed) throw new je(`Calling 'cancelAndSet' on a disposed IntervalTimer`);
    this.cancel();
    let r10 = n10.setInterval(() => {
      e206();
    }, t10);
    this.disposable = T(() => {
      n10.clearInterval(r10), this.disposable = void 0;
    });
  }
  dispose() {
    this.cancel(), this.isDisposed = true;
  }
}, us = class {
  constructor(e206, t10) {
    this.timeoutToken = void 0, this.runner = e206, this.timeout = t10, this.timeoutHandler = this.onTimeout.bind(this);
  }
  dispose() {
    this.cancel(), this.runner = null;
  }
  cancel() {
    this.isScheduled() && (clearTimeout(this.timeoutToken), this.timeoutToken = void 0);
  }
  schedule(e206 = this.timeout) {
    this.cancel(), this.timeoutToken = setTimeout(this.timeoutHandler, e206);
  }
  get delay() {
    return this.timeout;
  }
  set delay(e206) {
    this.timeout = e206;
  }
  isScheduled() {
    return this.timeoutToken !== void 0;
  }
  onTimeout() {
    this.timeoutToken = void 0, this.runner && this.doRun();
  }
  doRun() {
    this.runner?.();
  }
}, ds, fs;
(function() {
  let e206 = globalThis;
  fs = typeof e206.requestIdleCallback != `function` || typeof e206.cancelIdleCallback != `function` ? (e207, t10, n10) => {
    Nt(() => {
      if (r10) return;
      let e208 = Date.now() + 15;
      t10(Object.freeze({ didTimeout: true, timeRemaining() {
        return Math.max(0, e208 - Date.now());
      } }));
    });
    let r10 = false;
    return { dispose() {
      r10 || (r10 = true);
    } };
  } : (e207, t10, n10) => {
    let r10 = e207.requestIdleCallback(t10, typeof n10 == `number` ? { timeout: n10 } : void 0), i10 = false;
    return { dispose() {
      i10 || (i10 = true, e207.cancelIdleCallback(r10));
    } };
  }, ds = (e207, t10) => fs(globalThis, e207, t10);
})();
var ps = class {
  constructor(e206, t10) {
    this._didRun = false, this._executor = () => {
      try {
        this._value = t10();
      } catch (e207) {
        this._error = e207;
      } finally {
        this._didRun = true;
      }
    }, this._handle = fs(e206, () => this._executor());
  }
  dispose() {
    this._handle.dispose();
  }
  get value() {
    if (this._didRun || (this._handle.dispose(), this._executor()), this._error) throw this._error;
    return this._value;
  }
  get isInitialized() {
    return this._didRun;
  }
}, ms = class extends ps {
  constructor(e206) {
    super(globalThis, e206);
  }
}, hs = class {
  get isRejected() {
    return this.outcome?.outcome === 1;
  }
  get isSettled() {
    return !!this.outcome;
  }
  constructor() {
    this.p = new Promise((e206, t10) => {
      this.completeCallback = e206, this.errorCallback = t10;
    });
  }
  complete(e206) {
    return this.isSettled ? Promise.resolve() : new Promise((t10) => {
      this.completeCallback(e206), this.outcome = { outcome: 0, value: e206 }, t10();
    });
  }
  error(e206) {
    return this.isSettled ? Promise.resolve() : new Promise((t10) => {
      this.errorCallback(e206), this.outcome = { outcome: 1, value: e206 }, t10();
    });
  }
  cancel() {
    return this.error(new Te());
  }
}, gs;
(function(e206) {
  async function t10(e207) {
    let t11, n11 = await Promise.all(e207.map((e208) => e208.then((e209) => e209, (e209) => {
      t11 || (t11 = e209);
    })));
    if (t11 !== void 0) throw t11;
    return n11;
  }
  e206.settled = t10;
  function n10(e207) {
    return new Promise(async (t11, n11) => {
      try {
        await e207(t11, n11);
      } catch (e208) {
        n11(e208);
      }
    });
  }
  e206.withAsyncBody = n10;
})(gs || (gs = {}));
function _s(e206) {
  let t10 = new pr(), n10 = e206(t10.token);
  return new bs(t10, async (e207) => {
    let r10 = t10.token.onCancellationRequested(() => {
      r10.dispose(), t10.dispose(), e207.reject(new Te());
    });
    try {
      for await (let r11 of n10) {
        if (t10.token.isCancellationRequested) return;
        e207.emitOne(r11);
      }
      r10.dispose(), t10.dispose();
    } catch (n11) {
      r10.dispose(), t10.dispose(), e207.reject(n11);
    }
  });
}
var vs = class {
  constructor() {
    this._unsatisfiedConsumers = [], this._unconsumedValues = [];
  }
  get hasFinalValue() {
    return !!this._finalValue;
  }
  produce(e206) {
    if (this._ensureNoFinalValue(), this._unsatisfiedConsumers.length > 0) {
      let t10 = this._unsatisfiedConsumers.shift();
      this._resolveOrRejectDeferred(t10, e206);
    } else this._unconsumedValues.push(e206);
  }
  produceFinal(e206) {
    this._ensureNoFinalValue(), this._finalValue = e206;
    for (let t10 of this._unsatisfiedConsumers) this._resolveOrRejectDeferred(t10, e206);
    this._unsatisfiedConsumers.length = 0;
  }
  _ensureNoFinalValue() {
    if (this._finalValue) throw new je(`ProducerConsumer: cannot produce after final value has been set`);
  }
  _resolveOrRejectDeferred(e206, t10) {
    t10.ok ? e206.complete(t10.value) : e206.error(t10.error);
  }
  consume() {
    if (this._unconsumedValues.length > 0 || this._finalValue) {
      let e206 = this._unconsumedValues.length > 0 ? this._unconsumedValues.shift() : this._finalValue;
      return e206.ok ? Promise.resolve(e206.value) : Promise.reject(e206.error);
    } else {
      let e206 = new hs();
      return this._unsatisfiedConsumers.push(e206), e206.p;
    }
  }
}, ys = (_p = class {
  constructor(e206, t10) {
    this._onReturn = t10, this._producerConsumer = new vs(), this._iterator = { next: () => this._producerConsumer.consume(), return: () => (this._onReturn?.(), Promise.resolve({ done: true, value: void 0 })), throw: async (e207) => (this._finishError(e207), { done: true, value: void 0 }) }, queueMicrotask(async () => {
      let t11 = e206({ emitOne: (e207) => this._producerConsumer.produce({ ok: true, value: { done: false, value: e207 } }), emitMany: (e207) => {
        for (let t12 of e207) this._producerConsumer.produce({ ok: true, value: { done: false, value: t12 } });
      }, reject: (e207) => this._finishError(e207) });
      if (!this._producerConsumer.hasFinalValue) try {
        await t11, this._finishOk();
      } catch (e207) {
        this._finishError(e207);
      }
    });
  }
  static fromArray(t10) {
    return new _p((e206) => {
      e206.emitMany(t10);
    });
  }
  static fromPromise(t10) {
    return new _p(async (e206) => {
      e206.emitMany(await t10);
    });
  }
  static fromPromisesResolveOrder(t10) {
    return new _p(async (e206) => {
      await Promise.all(t10.map(async (t11) => e206.emitOne(await t11)));
    });
  }
  static merge(t10) {
    return new _p(async (e206) => {
      await Promise.all(t10.map(async (t11) => {
        for await (let n10 of t11) e206.emitOne(n10);
      }));
    });
  }
  static map(t10, n10) {
    return new _p(async (e206) => {
      for await (let r10 of t10) e206.emitOne(n10(r10));
    });
  }
  map(t10) {
    return _p.map(this, t10);
  }
  static coalesce(t10) {
    return _p.filter(t10, (e206) => !!e206);
  }
  coalesce() {
    return _p.coalesce(this);
  }
  static filter(t10, n10) {
    return new _p(async (e206) => {
      for await (let r10 of t10) n10(r10) && e206.emitOne(r10);
    });
  }
  filter(t10) {
    return _p.filter(this, t10);
  }
  _finishOk() {
    this._producerConsumer.hasFinalValue || this._producerConsumer.produceFinal({ ok: true, value: { done: true, value: void 0 } });
  }
  _finishError(e206) {
    this._producerConsumer.hasFinalValue || this._producerConsumer.produceFinal({ ok: false, error: e206 });
  }
  [Symbol.asyncIterator]() {
    return this._iterator;
  }
}, _p.EMPTY = _p.fromArray([]), _p), bs = class extends ys {
  constructor(e206, t10) {
    super(t10), this._source = e206;
  }
  cancel() {
    this._source.cancel();
  }
}, xs;
(function(e206) {
  e206.inMemory = `inmemory`, e206.vscode = `vscode`, e206.internal = `private`, e206.walkThrough = `walkThrough`, e206.walkThroughSnippet = `walkThroughSnippet`, e206.http = `http`, e206.https = `https`, e206.file = `file`, e206.mailto = `mailto`, e206.untitled = `untitled`, e206.data = `data`, e206.command = `command`, e206.vscodeRemote = `vscode-remote`, e206.vscodeRemoteResource = `vscode-remote-resource`, e206.vscodeManagedRemoteResource = `vscode-managed-remote-resource`, e206.vscodeUserData = `vscode-userdata`, e206.vscodeCustomEditor = `vscode-custom-editor`, e206.vscodeNotebookCell = `vscode-notebook-cell`, e206.vscodeNotebookCellMetadata = `vscode-notebook-cell-metadata`, e206.vscodeNotebookCellMetadataDiff = `vscode-notebook-cell-metadata-diff`, e206.vscodeNotebookCellOutput = `vscode-notebook-cell-output`, e206.vscodeNotebookCellOutputDiff = `vscode-notebook-cell-output-diff`, e206.vscodeNotebookMetadata = `vscode-notebook-metadata`, e206.vscodeInteractiveInput = `vscode-interactive-input`, e206.vscodeSettings = `vscode-settings`, e206.vscodeWorkspaceTrust = `vscode-workspace-trust`, e206.vscodeTerminal = `vscode-terminal`, e206.vscodeChatCodeBlock = `vscode-chat-code-block`, e206.vscodeChatCodeCompareBlock = `vscode-chat-code-compare-block`, e206.vscodeChatEditor = `vscode-chat-editor`, e206.vscodeChatInput = `chatSessionInput`, e206.vscodeLocalChatSession = `vscode-chat-session`, e206.webviewPanel = `webview-panel`, e206.vscodeWebview = `vscode-webview`, e206.extension = `extension`, e206.vscodeFileResource = `vscode-file`, e206.tmp = `tmp`, e206.vsls = `vsls`, e206.vscodeSourceControl = `vscode-scm`, e206.commentsInput = `comment`, e206.codeSetting = `code-setting`, e206.outputChannel = `output`, e206.accessibleView = `accessible-view`, e206.chatEditingSnapshotScheme = `chat-editing-snapshot-text-model`, e206.chatEditingModel = `chat-editing-text-model`, e206.copilotPr = `copilot-pr`;
})(xs || (xs = {}));
function Ss(e206, t10) {
  return $r.isUri(e206) ? to(e206.scheme, t10) : no(e206, t10 + `:`);
}
function Cs(e206, ...t10) {
  return t10.some((t11) => Ss(e206, t11));
}
var ws = new class {
  constructor() {
    this._hosts = /* @__PURE__ */ Object.create(null), this._ports = /* @__PURE__ */ Object.create(null), this._connectionTokens = /* @__PURE__ */ Object.create(null), this._preferredWebSchema = `http`, this._delegate = null, this._serverRootPath = `/`;
  }
  setPreferredWebSchema(e206) {
    this._preferredWebSchema = e206;
  }
  get _remoteResourcesPath() {
    return Kr.join(this._serverRootPath, xs.vscodeRemoteResource);
  }
  rewrite(e206) {
    if (this._delegate) try {
      return this._delegate(e206);
    } catch (t11) {
      return be(t11), e206;
    }
    let t10 = e206.authority, n10 = this._hosts[t10];
    n10 && n10.indexOf(`:`) !== -1 && n10.indexOf(`[`) === -1 && (n10 = `[${n10}]`);
    let r10 = this._ports[t10], i10 = this._connectionTokens[t10], a10 = `path=${encodeURIComponent(e206.path)}`;
    return typeof i10 == `string` && (a10 += `&tkn=${encodeURIComponent(i10)}`), $r.from({ scheme: Ot ? this._preferredWebSchema : xs.vscodeRemoteResource, authority: `${n10}:${r10}`, path: this._remoteResourcesPath, query: a10 });
  }
}(), Ts = `vscode-app`, Es = new (_q = class {
  uriToBrowserUri(t10) {
    return t10.scheme === xs.vscodeRemote ? ws.rewrite(t10) : t10.scheme === xs.file && (Dt || tee === `${xs.vscodeFileResource}://${_q.FALLBACK_AUTHORITY}`) ? t10.with({ scheme: xs.vscodeFileResource, authority: t10.authority || _q.FALLBACK_AUTHORITY, query: null, fragment: null }) : t10;
  }
}, _q.FALLBACK_AUTHORITY = Ts, _q)(), Ds;
(function(e206) {
  let t10 = /* @__PURE__ */ new Map([[`1`, { "Cross-Origin-Opener-Policy": `same-origin` }], [`2`, { "Cross-Origin-Embedder-Policy": `require-corp` }], [`3`, { "Cross-Origin-Opener-Policy": `same-origin`, "Cross-Origin-Embedder-Policy": `require-corp` }]]);
  e206.CoopAndCoep = Object.freeze(t10.get(`3`));
  let n10 = `vscode-coi`;
  function r10(e207) {
    let r11;
    typeof e207 == `string` ? r11 = new URL(e207).searchParams : e207 instanceof URL ? r11 = e207.searchParams : $r.isUri(e207) && (r11 = new URL(e207.toString(true)).searchParams);
    let i11 = r11?.get(n10);
    if (i11) return t10.get(i11);
  }
  e206.getHeadersFromQuery = r10;
  function i10(e207, t11, r11) {
    if (!globalThis.crossOriginIsolated) return;
    let i11 = t11 && r11 ? `3` : r11 ? `2` : `1`;
    e207 instanceof URLSearchParams ? e207.set(n10, i11) : e207[n10] = i11;
  }
  e206.addSearchParam = i10;
})(Ds || (Ds = {})), t();
var Os = n !== void 0;
new Fa(() => new Uint8Array(256));
var ks, As = class e18 {
  static wrap(t10) {
    return Os && !n.isBuffer(t10) && (t10 = n.from(t10.buffer, t10.byteOffset, t10.byteLength)), new e18(t10);
  }
  constructor(e206) {
    this.buffer = e206, this.byteLength = this.buffer.byteLength;
  }
  toString() {
    return Os ? this.buffer.toString() : (ks || (ks = new TextDecoder()), ks.decode(this.buffer));
  }
};
function Vte(e206, t10) {
  return e206[t10 + 0] << 0 >>> 0 | e206[t10 + 1] << 8 >>> 0;
}
function Hte(e206, t10, n10) {
  e206[n10 + 0] = t10 & 255, t10 >>>= 8, e206[n10 + 1] = t10 & 255;
}
function js(e206, t10) {
  return e206[t10] * 2 ** 24 + e206[t10 + 1] * 2 ** 16 + e206[t10 + 2] * 2 ** 8 + e206[t10 + 3];
}
function Ms(e206, t10, n10) {
  e206[n10 + 3] = t10, t10 >>>= 8, e206[n10 + 2] = t10, t10 >>>= 8, e206[n10 + 1] = t10, t10 >>>= 8, e206[n10] = t10;
}
function Ns(e206, t10) {
  return e206[t10];
}
function Ps(e206, t10, n10) {
  e206[n10] = t10;
}
var Fs = `0123456789abcdef`;
function Ute({ buffer: e206 }) {
  let t10 = ``;
  for (let n10 = 0; n10 < e206.length; n10++) {
    let r10 = e206[n10];
    t10 += Fs[r10 >>> 4], t10 += Fs[r10 & 15];
  }
  return t10;
}
function Is(e206) {
  return Ls(e206, 0);
}
function Ls(e206, t10) {
  switch (typeof e206) {
    case `object`:
      return e206 === null ? Rs(349, t10) : Array.isArray(e206) ? Gte(e206, t10) : Kte(e206, t10);
    case `string`:
      return zs(e206, t10);
    case `boolean`:
      return Wte(e206, t10);
    case `number`:
      return Rs(e206, t10);
    case `undefined`:
      return Rs(937, t10);
    default:
      return Rs(617, t10);
  }
}
function Rs(e206, t10) {
  return (t10 << 5) - t10 + e206 | 0;
}
function Wte(e206, t10) {
  return Rs(e206 ? 433 : 863, t10);
}
function zs(e206, t10) {
  t10 = Rs(149417, t10);
  for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) t10 = Rs(e206.charCodeAt(n10), t10);
  return t10;
}
function Gte(e206, t10) {
  return t10 = Rs(104579, t10), e206.reduce((e207, t11) => Ls(t11, e207), t10);
}
function Kte(e206, t10) {
  return t10 = Rs(181387, t10), Object.keys(e206).sort().reduce((t11, n10) => (t11 = zs(n10, t11), Ls(e206[n10], t11)), t10);
}
function Bs(e206, t10, n10 = 32) {
  let r10 = n10 - t10, i10 = ~((1 << r10) - 1);
  return (e206 << t10 | (i10 & e206) >>> r10) >>> 0;
}
function Vs(e206, t10 = 32) {
  return e206 instanceof ArrayBuffer ? Ute(As.wrap(new Uint8Array(e206))) : (e206 >>> 0).toString(16).padStart(t10 / 4, `0`);
}
var qte = (_r2 = class {
  constructor() {
    this._h0 = 1732584193, this._h1 = 4023233417, this._h2 = 2562383102, this._h3 = 271733878, this._h4 = 3285377520, this._buff = new Uint8Array(67), this._buffDV = new DataView(this._buff.buffer), this._buffLen = 0, this._totalLen = 0, this._leftoverHighSurrogate = 0, this._finished = false;
  }
  update(e206) {
    let t10 = e206.length;
    if (t10 === 0) return;
    let n10 = this._buff, r10 = this._buffLen, i10 = this._leftoverHighSurrogate, a10, o10;
    for (i10 === 0 ? (a10 = e206.charCodeAt(0), o10 = 0) : (a10 = i10, o10 = -1, i10 = 0); ; ) {
      let s10 = a10;
      if (ao(a10)) if (o10 + 1 < t10) {
        let t11 = e206.charCodeAt(o10 + 1);
        oo(t11) ? (o10++, s10 = so(a10, t11)) : s10 = 65533;
      } else {
        i10 = a10;
        break;
      }
      else oo(a10) && (s10 = 65533);
      if (r10 = this._push(n10, r10, s10), o10++, o10 < t10) a10 = e206.charCodeAt(o10);
      else break;
    }
    this._buffLen = r10, this._leftoverHighSurrogate = i10;
  }
  _push(e206, t10, n10) {
    return n10 < 128 ? e206[t10++] = n10 : n10 < 2048 ? (e206[t10++] = 192 | (n10 & 1984) >>> 6, e206[t10++] = 128 | (n10 & 63) >>> 0) : n10 < 65536 ? (e206[t10++] = 224 | (n10 & 61440) >>> 12, e206[t10++] = 128 | (n10 & 4032) >>> 6, e206[t10++] = 128 | (n10 & 63) >>> 0) : (e206[t10++] = 240 | (n10 & 1835008) >>> 18, e206[t10++] = 128 | (n10 & 258048) >>> 12, e206[t10++] = 128 | (n10 & 4032) >>> 6, e206[t10++] = 128 | (n10 & 63) >>> 0), t10 >= 64 && (this._step(), t10 -= 64, this._totalLen += 64, e206[0] = e206[64], e206[1] = e206[65], e206[2] = e206[66]), t10;
  }
  digest() {
    return this._finished || (this._finished = true, this._leftoverHighSurrogate && (this._leftoverHighSurrogate = 0, this._buffLen = this._push(this._buff, this._buffLen, 65533)), this._totalLen += this._buffLen, this._wrapUp()), Vs(this._h0) + Vs(this._h1) + Vs(this._h2) + Vs(this._h3) + Vs(this._h4);
  }
  _wrapUp() {
    this._buff[this._buffLen++] = 128, this._buff.subarray(this._buffLen).fill(0), this._buffLen > 56 && (this._step(), this._buff.fill(0));
    let e206 = 8 * this._totalLen;
    this._buffDV.setUint32(56, Math.floor(e206 / 4294967296), false), this._buffDV.setUint32(60, e206 % 4294967296, false), this._step();
  }
  _step() {
    let t10 = _r2._bigBlock32, n10 = this._buffDV;
    for (let e206 = 0; e206 < 64; e206 += 4) t10.setUint32(e206, n10.getUint32(e206, false), false);
    for (let e206 = 64; e206 < 320; e206 += 4) t10.setUint32(e206, Bs(t10.getUint32(e206 - 12, false) ^ t10.getUint32(e206 - 32, false) ^ t10.getUint32(e206 - 56, false) ^ t10.getUint32(e206 - 64, false), 1), false);
    let r10 = this._h0, i10 = this._h1, a10 = this._h2, o10 = this._h3, s10 = this._h4, c10, l10, u10;
    for (let e206 = 0; e206 < 80; e206++) e206 < 20 ? (c10 = i10 & a10 | ~i10 & o10, l10 = 1518500249) : e206 < 40 ? (c10 = i10 ^ a10 ^ o10, l10 = 1859775393) : e206 < 60 ? (c10 = i10 & a10 | i10 & o10 | a10 & o10, l10 = 2400959708) : (c10 = i10 ^ a10 ^ o10, l10 = 3395469782), u10 = Bs(r10, 5) + c10 + s10 + l10 + t10.getUint32(e206 * 4, false) & 4294967295, s10 = o10, o10 = a10, a10 = Bs(i10, 30), i10 = r10, r10 = u10;
    this._h0 = this._h0 + r10 & 4294967295, this._h1 = this._h1 + i10 & 4294967295, this._h2 = this._h2 + a10 & 4294967295, this._h3 = this._h3 + o10 & 4294967295, this._h4 = this._h4 + s10 & 4294967295;
  }
}, _r2._bigBlock32 = new DataView(new ArrayBuffer(320)), _r2), Hs;
function Jte(e206) {
  Hs ? Hs instanceof Ws ? Hs.loggers.push(e206) : Hs = new Ws([Hs, e206]) : Hs = e206;
}
function Us() {
  return Hs;
}
var Ws = class {
  constructor(e206) {
    this.loggers = e206;
  }
  handleObservableCreated(e206, t10) {
    for (let n10 of this.loggers) n10.handleObservableCreated(e206, t10);
  }
  handleOnListenerCountChanged(e206, t10) {
    for (let n10 of this.loggers) n10.handleOnListenerCountChanged(e206, t10);
  }
  handleObservableUpdated(e206, t10) {
    for (let n10 of this.loggers) n10.handleObservableUpdated(e206, t10);
  }
  handleAutorunCreated(e206, t10) {
    for (let n10 of this.loggers) n10.handleAutorunCreated(e206, t10);
  }
  handleAutorunDisposed(e206) {
    for (let t10 of this.loggers) t10.handleAutorunDisposed(e206);
  }
  handleAutorunDependencyChanged(e206, t10, n10) {
    for (let r10 of this.loggers) r10.handleAutorunDependencyChanged(e206, t10, n10);
  }
  handleAutorunStarted(e206) {
    for (let t10 of this.loggers) t10.handleAutorunStarted(e206);
  }
  handleAutorunFinished(e206) {
    for (let t10 of this.loggers) t10.handleAutorunFinished(e206);
  }
  handleDerivedDependencyChanged(e206, t10, n10) {
    for (let r10 of this.loggers) r10.handleDerivedDependencyChanged(e206, t10, n10);
  }
  handleDerivedCleared(e206) {
    for (let t10 of this.loggers) t10.handleDerivedCleared(e206);
  }
  handleBeginTransaction(e206) {
    for (let t10 of this.loggers) t10.handleBeginTransaction(e206);
  }
  handleEndTransaction(e206) {
    for (let t10 of this.loggers) t10.handleEndTransaction(e206);
  }
}, Gs;
(function(e206) {
  let t10 = false;
  function n10() {
    t10 = true;
  }
  e206.enable = n10;
  function r10() {
    if (!t10) return;
    let e207 = Error, n11 = e207.stackTraceLimit;
    e207.stackTraceLimit = 3;
    let r11 = Error().stack;
    return e207.stackTraceLimit = n11, Yte.fromStack(r11, 2);
  }
  e206.ofCaller = r10;
})(Gs || (Gs = {}));
var Yte = class e19 {
  static fromStack(t10, n10) {
    let r10 = Xte(t10.split(`
`)[n10 + 1]);
    if (r10) return new e19(r10.fileName, r10.line, r10.column, r10.id);
  }
  constructor(e206, t10, n10, r10) {
    this.fileName = e206, this.line = t10, this.column = n10, this.id = r10;
  }
};
function Xte(e206) {
  let t10 = e206.match(/\((.*):(\d+):(\d+)\)/);
  if (t10) return { fileName: t10[1], line: parseInt(t10[2]), column: parseInt(t10[3]), id: e206 };
  let n10 = e206.match(/at ([^\(\)]*):(\d+):(\d+)/);
  if (n10) return { fileName: n10[1], line: parseInt(n10[2]), column: parseInt(n10[3]), id: e206 };
}
var Ks = (e206, t10) => e206 === t10;
function qs(e206 = Ks) {
  return (t10, n10) => o(t10, n10, e206);
}
function Js() {
  return (e206, t10) => e206.equals(t10);
}
function Ys(e206, t10, n10) {
  if (n10 !== void 0) {
    let r10 = e206;
    return r10 == null || t10 == null ? t10 === r10 : n10(r10, t10);
  } else {
    let t11 = e206;
    return (e207, n11) => e207 == null || n11 == null ? n11 === e207 : t11(e207, n11);
  }
}
function Xs(e206, t10) {
  if (e206 === t10) return true;
  if (Array.isArray(e206) && Array.isArray(t10)) {
    if (e206.length !== t10.length) return false;
    for (let n10 = 0; n10 < e206.length; n10++) if (!Xs(e206[n10], t10[n10])) return false;
    return true;
  }
  if (e206 && typeof e206 == `object` && t10 && typeof t10 == `object` && Object.getPrototypeOf(e206) === Object.prototype && Object.getPrototypeOf(t10) === Object.prototype) {
    let n10 = e206, r10 = t10, i10 = Object.keys(n10), a10 = Object.keys(r10), o10 = new Set(a10);
    if (i10.length !== a10.length) return false;
    for (let e207 of i10) if (!o10.has(e207) || !Xs(n10[e207], r10[e207])) return false;
    return true;
  }
  return false;
}
var Zs = class {
  constructor(e206, t10, n10) {
    this.owner = e206, this.debugNameSource = t10, this.referenceFn = n10;
  }
  getDebugName(e206) {
    return Zte(e206, this);
  }
}, Qs = /* @__PURE__ */ new Map(), $s = /* @__PURE__ */ new WeakMap();
function Zte(e206, t10) {
  let n10 = $s.get(e206);
  if (n10) return n10;
  let r10 = Qte(e206, t10);
  if (r10) {
    let t11 = Qs.get(r10) ?? 0;
    t11++, Qs.set(r10, t11);
    let n11 = t11 === 1 ? r10 : `${r10}#${t11}`;
    return $s.set(e206, n11), n11;
  }
}
function Qte(e206, t10) {
  let n10 = $s.get(e206);
  if (n10) return n10;
  let r10 = t10.owner ? ene(t10.owner) + `.` : ``, i10, a10 = t10.debugNameSource;
  if (a10 !== void 0) if (typeof a10 == `function`) {
    if (i10 = a10(), i10 !== void 0) return r10 + i10;
  } else return r10 + a10;
  let o10 = t10.referenceFn;
  if (o10 !== void 0 && (i10 = rc(o10), i10 !== void 0)) return r10 + i10;
  if (t10.owner !== void 0) {
    let n11 = $te(t10.owner, e206);
    if (n11 !== void 0) return r10 + n11;
  }
}
function $te(e206, t10) {
  for (let n10 in e206) if (e206[n10] === t10) return n10;
}
var ec = /* @__PURE__ */ new Map(), tc = /* @__PURE__ */ new WeakMap();
function ene(e206) {
  let t10 = tc.get(e206);
  if (t10) return t10;
  let n10 = nc(e206) ?? `Object`, r10 = ec.get(n10) ?? 0;
  r10++, ec.set(n10, r10);
  let i10 = r10 === 1 ? n10 : `${n10}#${r10}`;
  return tc.set(e206, i10), i10;
}
function nc(e206) {
  let t10 = e206.constructor;
  if (t10) return t10.name === `Object` ? void 0 : t10.name;
}
function rc(e206) {
  let t10 = e206.toString(), n10 = /\/\*\*\s*@description\s*([^*]*)\*\//.exec(t10);
  return (n10 ? n10[1] : void 0)?.trim();
}
var ic;
function tne(e206) {
  ic = e206;
}
var ac;
function nne(e206) {
  ac = e206;
}
var oc = class {
  get TChange() {
    return null;
  }
  reportChanges() {
    this.get();
  }
  read(e206) {
    return e206 ? e206.readObservable(this) : this.get();
  }
  map(e206, t10, n10 = Gs.ofCaller()) {
    let r10 = t10 === void 0 ? void 0 : e206, i10 = t10 === void 0 ? e206 : t10;
    return ic({ owner: r10, debugName: () => {
      let e207 = rc(i10);
      if (e207 !== void 0) return e207;
      let t11 = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(i10.toString());
      if (t11) return `${this.debugName}.${t11[2]}`;
      if (!r10) return `${this.debugName} (mapped)`;
    }, debugReferenceFn: i10 }, (e207) => i10(this.read(e207), e207), n10);
  }
  flatten() {
    return ic({ owner: void 0, debugName: () => `${this.debugName} (flattened)` }, (e206) => this.read(e206).read(e206));
  }
  recomputeInitiallyAndOnChange(e206, t10) {
    return e206.add(ac(this, t10)), this;
  }
}, sc = class extends oc {
  constructor(e206) {
    super(), this._observers = /* @__PURE__ */ new Set(), Us()?.handleObservableCreated(this, e206);
  }
  addObserver(e206) {
    let t10 = this._observers.size;
    this._observers.add(e206), t10 === 0 && this.onFirstObserverAdded(), t10 !== this._observers.size && Us()?.handleOnListenerCountChanged(this, this._observers.size);
  }
  removeObserver(e206) {
    let t10 = this._observers.delete(e206);
    t10 && this._observers.size === 0 && this.onLastObserverRemoved(), t10 && Us()?.handleOnListenerCountChanged(this, this._observers.size);
  }
  onFirstObserverAdded() {
  }
  onLastObserverRemoved() {
  }
  debugGetObservers() {
    return this._observers;
  }
};
function rne(e206) {
  switch (e206) {
    case 0:
      return `initial`;
    case 1:
      return `dependenciesMightHaveChanged`;
    case 2:
      return `stale`;
    case 3:
      return `upToDate`;
    default:
      return `<unknown>`;
  }
}
var cc = class extends sc {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? `(anonymous)`;
  }
  constructor(e206, t10, n10, r10 = void 0, i10, a10) {
    super(a10), this._debugNameData = e206, this._computeFn = t10, this._changeTracker = n10, this._handleLastObserverRemoved = r10, this._equalityComparator = i10, this._state = 0, this._value = void 0, this._updateCount = 0, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._changeSummary = void 0, this._isUpdating = false, this._isComputing = false, this._didReportChange = false, this._isInBeforeUpdate = false, this._isReaderValid = false, this._store = void 0, this._delayedStore = void 0, this._removedObserverToCallEndUpdateOn = null, this._changeSummary = this._changeTracker?.createChangeSummary(void 0);
  }
  onLastObserverRemoved() {
    this._state = 0, this._value = void 0, Us()?.handleDerivedCleared(this);
    for (let e206 of this._dependencies) e206.removeObserver(this);
    this._dependencies.clear(), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._delayedStore !== void 0 && (this._delayedStore.dispose(), this._delayedStore = void 0), this._handleLastObserverRemoved?.();
  }
  get() {
    if (this._isComputing, this._observers.size === 0) {
      let e206;
      try {
        this._isReaderValid = true;
        let t10;
        this._changeTracker && (t10 = this._changeTracker.createChangeSummary(void 0), this._changeTracker.beforeUpdate?.(this, t10)), e206 = this._computeFn(this, t10);
      } finally {
        this._isReaderValid = false;
      }
      return this.onLastObserverRemoved(), e206;
    } else {
      do {
        if (this._state === 1) {
          for (let e206 of this._dependencies) if (e206.reportChanges(), this._state === 2) break;
        }
        this._state === 1 && (this._state = 3), this._state !== 3 && this._recompute();
      } while (this._state !== 3);
      return this._value;
    }
  }
  _recompute() {
    let e206 = false;
    this._isComputing = true, this._didReportChange = false;
    let t10 = this._dependenciesToBeRemoved;
    this._dependenciesToBeRemoved = this._dependencies, this._dependencies = t10;
    try {
      let t11 = this._changeSummary;
      this._isReaderValid = true, this._changeTracker && (this._isInBeforeUpdate = true, this._changeTracker.beforeUpdate?.(this, t11), this._isInBeforeUpdate = false, this._changeSummary = this._changeTracker?.createChangeSummary(t11));
      let n10 = this._state !== 0, r10 = this._value;
      this._state = 3;
      let i10 = this._delayedStore;
      i10 !== void 0 && (this._delayedStore = void 0);
      try {
        this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._value = this._computeFn(this, t11);
      } finally {
        this._isReaderValid = false;
        for (let e207 of this._dependenciesToBeRemoved) e207.removeObserver(this);
        this._dependenciesToBeRemoved.clear(), i10 !== void 0 && i10.dispose();
      }
      e206 = this._didReportChange || n10 && !this._equalityComparator(r10, this._value), Us()?.handleObservableUpdated(this, { oldValue: r10, newValue: this._value, change: void 0, didChange: e206, hadValue: n10 });
    } catch (e207) {
      ye(e207);
    }
    if (this._isComputing = false, !this._didReportChange && e206) for (let e207 of this._observers) e207.handleChange(this, void 0);
    else this._didReportChange = false;
  }
  toString() {
    return `LazyDerived<${this.debugName}>`;
  }
  beginUpdate(e206) {
    if (this._isUpdating) throw new je(`Cyclic deriveds are not supported yet!`);
    this._updateCount++, this._isUpdating = true;
    try {
      let e207 = this._updateCount === 1;
      if (this._state === 3 && (this._state = 1, !e207)) for (let e208 of this._observers) e208.handlePossibleChange(this);
      if (e207) for (let e208 of this._observers) e208.beginUpdate(this);
    } finally {
      this._isUpdating = false;
    }
  }
  endUpdate(e206) {
    if (this._updateCount--, this._updateCount === 0) {
      let e207 = [...this._observers];
      for (let t10 of e207) t10.endUpdate(this);
      if (this._removedObserverToCallEndUpdateOn) {
        let e208 = [...this._removedObserverToCallEndUpdateOn];
        this._removedObserverToCallEndUpdateOn = null;
        for (let t10 of e208) t10.endUpdate(this);
      }
    }
    Ie(() => this._updateCount >= 0);
  }
  handlePossibleChange(e206) {
    if (this._state === 3 && this._dependencies.has(e206) && !this._dependenciesToBeRemoved.has(e206)) {
      this._state = 1;
      for (let e207 of this._observers) e207.handlePossibleChange(this);
    }
  }
  handleChange(e206, t10) {
    if (this._dependencies.has(e206) && !this._dependenciesToBeRemoved.has(e206) || this._isInBeforeUpdate) {
      Us()?.handleDerivedDependencyChanged(this, e206, t10);
      let n10 = false;
      try {
        n10 = this._changeTracker ? this._changeTracker.handleChange({ changedObservable: e206, change: t10, didChange: (t11) => t11 === e206 }, this._changeSummary) : true;
      } catch (e207) {
        ye(e207);
      }
      let r10 = this._state === 3;
      if (n10 && (this._state === 1 || r10) && (this._state = 2, r10)) for (let e207 of this._observers) e207.handlePossibleChange(this);
    }
  }
  _ensureReaderValid() {
    if (!this._isReaderValid) throw new je(`The reader object cannot be used outside its compute function!`);
  }
  readObservable(e206) {
    this._ensureReaderValid(), e206.addObserver(this);
    let t10 = e206.get();
    return this._dependencies.add(e206), this._dependenciesToBeRemoved.delete(e206), t10;
  }
  get store() {
    return this._ensureReaderValid(), this._store === void 0 && (this._store = new E()), this._store;
  }
  addObserver(e206) {
    let t10 = !this._observers.has(e206) && this._updateCount > 0;
    super.addObserver(e206), t10 && (this._removedObserverToCallEndUpdateOn && this._removedObserverToCallEndUpdateOn.has(e206) ? this._removedObserverToCallEndUpdateOn.delete(e206) : e206.beginUpdate(this));
  }
  removeObserver(e206) {
    this._observers.has(e206) && this._updateCount > 0 && (this._removedObserverToCallEndUpdateOn || (this._removedObserverToCallEndUpdateOn = /* @__PURE__ */ new Set()), this._removedObserverToCallEndUpdateOn.add(e206)), super.removeObserver(e206);
  }
  debugGetState() {
    return { state: this._state, stateStr: rne(this._state), updateCount: this._updateCount, isComputing: this._isComputing, dependencies: this._dependencies, value: this._value };
  }
  debugSetValue(e206) {
    this._value = e206;
  }
  debugRecompute() {
    this._isComputing ? this._state = 2 : this._recompute();
  }
  setValue(e206, t10, n10) {
    this._value = e206;
    let r10 = this._observers;
    t10.updateObserver(this, this);
    for (let e207 of r10) e207.handleChange(this, n10);
  }
}, lc = class extends cc {
  constructor(e206, t10, n10, r10 = void 0, i10, a10, o10) {
    super(e206, t10, n10, r10, i10, o10), this.set = a10;
  }
};
function I(e206, t10, n10 = Gs.ofCaller()) {
  return t10 === void 0 ? new cc(new Zs(void 0, void 0, e206), e206, void 0, void 0, Ks, n10) : new cc(new Zs(e206, void 0, t10), t10, void 0, void 0, Ks, n10);
}
function uc(e206, t10, n10, r10 = Gs.ofCaller()) {
  return new lc(new Zs(e206, void 0, t10), t10, void 0, void 0, Ks, n10, r10);
}
function dc(e206, t10, n10 = Gs.ofCaller()) {
  return new cc(new Zs(e206.owner, e206.debugName, e206.debugReferenceFn), t10, void 0, e206.onLastObserverRemoved, e206.equalsFn ?? Ks, n10);
}
tne(dc);
function fc(e206, t10, n10 = Gs.ofCaller()) {
  return new cc(new Zs(e206.owner, e206.debugName, void 0), t10, e206.changeTracker, void 0, e206.equalityComparer ?? Ks, n10);
}
function pc(e206, t10, n10 = Gs.ofCaller()) {
  let r10, i10;
  t10 === void 0 ? (r10 = e206, i10 = void 0) : (i10 = e206, r10 = t10);
  let a10;
  return new cc(new Zs(i10, void 0, r10), (e207) => {
    a10 ? a10.clear() : a10 = new E();
    let t11 = r10(e207);
    return t11 && a10.add(t11), t11;
  }, void 0, () => {
    a10 && (a10 = (a10.dispose(), void 0));
  }, Ks, n10);
}
function ine(e206) {
  switch (e206) {
    case 1:
      return `dependenciesMightHaveChanged`;
    case 2:
      return `stale`;
    case 3:
      return `upToDate`;
    default:
      return `<unknown>`;
  }
}
var mc = class {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? `(anonymous)`;
  }
  constructor(e206, t10, n10, r10) {
    this._debugNameData = e206, this._runFn = t10, this._changeTracker = n10, this._state = 2, this._updateCount = 0, this._disposed = false, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = false, this._store = void 0, this._delayedStore = void 0, this._changeSummary = this._changeTracker?.createChangeSummary(void 0), Us()?.handleAutorunCreated(this, r10), this._run();
  }
  dispose() {
    if (!this._disposed) {
      this._disposed = true;
      for (let e206 of this._dependencies) e206.removeObserver(this);
      this._dependencies.clear(), this._store !== void 0 && this._store.dispose(), this._delayedStore !== void 0 && this._delayedStore.dispose(), Us()?.handleAutorunDisposed(this);
    }
  }
  _run() {
    let e206 = this._dependenciesToBeRemoved;
    this._dependenciesToBeRemoved = this._dependencies, this._dependencies = e206, this._state = 3;
    try {
      if (!this._disposed) {
        Us()?.handleAutorunStarted(this);
        let e207 = this._changeSummary, t10 = this._delayedStore;
        t10 !== void 0 && (this._delayedStore = void 0);
        try {
          this._isRunning = true, this._changeTracker && (this._changeTracker.beforeUpdate?.(this, e207), this._changeSummary = this._changeTracker.createChangeSummary(e207)), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._runFn(this, e207);
        } catch (e208) {
          ye(e208);
        } finally {
          this._isRunning = false, t10 !== void 0 && t10.dispose();
        }
      }
    } finally {
      this._disposed || Us()?.handleAutorunFinished(this);
      for (let e207 of this._dependenciesToBeRemoved) e207.removeObserver(this);
      this._dependenciesToBeRemoved.clear();
    }
  }
  toString() {
    return `Autorun<${this.debugName}>`;
  }
  beginUpdate(e206) {
    this._state === 3 && (this._state = 1), this._updateCount++;
  }
  endUpdate(e206) {
    try {
      if (this._updateCount === 1) do {
        if (this._state === 1) {
          this._state = 3;
          for (let e207 of this._dependencies) if (e207.reportChanges(), this._state === 2) break;
        }
        this._state !== 3 && this._run();
      } while (this._state !== 3);
    } finally {
      this._updateCount--;
    }
    Ie(() => this._updateCount >= 0);
  }
  handlePossibleChange(e206) {
    this._state === 3 && this._isDependency(e206) && (this._state = 1);
  }
  handleChange(e206, t10) {
    if (this._isDependency(e206)) {
      Us()?.handleAutorunDependencyChanged(this, e206, t10);
      try {
        (!this._changeTracker || this._changeTracker.handleChange({ changedObservable: e206, change: t10, didChange: (t11) => t11 === e206 }, this._changeSummary)) && (this._state = 2);
      } catch (e207) {
        ye(e207);
      }
    }
  }
  _isDependency(e206) {
    return this._dependencies.has(e206) && !this._dependenciesToBeRemoved.has(e206);
  }
  _ensureNoRunning() {
    if (!this._isRunning) throw new je(`The reader object cannot be used outside its compute function!`);
  }
  readObservable(e206) {
    if (this._ensureNoRunning(), this._disposed) return e206.get();
    e206.addObserver(this);
    let t10 = e206.get();
    return this._dependencies.add(e206), this._dependenciesToBeRemoved.delete(e206), t10;
  }
  get store() {
    if (this._ensureNoRunning(), this._disposed) throw new je(`Cannot access store after dispose`);
    return this._store === void 0 && (this._store = new E()), this._store;
  }
  debugGetState() {
    return { isRunning: this._isRunning, updateCount: this._updateCount, dependencies: this._dependencies, state: this._state, stateStr: ine(this._state) };
  }
  debugRerun() {
    this._isRunning ? this._state = 2 : this._run();
  }
};
function hc(e206, t10 = Gs.ofCaller()) {
  return new mc(new Zs(void 0, void 0, e206), e206, void 0, t10);
}
function gc(e206, t10, n10 = Gs.ofCaller()) {
  return new mc(new Zs(e206.owner, e206.debugName, e206.debugReferenceFn ?? t10), t10, void 0, n10);
}
function _c(e206, t10, n10 = Gs.ofCaller()) {
  return new mc(new Zs(e206.owner, e206.debugName, e206.debugReferenceFn ?? t10), t10, e206.changeTracker, n10);
}
function ane(e206, t10) {
  let n10 = new E(), r10 = _c({ owner: e206.owner, debugName: e206.debugName, debugReferenceFn: e206.debugReferenceFn ?? t10, changeTracker: e206.changeTracker }, (e207, r11) => {
    n10.clear(), t10(e207, r11, n10);
  });
  return T(() => {
    r10.dispose(), n10.dispose();
  });
}
function vc(e206) {
  let t10 = new E(), n10 = gc({ owner: void 0, debugName: void 0, debugReferenceFn: e206 }, (n11) => {
    t10.clear(), e206(n11, t10);
  });
  return T(() => {
    n10.dispose(), t10.dispose();
  });
}
function one(e206, t10) {
  let n10;
  return gc({ debugReferenceFn: t10 }, (r10) => {
    let i10 = e206.read(r10), a10 = n10;
    n10 = i10, t10({ lastValue: a10, newValue: i10 });
  });
}
function yc(e206) {
  let t10 = Error(`BugIndicatingErrorRecovery: ` + e206);
  be(t10), console.error(`recovered from an error that indicates a bug`, t10);
}
function bc(e206, t10) {
  let n10 = new wc(e206, t10);
  try {
    e206(n10);
  } finally {
    n10.finish();
  }
}
var xc = void 0;
function Sc(e206) {
  if (xc) e206(xc);
  else {
    let t10 = new wc(e206, void 0);
    xc = t10;
    try {
      e206(t10);
    } finally {
      t10.finish(), xc = void 0;
    }
  }
}
async function sne(e206, t10) {
  let n10 = new wc(e206, t10);
  try {
    await e206(n10);
  } finally {
    n10.finish();
  }
}
function Cc(e206, t10, n10) {
  e206 ? t10(e206) : bc(t10, n10);
}
var wc = class {
  constructor(e206, t10) {
    this._fn = e206, this._getDebugName = t10, this._updatingObservers = [], Us()?.handleBeginTransaction(this);
  }
  getDebugName() {
    return this._getDebugName ? this._getDebugName() : rc(this._fn);
  }
  updateObserver(e206, t10) {
    if (!this._updatingObservers) {
      yc(`Transaction already finished!`), bc((n10) => {
        n10.updateObserver(e206, t10);
      });
      return;
    }
    this._updatingObservers.push({ observer: e206, observable: t10 }), e206.beginUpdate(t10);
  }
  finish() {
    let e206 = this._updatingObservers;
    if (!e206) {
      yc(`transaction.finish() has already been called!`);
      return;
    }
    for (let t10 = 0; t10 < e206.length; t10++) {
      let { observer: n10, observable: r10 } = e206[t10];
      n10.endUpdate(r10);
    }
    this._updatingObservers = null, Us()?.handleEndTransaction(this);
  }
  debugGetUpdatingObservers() {
    return this._updatingObservers;
  }
};
function Tc(...e206) {
  let t10, n10, r10, i10;
  return e206.length === 2 ? [n10, r10] = e206 : [t10, n10, r10, i10] = e206, new Dc(new Zs(t10, void 0, r10), n10, r10, () => Dc.globalTransaction, Ks, i10 ?? Gs.ofCaller());
}
function Ec(e206, t10, n10, r10 = Gs.ofCaller()) {
  return new Dc(new Zs(e206.owner, e206.debugName, e206.debugReferenceFn ?? n10), t10, n10, () => Dc.globalTransaction, e206.equalsFn ?? Ks, r10);
}
var Dc = class extends sc {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(a10), this._debugNameData = e206, this.event = t10, this._getValue = n10, this._getTransaction = r10, this._equalityComparator = i10, this._hasValue = false, this.handleEvent = (e207) => {
      let t11 = this._getValue(e207), n11 = this._value, r11 = !this._hasValue || !this._equalityComparator(n11, t11), i11 = false;
      r11 && (this._value = t11, this._hasValue && (i11 = true, Cc(this._getTransaction(), (e208) => {
        Us()?.handleObservableUpdated(this, { oldValue: n11, newValue: t11, change: void 0, didChange: r11, hadValue: this._hasValue });
        for (let t12 of this._observers) e208.updateObserver(t12, this), t12.handleChange(this, void 0);
      }, () => {
        let e208 = this.getDebugName();
        return `Event fired` + (e208 ? `: ${e208}` : ``);
      })), this._hasValue = true), i11 || Us()?.handleObservableUpdated(this, { oldValue: n11, newValue: t11, change: void 0, didChange: r11, hadValue: this._hasValue });
    };
  }
  getDebugName() {
    return this._debugNameData.getDebugName(this);
  }
  get debugName() {
    let e206 = this.getDebugName();
    return `From Event` + (e206 ? `: ${e206}` : ``);
  }
  onFirstObserverAdded() {
    this._subscription = this.event(this.handleEvent);
  }
  onLastObserverRemoved() {
    this._subscription.dispose(), this._subscription = void 0, this._hasValue = false, this._value = void 0;
  }
  get() {
    return this._subscription ? (this._hasValue || this.handleEvent(void 0), this._value) : this._getValue(void 0);
  }
  debugSetValue(e206) {
    this._value = e206;
  }
  debugGetState() {
    return { value: this._value, hasValue: this._hasValue };
  }
};
(function(e206) {
  e206.Observer = Dc;
  function t10(e207, t11) {
    let n10 = false;
    Dc.globalTransaction === void 0 && (Dc.globalTransaction = e207, n10 = true);
    try {
      t11();
    } finally {
      n10 && (Dc.globalTransaction = void 0);
    }
  }
  e206.batchEventsGlobally = t10;
})(Tc || (Tc = {}));
function Oc(e206, t10) {
  let n10 = false, r10, i10;
  return Tc((a10) => {
    let o10 = hc((o11) => {
      let s10 = e206.read(o11);
      n10 ? (i10 && clearTimeout(i10), i10 = setTimeout(() => {
        r10 = s10, a10();
      }, t10)) : (n10 = true, r10 = s10);
    });
    return { dispose() {
      o10.dispose(), n10 = false, r10 = void 0;
    } };
  }, () => n10 ? r10 : e206.get());
}
function kc(e206, t10) {
  let n10 = new cne(true, t10);
  e206.addObserver(n10);
  try {
    n10.beginUpdate(e206);
  } finally {
    n10.endUpdate(e206);
  }
  return T(() => {
    e206.removeObserver(n10);
  });
}
nne(kc);
var cne = class {
  constructor(e206, t10) {
    this._forceRecompute = e206, this._handleValue = t10, this._counter = 0;
  }
  beginUpdate(e206) {
    this._counter++;
  }
  endUpdate(e206) {
    this._counter === 1 && this._forceRecompute && (this._handleValue ? this._handleValue(e206.get()) : e206.reportChanges()), this._counter--;
  }
  handlePossibleChange(e206) {
  }
  handleChange(e206, t10) {
  }
};
function Ac(e206, t10) {
  let n10;
  return dc({ owner: e206, debugReferenceFn: t10 }, (e207) => (n10 = t10(e207, n10), n10));
}
function jc(e206, t10, n10, r10) {
  let i10 = new Mc(n10, r10);
  return dc({ debugReferenceFn: n10, owner: e206, onLastObserverRemoved: () => {
    i10.dispose(), i10 = new Mc(n10);
  } }, (e207) => (i10.setItems(t10.read(e207)), i10.getItems()));
}
var Mc = class {
  constructor(e206, t10) {
    this._map = e206, this._keySelector = t10, this._cache = /* @__PURE__ */ new Map(), this._items = [];
  }
  dispose() {
    this._cache.forEach((e206) => e206.store.dispose()), this._cache.clear();
  }
  setItems(e206) {
    let t10 = [], n10 = new Set(this._cache.keys());
    for (let r10 of e206) {
      let e207 = this._keySelector ? this._keySelector(r10) : r10, i10 = this._cache.get(e207);
      if (i10) n10.delete(e207);
      else {
        let t11 = new E();
        i10 = { out: this._map(r10, t11), store: t11 }, this._cache.set(e207, i10);
      }
      t10.push(i10.out);
    }
    for (let e207 of n10) this._cache.get(e207).store.dispose(), this._cache.delete(e207);
    this._items = t10;
  }
  getItems() {
    return this._items;
  }
};
function Nc(e206, t10) {
  switch (typeof e206) {
    case `number`:
      return `` + e206;
    case `string`:
      return e206.length + 2 <= t10 ? `"${e206}"` : `"${e206.substr(0, t10 - 7)}"+...`;
    case `boolean`:
      return e206 ? `true` : `false`;
    case `undefined`:
      return `undefined`;
    case `object`:
      return e206 === null ? `null` : Array.isArray(e206) ? lne(e206, t10) : une(e206, t10);
    case `symbol`:
      return e206.toString();
    case `function`:
      return `[[Function${e206.name ? ` ` + e206.name : ``}]]`;
    default:
      return `` + e206;
  }
}
function lne(e206, t10) {
  let n10 = `[ `, r10 = true;
  for (let i10 of e206) {
    if (r10 || (n10 += `, `), n10.length - 5 > t10) {
      n10 += `...`;
      break;
    }
    r10 = false, n10 += `${Nc(i10, t10 - n10.length)}`;
  }
  return n10 += ` ]`, n10;
}
function une(e206, t10) {
  if (typeof e206.toString == `function` && e206.toString !== Object.prototype.toString) {
    let n11 = e206.toString();
    return n11.length <= t10 ? n11 : n11.substring(0, t10 - 3) + `...`;
  }
  let n10 = nc(e206), r10 = n10 ? n10 + `(` : `{ `, i10 = true;
  for (let [n11, a10] of Object.entries(e206)) {
    if (i10 || (r10 += `, `), r10.length - 5 > t10) {
      r10 += `...`;
      break;
    }
    i10 = false, r10 += `${n11}: ${Nc(a10, t10 - r10.length)}`;
  }
  return r10 += n10 ? `)` : ` }`, r10;
}
var dne = class e20 {
  static createClient(t10, n10) {
    return new e20(t10, n10);
  }
  constructor(e206, t10) {
    this._channelFactory = e206, this._getHandler = t10, this._channel = this._channelFactory({ handleNotification: (e207) => {
      let t11 = e207, n11 = this._getHandler().notifications[t11[0]];
      if (!n11) throw Error(`Unknown notification "${t11[0]}"!`);
      n11(...t11[1]);
    }, handleRequest: (e207) => {
      let t11 = e207;
      try {
        return { type: `result`, value: this._getHandler().requests[t11[0]](...t11[1]) };
      } catch (e208) {
        return { type: `error`, value: e208 };
      }
    } });
    let n10 = new Proxy({}, { get: (e207, t11) => async (...e208) => {
      let n11 = await this._channel.sendRequest([t11, e208]);
      if (n11.type === `error`) throw n11.value;
      return n11.value;
    } });
    this.api = { notifications: new Proxy({}, { get: (e207, t11) => (...e208) => {
      this._channel.sendNotification([t11, e208]);
    } }), requests: n10 };
  }
};
function fne(e206, t10) {
  let n10 = globalThis, r10 = [], i10, { channel: a10, handler: o10 } = pne({ sendNotification: (e207) => {
    i10 ? i10.sendNotification(e207) : r10.push(e207);
  } }), s10;
  return (n10.$$debugValueEditor_debugChannels ?? (n10.$$debugValueEditor_debugChannels = {}))[e206] = (e207) => {
    s10 = t10(), i10 = e207;
    for (let t11 of r10) e207.sendNotification(t11);
    return r10 = [], o10;
  }, dne.createClient(a10, () => {
    if (!s10) throw Error(`Not supported`);
    return s10;
  });
}
function pne(e206) {
  let t10;
  return { channel: (n10) => (t10 = n10, { sendNotification: (t11) => {
    e206.sendNotification(t11);
  }, sendRequest: (e207) => {
    throw Error(`not supported`);
  } }), handler: { handleRequest: (e207) => e207.type === `notification` ? t10?.handleNotification(e207.data) : t10?.handleRequest(e207.data) } };
}
var mne = class {
  constructor() {
    this._timeout = void 0;
  }
  throttle(e206, t10) {
    this._timeout === void 0 && (this._timeout = setTimeout(() => {
      this._timeout = void 0, e206();
    }, t10));
  }
  dispose() {
    this._timeout !== void 0 && clearTimeout(this._timeout);
  }
};
function Pc(e206, t10) {
  for (let n10 in t10) e206[n10] && typeof e206[n10] == `object` && t10[n10] && typeof t10[n10] == `object` ? Pc(e206[n10], t10[n10]) : e206[n10] = t10[n10];
}
function Fc(e206, t10) {
  for (let n10 in t10) t10[n10] === null ? delete e206[n10] : e206[n10] && typeof e206[n10] == `object` && t10[n10] && typeof t10[n10] == `object` ? Fc(e206[n10], t10[n10]) : e206[n10] = t10[n10];
}
function Ic(e206, t10, n10 = Gs.ofCaller()) {
  let r10;
  return r10 = typeof e206 == `string` ? new Zs(void 0, e206, void 0) : new Zs(e206, void 0, void 0), new Lc(r10, t10, Ks, n10);
}
var Lc = class extends sc {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? `ObservableValue`;
  }
  constructor(e206, t10, n10, r10) {
    super(r10), this._debugNameData = e206, this._equalityComparator = n10, this._value = t10, Us()?.handleObservableUpdated(this, { hadValue: false, newValue: t10, change: void 0, didChange: true, oldValue: void 0 });
  }
  get() {
    return this._value;
  }
  set(e206, t10, n10) {
    if (n10 === void 0 && this._equalityComparator(this._value, e206)) return;
    let r10;
    t10 || (t10 = r10 = new wc(() => {
    }, () => `Setting ${this.debugName}`));
    try {
      let r11 = this._value;
      this._setValue(e206), Us()?.handleObservableUpdated(this, { oldValue: r11, newValue: e206, change: n10, didChange: true, hadValue: true });
      for (let e207 of this._observers) t10.updateObserver(e207, this), e207.handleChange(this, n10);
    } finally {
      r10 && r10.finish();
    }
  }
  toString() {
    return `${this.debugName}: ${this._value}`;
  }
  _setValue(e206) {
    this._value = e206;
  }
  debugGetState() {
    return { value: this._value };
  }
  debugSetValue(e206) {
    this._value = e206;
  }
};
function Rc(e206, t10, n10 = Gs.ofCaller()) {
  let r10;
  return r10 = typeof e206 == `string` ? new Zs(void 0, e206, void 0) : new Zs(e206, void 0, void 0), new zc(r10, t10, Ks, n10);
}
var zc = class extends Lc {
  _setValue(e206) {
    this._value !== e206 && (this._value && this._value.dispose(), this._value = e206);
  }
  dispose() {
    this._value?.dispose();
  }
}, Bc = (_s2 = class {
  static getInstance() {
    return _s2._instance === void 0 && (_s2._instance = new _s2()), _s2._instance;
  }
  getTransactionState() {
    let e206 = [], t10 = [...this._activeTransactions];
    if (t10.length === 0) return;
    let n10 = t10.flatMap((e207) => e207.debugGetUpdatingObservers() ?? []).map((e207) => e207.observer), r10 = /* @__PURE__ */ new Set();
    for (; n10.length > 0; ) {
      let t11 = n10.shift();
      if (r10.has(t11)) continue;
      r10.add(t11);
      let i10 = this._getInfo(t11, (e207) => {
        r10.has(e207) || n10.push(e207);
      });
      i10 && e206.push(i10);
    }
    return { names: t10.map((e207) => e207.getDebugName() ?? `tx`), affected: e206 };
  }
  _getObservableInfo(e206) {
    let t10 = this._instanceInfos.get(e206);
    if (!t10) {
      be(new je(`No info found`));
      return;
    }
    return t10;
  }
  _getAutorunInfo(e206) {
    let t10 = this._instanceInfos.get(e206);
    if (!t10) {
      be(new je(`No info found`));
      return;
    }
    return t10;
  }
  _getInfo(e206, t10) {
    if (e206 instanceof cc) {
      let n10 = [...e206.debugGetObservers()];
      for (let e207 of n10) t10(e207);
      let r10 = this._getObservableInfo(e206);
      if (!r10) return;
      let i10 = e206.debugGetState(), a10 = { name: e206.debugName, instanceId: r10.instanceId, updateCount: i10.updateCount }, o10 = [...r10.changedObservables].map((e207) => this._instanceInfos.get(e207)?.instanceId).filter(Ke);
      if (i10.isComputing) return { ...a10, type: `observable/derived`, state: `updating`, changedDependencies: o10, initialComputation: false };
      switch (i10.state) {
        case 0:
          return { ...a10, type: `observable/derived`, state: `noValue` };
        case 3:
          return { ...a10, type: `observable/derived`, state: `upToDate` };
        case 2:
          return { ...a10, type: `observable/derived`, state: `stale`, changedDependencies: o10 };
        case 1:
          return { ...a10, type: `observable/derived`, state: `possiblyStale` };
      }
    } else if (e206 instanceof mc) {
      let t11 = this._getAutorunInfo(e206);
      if (!t11) return;
      let n10 = { name: e206.debugName, instanceId: t11.instanceId, updateCount: t11.updateCount }, r10 = [...t11.changedObservables].map((e207) => this._instanceInfos.get(e207).instanceId);
      if (e206.debugGetState().isRunning) return { ...n10, type: `autorun`, state: `updating`, changedDependencies: r10 };
      switch (e206.debugGetState().state) {
        case 3:
          return { ...n10, type: `autorun`, state: `upToDate` };
        case 2:
          return { ...n10, type: `autorun`, state: `stale`, changedDependencies: r10 };
        case 1:
          return { ...n10, type: `autorun`, state: `possiblyStale` };
      }
    }
  }
  _formatObservable(e206) {
    let t10 = this._getObservableInfo(e206);
    if (t10) return { name: e206.debugName, instanceId: t10.instanceId };
  }
  _formatObserver(e206) {
    if (e206 instanceof cc) return { name: e206.toString(), instanceId: this._getObservableInfo(e206)?.instanceId };
    let t10 = this._getAutorunInfo(e206);
    if (t10) return { name: e206.toString(), instanceId: t10.instanceId };
  }
  constructor() {
    this._declarationId = 0, this._instanceId = 0, this._declarations = /* @__PURE__ */ new Map(), this._instanceInfos = /* @__PURE__ */ new WeakMap(), this._aliveInstances = /* @__PURE__ */ new Map(), this._activeTransactions = /* @__PURE__ */ new Set(), this._channel = fne(`observableDevTools`, () => ({ notifications: { setDeclarationIdFilter: (e206) => {
    }, logObservableValue: (e206) => {
      console.log(`logObservableValue`, e206);
    }, flushUpdates: () => {
      this._flushUpdates();
    }, resetUpdates: () => {
      this._pendingChanges = null, this._channel.api.notifications.handleChange(this._fullState, true);
    } }, requests: { getDeclarations: () => {
      let e206 = {};
      for (let t10 of this._declarations.values()) e206[t10.id] = t10;
      return { decls: e206 };
    }, getSummarizedInstances: () => null, getObservableValueInfo: (e206) => ({ observers: [...this._aliveInstances.get(e206).debugGetObservers()].map((e207) => this._formatObserver(e207)).filter(Ke) }), getDerivedInfo: (e206) => {
      let t10 = this._aliveInstances.get(e206);
      return { dependencies: [...t10.debugGetState().dependencies].map((e207) => this._formatObservable(e207)).filter(Ke), observers: [...t10.debugGetObservers()].map((e207) => this._formatObserver(e207)).filter(Ke) };
    }, getAutorunInfo: (e206) => ({ dependencies: [...this._aliveInstances.get(e206).debugGetState().dependencies].map((e207) => this._formatObservable(e207)).filter(Ke) }), getTransactionState: () => this.getTransactionState(), setValue: (e206, t10) => {
      let n10 = this._aliveInstances.get(e206);
      if (n10 instanceof cc) n10.debugSetValue(t10);
      else if (n10 instanceof Lc) n10.debugSetValue(t10);
      else if (n10 instanceof Dc) n10.debugSetValue(t10);
      else throw new je(`Observable is not supported`);
      let r10 = [...n10.debugGetObservers()];
      for (let e207 of r10) e207.beginUpdate(n10);
      for (let e207 of r10) e207.handleChange(n10, void 0);
      for (let e207 of r10) e207.endUpdate(n10);
    }, getValue: (e206) => {
      let t10 = this._aliveInstances.get(e206);
      if (t10 instanceof cc || t10 instanceof Lc) return Nc(t10.debugGetState().value, 200);
    }, logValue: (e206) => {
      let t10 = this._aliveInstances.get(e206);
      if (t10 && `get` in t10) console.log(`Logged Value:`, t10.get());
      else throw new je(`Observable is not supported`);
    }, rerun: (e206) => {
      let t10 = this._aliveInstances.get(e206);
      if (t10 instanceof cc) t10.debugRecompute();
      else if (t10 instanceof mc) t10.debugRerun();
      else throw new je(`Observable is not supported`);
    } } })), this._pendingChanges = null, this._changeThrottler = new mne(), this._fullState = {}, this._flushUpdates = () => {
      this._pendingChanges !== null && (this._channel.api.notifications.handleChange(this._pendingChanges, false), this._pendingChanges = null);
    }, Gs.enable();
  }
  _handleChange(e206) {
    Fc(this._fullState, e206), this._pendingChanges === null ? this._pendingChanges = e206 : Pc(this._pendingChanges, e206), this._changeThrottler.throttle(this._flushUpdates, 10);
  }
  _getDeclarationId(e206, t10) {
    if (!t10) return -1;
    let n10 = this._declarations.get(t10.id);
    return n10 === void 0 && (n10 = { id: this._declarationId++, type: e206, url: t10.fileName, line: t10.line, column: t10.column }, this._declarations.set(t10.id, n10), this._handleChange({ decls: { [n10.id]: n10 } })), n10.id;
  }
  handleObservableCreated(e206, t10) {
    let n10 = { declarationId: this._getDeclarationId(`observable/value`, t10), instanceId: this._instanceId++, listenerCount: 0, lastValue: void 0, updateCount: 0, changedObservables: /* @__PURE__ */ new Set() };
    this._instanceInfos.set(e206, n10);
  }
  handleOnListenerCountChanged(e206, t10) {
    let n10 = this._getObservableInfo(e206);
    if (n10) {
      if (n10.listenerCount === 0 && t10 > 0) {
        let t11 = e206 instanceof cc ? `observable/derived` : `observable/value`;
        this._aliveInstances.set(n10.instanceId, e206), this._handleChange({ instances: { [n10.instanceId]: { instanceId: n10.instanceId, declarationId: n10.declarationId, formattedValue: n10.lastValue, type: t11, name: e206.debugName } } });
      } else n10.listenerCount > 0 && t10 === 0 && (this._handleChange({ instances: { [n10.instanceId]: null } }), this._aliveInstances.delete(n10.instanceId));
      n10.listenerCount = t10;
    }
  }
  handleObservableUpdated(e206, t10) {
    if (e206 instanceof cc) {
      this._handleDerivedRecomputed(e206, t10);
      return;
    }
    let n10 = this._getObservableInfo(e206);
    n10 && t10.didChange && (n10.lastValue = Nc(t10.newValue, 30), n10.listenerCount > 0 && this._handleChange({ instances: { [n10.instanceId]: { formattedValue: n10.lastValue } } }));
  }
  handleAutorunCreated(e206, t10) {
    let n10 = { declarationId: this._getDeclarationId(`autorun`, t10), instanceId: this._instanceId++, updateCount: 0, changedObservables: /* @__PURE__ */ new Set() };
    this._instanceInfos.set(e206, n10), this._aliveInstances.set(n10.instanceId, e206), n10 && this._handleChange({ instances: { [n10.instanceId]: { instanceId: n10.instanceId, declarationId: n10.declarationId, runCount: 0, type: `autorun`, name: e206.debugName } } });
  }
  handleAutorunDisposed(e206) {
    let t10 = this._getAutorunInfo(e206);
    t10 && (this._handleChange({ instances: { [t10.instanceId]: null } }), this._instanceInfos.delete(e206), this._aliveInstances.delete(t10.instanceId));
  }
  handleAutorunDependencyChanged(e206, t10, n10) {
    let r10 = this._getAutorunInfo(e206);
    r10 && r10.changedObservables.add(t10);
  }
  handleAutorunStarted(e206) {
  }
  handleAutorunFinished(e206) {
    let t10 = this._getAutorunInfo(e206);
    t10 && (t10.changedObservables.clear(), t10.updateCount++, this._handleChange({ instances: { [t10.instanceId]: { runCount: t10.updateCount } } }));
  }
  handleDerivedDependencyChanged(e206, t10, n10) {
    let r10 = this._getObservableInfo(e206);
    r10 && r10.changedObservables.add(t10);
  }
  _handleDerivedRecomputed(e206, t10) {
    let n10 = this._getObservableInfo(e206);
    if (!n10) return;
    let r10 = Nc(t10.newValue, 30);
    n10.updateCount++, n10.changedObservables.clear(), n10.lastValue = r10, n10.listenerCount > 0 && this._handleChange({ instances: { [n10.instanceId]: { formattedValue: r10, recomputationCount: n10.updateCount } } });
  }
  handleDerivedCleared(e206) {
    let t10 = this._getObservableInfo(e206);
    t10 && (t10.lastValue = void 0, t10.changedObservables.clear(), t10.listenerCount > 0 && this._handleChange({ instances: { [t10.instanceId]: { formattedValue: void 0 } } }));
  }
  handleBeginTransaction(e206) {
    this._activeTransactions.add(e206);
  }
  handleEndTransaction(e206) {
    this._activeTransactions.delete(e206);
  }
}, _s2._instance = void 0, _s2);
Er && Er.VSCODE_DEV_DEBUG_OBSERVABLES && Jte(Bc.getInstance());
var { getWindow: Vc, getDocument: Hc, getWindows: Uc, getWindowsCount: Wc, getWindowId: Gc, getWindowById: Kc, onDidRegisterWindow: qc, onWillUnregisterWindow: Jc, onDidUnregisterWindow: Yc } = (function() {
  let e206 = /* @__PURE__ */ new Map();
  _te(Aa, 1);
  let t10 = { window: Aa, disposables: new E() };
  e206.set(Aa.vscodeWindowId, t10);
  let n10 = new k(), r10 = new k(), i10 = new k();
  function a10(n11, r11) {
    return (typeof n11 == `number` ? e206.get(n11) : void 0) ?? (r11 ? t10 : void 0);
  }
  return { onDidRegisterWindow: n10.event, onWillUnregisterWindow: i10.event, onDidUnregisterWindow: r10.event, registerWindow(t11) {
    if (e206.has(t11.vscodeWindowId)) return D.None;
    let a11 = new E(), o10 = { window: t11, disposables: a11.add(new E()) };
    return e206.set(t11.vscodeWindowId, o10), a11.add(T(() => {
      e206.delete(t11.vscodeWindowId), r10.fire(t11);
    })), a11.add(L(t11, R.BEFORE_UNLOAD, () => {
      i10.fire(t11);
    })), n10.fire(o10), a11;
  }, getWindows() {
    return e206.values();
  }, getWindowsCount() {
    return e206.size;
  }, getWindowId(e207) {
    return e207.vscodeWindowId;
  }, hasWindow(t11) {
    return e206.has(t11);
  }, getWindowById: a10, getWindow(e207) {
    let t11 = e207;
    if (t11?.ownerDocument?.defaultView) return t11.ownerDocument.defaultView.window;
    let n11 = e207;
    return n11?.view ? n11.view.window : Aa;
  }, getDocument(e207) {
    return Vc(e207).document;
  } };
})();
function Xc(e206) {
  for (; e206.firstChild; ) e206.firstChild.remove();
}
var Zc = class {
  constructor(e206, t10, n10, r10) {
    this._node = e206, this._type = t10, this._handler = n10, this._options = r10 || false, this._node.addEventListener(this._type, this._handler, this._options);
  }
  dispose() {
    this._handler && (this._handler = (this._node.removeEventListener(this._type, this._handler, this._options), this._node = null, null));
  }
};
function L(e206, t10, n10, r10) {
  return new Zc(e206, t10, n10, r10);
}
function Qc(e206, t10) {
  return function(n10) {
    return t10(new Xo(e206, n10));
  };
}
function $c(e206) {
  return function(t10) {
    return e206(new Jo(t10));
  };
}
var el = function(e206, t10, n10, r10) {
  let i10 = n10;
  return t10 === `click` || t10 === `mousedown` || t10 === `contextmenu` ? i10 = Qc(Vc(e206), n10) : (t10 === `keydown` || t10 === `keypress` || t10 === `keyup`) && (i10 = $c(n10)), L(e206, t10, i10, r10);
}, tl = function(e206, t10, n10) {
  return nl(e206, Qc(Vc(e206), t10), n10);
};
function nl(e206, t10, n10) {
  return L(e206, kt && Bo.pointerEvents ? R.POINTER_DOWN : R.MOUSE_DOWN, t10, n10);
}
function rl(e206, t10, n10) {
  return L(e206, kt && Bo.pointerEvents ? R.POINTER_MOVE : R.MOUSE_MOVE, t10, n10);
}
function il(e206, t10, n10) {
  return L(e206, kt && Bo.pointerEvents ? R.POINTER_UP : R.MOUSE_UP, t10, n10);
}
function al(e206, t10, n10) {
  return fs(e206, t10, n10);
}
var ol = class extends ps {
  constructor(e206, t10) {
    super(e206, t10);
  }
}, sl, cl, ll = class extends ls {
  constructor(e206) {
    super(), this.defaultTarget = e206 && Vc(e206);
  }
  cancelAndSet(e206, t10, n10) {
    return super.cancelAndSet(e206, t10, n10 ?? this.defaultTarget);
  }
}, ul = class {
  constructor(e206, t10 = 0) {
    this._runner = e206, this.priority = t10, this._canceled = false;
  }
  dispose() {
    this._canceled = true;
  }
  execute() {
    if (!this._canceled) try {
      this._runner();
    } catch (e206) {
      be(e206);
    }
  }
  static sort(e206, t10) {
    return t10.priority - e206.priority;
  }
};
(function() {
  let e206 = /* @__PURE__ */ new Map(), t10 = /* @__PURE__ */ new Map(), n10 = /* @__PURE__ */ new Map(), r10 = /* @__PURE__ */ new Map(), i10 = (i11) => {
    n10.set(i11, false);
    let a10 = e206.get(i11) ?? [];
    for (t10.set(i11, a10), e206.set(i11, []), r10.set(i11, true); a10.length > 0; ) a10.sort(ul.sort), a10.shift().execute();
    r10.set(i11, false);
  };
  cl = (t11, r11, a10 = 0) => {
    let o10 = Gc(t11), s10 = new ul(r11, a10), c10 = e206.get(o10);
    return c10 || (c10 = [], e206.set(o10, c10)), c10.push(s10), n10.get(o10) || (n10.set(o10, true), t11.requestAnimationFrame(() => i10(o10))), s10;
  }, sl = (e207, n11, i11) => {
    let a10 = Gc(e207);
    if (r10.get(a10)) {
      let e208 = new ul(n11, i11), r11 = t10.get(a10);
      return r11 || (r11 = [], t10.set(a10, r11)), r11.push(e208), e208;
    } else return cl(e207, n11, i11);
  };
})();
function dl(e206) {
  return Vc(e206).getComputedStyle(e206, null);
}
function fl(e206, t10, n10) {
  let r10 = Vc(e206), i10 = r10.document;
  if (e206 !== i10.body) return new ml(e206.clientWidth, e206.clientHeight);
  if (kt && r10?.visualViewport) return new ml(r10.visualViewport.width, r10.visualViewport.height);
  if (r10?.innerWidth && r10.innerHeight) return new ml(r10.innerWidth, r10.innerHeight);
  if (i10.body && i10.body.clientWidth && i10.body.clientHeight) return new ml(i10.body.clientWidth, i10.body.clientHeight);
  if (i10.documentElement && i10.documentElement.clientWidth && i10.documentElement.clientHeight) return new ml(i10.documentElement.clientWidth, i10.documentElement.clientHeight);
  throw Error(`Unable to figure out browser width and height`);
}
var pl = class e21 {
  static convertToPixels(e206, t10) {
    return parseFloat(t10) || 0;
  }
  static getDimension(t10, n10) {
    let r10 = dl(t10), i10 = r10 ? r10.getPropertyValue(n10) : `0`;
    return e21.convertToPixels(t10, i10);
  }
  static getBorderLeftWidth(t10) {
    return e21.getDimension(t10, `border-left-width`);
  }
  static getBorderRightWidth(t10) {
    return e21.getDimension(t10, `border-right-width`);
  }
  static getBorderTopWidth(t10) {
    return e21.getDimension(t10, `border-top-width`);
  }
  static getBorderBottomWidth(t10) {
    return e21.getDimension(t10, `border-bottom-width`);
  }
  static getPaddingLeft(t10) {
    return e21.getDimension(t10, `padding-left`);
  }
  static getPaddingRight(t10) {
    return e21.getDimension(t10, `padding-right`);
  }
  static getPaddingTop(t10) {
    return e21.getDimension(t10, `padding-top`);
  }
  static getPaddingBottom(t10) {
    return e21.getDimension(t10, `padding-bottom`);
  }
  static getMarginLeft(t10) {
    return e21.getDimension(t10, `margin-left`);
  }
  static getMarginTop(t10) {
    return e21.getDimension(t10, `margin-top`);
  }
  static getMarginRight(t10) {
    return e21.getDimension(t10, `margin-right`);
  }
  static getMarginBottom(t10) {
    return e21.getDimension(t10, `margin-bottom`);
  }
}, ml = (_t2 = class {
  constructor(e206, t10) {
    this.width = e206, this.height = t10;
  }
  with(t10 = this.width, n10 = this.height) {
    return t10 !== this.width || n10 !== this.height ? new _t2(t10, n10) : this;
  }
  static is(e206) {
    return typeof e206 == `object` && typeof e206.height == `number` && typeof e206.width == `number`;
  }
  static lift(t10) {
    return t10 instanceof _t2 ? t10 : new _t2(t10.width, t10.height);
  }
  static equals(e206, t10) {
    return e206 === t10 ? true : !e206 || !t10 ? false : e206.width === t10.width && e206.height === t10.height;
  }
}, _t2.None = new _t2(0, 0), _t2);
function hl(e206) {
  let t10 = e206.offsetParent, n10 = e206.offsetTop, r10 = e206.offsetLeft;
  for (; (e206 = e206.parentNode) !== null && e206 !== e206.ownerDocument.body && e206 !== e206.ownerDocument.documentElement; ) {
    n10 -= e206.scrollTop;
    let i10 = El(e206) ? null : dl(e206);
    i10 && (r10 -= i10.direction === `rtl` ? -e206.scrollLeft : e206.scrollLeft), e206 === t10 && (r10 += pl.getBorderLeftWidth(e206), n10 += pl.getBorderTopWidth(e206), n10 += e206.offsetTop, r10 += e206.offsetLeft, t10 = e206.offsetParent);
  }
  return { left: r10, top: n10 };
}
function gl(e206, t10, n10) {
  typeof t10 == `number` && (e206.style.width = `${t10}px`), typeof n10 == `number` && (e206.style.height = `${n10}px`);
}
function _l2(e206) {
  let t10 = e206.getBoundingClientRect(), n10 = Vc(e206);
  return { left: t10.left + n10.scrollX, top: t10.top + n10.scrollY, width: t10.width, height: t10.height };
}
function vl(e206) {
  let t10 = e206, n10 = 1;
  do {
    let e207 = dl(t10).zoom;
    e207 != null && e207 !== `1` && (n10 *= e207), t10 = t10.parentElement;
  } while (t10 !== null && t10 !== t10.ownerDocument.documentElement);
  return n10;
}
function yl(e206) {
  let t10 = pl.getMarginLeft(e206) + pl.getMarginRight(e206);
  return e206.offsetWidth + t10;
}
function bl(e206) {
  let t10 = pl.getBorderLeftWidth(e206) + pl.getBorderRightWidth(e206), n10 = pl.getPaddingLeft(e206) + pl.getPaddingRight(e206);
  return e206.offsetWidth - t10 - n10;
}
function xl(e206) {
  let t10 = pl.getBorderTopWidth(e206) + pl.getBorderBottomWidth(e206), n10 = pl.getPaddingTop(e206) + pl.getPaddingBottom(e206);
  return e206.offsetHeight - t10 - n10;
}
function Sl(e206) {
  let t10 = pl.getMarginTop(e206) + pl.getMarginBottom(e206);
  return e206.offsetHeight + t10;
}
function Cl(e206, t10) {
  return !!t10?.contains(e206);
}
function wl(e206, t10, n10) {
  for (; e206 && e206.nodeType === e206.ELEMENT_NODE; ) {
    if (e206.classList.contains(t10)) return e206;
    if (n10) {
      if (typeof n10 == `string`) {
        if (e206.classList.contains(n10)) return null;
      } else if (e206 === n10) return null;
    }
    e206 = e206.parentNode;
  }
  return null;
}
function Tl(e206, t10, n10) {
  return !!wl(e206, t10, n10);
}
function El(e206) {
  return e206 && !!e206.host && !!e206.mode;
}
function Dl(e206) {
  return !!Ol(e206);
}
function Ol(e206) {
  for (; e206.parentNode; ) {
    if (e206 === e206.ownerDocument?.body) return null;
    e206 = e206.parentNode;
  }
  return El(e206) ? e206 : null;
}
function kl() {
  let e206 = Ml().activeElement;
  for (; e206?.shadowRoot; ) e206 = e206.shadowRoot.activeElement;
  return e206;
}
function Al(e206) {
  return kl() === e206;
}
function jl(e206) {
  return Cl(kl(), e206);
}
function Ml() {
  return Wc() <= 1 ? Aa.document : Array.from(Uc()).map(({ window: e206 }) => e206.document).find((e206) => e206.hasFocus()) ?? Aa.document;
}
function Nl() {
  return Ml().defaultView?.window ?? Aa;
}
var Pl = new class {
  constructor() {
    this.mutationObservers = /* @__PURE__ */ new Map();
  }
  observe(e206, t10, n10) {
    let r10 = this.mutationObservers.get(e206);
    r10 || (r10 = /* @__PURE__ */ new Map(), this.mutationObservers.set(e206, r10));
    let i10 = Is(n10), a10 = r10.get(i10);
    if (a10) a10.users += 1;
    else {
      let o10 = new k(), s10 = new MutationObserver((e207) => o10.fire(e207));
      s10.observe(e206, n10);
      let c10 = a10 = { users: 1, observer: s10, onDidMutate: o10.event };
      t10.add(T(() => {
        --c10.users, c10.users === 0 && (o10.dispose(), s10.disconnect(), r10?.delete(i10), r10?.size === 0 && this.mutationObservers.delete(e206));
      })), r10.set(i10, a10);
    }
    return a10.onDidMutate;
  }
}();
function Fl(e206) {
  return e206 instanceof HTMLElement || e206 instanceof Vc(e206).HTMLElement;
}
function Il(e206) {
  return e206 instanceof HTMLAnchorElement || e206 instanceof Vc(e206).HTMLAnchorElement;
}
function Ll(e206) {
  return e206 instanceof SVGElement || e206 instanceof Vc(e206).SVGElement;
}
function Rl(e206) {
  return e206 instanceof MouseEvent || e206 instanceof Vc(e206).MouseEvent;
}
function zl(e206) {
  return e206 instanceof KeyboardEvent || e206 instanceof Vc(e206).KeyboardEvent;
}
var R = { CLICK: `click`, AUXCLICK: `auxclick`, DBLCLICK: `dblclick`, MOUSE_UP: `mouseup`, MOUSE_DOWN: `mousedown`, MOUSE_OVER: `mouseover`, MOUSE_MOVE: `mousemove`, MOUSE_OUT: `mouseout`, MOUSE_ENTER: `mouseenter`, MOUSE_LEAVE: `mouseleave`, MOUSE_WHEEL: `wheel`, POINTER_UP: `pointerup`, POINTER_DOWN: `pointerdown`, POINTER_MOVE: `pointermove`, POINTER_LEAVE: `pointerleave`, CONTEXT_MENU: `contextmenu`, KEY_DOWN: `keydown`, KEY_UP: `keyup`, BEFORE_UNLOAD: `beforeunload`, FOCUS: `focus`, FOCUS_IN: `focusin`, FOCUS_OUT: `focusout`, BLUR: `blur`, INPUT: `input`, DRAG_START: `dragstart`, DRAG: `drag`, DRAG_ENTER: `dragenter`, DRAG_LEAVE: `dragleave`, DRAG_OVER: `dragover`, DROP: `drop`, DRAG_END: `dragend` };
function Bl(e206) {
  let t10 = e206;
  return !!(t10 && typeof t10.preventDefault == `function` && typeof t10.stopPropagation == `function`);
}
var Vl = { stop: (e206, t10) => (e206.preventDefault(), t10 && e206.stopPropagation(), e206) };
function Hl(e206) {
  let t10 = [];
  for (let n10 = 0; e206 && e206.nodeType === e206.ELEMENT_NODE; n10++) t10[n10] = e206.scrollTop, e206 = e206.parentNode;
  return t10;
}
function Ul(e206, t10) {
  for (let n10 = 0; e206 && e206.nodeType === e206.ELEMENT_NODE; n10++) e206.scrollTop !== t10[n10] && (e206.scrollTop = t10[n10]), e206 = e206.parentNode;
}
var Wl = class e22 extends D {
  get onDidFocus() {
    return this._onDidFocus.event;
  }
  get onDidBlur() {
    return this._onDidBlur.event;
  }
  static hasFocusWithin(e206) {
    if (Fl(e206)) {
      let t10 = Ol(e206);
      return Cl(t10 ? t10.activeElement : e206.ownerDocument.activeElement, e206);
    } else {
      let t10 = e206;
      return Cl(t10.document.activeElement, t10.document);
    }
  }
  constructor(t10) {
    super(), this._onDidFocus = this._register(new k()), this._onDidBlur = this._register(new k());
    let n10 = e22.hasFocusWithin(t10), r10 = false, i10 = () => {
      r10 = false, n10 || (n10 = true, this._onDidFocus.fire());
    }, a10 = () => {
      n10 && (r10 = true, (Fl(t10) ? Vc(t10) : t10).setTimeout(() => {
        r10 && (r10 = false, n10 = false, this._onDidBlur.fire());
      }, 0));
    };
    this._refreshStateHandler = () => {
      e22.hasFocusWithin(t10) !== n10 && (n10 ? a10() : i10());
    }, this._register(L(t10, R.FOCUS, i10, true)), this._register(L(t10, R.BLUR, a10, true)), Fl(t10) && (this._register(L(t10, R.FOCUS_IN, () => this._refreshStateHandler())), this._register(L(t10, R.FOCUS_OUT, () => this._refreshStateHandler())));
  }
};
function Gl(e206) {
  return new Wl(e206);
}
function Kl(e206, t10) {
  return e206.after(t10), t10;
}
function z(e206, ...t10) {
  if (e206.append(...t10), t10.length === 1 && typeof t10[0] != `string`) return t10[0];
}
function ql(e206, t10) {
  return e206.insertBefore(t10, e206.firstChild), t10;
}
function Jl(e206, ...t10) {
  e206.textContent = ``, z(e206, ...t10);
}
var hne = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/, Yl;
(function(e206) {
  e206.HTML = `http://www.w3.org/1999/xhtml`, e206.SVG = `http://www.w3.org/2000/svg`;
})(Yl || (Yl = {}));
function Xl(e206, t10, n10, ...r10) {
  let i10 = hne.exec(t10);
  if (!i10) throw Error(`Bad use of emmet`);
  let a10 = i10[1] || `div`, o10;
  return o10 = e206 === Yl.HTML ? document.createElement(a10) : document.createElementNS(e206, a10), i10[3] && (o10.id = i10[3]), i10[4] && (o10.className = i10[4].replace(/\./g, ` `).trim()), n10 && Object.entries(n10).forEach(([e207, t11]) => {
    t11 !== void 0 && (/^on\w+$/.test(e207) ? o10[e207] = t11 : e207 === `selected` ? t11 && o10.setAttribute(e207, `true`) : o10.setAttribute(e207, t11));
  }), o10.append(...r10), o10;
}
function B(e206, t10, ...n10) {
  return Xl(Yl.HTML, e206, t10, ...n10);
}
B.SVG = function(e206, t10, ...n10) {
  return Xl(Yl.SVG, e206, t10, ...n10);
};
function gne(e206, ...t10) {
  e206 ? Zl(...t10) : Ql(...t10);
}
function Zl(...e206) {
  for (let t10 of e206) t10.style.display = ``, t10.removeAttribute(`aria-hidden`);
}
function Ql(...e206) {
  for (let t10 of e206) t10.style.display = `none`, t10.setAttribute(`aria-hidden`, `true`);
}
function $l(e206, t10) {
  let n10 = e206.devicePixelRatio * t10;
  return Math.max(1, Math.floor(n10)) / e206.devicePixelRatio;
}
function eu(e206) {
  Aa.open(e206, `_blank`, `noopener`);
}
function _ne(e206, t10) {
  let n10 = () => {
    t10(), r10 = cl(e206, n10);
  }, r10 = cl(e206, n10);
  return T(() => r10.dispose());
}
ws.setPreferredWebSchema(/^https:/.test(Aa.location.href) ? `https` : `http`);
var tu = class e23 extends k {
  constructor() {
    super(), this._subscriptions = new E(), this._keyStatus = { altKey: false, shiftKey: false, ctrlKey: false, metaKey: false }, this._subscriptions.add(O.runAndSubscribe(qc, ({ window: e206, disposables: t10 }) => this.registerListeners(e206, t10), { window: Aa, disposables: this._subscriptions }));
  }
  registerListeners(e206, t10) {
    t10.add(L(e206, `keydown`, (e207) => {
      if (e207.defaultPrevented) return;
      let t11 = new Jo(e207);
      if (!(t11.keyCode === 6 && e207.repeat)) {
        if (e207.altKey && !this._keyStatus.altKey) this._keyStatus.lastKeyPressed = `alt`;
        else if (e207.ctrlKey && !this._keyStatus.ctrlKey) this._keyStatus.lastKeyPressed = `ctrl`;
        else if (e207.metaKey && !this._keyStatus.metaKey) this._keyStatus.lastKeyPressed = `meta`;
        else if (e207.shiftKey && !this._keyStatus.shiftKey) this._keyStatus.lastKeyPressed = `shift`;
        else if (t11.keyCode !== 6) this._keyStatus.lastKeyPressed = void 0;
        else return;
        this._keyStatus.altKey = e207.altKey, this._keyStatus.ctrlKey = e207.ctrlKey, this._keyStatus.metaKey = e207.metaKey, this._keyStatus.shiftKey = e207.shiftKey, this._keyStatus.lastKeyPressed && (this._keyStatus.event = e207, this.fire(this._keyStatus));
      }
    }, true)), t10.add(L(e206, `keyup`, (e207) => {
      e207.defaultPrevented || (!e207.altKey && this._keyStatus.altKey ? this._keyStatus.lastKeyReleased = `alt` : !e207.ctrlKey && this._keyStatus.ctrlKey ? this._keyStatus.lastKeyReleased = `ctrl` : !e207.metaKey && this._keyStatus.metaKey ? this._keyStatus.lastKeyReleased = `meta` : !e207.shiftKey && this._keyStatus.shiftKey ? this._keyStatus.lastKeyReleased = `shift` : this._keyStatus.lastKeyReleased = void 0, this._keyStatus.lastKeyPressed !== this._keyStatus.lastKeyReleased && (this._keyStatus.lastKeyPressed = void 0), this._keyStatus.altKey = e207.altKey, this._keyStatus.ctrlKey = e207.ctrlKey, this._keyStatus.metaKey = e207.metaKey, this._keyStatus.shiftKey = e207.shiftKey, this._keyStatus.lastKeyReleased && (this._keyStatus.event = e207, this.fire(this._keyStatus)));
    }, true)), t10.add(L(e206.document.body, `mousedown`, () => {
      this._keyStatus.lastKeyPressed = void 0;
    }, true)), t10.add(L(e206.document.body, `mouseup`, () => {
      this._keyStatus.lastKeyPressed = void 0;
    }, true)), t10.add(L(e206.document.body, `mousemove`, (e207) => {
      e207.buttons && (this._keyStatus.lastKeyPressed = void 0);
    }, true)), t10.add(L(e206, `blur`, () => {
      this.resetKeyStatus();
    }));
  }
  get keyStatus() {
    return this._keyStatus;
  }
  resetKeyStatus() {
    this.doResetKeyStatus(), this.fire(this._keyStatus);
  }
  doResetKeyStatus() {
    this._keyStatus = { altKey: false, shiftKey: false, ctrlKey: false, metaKey: false };
  }
  static getInstance() {
    return e23.instance || (e23.instance = new e23()), e23.instance;
  }
  dispose() {
    super.dispose(), this._subscriptions.dispose();
  }
}, vne = class extends D {
  constructor(e206, t10) {
    super(), this.element = e206, this.callbacks = t10, this.counter = 0, this.dragStartTime = 0, this.registerListeners();
  }
  registerListeners() {
    this.callbacks.onDragStart && this._register(L(this.element, R.DRAG_START, (e206) => {
      this.callbacks.onDragStart?.(e206);
    })), this.callbacks.onDrag && this._register(L(this.element, R.DRAG, (e206) => {
      this.callbacks.onDrag?.(e206);
    })), this._register(L(this.element, R.DRAG_ENTER, (e206) => {
      this.counter++, this.dragStartTime = e206.timeStamp, this.callbacks.onDragEnter?.(e206);
    })), this._register(L(this.element, R.DRAG_OVER, (e206) => {
      e206.preventDefault(), this.callbacks.onDragOver?.(e206, e206.timeStamp - this.dragStartTime);
    })), this._register(L(this.element, R.DRAG_LEAVE, (e206) => {
      this.counter--, this.counter === 0 && (this.dragStartTime = 0, this.callbacks.onDragLeave?.(e206));
    })), this._register(L(this.element, R.DRAG_END, (e206) => {
      this.counter = 0, this.dragStartTime = 0, this.callbacks.onDragEnd?.(e206);
    })), this._register(L(this.element, R.DROP, (e206) => {
      this.counter = 0, this.dragStartTime = 0, this.callbacks.onDrop?.(e206);
    }));
  }
}, yne = /(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;
function nu(e206, ...t10) {
  let n10, r10;
  Array.isArray(t10[0]) ? (n10 = {}, r10 = t10[0]) : (n10 = t10[0] || {}, r10 = t10[1]);
  let i10 = yne.exec(e206);
  if (!i10 || !i10.groups) throw Error(`Bad use of h`);
  let a10 = i10.groups.tag || `div`, o10 = document.createElement(a10);
  i10.groups.id && (o10.id = i10.groups.id);
  let s10 = [];
  if (i10.groups.class) for (let e207 of i10.groups.class.split(`.`)) e207 !== `` && s10.push(e207);
  if (n10.className !== void 0) for (let e207 of n10.className.split(`.`)) e207 !== `` && s10.push(e207);
  s10.length > 0 && (o10.className = s10.join(` `));
  let c10 = {};
  if (i10.groups.name && (c10[i10.groups.name] = o10), r10) for (let e207 of r10) Fl(e207) ? o10.appendChild(e207) : typeof e207 == `string` ? o10.append(e207) : `root` in e207 && (Object.assign(c10, e207), o10.appendChild(e207.root));
  for (let [e207, t11] of Object.entries(n10)) if (e207 === `className`) continue;
  else if (e207 === `style`) for (let [e208, n11] of Object.entries(t11)) o10.style.setProperty(ru(e208), typeof n11 == `number` ? n11 + `px` : `` + n11);
  else e207 === `tabIndex` ? o10.tabIndex = t11 : o10.setAttribute(ru(e207), t11.toString());
  return c10.root = o10, c10;
}
function ru(e206) {
  return e206.replace(/([a-z])([A-Z])/g, `$1-$2`).toLowerCase();
}
function iu(e206) {
  return e206.tagName.toLowerCase() === `input` || e206.tagName.toLowerCase() === `textarea` || Fl(e206) && !!e206.editContext;
}
var au;
(function(e206) {
  function t10(e207 = void 0) {
    return (t11, n11, r11) => {
      let i10 = n11.class;
      delete n11.class;
      let a10 = n11.ref;
      delete n11.ref;
      let o10 = n11.obsRef;
      return delete n11.obsRef, new Sne(t11, a10, o10, e207, i10, n11, r11);
    };
  }
  function n10(e207, n11 = void 0) {
    let r11 = t10(n11);
    return (t11, n12) => r11(e207, t11, n12);
  }
  e206.div = n10(`div`), e206.elem = t10(void 0), e206.svg = n10(`svg`, `http://www.w3.org/2000/svg`), e206.svgElem = t10(`http://www.w3.org/2000/svg`);
  function r10() {
    let e207, t11 = function(t12) {
      e207 = t12;
    };
    return Object.defineProperty(t11, `element`, { get() {
      if (!e207) throw new je(`Make sure the ref is set before accessing the element. Maybe wrong initialization order?`);
      return e207;
    } }), t11;
  }
  e206.ref = r10;
})(au || (au = {}));
var bne = class e24 {
  constructor(t10, n10, r10, i10, a10, o10, s10) {
    this._deriveds = [], this._element = i10 ? document.createElementNS(i10, t10) : document.createElement(t10), n10 && n10(this._element), r10 && this._deriveds.push(I((e206) => {
      r10(this), e206.store.add({ dispose: () => {
        r10(null);
      } });
    })), a10 && (lu(a10) ? this._deriveds.push(I(this, (e206) => {
      ou(this._element, cu(a10, e206));
    })) : ou(this._element, cu(a10, void 0)));
    for (let [e206, t11] of Object.entries(o10)) if (e206 === `style`) for (let [e207, n11] of Object.entries(t11)) {
      let t12 = ru(e207);
      pu(n11) ? this._deriveds.push(dc({ owner: this, debugName: () => `set.style.${t12}` }, (e208) => {
        this._element.style.setProperty(t12, uu(n11.read(e208)));
      })) : this._element.style.setProperty(t12, uu(n11));
    }
    else e206 === `tabIndex` ? pu(t11) ? this._deriveds.push(I(this, (e207) => {
      this._element.tabIndex = t11.read(e207);
    })) : this._element.tabIndex = t11 : e206.startsWith(`on`) ? this._element[e206] = t11 : pu(t11) ? this._deriveds.push(dc({ owner: this, debugName: () => `set.${e206}` }, (n11) => {
      fu(this._element, e206, t11.read(n11));
    })) : fu(this._element, e206, t11);
    if (s10) {
      let t11 = function(n12, r11) {
        return pu(r11) ? t11(n12, r11.read(n12)) : Array.isArray(r11) ? r11.flatMap((e206) => t11(n12, e206)) : r11 instanceof e24 ? (n12 && r11.readEffect(n12), [r11._element]) : r11 ? [r11] : [];
      };
      let n11 = I(this, (e206) => {
        this._element.replaceChildren(...t11(e206, s10));
      });
      this._deriveds.push(n11), du(s10) || n11.get();
    }
  }
  readEffect(e206) {
    for (let t10 of this._deriveds) t10.read(e206);
  }
  keepUpdated(e206) {
    return I((e207) => {
      this.readEffect(e207);
    }).recomputeInitiallyAndOnChange(e206), this;
  }
  toDisposableLiveElement() {
    let e206 = new E();
    return this.keepUpdated(e206), new xne(this._element, e206);
  }
};
function ou(e206, t10) {
  Ll(e206) ? e206.setAttribute(`class`, t10) : e206.className = t10;
}
function su(e206, t10, n10) {
  if (pu(e206)) {
    n10(e206.read(t10));
    return;
  }
  if (Array.isArray(e206)) {
    for (let r10 of e206) su(r10, t10, n10);
    return;
  }
  n10(e206);
}
function cu(e206, t10) {
  let n10 = ``;
  return su(e206, t10, (e207) => {
    e207 && (n10.length === 0 ? n10 = e207 : n10 += ` ` + e207);
  }), n10;
}
function lu(e206) {
  return pu(e206) ? true : Array.isArray(e206) ? e206.some((e207) => lu(e207)) : false;
}
function uu(e206) {
  return typeof e206 == `number` ? e206 + `px` : e206;
}
function du(e206) {
  return pu(e206) ? true : Array.isArray(e206) ? e206.some((e207) => du(e207)) : false;
}
var xne = class {
  constructor(e206, t10) {
    this.element = e206, this._disposable = t10;
  }
  dispose() {
    this._disposable.dispose();
  }
}, Sne = class extends bne {
  constructor() {
    super(...arguments), this._isHovered = void 0, this._didMouseMoveDuringHover = void 0;
  }
  get element() {
    return this._element;
  }
  get isHovered() {
    if (!this._isHovered) {
      let e206 = Ic(`hovered`, false);
      this._element.addEventListener(`mouseenter`, (t10) => e206.set(true, void 0)), this._element.addEventListener(`mouseleave`, (t10) => e206.set(false, void 0)), this._isHovered = e206;
    }
    return this._isHovered;
  }
  get didMouseMoveDuringHover() {
    if (!this._didMouseMoveDuringHover) {
      let e206 = false, t10 = Ic(`didMouseMoveDuringHover`, false);
      this._element.addEventListener(`mouseenter`, (t11) => {
        e206 = true;
      }), this._element.addEventListener(`mousemove`, (n10) => {
        e206 && t10.set(true, void 0);
      }), this._element.addEventListener(`mouseleave`, (n10) => {
        e206 = false, t10.set(false, void 0);
      }), this._didMouseMoveDuringHover = t10;
    }
    return this._didMouseMoveDuringHover;
  }
};
function fu(e206, t10, n10) {
  n10 == null ? e206.removeAttribute(ru(t10)) : e206.setAttribute(ru(t10), String(n10));
}
function pu(e206) {
  return !!e206 && e206.read !== void 0 && e206.reportChanges !== void 0;
}
var Cne = class extends D {
  constructor(e206) {
    super(), this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, this._listener = () => this._handleChange(e206, true), this._mediaQueryList = null, this._handleChange(e206, false);
  }
  _handleChange(e206, t10) {
    this._mediaQueryList?.removeEventListener(`change`, this._listener), this._mediaQueryList = e206.matchMedia(`(resolution: ${e206.devicePixelRatio}dppx)`), this._mediaQueryList.addEventListener(`change`, this._listener), t10 && this._onDidChange.fire();
  }
}, wne = class extends D {
  get value() {
    return this._value;
  }
  constructor(e206) {
    super(), this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, this._value = this._getPixelRatio(e206);
    let t10 = this._register(new Cne(e206));
    this._register(t10.onDidChange(() => {
      this._value = this._getPixelRatio(e206), this._onDidChange.fire(this._value);
    }));
  }
  _getPixelRatio(e206) {
    let t10 = document.createElement(`canvas`).getContext(`2d`);
    return (e206.devicePixelRatio || 1) / (t10.webkitBackingStorePixelRatio || t10.mozBackingStorePixelRatio || t10.msBackingStorePixelRatio || t10.oBackingStorePixelRatio || t10.backingStorePixelRatio || 1);
  }
}, mu = new class {
  constructor() {
    this.mapWindowIdToPixelRatioMonitor = /* @__PURE__ */ new Map();
  }
  _getOrCreatePixelRatioMonitor(e206) {
    let t10 = Gc(e206), n10 = this.mapWindowIdToPixelRatioMonitor.get(t10);
    return n10 || (n10 = Wt(new wne(e206)), this.mapWindowIdToPixelRatioMonitor.set(t10, n10), O.once(Yc)(({ vscodeWindowId: e207 }) => {
      e207 === t10 && (n10?.dispose(), this.mapWindowIdToPixelRatioMonitor.delete(t10));
    })), n10;
  }
  getInstance(e206) {
    return this._getOrCreatePixelRatioMonitor(e206);
  }
}(), hu = class {
  constructor(e206) {
    this.domNode = e206, this._maxWidth = ``, this._width = ``, this._height = ``, this._top = ``, this._left = ``, this._bottom = ``, this._right = ``, this._paddingLeft = ``, this._fontFamily = ``, this._fontWeight = ``, this._fontSize = ``, this._fontStyle = ``, this._fontFeatureSettings = ``, this._fontVariationSettings = ``, this._textDecoration = ``, this._lineHeight = ``, this._letterSpacing = ``, this._className = ``, this._display = ``, this._position = ``, this._visibility = ``, this._color = ``, this._backgroundColor = ``, this._layerHint = false, this._contain = `none`, this._boxShadow = ``;
  }
  focus() {
    this.domNode.focus();
  }
  setMaxWidth(e206) {
    let t10 = gu(e206);
    this._maxWidth !== t10 && (this._maxWidth = t10, this.domNode.style.maxWidth = this._maxWidth);
  }
  setWidth(e206) {
    let t10 = gu(e206);
    this._width !== t10 && (this._width = t10, this.domNode.style.width = this._width);
  }
  setHeight(e206) {
    let t10 = gu(e206);
    this._height !== t10 && (this._height = t10, this.domNode.style.height = this._height);
  }
  setTop(e206) {
    let t10 = gu(e206);
    this._top !== t10 && (this._top = t10, this.domNode.style.top = this._top);
  }
  setLeft(e206) {
    let t10 = gu(e206);
    this._left !== t10 && (this._left = t10, this.domNode.style.left = this._left);
  }
  setBottom(e206) {
    let t10 = gu(e206);
    this._bottom !== t10 && (this._bottom = t10, this.domNode.style.bottom = this._bottom);
  }
  setRight(e206) {
    let t10 = gu(e206);
    this._right !== t10 && (this._right = t10, this.domNode.style.right = this._right);
  }
  setPaddingLeft(e206) {
    let t10 = gu(e206);
    this._paddingLeft !== t10 && (this._paddingLeft = t10, this.domNode.style.paddingLeft = this._paddingLeft);
  }
  setFontFamily(e206) {
    this._fontFamily !== e206 && (this._fontFamily = e206, this.domNode.style.fontFamily = this._fontFamily);
  }
  setFontWeight(e206) {
    this._fontWeight !== e206 && (this._fontWeight = e206, this.domNode.style.fontWeight = this._fontWeight);
  }
  setFontSize(e206) {
    let t10 = gu(e206);
    this._fontSize !== t10 && (this._fontSize = t10, this.domNode.style.fontSize = this._fontSize);
  }
  setFontStyle(e206) {
    this._fontStyle !== e206 && (this._fontStyle = e206, this.domNode.style.fontStyle = this._fontStyle);
  }
  setFontFeatureSettings(e206) {
    this._fontFeatureSettings !== e206 && (this._fontFeatureSettings = e206, this.domNode.style.fontFeatureSettings = this._fontFeatureSettings);
  }
  setFontVariationSettings(e206) {
    this._fontVariationSettings !== e206 && (this._fontVariationSettings = e206, this.domNode.style.fontVariationSettings = this._fontVariationSettings);
  }
  setTextDecoration(e206) {
    this._textDecoration !== e206 && (this._textDecoration = e206, this.domNode.style.textDecoration = this._textDecoration);
  }
  setLineHeight(e206) {
    let t10 = gu(e206);
    this._lineHeight !== t10 && (this._lineHeight = t10, this.domNode.style.lineHeight = this._lineHeight);
  }
  setLetterSpacing(e206) {
    let t10 = gu(e206);
    this._letterSpacing !== t10 && (this._letterSpacing = t10, this.domNode.style.letterSpacing = this._letterSpacing);
  }
  setClassName(e206) {
    this._className !== e206 && (this._className = e206, this.domNode.className = this._className);
  }
  toggleClassName(e206, t10) {
    this.domNode.classList.toggle(e206, t10), this._className = this.domNode.className;
  }
  setDisplay(e206) {
    this._display !== e206 && (this._display = e206, this.domNode.style.display = this._display);
  }
  setPosition(e206) {
    this._position !== e206 && (this._position = e206, this.domNode.style.position = this._position);
  }
  setVisibility(e206) {
    this._visibility !== e206 && (this._visibility = e206, this.domNode.style.visibility = this._visibility);
  }
  setColor(e206) {
    this._color !== e206 && (this._color = e206, this.domNode.style.color = this._color);
  }
  setBackgroundColor(e206) {
    this._backgroundColor !== e206 && (this._backgroundColor = e206, this.domNode.style.backgroundColor = this._backgroundColor);
  }
  setLayerHinting(e206) {
    this._layerHint !== e206 && (this._layerHint = e206, this.domNode.style.transform = this._layerHint ? `translate3d(0px, 0px, 0px)` : ``);
  }
  setBoxShadow(e206) {
    this._boxShadow !== e206 && (this._boxShadow = e206, this.domNode.style.boxShadow = e206);
  }
  setContain(e206) {
    this._contain !== e206 && (this._contain = e206, this.domNode.style.contain = this._contain);
  }
  setAttribute(e206, t10) {
    this.domNode.setAttribute(e206, t10);
  }
  removeAttribute(e206) {
    this.domNode.removeAttribute(e206);
  }
  appendChild(e206) {
    this.domNode.appendChild(e206.domNode);
  }
  removeChild(e206) {
    this.domNode.removeChild(e206.domNode);
  }
};
function gu(e206) {
  return typeof e206 == `number` ? `${e206}px` : e206;
}
function _u(e206) {
  return new hu(e206);
}
function vu(e206, t10) {
  e206 instanceof hu ? (e206.setFontFamily(t10.getMassagedFontFamily()), e206.setFontWeight(t10.fontWeight), e206.setFontSize(t10.fontSize), e206.setFontFeatureSettings(t10.fontFeatureSettings), e206.setFontVariationSettings(t10.fontVariationSettings), e206.setLineHeight(t10.lineHeight), e206.setLetterSpacing(t10.letterSpacing)) : (e206.style.fontFamily = t10.getMassagedFontFamily(), e206.style.fontWeight = t10.fontWeight, e206.style.fontSize = t10.fontSize + `px`, e206.style.fontFeatureSettings = t10.fontFeatureSettings, e206.style.fontVariationSettings = t10.fontVariationSettings, e206.style.lineHeight = t10.lineHeight + `px`, e206.style.letterSpacing = t10.letterSpacing + `px`);
}
var Tne = class {
  constructor(e206, t10) {
    this.chr = e206, this.type = t10, this.width = 0;
  }
  fulfill(e206) {
    this.width = e206;
  }
}, Ene = class e25 {
  constructor(e206, t10) {
    this._bareFontInfo = e206, this._requests = t10, this._container = null, this._testElements = null;
  }
  read(e206) {
    this._createDomElements(), e206.document.body.appendChild(this._container), this._readFromDomElements(), this._container?.remove(), this._container = null, this._testElements = null;
  }
  _createDomElements() {
    let t10 = document.createElement(`div`);
    t10.style.position = `absolute`, t10.style.top = `-50000px`, t10.style.width = `50000px`;
    let n10 = document.createElement(`div`);
    vu(n10, this._bareFontInfo), t10.appendChild(n10);
    let r10 = document.createElement(`div`);
    vu(r10, this._bareFontInfo), r10.style.fontWeight = `bold`, t10.appendChild(r10);
    let i10 = document.createElement(`div`);
    vu(i10, this._bareFontInfo), i10.style.fontStyle = `italic`, t10.appendChild(i10);
    let a10 = [];
    for (let t11 of this._requests) {
      let o10;
      t11.type === 0 && (o10 = n10), t11.type === 2 && (o10 = r10), t11.type === 1 && (o10 = i10), o10.appendChild(document.createElement(`br`));
      let s10 = document.createElement(`span`);
      e25._render(s10, t11), o10.appendChild(s10), a10.push(s10);
    }
    this._container = t10, this._testElements = a10;
  }
  static _render(e206, t10) {
    if (t10.chr === ` `) {
      let t11 = `\xA0`;
      for (let e207 = 0; e207 < 8; e207++) t11 += t11;
      e206.innerText = t11;
    } else {
      let n10 = t10.chr;
      for (let e207 = 0; e207 < 8; e207++) n10 += n10;
      e206.textContent = n10;
    }
  }
  _readFromDomElements() {
    for (let e206 = 0, t10 = this._requests.length; e206 < t10; e206++) {
      let t11 = this._requests[e206], n10 = this._testElements[e206];
      t11.fulfill(n10.offsetWidth / 256);
    }
  }
};
function Dne(e206, t10, n10) {
  new Ene(t10, n10).read(e206);
}
var One = class extends D {
  constructor() {
    super(...arguments), this._cache = /* @__PURE__ */ new Map(), this._evictUntrustedReadingsTimeout = -1, this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event;
  }
  dispose() {
    this._evictUntrustedReadingsTimeout !== -1 && (clearTimeout(this._evictUntrustedReadingsTimeout), this._evictUntrustedReadingsTimeout = -1), super.dispose();
  }
  clearAllFontInfos() {
    this._cache.clear(), this._onDidChange.fire();
  }
  _ensureCache(e206) {
    let t10 = Gc(e206), n10 = this._cache.get(t10);
    return n10 || (n10 = new kne(), this._cache.set(t10, n10)), n10;
  }
  _writeToCache(e206, t10, n10) {
    this._ensureCache(e206).put(t10, n10), !n10.isTrusted && this._evictUntrustedReadingsTimeout === -1 && (this._evictUntrustedReadingsTimeout = e206.setTimeout(() => {
      this._evictUntrustedReadingsTimeout = -1, this._evictUntrustedReadings(e206);
    }, 5e3));
  }
  _evictUntrustedReadings(e206) {
    let t10 = this._ensureCache(e206), n10 = t10.getValues(), r10 = false;
    for (let e207 of n10) e207.isTrusted || (r10 = true, t10.remove(e207));
    r10 && this._onDidChange.fire();
  }
  readFontInfo(e206, t10) {
    let n10 = this._ensureCache(e206);
    if (!n10.has(t10)) {
      let n11 = this._actualReadFontInfo(e206, t10);
      (n11.typicalHalfwidthCharacterWidth <= 2 || n11.typicalFullwidthCharacterWidth <= 2 || n11.spaceWidth <= 2 || n11.maxDigitWidth <= 2) && (n11 = new hn({ pixelRatio: mu.getInstance(e206).value, fontFamily: n11.fontFamily, fontWeight: n11.fontWeight, fontSize: n11.fontSize, fontFeatureSettings: n11.fontFeatureSettings, fontVariationSettings: n11.fontVariationSettings, lineHeight: n11.lineHeight, letterSpacing: n11.letterSpacing, isMonospace: n11.isMonospace, typicalHalfwidthCharacterWidth: Math.max(n11.typicalHalfwidthCharacterWidth, 5), typicalFullwidthCharacterWidth: Math.max(n11.typicalFullwidthCharacterWidth, 5), canUseHalfwidthRightwardsArrow: n11.canUseHalfwidthRightwardsArrow, spaceWidth: Math.max(n11.spaceWidth, 5), middotWidth: Math.max(n11.middotWidth, 5), wsmiddotWidth: Math.max(n11.wsmiddotWidth, 5), maxDigitWidth: Math.max(n11.maxDigitWidth, 5) }, false)), this._writeToCache(e206, t10, n11);
    }
    return n10.get(t10);
  }
  _createRequest(e206, t10, n10, r10) {
    let i10 = new Tne(e206, t10);
    return n10.push(i10), r10?.push(i10), i10;
  }
  _actualReadFontInfo(e206, t10) {
    let n10 = [], r10 = [], i10 = this._createRequest(`n`, 0, n10, r10), a10 = this._createRequest(`\uFF4D`, 0, n10, null), o10 = this._createRequest(` `, 0, n10, r10), s10 = this._createRequest(`0`, 0, n10, r10), c10 = this._createRequest(`1`, 0, n10, r10), l10 = this._createRequest(`2`, 0, n10, r10), u10 = this._createRequest(`3`, 0, n10, r10), d10 = this._createRequest(`4`, 0, n10, r10), f10 = this._createRequest(`5`, 0, n10, r10), p10 = this._createRequest(`6`, 0, n10, r10), m10 = this._createRequest(`7`, 0, n10, r10), h10 = this._createRequest(`8`, 0, n10, r10), g10 = this._createRequest(`9`, 0, n10, r10), _10 = this._createRequest(`\u2192`, 0, n10, r10), v10 = this._createRequest(`\uFFEB`, 0, n10, null), y10 = this._createRequest(`\xB7`, 0, n10, r10), b10 = this._createRequest(`\u2E31`, 0, n10, null), x10 = `|/-_ilm%`;
    for (let e207 = 0; e207 < 8; e207++) this._createRequest(x10.charAt(e207), 0, n10, r10), this._createRequest(x10.charAt(e207), 1, n10, r10), this._createRequest(x10.charAt(e207), 2, n10, r10);
    Dne(e206, t10, n10);
    let S10 = Math.max(s10.width, c10.width, l10.width, u10.width, d10.width, f10.width, p10.width, m10.width, h10.width, g10.width), ee2 = t10.fontFeatureSettings === Gn.OFF, te2 = r10[0].width;
    for (let e207 = 1, t11 = r10.length; ee2 && e207 < t11; e207++) {
      let t12 = te2 - r10[e207].width;
      if (t12 < -1e-3 || t12 > 1e-3) {
        ee2 = false;
        break;
      }
    }
    let ne2 = true;
    return ee2 && v10.width !== te2 && (ne2 = false), v10.width > _10.width && (ne2 = false), new hn({ pixelRatio: mu.getInstance(e206).value, fontFamily: t10.fontFamily, fontWeight: t10.fontWeight, fontSize: t10.fontSize, fontFeatureSettings: t10.fontFeatureSettings, fontVariationSettings: t10.fontVariationSettings, lineHeight: t10.lineHeight, letterSpacing: t10.letterSpacing, isMonospace: ee2, typicalHalfwidthCharacterWidth: i10.width, typicalFullwidthCharacterWidth: a10.width, canUseHalfwidthRightwardsArrow: ne2, spaceWidth: o10.width, middotWidth: y10.width, wsmiddotWidth: b10.width, maxDigitWidth: S10 }, true);
  }
}, kne = class {
  constructor() {
    this._keys = /* @__PURE__ */ Object.create(null), this._values = /* @__PURE__ */ Object.create(null);
  }
  has(e206) {
    let t10 = e206.getId();
    return !!this._values[t10];
  }
  get(e206) {
    let t10 = e206.getId();
    return this._values[t10];
  }
  put(e206, t10) {
    let n10 = e206.getId();
    this._keys[n10] = e206, this._values[n10] = t10;
  }
  remove(e206) {
    let t10 = e206.getId();
    delete this._keys[t10], delete this._values[t10];
  }
  getValues() {
    return Object.keys(this._keys).map((e206) => this._values[e206]);
  }
}, yu = new One(), bu;
(function(e206) {
  e206.serviceIds = /* @__PURE__ */ new Map(), e206.DI_TARGET = `$di$target`, e206.DI_DEPENDENCIES = `$di$dependencies`;
  function t10(t11) {
    return t11[e206.DI_DEPENDENCIES] || [];
  }
  e206.getServiceDependencies = t10;
})(bu || (bu = {}));
var V = xu(`instantiationService`);
function Ane(e206, t10, n10) {
  t10[bu.DI_TARGET] === t10 ? t10[bu.DI_DEPENDENCIES].push({ id: e206, index: n10 }) : (t10[bu.DI_DEPENDENCIES] = [{ id: e206, index: n10 }], t10[bu.DI_TARGET] = t10);
}
function xu(e206) {
  if (bu.serviceIds.has(e206)) return bu.serviceIds.get(e206);
  let t10 = function(e207, n10, r10) {
    if (arguments.length !== 3) throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);
    Ane(t10, e207, r10);
  };
  return t10.toString = () => e206, bu.serviceIds.set(e206, t10), t10;
}
var Su = xu(`codeEditorService`), Cu = xu(`modelService`), wu = xu(`textModelService`), Tu = class extends D {
  get onDidChange() {
    return this._onDidChange.event;
  }
  constructor(e206, t10 = ``, n10 = ``, r10 = true, i10) {
    super(), this._onDidChange = this._register(new k()), this._enabled = true, this._id = e206, this._label = t10, this._cssClass = n10, this._enabled = r10, this._actionCallback = i10;
  }
  get id() {
    return this._id;
  }
  get label() {
    return this._label;
  }
  set label(e206) {
    this._setLabel(e206);
  }
  _setLabel(e206) {
    this._label !== e206 && (this._label = e206, this._onDidChange.fire({ label: e206 }));
  }
  get tooltip() {
    return this._tooltip || ``;
  }
  set tooltip(e206) {
    this._setTooltip(e206);
  }
  _setTooltip(e206) {
    this._tooltip !== e206 && (this._tooltip = e206, this._onDidChange.fire({ tooltip: e206 }));
  }
  get class() {
    return this._cssClass;
  }
  set class(e206) {
    this._setClass(e206);
  }
  _setClass(e206) {
    this._cssClass !== e206 && (this._cssClass = e206, this._onDidChange.fire({ class: e206 }));
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e206) {
    this._setEnabled(e206);
  }
  _setEnabled(e206) {
    this._enabled !== e206 && (this._enabled = e206, this._onDidChange.fire({ enabled: e206 }));
  }
  get checked() {
    return this._checked;
  }
  set checked(e206) {
    this._setChecked(e206);
  }
  _setChecked(e206) {
    this._checked !== e206 && (this._checked = e206, this._onDidChange.fire({ checked: e206 }));
  }
  async run(e206, t10) {
    this._actionCallback && await this._actionCallback(e206);
  }
}, Eu = class extends D {
  constructor() {
    super(...arguments), this._onWillRun = this._register(new k()), this._onDidRun = this._register(new k());
  }
  get onWillRun() {
    return this._onWillRun.event;
  }
  get onDidRun() {
    return this._onDidRun.event;
  }
  async run(e206, t10) {
    if (!e206.enabled) return;
    this._onWillRun.fire({ action: e206 });
    let n10;
    try {
      await this.runAction(e206, t10);
    } catch (e207) {
      n10 = e207;
    }
    this._onDidRun.fire({ action: e206, error: n10 });
  }
  async runAction(e206, t10) {
    await e206.run(t10);
  }
}, Du = (_u2 = class {
  constructor() {
    this.id = _u2.ID, this.label = ``, this.tooltip = ``, this.class = `separator`, this.enabled = false, this.checked = false;
  }
  static join(...t10) {
    let n10 = [];
    for (let r10 of t10) r10.length && (n10 = n10.length ? [...n10, new _u2(), ...r10] : r10);
    return n10;
  }
  async run() {
  }
}, _u2.ID = `vs.actions.separator`, _u2), Ou = class {
  get actions() {
    return this._actions;
  }
  constructor(e206, t10, n10, r10) {
    this.tooltip = ``, this.enabled = true, this.checked = void 0, this.id = e206, this.label = t10, this.class = r10, this._actions = n10;
  }
  async run() {
  }
}, jne = (_v = class extends Tu {
  constructor() {
    super(_v.ID, C(28, `(empty)`), void 0, false);
  }
}, _v.ID = `vs.actions.empty`, _v);
function ku(e206) {
  return { id: e206.id, label: e206.label, tooltip: e206.tooltip ?? e206.label, class: e206.class, enabled: e206.enabled ?? true, checked: e206.checked, run: async (...t10) => e206.run(...t10) };
}
var Au;
(function(e206) {
  function t10(e207) {
    return !!e207 && typeof e207 == `object` && typeof e207.id == `string`;
  }
  e206.isThemeColor = t10;
})(Au || (Au = {}));
var ju;
(function(e206) {
  e206.iconNameSegment = `[A-Za-z0-9]+`, e206.iconNameExpression = `[A-Za-z0-9-]+`, e206.iconModifierExpression = `~[A-Za-z]+`, e206.iconNameCharacter = `[A-Za-z0-9~-]`;
  let t10 = RegExp(`^(${e206.iconNameExpression})(${e206.iconModifierExpression})?$`);
  function n10(e207) {
    let r11 = t10.exec(e207.id);
    if (!r11) return n10(F.error);
    let [, i11, a11] = r11, o11 = [`codicon`, `codicon-` + i11];
    return a11 && o11.push(`codicon-modifier-` + a11.substring(1)), o11;
  }
  e206.asClassNameArray = n10;
  function r10(e207) {
    return n10(e207).join(` `);
  }
  e206.asClassName = r10;
  function i10(e207) {
    return `.` + n10(e207).join(`.`);
  }
  e206.asCSSSelector = i10;
  function a10(e207) {
    return !!e207 && typeof e207 == `object` && typeof e207.id == `string` && (e207.color === void 0 || Au.isThemeColor(e207.color));
  }
  e206.isThemeIcon = a10;
  let o10 = RegExp(`^\\$\\((${e206.iconNameExpression}(?:${e206.iconModifierExpression})?)\\)$`);
  function s10(e207) {
    let t11 = o10.exec(e207);
    if (!t11) return;
    let [, n11] = t11;
    return { id: n11 };
  }
  e206.fromString = s10;
  function c10(e207) {
    return { id: e207 };
  }
  e206.fromId = c10;
  function l10(e207, t11) {
    let n11 = e207.id, r11 = n11.lastIndexOf(`~`);
    return r11 !== -1 && (n11 = n11.substring(0, r11)), t11 && (n11 = `${n11}~${t11}`), { id: n11 };
  }
  e206.modify = l10;
  function u10(e207) {
    let t11 = e207.id.lastIndexOf(`~`);
    if (t11 !== -1) return e207.id.substring(t11 + 1);
  }
  e206.getModifier = u10;
  function d10(e207, t11) {
    return e207.id === t11.id && e207.color?.id === t11.color?.id;
  }
  e206.isEqual = d10;
  function f10(e207) {
    return e207?.id === F.file.id;
  }
  e206.isFile = f10;
  function p10(e207) {
    return e207?.id === F.folder.id;
  }
  e206.isFolder = p10;
})(ju || (ju = {}));
var Mu = xu(`commandService`), Nu = new class {
  constructor() {
    this._commands = /* @__PURE__ */ new Map(), this._onDidRegisterCommand = new k(), this.onDidRegisterCommand = this._onDidRegisterCommand.event;
  }
  registerCommand(e206, t10) {
    if (!e206) throw Error(`invalid command`);
    if (typeof e206 == `string`) {
      if (!t10) throw Error(`invalid command`);
      return this.registerCommand({ id: e206, handler: t10 });
    }
    if (e206.metadata && Array.isArray(e206.metadata.args)) {
      let t11 = [];
      for (let n12 of e206.metadata.args) t11.push(n12.constraint);
      let n11 = e206.handler;
      e206.handler = function(e207, ...r11) {
        return Ze(r11, t11), n11(e207, ...r11);
      };
    }
    let { id: n10 } = e206, r10 = this._commands.get(n10);
    r10 || (r10 = new Qt(), this._commands.set(n10, r10));
    let i10 = r10.unshift(e206), a10 = T(() => {
      i10(), this._commands.get(n10)?.isEmpty() && this._commands.delete(n10);
    });
    return this._onDidRegisterCommand.fire(n10), Wt(a10);
  }
  registerCommandAlias(e206, t10) {
    return Nu.registerCommand(e206, (e207, ...n10) => e207.get(Mu).executeCommand(t10, ...n10));
  }
  getCommand(e206) {
    let t10 = this._commands.get(e206);
    if (!(!t10 || t10.isEmpty())) return Ut.first(t10);
  }
  getCommands() {
    let e206 = /* @__PURE__ */ new Map();
    for (let t10 of this._commands.keys()) {
      let n10 = this.getCommand(t10);
      n10 && e206.set(t10, n10);
    }
    return e206;
  }
}();
Nu.registerCommand(`noop`, () => {
});
function Pu(...e206) {
  switch (e206.length) {
    case 1:
      return C(1693, `Did you mean {0}?`, e206[0]);
    case 2:
      return C(1694, `Did you mean {0} or {1}?`, e206[0], e206[1]);
    case 3:
      return C(1695, `Did you mean {0}, {1} or {2}?`, e206[0], e206[1], e206[2]);
    default:
      return;
  }
}
var Mne = C(1696, `Did you forget to open or close the quote?`), Nne = C(1697, `Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.`), Fu = (_w = class {
  constructor() {
    this._input = ``, this._start = 0, this._current = 0, this._tokens = [], this._errors = [], this.stringRe = /[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy;
  }
  static getLexeme(e206) {
    switch (e206.type) {
      case 0:
        return `(`;
      case 1:
        return `)`;
      case 2:
        return `!`;
      case 3:
        return e206.isTripleEq ? `===` : `==`;
      case 4:
        return e206.isTripleEq ? `!==` : `!=`;
      case 5:
        return `<`;
      case 6:
        return `<=`;
      case 7:
        return `>=`;
      case 8:
        return `>=`;
      case 9:
        return `=~`;
      case 10:
        return e206.lexeme;
      case 11:
        return `true`;
      case 12:
        return `false`;
      case 13:
        return `in`;
      case 14:
        return `not`;
      case 15:
        return `&&`;
      case 16:
        return `||`;
      case 17:
        return e206.lexeme;
      case 18:
        return e206.lexeme;
      case 19:
        return e206.lexeme;
      case 20:
        return `EOF`;
      default:
        throw Oe(`unhandled token type: ${JSON.stringify(e206)}; have you forgotten to add a case?`);
    }
  }
  reset(e206) {
    return this._input = e206, this._start = 0, this._current = 0, this._tokens = [], this._errors = [], this;
  }
  scan() {
    for (; !this._isAtEnd(); ) switch (this._start = this._current, this._advance()) {
      case 40:
        this._addToken(0);
        break;
      case 41:
        this._addToken(1);
        break;
      case 33:
        if (this._match(61)) {
          let e206 = this._match(61);
          this._tokens.push({ type: 4, offset: this._start, isTripleEq: e206 });
        } else this._addToken(2);
        break;
      case 39:
        this._quotedString();
        break;
      case 47:
        this._regex();
        break;
      case 61:
        if (this._match(61)) {
          let e206 = this._match(61);
          this._tokens.push({ type: 3, offset: this._start, isTripleEq: e206 });
        } else this._match(126) ? this._addToken(9) : this._error(Pu(`==`, `=~`));
        break;
      case 60:
        this._addToken(this._match(61) ? 6 : 5);
        break;
      case 62:
        this._addToken(this._match(61) ? 8 : 7);
        break;
      case 38:
        this._match(38) ? this._addToken(15) : this._error(Pu(`&&`));
        break;
      case 124:
        this._match(124) ? this._addToken(16) : this._error(Pu(`||`));
        break;
      case 32:
      case 13:
      case 9:
      case 10:
      case 160:
        break;
      default:
        this._string();
    }
    return this._start = this._current, this._addToken(20), Array.from(this._tokens);
  }
  _match(e206) {
    return this._isAtEnd() || this._input.charCodeAt(this._current) !== e206 ? false : (this._current++, true);
  }
  _advance() {
    return this._input.charCodeAt(this._current++);
  }
  _peek() {
    return this._isAtEnd() ? 0 : this._input.charCodeAt(this._current);
  }
  _addToken(e206) {
    this._tokens.push({ type: e206, offset: this._start });
  }
  _error(e206) {
    let t10 = this._start, n10 = this._input.substring(this._start, this._current), r10 = { type: 19, offset: this._start, lexeme: n10 };
    this._errors.push({ offset: t10, lexeme: n10, additionalInfo: e206 }), this._tokens.push(r10);
  }
  _string() {
    this.stringRe.lastIndex = this._start;
    let t10 = this.stringRe.exec(this._input);
    if (t10) {
      this._current = this._start + t10[0].length;
      let n10 = this._input.substring(this._start, this._current), r10 = _w._keywords.get(n10);
      r10 ? this._addToken(r10) : this._tokens.push({ type: 17, lexeme: n10, offset: this._start });
    }
  }
  _quotedString() {
    for (; this._peek() !== 39 && !this._isAtEnd(); ) this._advance();
    if (this._isAtEnd()) {
      this._error(Mne);
      return;
    }
    this._advance(), this._tokens.push({ type: 18, lexeme: this._input.substring(this._start + 1, this._current - 1), offset: this._start + 1 });
  }
  _regex() {
    let t10 = this._current, n10 = false, r10 = false;
    for (; ; ) {
      if (t10 >= this._input.length) {
        this._current = t10, this._error(Nne);
        return;
      }
      let e206 = this._input.charCodeAt(t10);
      if (n10) n10 = false;
      else if (e206 === 47 && !r10) {
        t10++;
        break;
      } else e206 === 91 ? r10 = true : e206 === 92 ? n10 = true : e206 === 93 && (r10 = false);
      t10++;
    }
    for (; t10 < this._input.length && _w._regexFlags.has(this._input.charCodeAt(t10)); ) t10++;
    this._current = t10;
    let i10 = this._input.substring(this._start, this._current);
    this._tokens.push({ type: 10, lexeme: i10, offset: this._start });
  }
  _isAtEnd() {
    return this._current >= this._input.length;
  }
}, _w._regexFlags = new Set([`i`, `g`, `s`, `m`, `y`, `u`].map((e206) => e206.charCodeAt(0))), _w._keywords = /* @__PURE__ */ new Map([[`not`, 14], [`in`, 13], [`false`, 12], [`true`, 11]]), _w), Iu = /* @__PURE__ */ new Map();
Iu.set(`false`, false), Iu.set(`true`, true), Iu.set(`isMac`, Tt), Iu.set(`isLinux`, Et), Iu.set(`isWindows`, wt), Iu.set(`isWeb`, Ot), Iu.set(`isMacNative`, Tt && !Ot), Iu.set(`isEdge`, Bt), Iu.set(`isFirefox`, zt), Iu.set(`isChrome`, Rt), Iu.set(`isSafari`, iee);
var Pne = Object.prototype.hasOwnProperty, Fne = { regexParsingWithErrorRecovery: true }, Ine = C(1675, `Empty context key expression`), Lne = C(1676, `Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.`), Rne = C(1677, `'in' after 'not'.`), Lu = C(1678, `closing parenthesis ')'`), zne = C(1679, `Unexpected token`), Bne = C(1680, `Did you forget to put && or || before the token?`), Vne = C(1681, `Unexpected end of expression`), Hne = C(1682, `Did you forget to put a context key?`), Une = (_x = class {
  constructor(e206 = Fne) {
    this._config = e206, this._scanner = new Fu(), this._tokens = [], this._current = 0, this._parsingErrors = [], this._flagsGYRe = /g|y/g;
  }
  parse(t10) {
    if (t10 === ``) {
      this._parsingErrors.push({ message: Ine, offset: 0, lexeme: ``, additionalInfo: Lne });
      return;
    }
    this._tokens = this._scanner.reset(t10).scan(), this._current = 0, this._parsingErrors = [];
    try {
      let t11 = this._expr();
      if (!this._isAtEnd()) {
        let t12 = this._peek(), n10 = t12.type === 17 ? Bne : void 0;
        throw this._parsingErrors.push({ message: zne, offset: t12.offset, lexeme: Fu.getLexeme(t12), additionalInfo: n10 }), _x._parseError;
      }
      return t11;
    } catch (t11) {
      if (t11 !== _x._parseError) throw t11;
      return;
    }
  }
  _expr() {
    return this._or();
  }
  _or() {
    let e206 = [this._and()];
    for (; this._matchOne(16); ) {
      let t10 = this._and();
      e206.push(t10);
    }
    return e206.length === 1 ? e206[0] : H.or(...e206);
  }
  _and() {
    let e206 = [this._term()];
    for (; this._matchOne(15); ) {
      let t10 = this._term();
      e206.push(t10);
    }
    return e206.length === 1 ? e206[0] : H.and(...e206);
  }
  _term() {
    if (this._matchOne(2)) {
      let e206 = this._peek();
      switch (e206.type) {
        case 11:
          return this._advance(), zu.INSTANCE;
        case 12:
          return this._advance(), Bu.INSTANCE;
        case 0: {
          this._advance();
          let e207 = this._expr();
          return this._consume(1, Lu), e207?.negate();
        }
        case 17:
          return this._advance(), Ku.create(e206.lexeme);
        default:
          throw this._errExpectedButGot(`KEY | true | false | '(' expression ')'`, e206);
      }
    }
    return this._primary();
  }
  _primary() {
    let t10 = this._peek();
    switch (t10.type) {
      case 11:
        return this._advance(), H.true();
      case 12:
        return this._advance(), H.false();
      case 0: {
        this._advance();
        let e206 = this._expr();
        return this._consume(1, Lu), e206;
      }
      case 17: {
        let e206 = t10.lexeme;
        if (this._advance(), this._matchOne(9)) {
          let t11 = this._peek();
          if (!this._config.regexParsingWithErrorRecovery) {
            if (this._advance(), t11.type !== 10) throw this._errExpectedButGot(`REGEX`, t11);
            let n10 = t11.lexeme, r10 = n10.lastIndexOf(`/`), i10 = r10 === n10.length - 1 ? void 0 : this._removeFlagsGY(n10.substring(r10 + 1)), a10;
            try {
              a10 = new RegExp(n10.substring(1, r10), i10);
            } catch {
              throw this._errExpectedButGot(`REGEX`, t11);
            }
            return Qu.create(e206, a10);
          }
          switch (t11.type) {
            case 10:
            case 19: {
              let n10 = [t11.lexeme];
              this._advance();
              let r10 = this._peek(), i10 = 0;
              for (let e207 = 0; e207 < t11.lexeme.length; e207++) t11.lexeme.charCodeAt(e207) === 40 ? i10++ : t11.lexeme.charCodeAt(e207) === 41 && i10--;
              for (; !this._isAtEnd() && r10.type !== 15 && r10.type !== 16; ) {
                switch (r10.type) {
                  case 0:
                    i10++;
                    break;
                  case 1:
                    i10--;
                    break;
                  case 10:
                  case 18:
                    for (let e207 = 0; e207 < r10.lexeme.length; e207++) r10.lexeme.charCodeAt(e207) === 40 ? i10++ : t11.lexeme.charCodeAt(e207) === 41 && i10--;
                }
                if (i10 < 0) break;
                n10.push(Fu.getLexeme(r10)), this._advance(), r10 = this._peek();
              }
              let a10 = n10.join(``), o10 = a10.lastIndexOf(`/`), s10 = o10 === a10.length - 1 ? void 0 : this._removeFlagsGY(a10.substring(o10 + 1)), c10;
              try {
                c10 = new RegExp(a10.substring(1, o10), s10);
              } catch {
                throw this._errExpectedButGot(`REGEX`, t11);
              }
              return H.regex(e206, c10);
            }
            case 18: {
              let n10 = t11.lexeme;
              this._advance();
              let r10 = null;
              if (!Ia(n10)) {
                let e207 = n10.indexOf(`/`), i10 = n10.lastIndexOf(`/`);
                if (e207 !== i10 && e207 >= 0) {
                  let a10 = n10.slice(e207 + 1, i10), o10 = n10[i10 + 1] === `i` ? `i` : ``;
                  try {
                    r10 = new RegExp(a10, o10);
                  } catch {
                    throw this._errExpectedButGot(`REGEX`, t11);
                  }
                }
              }
              if (r10 === null) throw this._errExpectedButGot(`REGEX`, t11);
              return Qu.create(e206, r10);
            }
            default:
              throw this._errExpectedButGot(`REGEX`, this._peek());
          }
        }
        if (this._matchOne(14)) {
          this._consume(13, Rne);
          let t11 = this._value();
          return H.notIn(e206, t11);
        }
        switch (this._peek().type) {
          case 3: {
            this._advance();
            let t11 = this._value();
            if (this._previous().type === 18) return H.equals(e206, t11);
            switch (t11) {
              case `true`:
                return H.has(e206);
              case `false`:
                return H.not(e206);
              default:
                return H.equals(e206, t11);
            }
          }
          case 4: {
            this._advance();
            let t11 = this._value();
            if (this._previous().type === 18) return H.notEquals(e206, t11);
            switch (t11) {
              case `true`:
                return H.not(e206);
              case `false`:
                return H.has(e206);
              default:
                return H.notEquals(e206, t11);
            }
          }
          case 5:
            return this._advance(), Xu.create(e206, this._value());
          case 6:
            return this._advance(), Zu.create(e206, this._value());
          case 7:
            return this._advance(), Ju.create(e206, this._value());
          case 8:
            return this._advance(), Yu.create(e206, this._value());
          case 13:
            return this._advance(), H.in(e206, this._value());
          default:
            return H.has(e206);
        }
      }
      case 20:
        throw this._parsingErrors.push({ message: Vne, offset: t10.offset, lexeme: ``, additionalInfo: Hne }), _x._parseError;
      default:
        throw this._errExpectedButGot(`true | false | KEY 
	| KEY '=~' REGEX 
	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`, this._peek());
    }
  }
  _value() {
    let e206 = this._peek();
    switch (e206.type) {
      case 17:
      case 18:
        return this._advance(), e206.lexeme;
      case 11:
        return this._advance(), `true`;
      case 12:
        return this._advance(), `false`;
      case 13:
        return this._advance(), `in`;
      default:
        return ``;
    }
  }
  _removeFlagsGY(e206) {
    return e206.replaceAll(this._flagsGYRe, ``);
  }
  _previous() {
    return this._tokens[this._current - 1];
  }
  _matchOne(e206) {
    return this._check(e206) ? (this._advance(), true) : false;
  }
  _advance() {
    return this._isAtEnd() || this._current++, this._previous();
  }
  _consume(e206, t10) {
    if (this._check(e206)) return this._advance();
    throw this._errExpectedButGot(t10, this._peek());
  }
  _errExpectedButGot(t10, n10, r10) {
    let i10 = C(1683, `Expected: {0}
Received: '{1}'.`, t10, Fu.getLexeme(n10)), a10 = n10.offset, o10 = Fu.getLexeme(n10);
    return this._parsingErrors.push({ message: i10, offset: a10, lexeme: o10, additionalInfo: r10 }), _x._parseError;
  }
  _check(e206) {
    return this._peek().type === e206;
  }
  _peek() {
    return this._tokens[this._current];
  }
  _isAtEnd() {
    return this._peek().type === 20;
  }
}, _x._parseError = Error(), _x), H = (_y2 = class {
  static false() {
    return zu.INSTANCE;
  }
  static true() {
    return Bu.INSTANCE;
  }
  static has(e206) {
    return Vu.create(e206);
  }
  static equals(e206, t10) {
    return Hu.create(e206, t10);
  }
  static notEquals(e206, t10) {
    return Gu.create(e206, t10);
  }
  static regex(e206, t10) {
    return Qu.create(e206, t10);
  }
  static in(e206, t10) {
    return Uu.create(e206, t10);
  }
  static notIn(e206, t10) {
    return Wu.create(e206, t10);
  }
  static not(e206) {
    return Ku.create(e206);
  }
  static and(...e206) {
    return ed.create(e206, null, true);
  }
  static or(...e206) {
    return td.create(e206, null, true);
  }
  static deserialize(e206) {
    if (e206 != null) return this._parser.parse(e206);
  }
}, _y2._parser = new Une({ regexParsingWithErrorRecovery: false }), _y2);
function Wne(e206, t10) {
  let n10 = e206 ? e206.substituteConstants() : void 0, r10 = t10 ? t10.substituteConstants() : void 0;
  return !n10 && !r10 ? true : !n10 || !r10 ? false : n10.equals(r10);
}
function Ru(e206, t10) {
  return e206.cmp(t10);
}
var zu = (_z = class {
  constructor() {
    this.type = 0;
  }
  cmp(e206) {
    return this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return false;
  }
  serialize() {
    return `false`;
  }
  keys() {
    return [];
  }
  negate() {
    return Bu.INSTANCE;
  }
}, _z.INSTANCE = new _z(), _z), Bu = (_A = class {
  constructor() {
    this.type = 1;
  }
  cmp(e206) {
    return this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return true;
  }
  serialize() {
    return `true`;
  }
  keys() {
    return [];
  }
  negate() {
    return zu.INSTANCE;
  }
}, _A.INSTANCE = new _A(), _A), Vu = class e26 {
  static create(t10, n10 = null) {
    let r10 = Iu.get(t10);
    return typeof r10 == `boolean` ? r10 ? Bu.INSTANCE : zu.INSTANCE : new e26(t10, n10);
  }
  constructor(e206, t10) {
    this.key = e206, this.negated = t10, this.type = 2;
  }
  cmp(e206) {
    return e206.type === this.type ? rd(this.key, e206.key) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key : false;
  }
  substituteConstants() {
    let e206 = Iu.get(this.key);
    return typeof e206 == `boolean` ? e206 ? Bu.INSTANCE : zu.INSTANCE : this;
  }
  evaluate(e206) {
    return !!e206.getValue(this.key);
  }
  serialize() {
    return this.key;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Ku.create(this.key, this)), this.negated;
  }
}, Hu = class e27 {
  static create(t10, n10, r10 = null) {
    if (typeof n10 == `boolean`) return n10 ? Vu.create(t10, r10) : Ku.create(t10, r10);
    let i10 = Iu.get(t10);
    return typeof i10 == `boolean` ? n10 === (i10 ? `true` : `false`) ? Bu.INSTANCE : zu.INSTANCE : new e27(t10, n10, r10);
  }
  constructor(e206, t10, n10) {
    this.key = e206, this.value = t10, this.negated = n10, this.type = 4;
  }
  cmp(e206) {
    return e206.type === this.type ? id(this.key, this.value, e206.key, e206.value) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key && this.value === e206.value : false;
  }
  substituteConstants() {
    let e206 = Iu.get(this.key);
    if (typeof e206 == `boolean`) {
      let t10 = e206 ? `true` : `false`;
      return this.value === t10 ? Bu.INSTANCE : zu.INSTANCE;
    }
    return this;
  }
  evaluate(e206) {
    return e206.getValue(this.key) == this.value;
  }
  serialize() {
    return `${this.key} == '${this.value}'`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Gu.create(this.key, this.value, this)), this.negated;
  }
}, Uu = class e28 {
  static create(t10, n10) {
    return new e28(t10, n10);
  }
  constructor(e206, t10) {
    this.key = e206, this.valueKey = t10, this.type = 10, this.negated = null;
  }
  cmp(e206) {
    return e206.type === this.type ? id(this.key, this.valueKey, e206.key, e206.valueKey) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key && this.valueKey === e206.valueKey : false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    let t10 = e206.getValue(this.valueKey), n10 = e206.getValue(this.key);
    return Array.isArray(t10) ? t10.includes(n10) : typeof n10 == `string` && typeof t10 == `object` && t10 ? Pne.call(t10, n10) : false;
  }
  serialize() {
    return `${this.key} in '${this.valueKey}'`;
  }
  keys() {
    return [this.key, this.valueKey];
  }
  negate() {
    return this.negated || (this.negated = Wu.create(this.key, this.valueKey)), this.negated;
  }
}, Wu = class e29 {
  static create(t10, n10) {
    return new e29(t10, n10);
  }
  constructor(e206, t10) {
    this.key = e206, this.valueKey = t10, this.type = 11, this._negated = Uu.create(e206, t10);
  }
  cmp(e206) {
    return e206.type === this.type ? this._negated.cmp(e206._negated) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this._negated.equals(e206._negated) : false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return !this._negated.evaluate(e206);
  }
  serialize() {
    return `${this.key} not in '${this.valueKey}'`;
  }
  keys() {
    return this._negated.keys();
  }
  negate() {
    return this._negated;
  }
}, Gu = class e30 {
  static create(t10, n10, r10 = null) {
    if (typeof n10 == `boolean`) return n10 ? Ku.create(t10, r10) : Vu.create(t10, r10);
    let i10 = Iu.get(t10);
    return typeof i10 == `boolean` ? n10 === (i10 ? `true` : `false`) ? zu.INSTANCE : Bu.INSTANCE : new e30(t10, n10, r10);
  }
  constructor(e206, t10, n10) {
    this.key = e206, this.value = t10, this.negated = n10, this.type = 5;
  }
  cmp(e206) {
    return e206.type === this.type ? id(this.key, this.value, e206.key, e206.value) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key && this.value === e206.value : false;
  }
  substituteConstants() {
    let e206 = Iu.get(this.key);
    if (typeof e206 == `boolean`) {
      let t10 = e206 ? `true` : `false`;
      return this.value === t10 ? zu.INSTANCE : Bu.INSTANCE;
    }
    return this;
  }
  evaluate(e206) {
    return e206.getValue(this.key) != this.value;
  }
  serialize() {
    return `${this.key} != '${this.value}'`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Hu.create(this.key, this.value, this)), this.negated;
  }
}, Ku = class e31 {
  static create(t10, n10 = null) {
    let r10 = Iu.get(t10);
    return typeof r10 == `boolean` ? r10 ? zu.INSTANCE : Bu.INSTANCE : new e31(t10, n10);
  }
  constructor(e206, t10) {
    this.key = e206, this.negated = t10, this.type = 3;
  }
  cmp(e206) {
    return e206.type === this.type ? rd(this.key, e206.key) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key : false;
  }
  substituteConstants() {
    let e206 = Iu.get(this.key);
    return typeof e206 == `boolean` ? e206 ? zu.INSTANCE : Bu.INSTANCE : this;
  }
  evaluate(e206) {
    return !e206.getValue(this.key);
  }
  serialize() {
    return `!${this.key}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Vu.create(this.key, this)), this.negated;
  }
};
function qu(e206, t10) {
  if (typeof e206 == `string`) {
    let t11 = parseFloat(e206);
    isNaN(t11) || (e206 = t11);
  }
  return typeof e206 == `string` || typeof e206 == `number` ? t10(e206) : zu.INSTANCE;
}
var Ju = class e32 {
  static create(t10, n10, r10 = null) {
    return qu(n10, (n11) => new e32(t10, n11, r10));
  }
  constructor(e206, t10, n10) {
    this.key = e206, this.value = t10, this.negated = n10, this.type = 12;
  }
  cmp(e206) {
    return e206.type === this.type ? id(this.key, this.value, e206.key, e206.value) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key && this.value === e206.value : false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return typeof this.value == `string` ? false : parseFloat(e206.getValue(this.key)) > this.value;
  }
  serialize() {
    return `${this.key} > ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Zu.create(this.key, this.value, this)), this.negated;
  }
}, Yu = class e33 {
  static create(t10, n10, r10 = null) {
    return qu(n10, (n11) => new e33(t10, n11, r10));
  }
  constructor(e206, t10, n10) {
    this.key = e206, this.value = t10, this.negated = n10, this.type = 13;
  }
  cmp(e206) {
    return e206.type === this.type ? id(this.key, this.value, e206.key, e206.value) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key && this.value === e206.value : false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return typeof this.value == `string` ? false : parseFloat(e206.getValue(this.key)) >= this.value;
  }
  serialize() {
    return `${this.key} >= ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Xu.create(this.key, this.value, this)), this.negated;
  }
}, Xu = class e34 {
  static create(t10, n10, r10 = null) {
    return qu(n10, (n11) => new e34(t10, n11, r10));
  }
  constructor(e206, t10, n10) {
    this.key = e206, this.value = t10, this.negated = n10, this.type = 14;
  }
  cmp(e206) {
    return e206.type === this.type ? id(this.key, this.value, e206.key, e206.value) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key && this.value === e206.value : false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return typeof this.value == `string` ? false : parseFloat(e206.getValue(this.key)) < this.value;
  }
  serialize() {
    return `${this.key} < ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Yu.create(this.key, this.value, this)), this.negated;
  }
}, Zu = class e35 {
  static create(t10, n10, r10 = null) {
    return qu(n10, (n11) => new e35(t10, n11, r10));
  }
  constructor(e206, t10, n10) {
    this.key = e206, this.value = t10, this.negated = n10, this.type = 15;
  }
  cmp(e206) {
    return e206.type === this.type ? id(this.key, this.value, e206.key, e206.value) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this.key === e206.key && this.value === e206.value : false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return typeof this.value == `string` ? false : parseFloat(e206.getValue(this.key)) <= this.value;
  }
  serialize() {
    return `${this.key} <= ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Ju.create(this.key, this.value, this)), this.negated;
  }
}, Qu = class e36 {
  static create(t10, n10) {
    return new e36(t10, n10);
  }
  constructor(e206, t10) {
    this.key = e206, this.regexp = t10, this.type = 7, this.negated = null;
  }
  cmp(e206) {
    if (e206.type !== this.type) return this.type - e206.type;
    if (this.key < e206.key) return -1;
    if (this.key > e206.key) return 1;
    let t10 = this.regexp ? this.regexp.source : ``, n10 = e206.regexp ? e206.regexp.source : ``;
    return t10 < n10 ? -1 : +(t10 > n10);
  }
  equals(e206) {
    if (e206.type === this.type) {
      let t10 = this.regexp ? this.regexp.source : ``, n10 = e206.regexp ? e206.regexp.source : ``;
      return this.key === e206.key && t10 === n10;
    }
    return false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    let t10 = e206.getValue(this.key);
    return this.regexp ? this.regexp.test(t10) : false;
  }
  serialize() {
    let e206 = this.regexp ? `/${this.regexp.source}/${this.regexp.flags}` : `/invalid/`;
    return `${this.key} =~ ${e206}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Gne.create(this)), this.negated;
  }
}, Gne = class e37 {
  static create(t10) {
    return new e37(t10);
  }
  constructor(e206) {
    this._actual = e206, this.type = 8;
  }
  cmp(e206) {
    return e206.type === this.type ? this._actual.cmp(e206._actual) : this.type - e206.type;
  }
  equals(e206) {
    return e206.type === this.type ? this._actual.equals(e206._actual) : false;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e206) {
    return !this._actual.evaluate(e206);
  }
  serialize() {
    return `!(${this._actual.serialize()})`;
  }
  keys() {
    return this._actual.keys();
  }
  negate() {
    return this._actual;
  }
};
function $u(e206) {
  let t10 = null;
  for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
    let r11 = e206[n10].substituteConstants();
    if (e206[n10] !== r11 && t10 === null) {
      t10 = [];
      for (let r12 = 0; r12 < n10; r12++) t10[r12] = e206[r12];
    }
    t10 !== null && (t10[n10] = r11);
  }
  return t10 === null ? e206 : t10;
}
var ed = class e38 {
  static create(t10, n10, r10) {
    return e38._normalizeArr(t10, n10, r10);
  }
  constructor(e206, t10) {
    this.expr = e206, this.negated = t10, this.type = 6;
  }
  cmp(e206) {
    if (e206.type !== this.type) return this.type - e206.type;
    if (this.expr.length < e206.expr.length) return -1;
    if (this.expr.length > e206.expr.length) return 1;
    for (let t10 = 0, n10 = this.expr.length; t10 < n10; t10++) {
      let n11 = Ru(this.expr[t10], e206.expr[t10]);
      if (n11 !== 0) return n11;
    }
    return 0;
  }
  equals(e206) {
    if (e206.type === this.type) {
      if (this.expr.length !== e206.expr.length) return false;
      for (let t10 = 0, n10 = this.expr.length; t10 < n10; t10++) if (!this.expr[t10].equals(e206.expr[t10])) return false;
      return true;
    }
    return false;
  }
  substituteConstants() {
    let t10 = $u(this.expr);
    return t10 === this.expr ? this : e38.create(t10, this.negated, false);
  }
  evaluate(e206) {
    for (let t10 = 0, n10 = this.expr.length; t10 < n10; t10++) if (!this.expr[t10].evaluate(e206)) return false;
    return true;
  }
  static _normalizeArr(t10, n10, r10) {
    let i10 = [], a10 = false;
    for (let e206 of t10) if (e206) {
      if (e206.type === 1) {
        a10 = true;
        continue;
      }
      if (e206.type === 0) return zu.INSTANCE;
      if (e206.type === 6) {
        i10.push(...e206.expr);
        continue;
      }
      i10.push(e206);
    }
    if (i10.length === 0 && a10) return Bu.INSTANCE;
    if (i10.length !== 0) {
      if (i10.length === 1) return i10[0];
      i10.sort(Ru);
      for (let e206 = 1; e206 < i10.length; e206++) i10[e206 - 1].equals(i10[e206]) && (i10.splice(e206, 1), e206--);
      if (i10.length === 1) return i10[0];
      for (; i10.length > 1; ) {
        let t11 = i10[i10.length - 1];
        if (t11.type !== 9) break;
        i10.pop();
        let n11 = i10.pop(), a11 = i10.length === 0, o10 = td.create(t11.expr.map((t12) => e38.create([t12, n11], null, r10)), null, a11);
        o10 && (i10.push(o10), i10.sort(Ru));
      }
      if (i10.length === 1) return i10[0];
      if (r10) {
        for (let e206 = 0; e206 < i10.length; e206++) for (let t11 = e206 + 1; t11 < i10.length; t11++) if (i10[e206].negate().equals(i10[t11])) return zu.INSTANCE;
        if (i10.length === 1) return i10[0];
      }
      return new e38(i10, n10);
    }
  }
  serialize() {
    return this.expr.map((e206) => e206.serialize()).join(` && `);
  }
  keys() {
    let e206 = [];
    for (let t10 of this.expr) e206.push(...t10.keys());
    return e206;
  }
  negate() {
    if (!this.negated) {
      let e206 = [];
      for (let t10 of this.expr) e206.push(t10.negate());
      this.negated = td.create(e206, this, true);
    }
    return this.negated;
  }
}, td = class e39 {
  static create(t10, n10, r10) {
    return e39._normalizeArr(t10, n10, r10);
  }
  constructor(e206, t10) {
    this.expr = e206, this.negated = t10, this.type = 9;
  }
  cmp(e206) {
    if (e206.type !== this.type) return this.type - e206.type;
    if (this.expr.length < e206.expr.length) return -1;
    if (this.expr.length > e206.expr.length) return 1;
    for (let t10 = 0, n10 = this.expr.length; t10 < n10; t10++) {
      let n11 = Ru(this.expr[t10], e206.expr[t10]);
      if (n11 !== 0) return n11;
    }
    return 0;
  }
  equals(e206) {
    if (e206.type === this.type) {
      if (this.expr.length !== e206.expr.length) return false;
      for (let t10 = 0, n10 = this.expr.length; t10 < n10; t10++) if (!this.expr[t10].equals(e206.expr[t10])) return false;
      return true;
    }
    return false;
  }
  substituteConstants() {
    let t10 = $u(this.expr);
    return t10 === this.expr ? this : e39.create(t10, this.negated, false);
  }
  evaluate(e206) {
    for (let t10 = 0, n10 = this.expr.length; t10 < n10; t10++) if (this.expr[t10].evaluate(e206)) return true;
    return false;
  }
  static _normalizeArr(t10, n10, r10) {
    let i10 = [], a10 = false;
    if (t10) {
      for (let e206 = 0, n11 = t10.length; e206 < n11; e206++) {
        let n12 = t10[e206];
        if (n12) {
          if (n12.type === 0) {
            a10 = true;
            continue;
          }
          if (n12.type === 1) return Bu.INSTANCE;
          if (n12.type === 9) {
            i10 = i10.concat(n12.expr);
            continue;
          }
          i10.push(n12);
        }
      }
      if (i10.length === 0 && a10) return zu.INSTANCE;
      i10.sort(Ru);
    }
    if (i10.length !== 0) {
      if (i10.length === 1) return i10[0];
      for (let e206 = 1; e206 < i10.length; e206++) i10[e206 - 1].equals(i10[e206]) && (i10.splice(e206, 1), e206--);
      if (i10.length === 1) return i10[0];
      if (r10) {
        for (let e206 = 0; e206 < i10.length; e206++) for (let t11 = e206 + 1; t11 < i10.length; t11++) if (i10[e206].negate().equals(i10[t11])) return Bu.INSTANCE;
        if (i10.length === 1) return i10[0];
      }
      return new e39(i10, n10);
    }
  }
  serialize() {
    return this.expr.map((e206) => e206.serialize()).join(` || `);
  }
  keys() {
    let e206 = [];
    for (let t10 of this.expr) e206.push(...t10.keys());
    return e206;
  }
  negate() {
    if (!this.negated) {
      let t10 = [];
      for (let e206 of this.expr) t10.push(e206.negate());
      for (; t10.length > 1; ) {
        let n10 = t10.shift(), r10 = t10.shift(), i10 = [];
        for (let e206 of sd(n10)) for (let t11 of sd(r10)) i10.push(ed.create([e206, t11], null, false));
        t10.unshift(e39.create(i10, null, false));
      }
      this.negated = e39.create(t10, this, true);
    }
    return this.negated;
  }
}, U = (_B = class extends Vu {
  static all() {
    return _B._info.values();
  }
  constructor(t10, n10, r10) {
    super(t10, null), this._defaultValue = n10, typeof r10 == `object` ? _B._info.push({ ...r10, key: t10 }) : r10 !== true && _B._info.push({ key: t10, description: r10, type: n10 == null ? void 0 : typeof n10 });
  }
  bindTo(e206) {
    return e206.createKey(this.key, this._defaultValue);
  }
  getValue(e206) {
    return e206.getContextKeyValue(this.key);
  }
  toNegated() {
    return this.negate();
  }
  isEqualTo(e206) {
    return Hu.create(this.key, e206);
  }
}, _B._info = [], _B), nd = xu(`contextKeyService`);
function rd(e206, t10) {
  return e206 < t10 ? -1 : +(e206 > t10);
}
function id(e206, t10, n10, r10) {
  return e206 < n10 ? -1 : e206 > n10 ? 1 : t10 < r10 ? -1 : +(t10 > r10);
}
function ad(e206, t10) {
  if (e206.type === 0 || t10.type === 1) return true;
  if (e206.type === 9) return t10.type === 9 ? od(e206.expr, t10.expr) : false;
  if (t10.type === 9) {
    for (let n10 of t10.expr) if (ad(e206, n10)) return true;
    return false;
  }
  if (e206.type === 6) {
    if (t10.type === 6) return od(t10.expr, e206.expr);
    for (let n10 of e206.expr) if (ad(n10, t10)) return true;
    return false;
  }
  return e206.equals(t10);
}
function od(e206, t10) {
  let n10 = 0, r10 = 0;
  for (; n10 < e206.length && r10 < t10.length; ) {
    let i10 = e206[n10].cmp(t10[r10]);
    if (i10 < 0) return false;
    i10 === 0 && n10++, r10++;
  }
  return n10 === e206.length;
}
function sd(e206) {
  return e206.type === 9 ? e206.expr : [e206];
}
var cd = new class {
  constructor() {
    this.data = /* @__PURE__ */ new Map();
  }
  add(e206, t10) {
    Me(Re(e206)), Me(Be(t10)), Me(!this.data.has(e206), `There is already an extension with this id`), this.data.set(e206, t10);
  }
  as(e206) {
    return this.data.get(e206) || null;
  }
  dispose() {
    this.data.forEach((e206) => {
      Xe(e206.dispose) && e206.dispose();
    }), this.data.clear();
  }
}(), ld = new class e40 {
  constructor() {
    this._coreKeybindings = new Qt(), this._extensionKeybindings = [], this._cachedMergedKeybindings = null;
  }
  static bindToCurrentPlatform(e206) {
    if (Pt === 1) {
      if (e206 && e206.win) return e206.win;
    } else if (Pt === 2) {
      if (e206 && e206.mac) return e206.mac;
    } else if (e206 && e206.linux) return e206.linux;
    return e206;
  }
  registerKeybindingRule(t10) {
    let n10 = e40.bindToCurrentPlatform(t10), r10 = new E();
    if (n10 && n10.primary) {
      let e206 = Vo(n10.primary, Pt);
      e206 && r10.add(this._registerDefaultKeybinding(e206, t10.id, t10.args, t10.weight, 0, t10.when));
    }
    if (n10 && Array.isArray(n10.secondary)) for (let e206 = 0, i10 = n10.secondary.length; e206 < i10; e206++) {
      let i11 = n10.secondary[e206], a10 = Vo(i11, Pt);
      a10 && r10.add(this._registerDefaultKeybinding(a10, t10.id, t10.args, t10.weight, -e206 - 1, t10.when));
    }
    return r10;
  }
  registerCommandAndKeybindingRule(e206) {
    return qt(this.registerKeybindingRule(e206), Nu.registerCommand(e206));
  }
  _registerDefaultKeybinding(e206, t10, n10, r10, i10, a10) {
    let o10 = this._coreKeybindings.push({ keybinding: e206, command: t10, commandArgs: n10, when: a10, weight1: r10, weight2: i10, extensionId: null, isBuiltinExtension: false });
    return this._cachedMergedKeybindings = null, T(() => {
      o10(), this._cachedMergedKeybindings = null;
    });
  }
  getDefaultKeybindings() {
    return this._cachedMergedKeybindings || (this._cachedMergedKeybindings = Array.from(this._coreKeybindings).concat(this._extensionKeybindings), this._cachedMergedKeybindings.sort(Kne)), this._cachedMergedKeybindings.slice(0);
  }
}();
cd.add({ EditorModes: `platform.keybindingsRegistry` }.EditorModes, ld);
function Kne(e206, t10) {
  if (e206.weight1 !== t10.weight1) return e206.weight1 - t10.weight1;
  if (e206.command && t10.command) {
    if (e206.command < t10.command) return -1;
    if (e206.command > t10.command) return 1;
  }
  return e206.weight2 - t10.weight2;
}
var qne = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, ud = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, dd;
function fd(e206) {
  return e206.command !== void 0;
}
function Jne(e206) {
  return e206.submenu !== void 0;
}
var W = (_C = class {
  constructor(t10) {
    if (_C._instances.has(t10)) throw TypeError(`MenuId with identifier '${t10}' already exists. Use MenuId.for(ident) or a unique identifier`);
    _C._instances.set(t10, this), this.id = t10;
  }
}, _C._instances = /* @__PURE__ */ new Map(), _C.CommandPalette = new _C(`CommandPalette`), _C.DebugBreakpointsContext = new _C(`DebugBreakpointsContext`), _C.DebugCallStackContext = new _C(`DebugCallStackContext`), _C.DebugConsoleContext = new _C(`DebugConsoleContext`), _C.DebugVariablesContext = new _C(`DebugVariablesContext`), _C.NotebookVariablesContext = new _C(`NotebookVariablesContext`), _C.DebugHoverContext = new _C(`DebugHoverContext`), _C.DebugWatchContext = new _C(`DebugWatchContext`), _C.DebugToolBar = new _C(`DebugToolBar`), _C.DebugToolBarStop = new _C(`DebugToolBarStop`), _C.DebugDisassemblyContext = new _C(`DebugDisassemblyContext`), _C.DebugCallStackToolbar = new _C(`DebugCallStackToolbar`), _C.DebugCreateConfiguration = new _C(`DebugCreateConfiguration`), _C.EditorContext = new _C(`EditorContext`), _C.SimpleEditorContext = new _C(`SimpleEditorContext`), _C.EditorContent = new _C(`EditorContent`), _C.EditorLineNumberContext = new _C(`EditorLineNumberContext`), _C.EditorContextCopy = new _C(`EditorContextCopy`), _C.EditorContextPeek = new _C(`EditorContextPeek`), _C.EditorContextShare = new _C(`EditorContextShare`), _C.EditorTitle = new _C(`EditorTitle`), _C.CompactWindowEditorTitle = new _C(`CompactWindowEditorTitle`), _C.EditorTitleRun = new _C(`EditorTitleRun`), _C.EditorTitleContext = new _C(`EditorTitleContext`), _C.EditorTitleContextShare = new _C(`EditorTitleContextShare`), _C.EmptyEditorGroup = new _C(`EmptyEditorGroup`), _C.EmptyEditorGroupContext = new _C(`EmptyEditorGroupContext`), _C.EditorTabsBarContext = new _C(`EditorTabsBarContext`), _C.EditorTabsBarShowTabsSubmenu = new _C(`EditorTabsBarShowTabsSubmenu`), _C.EditorTabsBarShowTabsZenModeSubmenu = new _C(`EditorTabsBarShowTabsZenModeSubmenu`), _C.EditorActionsPositionSubmenu = new _C(`EditorActionsPositionSubmenu`), _C.EditorSplitMoveSubmenu = new _C(`EditorSplitMoveSubmenu`), _C.ExplorerContext = new _C(`ExplorerContext`), _C.ExplorerContextShare = new _C(`ExplorerContextShare`), _C.ExtensionContext = new _C(`ExtensionContext`), _C.ExtensionEditorContextMenu = new _C(`ExtensionEditorContextMenu`), _C.GlobalActivity = new _C(`GlobalActivity`), _C.CommandCenter = new _C(`CommandCenter`), _C.CommandCenterCenter = new _C(`CommandCenterCenter`), _C.LayoutControlMenuSubmenu = new _C(`LayoutControlMenuSubmenu`), _C.LayoutControlMenu = new _C(`LayoutControlMenu`), _C.MenubarMainMenu = new _C(`MenubarMainMenu`), _C.MenubarAppearanceMenu = new _C(`MenubarAppearanceMenu`), _C.MenubarDebugMenu = new _C(`MenubarDebugMenu`), _C.MenubarEditMenu = new _C(`MenubarEditMenu`), _C.MenubarCopy = new _C(`MenubarCopy`), _C.MenubarFileMenu = new _C(`MenubarFileMenu`), _C.MenubarGoMenu = new _C(`MenubarGoMenu`), _C.MenubarHelpMenu = new _C(`MenubarHelpMenu`), _C.MenubarLayoutMenu = new _C(`MenubarLayoutMenu`), _C.MenubarNewBreakpointMenu = new _C(`MenubarNewBreakpointMenu`), _C.PanelAlignmentMenu = new _C(`PanelAlignmentMenu`), _C.PanelPositionMenu = new _C(`PanelPositionMenu`), _C.ActivityBarPositionMenu = new _C(`ActivityBarPositionMenu`), _C.MenubarPreferencesMenu = new _C(`MenubarPreferencesMenu`), _C.MenubarRecentMenu = new _C(`MenubarRecentMenu`), _C.MenubarSelectionMenu = new _C(`MenubarSelectionMenu`), _C.MenubarShare = new _C(`MenubarShare`), _C.MenubarSwitchEditorMenu = new _C(`MenubarSwitchEditorMenu`), _C.MenubarSwitchGroupMenu = new _C(`MenubarSwitchGroupMenu`), _C.MenubarTerminalMenu = new _C(`MenubarTerminalMenu`), _C.MenubarTerminalSuggestStatusMenu = new _C(`MenubarTerminalSuggestStatusMenu`), _C.MenubarViewMenu = new _C(`MenubarViewMenu`), _C.MenubarHomeMenu = new _C(`MenubarHomeMenu`), _C.OpenEditorsContext = new _C(`OpenEditorsContext`), _C.OpenEditorsContextShare = new _C(`OpenEditorsContextShare`), _C.ProblemsPanelContext = new _C(`ProblemsPanelContext`), _C.SCMInputBox = new _C(`SCMInputBox`), _C.SCMChangeContext = new _C(`SCMChangeContext`), _C.SCMResourceContext = new _C(`SCMResourceContext`), _C.SCMResourceContextShare = new _C(`SCMResourceContextShare`), _C.SCMResourceFolderContext = new _C(`SCMResourceFolderContext`), _C.SCMResourceGroupContext = new _C(`SCMResourceGroupContext`), _C.SCMSourceControl = new _C(`SCMSourceControl`), _C.SCMSourceControlInline = new _C(`SCMSourceControlInline`), _C.SCMSourceControlTitle = new _C(`SCMSourceControlTitle`), _C.SCMHistoryTitle = new _C(`SCMHistoryTitle`), _C.SCMHistoryItemContext = new _C(`SCMHistoryItemContext`), _C.SCMHistoryItemChangeContext = new _C(`SCMHistoryItemChangeContext`), _C.SCMHistoryItemRefContext = new _C(`SCMHistoryItemRefContext`), _C.SCMArtifactGroupContext = new _C(`SCMArtifactGroupContext`), _C.SCMArtifactContext = new _C(`SCMArtifactContext`), _C.SCMQuickDiffDecorations = new _C(`SCMQuickDiffDecorations`), _C.SCMTitle = new _C(`SCMTitle`), _C.SearchContext = new _C(`SearchContext`), _C.SearchActionMenu = new _C(`SearchActionContext`), _C.StatusBarWindowIndicatorMenu = new _C(`StatusBarWindowIndicatorMenu`), _C.StatusBarRemoteIndicatorMenu = new _C(`StatusBarRemoteIndicatorMenu`), _C.StickyScrollContext = new _C(`StickyScrollContext`), _C.TestItem = new _C(`TestItem`), _C.TestItemGutter = new _C(`TestItemGutter`), _C.TestProfilesContext = new _C(`TestProfilesContext`), _C.TestMessageContext = new _C(`TestMessageContext`), _C.TestMessageContent = new _C(`TestMessageContent`), _C.TestPeekElement = new _C(`TestPeekElement`), _C.TestPeekTitle = new _C(`TestPeekTitle`), _C.TestCallStack = new _C(`TestCallStack`), _C.TestCoverageFilterItem = new _C(`TestCoverageFilterItem`), _C.TouchBarContext = new _C(`TouchBarContext`), _C.TitleBar = new _C(`TitleBar`), _C.TitleBarContext = new _C(`TitleBarContext`), _C.TitleBarTitleContext = new _C(`TitleBarTitleContext`), _C.TunnelContext = new _C(`TunnelContext`), _C.TunnelPrivacy = new _C(`TunnelPrivacy`), _C.TunnelProtocol = new _C(`TunnelProtocol`), _C.TunnelPortInline = new _C(`TunnelInline`), _C.TunnelTitle = new _C(`TunnelTitle`), _C.TunnelLocalAddressInline = new _C(`TunnelLocalAddressInline`), _C.TunnelOriginInline = new _C(`TunnelOriginInline`), _C.ViewItemContext = new _C(`ViewItemContext`), _C.ViewContainerTitle = new _C(`ViewContainerTitle`), _C.ViewContainerTitleContext = new _C(`ViewContainerTitleContext`), _C.ViewTitle = new _C(`ViewTitle`), _C.ViewTitleContext = new _C(`ViewTitleContext`), _C.CommentEditorActions = new _C(`CommentEditorActions`), _C.CommentThreadTitle = new _C(`CommentThreadTitle`), _C.CommentThreadActions = new _C(`CommentThreadActions`), _C.CommentThreadAdditionalActions = new _C(`CommentThreadAdditionalActions`), _C.CommentThreadTitleContext = new _C(`CommentThreadTitleContext`), _C.CommentThreadCommentContext = new _C(`CommentThreadCommentContext`), _C.CommentTitle = new _C(`CommentTitle`), _C.CommentActions = new _C(`CommentActions`), _C.CommentsViewThreadActions = new _C(`CommentsViewThreadActions`), _C.InteractiveToolbar = new _C(`InteractiveToolbar`), _C.InteractiveCellTitle = new _C(`InteractiveCellTitle`), _C.InteractiveCellDelete = new _C(`InteractiveCellDelete`), _C.InteractiveCellExecute = new _C(`InteractiveCellExecute`), _C.InteractiveInputExecute = new _C(`InteractiveInputExecute`), _C.InteractiveInputConfig = new _C(`InteractiveInputConfig`), _C.ReplInputExecute = new _C(`ReplInputExecute`), _C.IssueReporter = new _C(`IssueReporter`), _C.NotebookToolbar = new _C(`NotebookToolbar`), _C.NotebookToolbarContext = new _C(`NotebookToolbarContext`), _C.NotebookStickyScrollContext = new _C(`NotebookStickyScrollContext`), _C.NotebookCellTitle = new _C(`NotebookCellTitle`), _C.NotebookCellDelete = new _C(`NotebookCellDelete`), _C.NotebookCellInsert = new _C(`NotebookCellInsert`), _C.NotebookCellBetween = new _C(`NotebookCellBetween`), _C.NotebookCellListTop = new _C(`NotebookCellTop`), _C.NotebookCellExecute = new _C(`NotebookCellExecute`), _C.NotebookCellExecuteGoTo = new _C(`NotebookCellExecuteGoTo`), _C.NotebookCellExecutePrimary = new _C(`NotebookCellExecutePrimary`), _C.NotebookDiffCellInputTitle = new _C(`NotebookDiffCellInputTitle`), _C.NotebookDiffDocumentMetadata = new _C(`NotebookDiffDocumentMetadata`), _C.NotebookDiffCellMetadataTitle = new _C(`NotebookDiffCellMetadataTitle`), _C.NotebookDiffCellOutputsTitle = new _C(`NotebookDiffCellOutputsTitle`), _C.NotebookOutputToolbar = new _C(`NotebookOutputToolbar`), _C.NotebookOutlineFilter = new _C(`NotebookOutlineFilter`), _C.NotebookOutlineActionMenu = new _C(`NotebookOutlineActionMenu`), _C.NotebookEditorLayoutConfigure = new _C(`NotebookEditorLayoutConfigure`), _C.NotebookKernelSource = new _C(`NotebookKernelSource`), _C.BulkEditTitle = new _C(`BulkEditTitle`), _C.BulkEditContext = new _C(`BulkEditContext`), _C.TimelineItemContext = new _C(`TimelineItemContext`), _C.TimelineTitle = new _C(`TimelineTitle`), _C.TimelineTitleContext = new _C(`TimelineTitleContext`), _C.TimelineFilterSubMenu = new _C(`TimelineFilterSubMenu`), _C.AccountsContext = new _C(`AccountsContext`), _C.SidebarTitle = new _C(`SidebarTitle`), _C.PanelTitle = new _C(`PanelTitle`), _C.AuxiliaryBarTitle = new _C(`AuxiliaryBarTitle`), _C.TerminalInstanceContext = new _C(`TerminalInstanceContext`), _C.TerminalEditorInstanceContext = new _C(`TerminalEditorInstanceContext`), _C.TerminalNewDropdownContext = new _C(`TerminalNewDropdownContext`), _C.TerminalTabContext = new _C(`TerminalTabContext`), _C.TerminalTabEmptyAreaContext = new _C(`TerminalTabEmptyAreaContext`), _C.TerminalStickyScrollContext = new _C(`TerminalStickyScrollContext`), _C.WebviewContext = new _C(`WebviewContext`), _C.InlineCompletionsActions = new _C(`InlineCompletionsActions`), _C.InlineEditsActions = new _C(`InlineEditsActions`), _C.NewFile = new _C(`NewFile`), _C.MergeInput1Toolbar = new _C(`MergeToolbar1Toolbar`), _C.MergeInput2Toolbar = new _C(`MergeToolbar2Toolbar`), _C.MergeBaseToolbar = new _C(`MergeBaseToolbar`), _C.MergeInputResultToolbar = new _C(`MergeToolbarResultToolbar`), _C.InlineSuggestionToolbar = new _C(`InlineSuggestionToolbar`), _C.InlineEditToolbar = new _C(`InlineEditToolbar`), _C.ChatContext = new _C(`ChatContext`), _C.ChatCodeBlock = new _C(`ChatCodeblock`), _C.ChatCompareBlock = new _C(`ChatCompareBlock`), _C.ChatMessageTitle = new _C(`ChatMessageTitle`), _C.ChatHistory = new _C(`ChatHistory`), _C.ChatWelcomeContext = new _C(`ChatWelcomeContext`), _C.ChatMessageFooter = new _C(`ChatMessageFooter`), _C.ChatExecute = new _C(`ChatExecute`), _C.ChatInput = new _C(`ChatInput`), _C.ChatInputSide = new _C(`ChatInputSide`), _C.ChatModePicker = new _C(`ChatModePicker`), _C.ChatEditingWidgetToolbar = new _C(`ChatEditingWidgetToolbar`), _C.ChatEditingEditorContent = new _C(`ChatEditingEditorContent`), _C.ChatEditingEditorHunk = new _C(`ChatEditingEditorHunk`), _C.ChatEditingDeletedNotebookCell = new _C(`ChatEditingDeletedNotebookCell`), _C.ChatInputAttachmentToolbar = new _C(`ChatInputAttachmentToolbar`), _C.ChatEditingWidgetModifiedFilesToolbar = new _C(`ChatEditingWidgetModifiedFilesToolbar`), _C.ChatInputResourceAttachmentContext = new _C(`ChatInputResourceAttachmentContext`), _C.ChatInputSymbolAttachmentContext = new _C(`ChatInputSymbolAttachmentContext`), _C.ChatInlineResourceAnchorContext = new _C(`ChatInlineResourceAnchorContext`), _C.ChatInlineSymbolAnchorContext = new _C(`ChatInlineSymbolAnchorContext`), _C.ChatMessageCheckpoint = new _C(`ChatMessageCheckpoint`), _C.ChatMessageRestoreCheckpoint = new _C(`ChatMessageRestoreCheckpoint`), _C.ChatNewMenu = new _C(`ChatNewMenu`), _C.ChatEditingCodeBlockContext = new _C(`ChatEditingCodeBlockContext`), _C.ChatTitleBarMenu = new _C(`ChatTitleBarMenu`), _C.ChatAttachmentsContext = new _C(`ChatAttachmentsContext`), _C.ChatToolOutputResourceToolbar = new _C(`ChatToolOutputResourceToolbar`), _C.ChatTextEditorMenu = new _C(`ChatTextEditorMenu`), _C.ChatToolOutputResourceContext = new _C(`ChatToolOutputResourceContext`), _C.ChatMultiDiffContext = new _C(`ChatMultiDiffContext`), _C.ChatSessionsMenu = new _C(`ChatSessionsMenu`), _C.ChatSessionsCreateSubMenu = new _C(`ChatSessionsCreateSubMenu`), _C.ChatConfirmationMenu = new _C(`ChatConfirmationMenu`), _C.ChatEditorInlineExecute = new _C(`ChatEditorInputExecute`), _C.ChatEditorInlineInputSide = new _C(`ChatEditorInputSide`), _C.AccessibleView = new _C(`AccessibleView`), _C.MultiDiffEditorFileToolbar = new _C(`MultiDiffEditorFileToolbar`), _C.DiffEditorHunkToolbar = new _C(`DiffEditorHunkToolbar`), _C.DiffEditorSelectionToolbar = new _C(`DiffEditorSelectionToolbar`), _C), pd = xu(`menuService`), md = (_D = class {
  static for(t10) {
    let n10 = this._all.get(t10);
    return n10 || (n10 = new _D(t10), this._all.set(t10, n10)), n10;
  }
  static merge(t10) {
    let n10 = /* @__PURE__ */ new Set();
    for (let r10 of t10) r10 instanceof _D && n10.add(r10.id);
    return n10;
  }
  constructor(e206) {
    this.id = e206, this.has = (t10) => t10 === e206;
  }
}, _D._all = /* @__PURE__ */ new Map(), _D), hd = new class {
  constructor() {
    this._commands = /* @__PURE__ */ new Map(), this._menuItems = /* @__PURE__ */ new Map(), this._onDidChangeMenu = new uee({ merge: md.merge }), this.onDidChangeMenu = this._onDidChangeMenu.event;
  }
  addCommand(e206) {
    return this._commands.set(e206.id, e206), this._onDidChangeMenu.fire(md.for(W.CommandPalette)), Wt(T(() => {
      this._commands.delete(e206.id) && this._onDidChangeMenu.fire(md.for(W.CommandPalette));
    }));
  }
  getCommand(e206) {
    return this._commands.get(e206);
  }
  getCommands() {
    let e206 = /* @__PURE__ */ new Map();
    return this._commands.forEach((t10, n10) => e206.set(n10, t10)), e206;
  }
  appendMenuItem(e206, t10) {
    let n10 = this._menuItems.get(e206);
    n10 || (n10 = new Qt(), this._menuItems.set(e206, n10));
    let r10 = n10.push(t10);
    return this._onDidChangeMenu.fire(md.for(e206)), Wt(T(() => {
      r10(), this._onDidChangeMenu.fire(md.for(e206));
    }));
  }
  appendMenuItems(e206) {
    let t10 = new E();
    for (let { id: n10, item: r10 } of e206) t10.add(this.appendMenuItem(n10, r10));
    return t10;
  }
  getMenuItems(e206) {
    let t10;
    return t10 = this._menuItems.has(e206) ? [...this._menuItems.get(e206)] : [], e206 === W.CommandPalette && this._appendImplicitItems(t10), t10;
  }
  _appendImplicitItems(e206) {
    let t10 = /* @__PURE__ */ new Set();
    for (let n10 of e206) fd(n10) && (t10.add(n10.command.id), n10.alt && t10.add(n10.alt.id));
    this._commands.forEach((n10, r10) => {
      t10.has(r10) || e206.push({ command: n10 });
    });
  }
}(), gd = class extends Ou {
  constructor(e206, t10, n10) {
    super(`submenuitem.${e206.submenu.id}`, typeof e206.title == `string` ? e206.title : e206.title.value, n10, `submenu`), this.item = e206, this.hideActions = t10;
  }
}, _d2 = dd = class {
  static label(e206, t10) {
    return t10?.renderShortTitle && e206.shortTitle ? typeof e206.shortTitle == `string` ? e206.shortTitle : e206.shortTitle.value : typeof e206.title == `string` ? e206.title : e206.title.value;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.hideActions = r10, this.menuKeybinding = i10, this._commandService = o10, this.id = e206.id, this.label = dd.label(e206, n10), this.tooltip = (typeof e206.tooltip == `string` ? e206.tooltip : e206.tooltip?.value) ?? ``, this.enabled = !e206.precondition || a10.contextMatchesRules(e206.precondition), this.checked = void 0;
    let s10;
    if (e206.toggled) {
      let t11 = e206.toggled.condition ? e206.toggled : { condition: e206.toggled };
      this.checked = a10.contextMatchesRules(t11.condition), this.checked && t11.tooltip && (this.tooltip = typeof t11.tooltip == `string` ? t11.tooltip : t11.tooltip.value), this.checked && ju.isThemeIcon(t11.icon) && (s10 = t11.icon), this.checked && t11.title && (this.label = typeof t11.title == `string` ? t11.title : t11.title.value);
    }
    s10 || (s10 = ju.isThemeIcon(e206.icon) ? e206.icon : void 0), this.item = e206, this.alt = t10 ? new dd(t10, void 0, n10, r10, void 0, a10, o10) : void 0, this._options = n10, this.class = s10 && ju.asClassName(s10);
  }
  run(...e206) {
    let t10 = [];
    return this._options?.arg && (t10 = [...t10, this._options.arg]), this._options?.shouldForwardArgs && (t10 = [...t10, ...e206]), this._commandService.executeCommand(this.id, ...t10);
  }
};
_d2 = dd = qne([ud(5, nd), ud(6, Mu)], _d2);
var vd = class {
  constructor(e206) {
    this.desc = e206;
  }
};
function yd(e206) {
  let t10 = [], n10 = new e206(), { f1: r10, menu: i10, keybinding: a10, ...o10 } = n10.desc;
  if (Nu.getCommand(o10.id)) throw Error(`Cannot register two commands with the same id: ${o10.id}`);
  if (t10.push(Nu.registerCommand({ id: o10.id, handler: (e207, ...t11) => n10.run(e207, ...t11), metadata: o10.metadata ?? { description: n10.desc.title } })), Array.isArray(i10)) for (let e207 of i10) t10.push(hd.appendMenuItem(e207.id, { command: { ...o10, precondition: e207.precondition === null ? void 0 : o10.precondition }, ...e207 }));
  else i10 && t10.push(hd.appendMenuItem(i10.id, { command: { ...o10, precondition: i10.precondition === null ? void 0 : o10.precondition }, ...i10 }));
  if (r10 && (t10.push(hd.appendMenuItem(W.CommandPalette, { command: o10, when: o10.precondition })), t10.push(hd.addCommand(o10))), Array.isArray(a10)) for (let e207 of a10) t10.push(ld.registerKeybindingRule({ ...e207, id: o10.id, when: o10.precondition ? H.and(o10.precondition, e207.when) : e207.when }));
  else a10 && t10.push(ld.registerKeybindingRule({ ...a10, id: o10.id, when: o10.precondition ? H.and(o10.precondition, a10.when) : a10.when }));
  return { dispose() {
    Kt(t10);
  } };
}
var bd = xu(`telemetryService`), xd, Sd, Cd, Yne = class {
  constructor(e206, t10) {
    this.uri = e206, this.value = t10;
  }
};
function Xne(e206) {
  return Array.isArray(e206);
}
var wd = (_E = class {
  constructor(t10, n10) {
    if (this[xd] = `ResourceMap`, t10 instanceof _E) this.map = new Map(t10.map), this.toKey = n10 ?? _E.defaultToKey;
    else if (Xne(t10)) {
      this.map = /* @__PURE__ */ new Map(), this.toKey = n10 ?? _E.defaultToKey;
      for (let [e206, n11] of t10) this.set(e206, n11);
    } else this.map = /* @__PURE__ */ new Map(), this.toKey = t10 ?? _E.defaultToKey;
  }
  set(e206, t10) {
    return this.map.set(this.toKey(e206), new Yne(e206, t10)), this;
  }
  get(e206) {
    return this.map.get(this.toKey(e206))?.value;
  }
  has(e206) {
    return this.map.has(this.toKey(e206));
  }
  get size() {
    return this.map.size;
  }
  clear() {
    this.map.clear();
  }
  delete(e206) {
    return this.map.delete(this.toKey(e206));
  }
  forEach(e206, t10) {
    t10 !== void 0 && (e206 = e206.bind(t10));
    for (let [t11, n10] of this.map) e206(n10.value, n10.uri, this);
  }
  *values() {
    for (let e206 of this.map.values()) yield e206.value;
  }
  *keys() {
    for (let e206 of this.map.values()) yield e206.uri;
  }
  *entries() {
    for (let e206 of this.map.values()) yield [e206.uri, e206.value];
  }
  *[(xd = Symbol.toStringTag, Symbol.iterator)]() {
    for (let [, e206] of this.map) yield [e206.uri, e206.value];
  }
}, _E.defaultToKey = (e206) => e206.toString(), _E), Zne = class {
  constructor(e206, t10) {
    this[Sd] = `ResourceSet`, !e206 || typeof e206 == `function` ? this._map = new wd(e206) : (this._map = new wd(t10), e206.forEach(this.add, this));
  }
  get size() {
    return this._map.size;
  }
  add(e206) {
    return this._map.set(e206, e206), this;
  }
  clear() {
    this._map.clear();
  }
  delete(e206) {
    return this._map.delete(e206);
  }
  forEach(e206, t10) {
    this._map.forEach((n10, r10) => e206.call(t10, r10, r10, this));
  }
  has(e206) {
    return this._map.has(e206);
  }
  entries() {
    return this._map.entries();
  }
  keys() {
    return this._map.keys();
  }
  values() {
    return this._map.keys();
  }
  [(Sd = Symbol.toStringTag, Symbol.iterator)]() {
    return this.keys();
  }
}, Qne = class {
  constructor() {
    this[Cd] = `LinkedMap`, this._map = /* @__PURE__ */ new Map(), this._head = void 0, this._tail = void 0, this._size = 0, this._state = 0;
  }
  clear() {
    this._map.clear(), this._head = void 0, this._tail = void 0, this._size = 0, this._state++;
  }
  isEmpty() {
    return !this._head && !this._tail;
  }
  get size() {
    return this._size;
  }
  get first() {
    return this._head?.value;
  }
  get last() {
    return this._tail?.value;
  }
  has(e206) {
    return this._map.has(e206);
  }
  get(e206, t10 = 0) {
    let n10 = this._map.get(e206);
    if (n10) return t10 !== 0 && this.touch(n10, t10), n10.value;
  }
  set(e206, t10, n10 = 0) {
    let r10 = this._map.get(e206);
    if (r10) r10.value = t10, n10 !== 0 && this.touch(r10, n10);
    else {
      switch (r10 = { key: e206, value: t10, next: void 0, previous: void 0 }, n10) {
        case 0:
          this.addItemLast(r10);
          break;
        case 1:
          this.addItemFirst(r10);
          break;
        case 2:
          this.addItemLast(r10);
          break;
        default:
          this.addItemLast(r10);
          break;
      }
      this._map.set(e206, r10), this._size++;
    }
    return this;
  }
  delete(e206) {
    return !!this.remove(e206);
  }
  remove(e206) {
    let t10 = this._map.get(e206);
    if (t10) return this._map.delete(e206), this.removeItem(t10), this._size--, t10.value;
  }
  shift() {
    if (!this._head && !this._tail) return;
    if (!this._head || !this._tail) throw Error(`Invalid list`);
    let e206 = this._head;
    return this._map.delete(e206.key), this.removeItem(e206), this._size--, e206.value;
  }
  forEach(e206, t10) {
    let n10 = this._state, r10 = this._head;
    for (; r10; ) {
      if (t10 ? e206.bind(t10)(r10.value, r10.key, this) : e206(r10.value, r10.key, this), this._state !== n10) throw Error(`LinkedMap got modified during iteration.`);
      r10 = r10.next;
    }
  }
  keys() {
    let e206 = this, t10 = this._state, n10 = this._head, r10 = { [Symbol.iterator]() {
      return r10;
    }, next() {
      if (e206._state !== t10) throw Error(`LinkedMap got modified during iteration.`);
      if (n10) {
        let e207 = { value: n10.key, done: false };
        return n10 = n10.next, e207;
      } else return { value: void 0, done: true };
    } };
    return r10;
  }
  values() {
    let e206 = this, t10 = this._state, n10 = this._head, r10 = { [Symbol.iterator]() {
      return r10;
    }, next() {
      if (e206._state !== t10) throw Error(`LinkedMap got modified during iteration.`);
      if (n10) {
        let e207 = { value: n10.value, done: false };
        return n10 = n10.next, e207;
      } else return { value: void 0, done: true };
    } };
    return r10;
  }
  entries() {
    let e206 = this, t10 = this._state, n10 = this._head, r10 = { [Symbol.iterator]() {
      return r10;
    }, next() {
      if (e206._state !== t10) throw Error(`LinkedMap got modified during iteration.`);
      if (n10) {
        let e207 = { value: [n10.key, n10.value], done: false };
        return n10 = n10.next, e207;
      } else return { value: void 0, done: true };
    } };
    return r10;
  }
  [(Cd = Symbol.toStringTag, Symbol.iterator)]() {
    return this.entries();
  }
  trimOld(e206) {
    if (e206 >= this.size) return;
    if (e206 === 0) {
      this.clear();
      return;
    }
    let t10 = this._head, n10 = this.size;
    for (; t10 && n10 > e206; ) this._map.delete(t10.key), t10 = t10.next, n10--;
    this._head = t10, this._size = n10, t10 && (t10.previous = void 0), this._state++;
  }
  trimNew(e206) {
    if (e206 >= this.size) return;
    if (e206 === 0) {
      this.clear();
      return;
    }
    let t10 = this._tail, n10 = this.size;
    for (; t10 && n10 > e206; ) this._map.delete(t10.key), t10 = t10.previous, n10--;
    this._tail = t10, this._size = n10, t10 && (t10.next = void 0), this._state++;
  }
  addItemFirst(e206) {
    if (!this._head && !this._tail) this._tail = e206;
    else if (this._head) e206.next = this._head, this._head.previous = e206;
    else throw Error(`Invalid list`);
    this._head = e206, this._state++;
  }
  addItemLast(e206) {
    if (!this._head && !this._tail) this._head = e206;
    else if (this._tail) e206.previous = this._tail, this._tail.next = e206;
    else throw Error(`Invalid list`);
    this._tail = e206, this._state++;
  }
  removeItem(e206) {
    if (e206 === this._head && e206 === this._tail) this._head = void 0, this._tail = void 0;
    else if (e206 === this._head) {
      if (!e206.next) throw Error(`Invalid list`);
      e206.next.previous = void 0, this._head = e206.next;
    } else if (e206 === this._tail) {
      if (!e206.previous) throw Error(`Invalid list`);
      e206.previous.next = void 0, this._tail = e206.previous;
    } else {
      let t10 = e206.next, n10 = e206.previous;
      if (!t10 || !n10) throw Error(`Invalid list`);
      t10.previous = n10, n10.next = t10;
    }
    e206.next = void 0, e206.previous = void 0, this._state++;
  }
  touch(e206, t10) {
    if (!this._head || !this._tail) throw Error(`Invalid list`);
    if (!(t10 !== 1 && t10 !== 2)) {
      if (t10 === 1) {
        if (e206 === this._head) return;
        let t11 = e206.next, n10 = e206.previous;
        e206 === this._tail ? (n10.next = void 0, this._tail = n10) : (t11.previous = n10, n10.next = t11), e206.previous = void 0, e206.next = this._head, this._head.previous = e206, this._head = e206, this._state++;
      } else if (t10 === 2) {
        if (e206 === this._tail) return;
        let t11 = e206.next, n10 = e206.previous;
        e206 === this._head ? (t11.previous = void 0, this._head = t11) : (t11.previous = n10, n10.next = t11), e206.next = void 0, e206.previous = this._tail, this._tail.next = e206, this._tail = e206, this._state++;
      }
    }
  }
  toJSON() {
    let e206 = [];
    return this.forEach((t10, n10) => {
      e206.push([n10, t10]);
    }), e206;
  }
  fromJSON(e206) {
    this.clear();
    for (let [t10, n10] of e206) this.set(t10, n10);
  }
}, $ne = class extends Qne {
  constructor(e206, t10 = 1) {
    super(), this._limit = e206, this._ratio = Math.min(Math.max(0, t10), 1);
  }
  get limit() {
    return this._limit;
  }
  set limit(e206) {
    this._limit = e206, this.checkTrim();
  }
  get(e206, t10 = 2) {
    return super.get(e206, t10);
  }
  peek(e206) {
    return super.get(e206, 0);
  }
  set(e206, t10) {
    return super.set(e206, t10, 2), this;
  }
  checkTrim() {
    this.size > this._limit && this.trim(Math.round(this._limit * this._ratio));
  }
}, Td = class extends $ne {
  constructor(e206, t10 = 1) {
    super(e206, t10);
  }
  trim(e206) {
    this.trimOld(e206);
  }
  set(e206, t10) {
    return super.set(e206, t10), this.checkTrim(), this;
  }
}, ere = class {
  constructor(e206) {
    if (this._m1 = /* @__PURE__ */ new Map(), this._m2 = /* @__PURE__ */ new Map(), e206) for (let [t10, n10] of e206) this.set(t10, n10);
  }
  clear() {
    this._m1.clear(), this._m2.clear();
  }
  set(e206, t10) {
    this._m1.set(e206, t10), this._m2.set(t10, e206);
  }
  get(e206) {
    return this._m1.get(e206);
  }
  getKey(e206) {
    return this._m2.get(e206);
  }
  delete(e206) {
    let t10 = this._m1.get(e206);
    return t10 === void 0 ? false : (this._m1.delete(e206), this._m2.delete(t10), true);
  }
  keys() {
    return this._m1.keys();
  }
  values() {
    return this._m1.values();
  }
}, Ed = class {
  constructor() {
    this.map = /* @__PURE__ */ new Map();
  }
  add(e206, t10) {
    let n10 = this.map.get(e206);
    n10 || (n10 = /* @__PURE__ */ new Set(), this.map.set(e206, n10)), n10.add(t10);
  }
  delete(e206, t10) {
    let n10 = this.map.get(e206);
    n10 && (n10.delete(t10), n10.size === 0 && this.map.delete(e206));
  }
  forEach(e206, t10) {
    let n10 = this.map.get(e206);
    n10 && n10.forEach(t10);
  }
}, Dd = class {
  constructor() {
    this._data = /* @__PURE__ */ new Map();
  }
  set(e206, ...t10) {
    let n10 = this._data;
    for (let e207 = 0; e207 < t10.length - 1; e207++) n10.has(t10[e207]) || n10.set(t10[e207], /* @__PURE__ */ new Map()), n10 = n10.get(t10[e207]);
    n10.set(t10[t10.length - 1], e206);
  }
  get(...e206) {
    let t10 = this._data;
    for (let n10 = 0; n10 < e206.length - 1; n10++) {
      if (!t10.has(e206[n10])) return;
      t10 = t10.get(e206[n10]);
    }
    return t10.get(e206[e206.length - 1]);
  }
  clear() {
    this._data.clear();
  }
  toString() {
    let e206 = (t10, n10) => {
      let r10 = ``;
      for (let [i10, a10] of t10) r10 += `${`  `.repeat(n10)}${i10}: `, a10 instanceof Map ? r10 += `
` + e206(a10, n10 + 1) : r10 += `${a10}
`;
      return r10;
    };
    return e206(this._data, 0);
  }
};
function Od(e206) {
  return e206 === 47 || e206 === 92;
}
function kd(e206) {
  return e206.replace(/[\\/]/g, Kr.sep);
}
function tre(e206) {
  return e206.indexOf(`/`) === -1 && (e206 = kd(e206)), /^[a-zA-Z]:(\/|$)/.test(e206) && (e206 = `/` + e206), e206;
}
function Ad(e206, t10 = Kr.sep) {
  if (!e206) return ``;
  let n10 = e206.length, r10 = e206.charCodeAt(0);
  if (Od(r10)) {
    if (Od(e206.charCodeAt(1)) && !Od(e206.charCodeAt(2))) {
      let r11 = 3, i11 = r11;
      for (; r11 < n10 && !Od(e206.charCodeAt(r11)); r11++) ;
      if (i11 !== r11 && !Od(e206.charCodeAt(r11 + 1))) {
        for (r11 += 1; r11 < n10; r11++) if (Od(e206.charCodeAt(r11))) return e206.slice(0, r11 + 1).replace(/[\\/]/g, t10);
      }
    }
    return t10;
  } else if (Md(r10) && e206.charCodeAt(1) === 58) return Od(e206.charCodeAt(2)) ? e206.slice(0, 2) + t10 : e206.slice(0, 2);
  let i10 = e206.indexOf(`://`);
  if (i10 !== -1) {
    for (i10 += 3; i10 < n10; i10++) if (Od(e206.charCodeAt(i10))) return e206.slice(0, i10 + 1);
  }
  return ``;
}
function jd(e206, t10, n10, r10 = Xr) {
  if (e206 === t10) return true;
  if (!e206 || !t10 || t10.length > e206.length) return false;
  if (n10) {
    if (!no(e206, t10)) return false;
    if (t10.length === e206.length) return true;
    let n11 = t10.length;
    return t10.charAt(t10.length - 1) === r10 && n11--, e206.charAt(n11) === r10;
  }
  return t10.charAt(t10.length - 1) !== r10 && (t10 += r10), e206.indexOf(t10) === 0;
}
function Md(e206) {
  return e206 >= 65 && e206 <= 90 || e206 >= 97 && e206 <= 122;
}
function nre(e206, t10 = wt) {
  return t10 ? Md(e206.charCodeAt(0)) && e206.charCodeAt(1) === 58 : false;
}
function Nd(e206) {
  return ii(e206, true);
}
var Pd = new class {
  constructor(e206) {
    this._ignorePathCasing = e206;
  }
  compare(e206, t10, n10 = false) {
    return e206 === t10 ? 0 : Ja(this.getComparisonKey(e206, n10), this.getComparisonKey(t10, n10));
  }
  isEqual(e206, t10, n10 = false) {
    return e206 === t10 ? true : !e206 || !t10 ? false : this.getComparisonKey(e206, n10) === this.getComparisonKey(t10, n10);
  }
  getComparisonKey(e206, t10 = false) {
    return e206.with({ path: this._ignorePathCasing(e206) ? e206.path.toLowerCase() : void 0, fragment: t10 ? null : void 0 }).toString();
  }
  isEqualOrParent(e206, t10, n10 = false) {
    if (e206.scheme === t10.scheme) {
      if (e206.scheme === xs.file) return jd(Nd(e206), Nd(t10), this._ignorePathCasing(e206)) && e206.query === t10.query && (n10 || e206.fragment === t10.fragment);
      if (Bd(e206.authority, t10.authority)) return jd(e206.path, t10.path, this._ignorePathCasing(e206), `/`) && e206.query === t10.query && (n10 || e206.fragment === t10.fragment);
    }
    return false;
  }
  joinPath(e206, ...t10) {
    return $r.joinPath(e206, ...t10);
  }
  basenameOrAuthority(e206) {
    return Id(e206) || e206.authority;
  }
  basename(e206) {
    return Kr.basename(e206.path);
  }
  extname(e206) {
    return Kr.extname(e206.path);
  }
  dirname(e206) {
    if (e206.path.length === 0) return e206;
    let t10;
    return e206.scheme === xs.file ? t10 = $r.file(Jr(Nd(e206))).path : (t10 = Kr.dirname(e206.path), e206.authority && t10.length && t10.charCodeAt(0) !== 47 && (console.error(`dirname("${e206.toString})) resulted in a relative path`), t10 = `/`)), e206.with({ path: t10 });
  }
  normalizePath(e206) {
    if (!e206.path.length) return e206;
    let t10;
    return t10 = e206.scheme === xs.file ? $r.file(qr(Nd(e206))).path : Kr.normalize(e206.path), e206.with({ path: t10 });
  }
  relativePath(e206, t10) {
    if (e206.scheme !== t10.scheme || !Bd(e206.authority, t10.authority)) return;
    if (e206.scheme === xs.file) {
      let n11 = nte(Nd(e206), Nd(t10));
      return wt ? kd(n11) : n11;
    }
    let n10 = e206.path || `/`, r10 = t10.path || `/`;
    if (this._ignorePathCasing(e206)) {
      let e207 = 0;
      for (let t11 = Math.min(n10.length, r10.length); e207 < t11 && !(n10.charCodeAt(e207) !== r10.charCodeAt(e207) && n10.charAt(e207).toLowerCase() !== r10.charAt(e207).toLowerCase()); e207++) ;
      n10 = r10.substr(0, e207) + n10.substr(e207);
    }
    return Kr.relative(n10, r10);
  }
  resolvePath(e206, t10) {
    if (e206.scheme === xs.file) {
      let n10 = $r.file(tte(Nd(e206), t10));
      return e206.with({ authority: n10.authority, path: n10.path });
    }
    return t10 = tre(t10), e206.with({ path: Kr.resolve(e206.path, t10) });
  }
  isAbsolutePath(e206) {
    return !!e206.path && e206.path[0] === `/`;
  }
  isEqualAuthority(e206, t10) {
    return e206 === t10 || e206 !== void 0 && t10 !== void 0 && to(e206, t10);
  }
  hasTrailingPathSeparator(e206, t10 = Xr) {
    if (e206.scheme === xs.file) {
      let n10 = Nd(e206);
      return n10.length > Ad(n10).length && n10[n10.length - 1] === t10;
    } else {
      let t11 = e206.path;
      return t11.length > 1 && t11.charCodeAt(t11.length - 1) === 47 && !/^[a-zA-Z]:(\/$|\\$)/.test(e206.fsPath);
    }
  }
  removeTrailingPathSeparator(e206, t10 = Xr) {
    return Vd(e206, t10) ? e206.with({ path: e206.path.substr(0, e206.path.length - 1) }) : e206;
  }
  addTrailingPathSeparator(e206, t10 = Xr) {
    let n10 = false;
    if (e206.scheme === xs.file) {
      let r10 = Nd(e206);
      n10 = r10 !== void 0 && r10.length === Ad(r10).length && r10[r10.length - 1] === t10;
    } else {
      t10 = `/`;
      let r10 = e206.path;
      n10 = r10.length === 1 && r10.charCodeAt(r10.length - 1) === 47;
    }
    return !n10 && !Vd(e206, t10) ? e206.with({ path: e206.path + `/` }) : e206;
  }
}(() => false), Fd = Pd.isEqual.bind(Pd);
Pd.isEqualOrParent.bind(Pd), Pd.getComparisonKey.bind(Pd);
var rre = Pd.basenameOrAuthority.bind(Pd), Id = Pd.basename.bind(Pd), ire = Pd.extname.bind(Pd), Ld = Pd.dirname.bind(Pd), Rd = Pd.joinPath.bind(Pd), are = Pd.normalizePath.bind(Pd), ore = Pd.relativePath.bind(Pd), zd = Pd.resolvePath.bind(Pd);
Pd.isAbsolutePath.bind(Pd);
var Bd = Pd.isEqualAuthority.bind(Pd), Vd = Pd.hasTrailingPathSeparator.bind(Pd);
Pd.removeTrailingPathSeparator.bind(Pd), Pd.addTrailingPathSeparator.bind(Pd);
var Hd;
(function(e206) {
  e206.META_DATA_LABEL = `label`, e206.META_DATA_DESCRIPTION = `description`, e206.META_DATA_SIZE = `size`, e206.META_DATA_MIME = `mime`;
  function t10(t11) {
    let n10 = /* @__PURE__ */ new Map();
    t11.path.substring(t11.path.indexOf(`;`) + 1, t11.path.lastIndexOf(`;`)).split(`;`).forEach((e207) => {
      let [t12, r11] = e207.split(`:`);
      t12 && r11 && n10.set(t12, r11);
    });
    let r10 = t11.path.substring(0, t11.path.indexOf(`;`));
    return r10 && n10.set(e206.META_DATA_MIME, r10), n10;
  }
  e206.parseMetaData = t10;
})(Hd || (Hd = {}));
var Ud = xu(`logService`), Wd = xu(`loggerService`), Gd;
(function(e206) {
  e206[e206.Off = 0] = `Off`, e206[e206.Trace = 1] = `Trace`, e206[e206.Debug = 2] = `Debug`, e206[e206.Info = 3] = `Info`, e206[e206.Warning = 4] = `Warning`, e206[e206.Error = 5] = `Error`;
})(Gd || (Gd = {}));
var Kd = Gd.Info;
function qd(e206, t10) {
  return e206 !== Gd.Off && e206 <= t10;
}
var Jd = class extends D {
  constructor() {
    super(...arguments), this.level = Kd, this._onDidChangeLogLevel = this._register(new k());
  }
  get onDidChangeLogLevel() {
    return this._onDidChangeLogLevel.event;
  }
  setLevel(e206) {
    this.level !== e206 && (this.level = e206, this._onDidChangeLogLevel.fire(this.level));
  }
  getLevel() {
    return this.level;
  }
  checkLogLevel(e206) {
    return qd(this.level, e206);
  }
  canLog(e206) {
    return this._store.isDisposed ? false : this.checkLogLevel(e206);
  }
}, sre = class extends Jd {
  constructor(e206 = Kd, t10 = true) {
    super(), this.useColors = t10, this.setLevel(e206);
  }
  trace(e206, ...t10) {
    this.canLog(Gd.Trace) && (this.useColors ? console.log(`%cTRACE`, `color: #888`, e206, ...t10) : console.log(e206, ...t10));
  }
  debug(e206, ...t10) {
    this.canLog(Gd.Debug) && (this.useColors ? console.log(`%cDEBUG`, `background: #eee; color: #888`, e206, ...t10) : console.log(e206, ...t10));
  }
  info(e206, ...t10) {
    this.canLog(Gd.Info) && (this.useColors ? console.log(`%c INFO`, `color: #33f`, e206, ...t10) : console.log(e206, ...t10));
  }
  warn(e206, ...t10) {
    this.canLog(Gd.Warning) && (this.useColors ? console.warn(`%c WARN`, `color: #993`, e206, ...t10) : console.log(e206, ...t10));
  }
  error(e206, ...t10) {
    this.canLog(Gd.Error) && (this.useColors ? console.error(`%c  ERR`, `color: #f33`, e206, ...t10) : console.error(e206, ...t10));
  }
}, cre = class extends Jd {
  constructor(e206) {
    super(), this.loggers = e206, e206.length && this.setLevel(e206[0].getLevel());
  }
  setLevel(e206) {
    for (let t10 of this.loggers) t10.setLevel(e206);
    super.setLevel(e206);
  }
  trace(e206, ...t10) {
    for (let n10 of this.loggers) n10.trace(e206, ...t10);
  }
  debug(e206, ...t10) {
    for (let n10 of this.loggers) n10.debug(e206, ...t10);
  }
  info(e206, ...t10) {
    for (let n10 of this.loggers) n10.info(e206, ...t10);
  }
  warn(e206, ...t10) {
    for (let n10 of this.loggers) n10.warn(e206, ...t10);
  }
  error(e206, ...t10) {
    for (let n10 of this.loggers) n10.error(e206, ...t10);
  }
  dispose() {
    for (let e206 of this.loggers) e206.dispose();
    super.dispose();
  }
}, lre = class extends D {
  constructor(e206, t10, n10) {
    if (super(), this.logLevel = e206, this.logsHome = t10, this._loggers = new wd(), this._onDidChangeLoggers = this._register(new k()), this._onDidChangeVisibility = this._register(new k()), n10) for (let e207 of n10) this._loggers.set(e207.resource, { logger: void 0, info: e207 });
  }
  getLoggerEntry(e206) {
    return Re(e206) ? [...this._loggers.values()].find((t10) => t10.info.id === e206) : this._loggers.get(e206);
  }
  createLogger(e206, t10) {
    let n10 = this.toResource(e206), r10 = Re(e206) ? e206 : t10?.id ?? Is(n10.toString()).toString(16), i10 = this._loggers.get(n10)?.logger, a10 = t10?.logLevel === `always` ? Gd.Trace : t10?.logLevel;
    i10 || (i10 = this.doCreateLogger(n10, a10 ?? this.getLogLevel(n10) ?? this.logLevel, { ...t10, id: r10 }));
    let o10 = { logger: i10, info: { resource: n10, id: r10, logLevel: a10, name: t10?.name, hidden: t10?.hidden, group: t10?.group, extensionId: t10?.extensionId, when: t10?.when } };
    return this.registerLogger(o10.info), this._loggers.set(n10, o10), i10;
  }
  toResource(e206) {
    return Re(e206) ? Rd(this.logsHome, `${e206}.log`) : e206;
  }
  setVisibility(e206, t10) {
    let n10 = this.getLoggerEntry(e206);
    n10 && t10 !== !n10.info.hidden && (n10.info.hidden = !t10, this._loggers.set(n10.info.resource, n10), this._onDidChangeVisibility.fire([n10.info.resource, t10]));
  }
  getLogLevel(e206) {
    let t10;
    return e206 && (t10 = this._loggers.get(e206)?.info.logLevel), t10 ?? this.logLevel;
  }
  registerLogger(e206) {
    let t10 = this._loggers.get(e206.resource);
    t10 ? t10.info.hidden !== e206.hidden && this.setVisibility(e206.resource, !e206.hidden) : (this._loggers.set(e206.resource, { info: e206, logger: void 0 }), this._onDidChangeLoggers.fire({ added: [e206], removed: [] }));
  }
  dispose() {
    this._loggers.forEach((e206) => e206.logger?.dispose()), this._loggers.clear(), super.dispose();
  }
}, ure = class {
  constructor() {
    this.onDidChangeLogLevel = new k().event;
  }
  setLevel(e206) {
  }
  getLevel() {
    return Gd.Info;
  }
  trace(e206, ...t10) {
  }
  debug(e206, ...t10) {
  }
  info(e206, ...t10) {
  }
  warn(e206, ...t10) {
  }
  error(e206, ...t10) {
  }
  dispose() {
  }
}, dre = class extends lre {
  constructor() {
    super(Gd.Off, $r.parse(`log:///log`));
  }
  doCreateLogger(e206, t10, n10) {
    return new ure();
  }
};
function fre(e206) {
  switch (e206) {
    case Gd.Trace:
      return `trace`;
    case Gd.Debug:
      return `debug`;
    case Gd.Info:
      return `info`;
    case Gd.Warning:
      return `warn`;
    case Gd.Error:
      return `error`;
    case Gd.Off:
      return `off`;
  }
}
new U(`logLevel`, fre(Gd.Info));
var Yd = (_F = class {
  static getRegisteredCommands() {
    return [..._F.REGISTERED_COMMANDS];
  }
  static registerCommand(t10) {
    _F.REGISTERED_COMMANDS.add(t10);
  }
}, _F.REGISTERED_COMMANDS = /* @__PURE__ */ new Set(), _F), Xd = class {
  constructor(e206) {
    this.id = e206.id, this.precondition = e206.precondition, this._kbOpts = e206.kbOpts, this._menuOpts = e206.menuOpts, this.metadata = e206.metadata, this.canTriggerInlineEdits = e206.canTriggerInlineEdits;
  }
  register() {
    if (Array.isArray(this._menuOpts) ? this._menuOpts.forEach(this._registerMenuItem, this) : this._menuOpts && this._registerMenuItem(this._menuOpts), this._kbOpts) {
      let e206 = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts];
      for (let t10 of e206) {
        let e207 = t10.kbExpr;
        this.precondition && (e207 = e207 ? H.and(e207, this.precondition) : this.precondition);
        let n10 = { id: this.id, weight: t10.weight, args: t10.args, when: e207, primary: t10.primary, secondary: t10.secondary, win: t10.win, linux: t10.linux, mac: t10.mac };
        ld.registerKeybindingRule(n10);
      }
    }
    Nu.registerCommand({ id: this.id, handler: (e206, t10) => this.runCommand(e206, t10), metadata: this.metadata }), this.canTriggerInlineEdits && Yd.registerCommand(this.id);
  }
  _registerMenuItem(e206) {
    hd.appendMenuItem(e206.menuId, { group: e206.group, command: { id: this.id, title: e206.title, icon: e206.icon, precondition: this.precondition }, when: e206.when, order: e206.order });
  }
}, Zd = class extends Xd {
  constructor() {
    super(...arguments), this._implementations = [];
  }
  addImplementation(e206, t10, n10, r10) {
    return this._implementations.push({ priority: e206, name: t10, implementation: n10, when: r10 }), this._implementations.sort((e207, t11) => t11.priority - e207.priority), { dispose: () => {
      for (let e207 = 0; e207 < this._implementations.length; e207++) if (this._implementations[e207].implementation === n10) {
        this._implementations.splice(e207, 1);
        return;
      }
    } };
  }
  runCommand(e206, t10) {
    let n10 = e206.get(Ud), r10 = e206.get(nd);
    n10.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);
    for (let i10 of this._implementations) {
      if (i10.when) {
        let e207 = r10.getContext(kl());
        if (!i10.when.evaluate(e207)) continue;
      }
      let a10 = i10.implementation(e206, t10);
      if (a10) return n10.trace(`Command '${this.id}' was handled by '${i10.name}'.`), typeof a10 == `boolean` ? void 0 : a10;
    }
    n10.trace(`The Command '${this.id}' was not handled by any implementation.`);
  }
}, Qd = class extends Xd {
  constructor(e206, t10) {
    super(t10), this.command = e206;
  }
  runCommand(e206, t10) {
    return this.command.runCommand(e206, t10);
  }
}, $d = class e41 extends Xd {
  static bindToContribution(t10) {
    return class extends e41 {
      constructor(e206) {
        super(e206), this._callback = e206.handler;
      }
      runEditorCommand(e206, n10, r10) {
        let i10 = t10(n10);
        i10 && this._callback(i10, r10);
      }
    };
  }
  static runEditorCommand(e206, t10, n10, r10) {
    let i10 = e206.get(Su), a10 = i10.getFocusedCodeEditor() || i10.getActiveCodeEditor();
    if (a10) return a10.invokeWithinContext((e207) => {
      if (e207.get(nd).contextMatchesRules(n10 ?? void 0)) return r10(e207, a10, t10);
    });
  }
  runCommand(t10, n10) {
    return e41.runEditorCommand(t10, n10, this.precondition, (e206, t11, n11) => this.runEditorCommand(e206, t11, n11));
  }
}, G = class e42 extends $d {
  static convertOptions(e206) {
    let t10;
    t10 = Array.isArray(e206.menuOpts) ? e206.menuOpts : e206.menuOpts ? [e206.menuOpts] : [];
    function n10(t11) {
      return t11.menuId || (t11.menuId = W.EditorContext), t11.title || (t11.title = typeof e206.label == `string` ? e206.label : e206.label.value), t11.when = H.and(e206.precondition, t11.when), t11;
    }
    return Array.isArray(e206.contextMenuOpts) ? t10.push(...e206.contextMenuOpts.map(n10)) : e206.contextMenuOpts && t10.push(n10(e206.contextMenuOpts)), e206.menuOpts = t10, e206;
  }
  constructor(t10) {
    super(e42.convertOptions(t10)), typeof t10.label == `string` ? (this.label = t10.label, this.alias = t10.alias ?? t10.label) : (this.label = t10.label.value, this.alias = t10.alias ?? t10.label.original);
  }
  runEditorCommand(e206, t10, n10) {
    return this.reportTelemetry(e206, t10), this.run(e206, t10, n10 || {});
  }
  reportTelemetry(e206, t10) {
    e206.get(bd).publicLog2(`editorActionInvoked`, { name: this.label, id: this.id });
  }
}, ef = class extends G {
  constructor() {
    super(...arguments), this._implementations = [];
  }
  addImplementation(e206, t10) {
    return this._implementations.push([e206, t10]), this._implementations.sort((e207, t11) => t11[0] - e207[0]), { dispose: () => {
      for (let e207 = 0; e207 < this._implementations.length; e207++) if (this._implementations[e207][1] === t10) {
        this._implementations.splice(e207, 1);
        return;
      }
    } };
  }
  run(e206, t10, n10) {
    for (let r10 of this._implementations) {
      let i10 = r10[1](e206, t10, n10);
      if (i10) return typeof i10 == `boolean` ? void 0 : i10;
    }
  }
}, tf = class extends vd {
  run(e206, ...t10) {
    let n10 = e206.get(Su), r10 = n10.getFocusedCodeEditor() || n10.getActiveCodeEditor();
    if (r10) return r10.invokeWithinContext((e207) => {
      let n11 = e207.get(nd), i10 = e207.get(Ud);
      if (!n11.contextMatchesRules(this.desc.precondition ?? void 0)) {
        i10.debug(`[EditorAction2] NOT running command because its precondition is FALSE`, this.desc.id, this.desc.precondition?.serialize());
        return;
      }
      return this.runEditorCommand(e207, r10, ...t10);
    });
  }
};
function nf(e206, t10) {
  Nu.registerCommand(e206, function(e207, ...n10) {
    let r10 = e207.get(V), [i10, a10] = n10;
    Je($r.isUri(i10)), Je(j.isIPosition(a10));
    let o10 = e207.get(Cu).getModel(i10);
    if (o10) {
      let e208 = j.lift(a10);
      return r10.invokeFunction(t10, o10, e208, ...n10.slice(2));
    }
    return e207.get(wu).createModelReference(i10).then((e208) => new Promise((i11, o11) => {
      try {
        i11(r10.invokeFunction(t10, e208.object.textEditorModel, j.lift(a10), n10.slice(2)));
      } catch (e209) {
        o11(e209);
      }
    }).finally(() => {
      e208.dispose();
    }));
  });
}
function K(e206) {
  return sf.INSTANCE.registerEditorCommand(e206), e206;
}
function q(e206) {
  let t10 = new e206();
  return sf.INSTANCE.registerEditorAction(t10), t10;
}
function rf(e206) {
  return sf.INSTANCE.registerEditorAction(e206), e206;
}
function pre(e206) {
  sf.INSTANCE.registerEditorAction(e206);
}
function af(e206, t10, n10) {
  sf.INSTANCE.registerEditorContribution(e206, t10, n10);
}
var of;
(function(e206) {
  function t10(e207) {
    return sf.INSTANCE.getEditorCommand(e207);
  }
  e206.getEditorCommand = t10;
  function n10() {
    return sf.INSTANCE.getEditorActions();
  }
  e206.getEditorActions = n10;
  function r10() {
    return sf.INSTANCE.getEditorContributions();
  }
  e206.getEditorContributions = r10;
  function i10(e207) {
    return sf.INSTANCE.getEditorContributions().filter((t11) => e207.indexOf(t11.id) >= 0);
  }
  e206.getSomeEditorContributions = i10;
  function a10() {
    return sf.INSTANCE.getDiffEditorContributions();
  }
  e206.getDiffEditorContributions = a10;
})(of || (of = {}));
var mre = { EditorCommonContributions: `editor.contributions` }, sf = (_G = class {
  constructor() {
    this.editorContributions = [], this.diffEditorContributions = [], this.editorActions = [], this.editorCommands = /* @__PURE__ */ Object.create(null);
  }
  registerEditorContribution(e206, t10, n10) {
    this.editorContributions.push({ id: e206, ctor: t10, instantiation: n10 });
  }
  getEditorContributions() {
    return this.editorContributions.slice(0);
  }
  getDiffEditorContributions() {
    return this.diffEditorContributions.slice(0);
  }
  registerEditorAction(e206) {
    e206.register(), this.editorActions.push(e206);
  }
  getEditorActions() {
    return this.editorActions;
  }
  registerEditorCommand(e206) {
    e206.register(), this.editorCommands[e206.id] = e206;
  }
  getEditorCommand(e206) {
    return this.editorCommands[e206] || null;
  }
}, _G.INSTANCE = new _G(), _G);
cd.add(mre.EditorCommonContributions, sf.INSTANCE);
function cf(e206) {
  return e206.register(), e206;
}
var lf = cf(new Zd({ id: `undo`, precondition: void 0, kbOpts: { weight: 0, primary: 2104 }, menuOpts: [{ menuId: W.MenubarEditMenu, group: `1_do`, title: C(69, `&&Undo`), order: 1 }, { menuId: W.CommandPalette, group: ``, title: C(70, `Undo`), order: 1 }, { menuId: W.SimpleEditorContext, group: `1_do`, title: C(71, `Undo`), order: 1 }] }));
cf(new Qd(lf, { id: `default:undo`, precondition: void 0 }));
var uf = cf(new Zd({ id: `redo`, precondition: void 0, kbOpts: { weight: 0, primary: 2103, secondary: [3128], mac: { primary: 3128 } }, menuOpts: [{ menuId: W.MenubarEditMenu, group: `1_do`, title: C(72, `&&Redo`), order: 2 }, { menuId: W.CommandPalette, group: ``, title: C(73, `Redo`), order: 1 }, { menuId: W.SimpleEditorContext, group: `1_do`, title: C(74, `Redo`), order: 2 }] }));
cf(new Qd(uf, { id: `default:redo`, precondition: void 0 }));
var hre = cf(new Zd({ id: `editor.action.selectAll`, precondition: void 0, kbOpts: { weight: 0, kbExpr: null, primary: 2079 }, menuOpts: [{ menuId: W.MenubarSelectionMenu, group: `1_basic`, title: C(75, `&&Select All`), order: 1 }, { menuId: W.CommandPalette, group: ``, title: C(76, `Select All`), order: 1 }, { menuId: W.SimpleEditorContext, group: `9_select`, title: C(77, `Select All`), order: 1 }] })), df = `default`, gre = `$initialize`, ff = false;
function pf(e206) {
  Ot && (ff || (ff = true, console.warn(`Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq`)), console.warn(e206.message));
}
var _re = class {
  constructor(e206, t10, n10, r10, i10) {
    this.vsWorker = e206, this.req = t10, this.channel = n10, this.method = r10, this.args = i10, this.type = 0;
  }
}, mf = class {
  constructor(e206, t10, n10, r10) {
    this.vsWorker = e206, this.seq = t10, this.res = n10, this.err = r10, this.type = 1;
  }
}, vre = class {
  constructor(e206, t10, n10, r10, i10) {
    this.vsWorker = e206, this.req = t10, this.channel = n10, this.eventName = r10, this.arg = i10, this.type = 2;
  }
}, yre = class {
  constructor(e206, t10, n10) {
    this.vsWorker = e206, this.req = t10, this.event = n10, this.type = 3;
  }
}, bre = class {
  constructor(e206, t10) {
    this.vsWorker = e206, this.req = t10, this.type = 4;
  }
}, xre = class {
  constructor(e206) {
    this._workerId = -1, this._handler = e206, this._lastSentReq = 0, this._pendingReplies = /* @__PURE__ */ Object.create(null), this._pendingEmitters = /* @__PURE__ */ new Map(), this._pendingEvents = /* @__PURE__ */ new Map();
  }
  setWorkerId(e206) {
    this._workerId = e206;
  }
  async sendMessage(e206, t10, n10) {
    let r10 = String(++this._lastSentReq);
    return new Promise((i10, a10) => {
      this._pendingReplies[r10] = { resolve: i10, reject: a10 }, this._send(new _re(this._workerId, r10, e206, t10, n10));
    });
  }
  listen(e206, t10, n10) {
    let r10 = null, i10 = new k({ onWillAddFirstListener: () => {
      r10 = String(++this._lastSentReq), this._pendingEmitters.set(r10, i10), this._send(new vre(this._workerId, r10, e206, t10, n10));
    }, onDidRemoveLastListener: () => {
      this._pendingEmitters.delete(r10), this._send(new bre(this._workerId, r10)), r10 = null;
    } });
    return i10.event;
  }
  handleMessage(e206) {
    !e206 || !e206.vsWorker || this._workerId !== -1 && e206.vsWorker !== this._workerId || this._handleMessage(e206);
  }
  createProxyToRemoteChannel(e206, t10) {
    return new Proxy(/* @__PURE__ */ Object.create(null), { get: (n10, r10) => (typeof r10 == `string` && !n10[r10] && (gf(r10) ? n10[r10] = (t11) => this.listen(e206, r10, t11) : hf(r10) ? n10[r10] = this.listen(e206, r10, void 0) : r10.charCodeAt(0) === 36 && (n10[r10] = async (...n11) => (await t10?.(), this.sendMessage(e206, r10, n11)))), n10[r10]) });
  }
  _handleMessage(e206) {
    switch (e206.type) {
      case 1:
        return this._handleReplyMessage(e206);
      case 0:
        return this._handleRequestMessage(e206);
      case 2:
        return this._handleSubscribeEventMessage(e206);
      case 3:
        return this._handleEventMessage(e206);
      case 4:
        return this._handleUnsubscribeEventMessage(e206);
    }
  }
  _handleReplyMessage(e206) {
    if (!this._pendingReplies[e206.seq]) {
      console.warn(`Got reply to unknown seq`);
      return;
    }
    let t10 = this._pendingReplies[e206.seq];
    if (delete this._pendingReplies[e206.seq], e206.err) {
      let n10 = e206.err;
      if (e206.err.$isError) {
        let t11 = Error();
        t11.name = e206.err.name, t11.message = e206.err.message, t11.stack = e206.err.stack, n10 = t11;
      }
      t10.reject(n10);
      return;
    }
    t10.resolve(e206.res);
  }
  _handleRequestMessage(e206) {
    let t10 = e206.req;
    this._handler.handleMessage(e206.channel, e206.method, e206.args).then((e207) => {
      this._send(new mf(this._workerId, t10, e207, void 0));
    }, (e207) => {
      e207.detail instanceof Error && (e207.detail = Se(e207.detail)), this._send(new mf(this._workerId, t10, void 0, Se(e207)));
    });
  }
  _handleSubscribeEventMessage(e206) {
    let t10 = e206.req, n10 = this._handler.handleEvent(e206.channel, e206.eventName, e206.arg)((e207) => {
      this._send(new yre(this._workerId, t10, e207));
    });
    this._pendingEvents.set(t10, n10);
  }
  _handleEventMessage(e206) {
    if (!this._pendingEmitters.has(e206.req)) {
      console.warn(`Got event for unknown req`);
      return;
    }
    this._pendingEmitters.get(e206.req).fire(e206.event);
  }
  _handleUnsubscribeEventMessage(e206) {
    if (!this._pendingEvents.has(e206.req)) {
      console.warn(`Got unsubscribe for unknown req`);
      return;
    }
    this._pendingEvents.get(e206.req).dispose(), this._pendingEvents.delete(e206.req);
  }
  _send(e206) {
    let t10 = [];
    if (e206.type === 0) for (let n10 = 0; n10 < e206.args.length; n10++) {
      let r10 = e206.args[n10];
      r10 instanceof ArrayBuffer && t10.push(r10);
    }
    else e206.type === 1 && e206.res instanceof ArrayBuffer && t10.push(e206.res);
    this._handler.sendMessage(e206, t10);
  }
}, Sre = class extends D {
  constructor(e206) {
    super(), this._localChannels = /* @__PURE__ */ new Map(), this._worker = this._register(e206), this._register(this._worker.onMessage((e207) => {
      this._protocol.handleMessage(e207);
    })), this._register(this._worker.onError((e207) => {
      pf(e207), be(e207);
    })), this._protocol = new xre({ sendMessage: (e207, t10) => {
      this._worker.postMessage(e207, t10);
    }, handleMessage: (e207, t10, n10) => this._handleMessage(e207, t10, n10), handleEvent: (e207, t10, n10) => this._handleEvent(e207, t10, n10) }), this._protocol.setWorkerId(this._worker.getId()), this._onModuleLoaded = this._protocol.sendMessage(df, gre, [this._worker.getId()]).then(() => {
    }), this.proxy = this._protocol.createProxyToRemoteChannel(df, async () => {
      await this._onModuleLoaded;
    }), this._onModuleLoaded.catch((e207) => {
      this._onError(`Worker failed to load `, e207);
    });
  }
  _handleMessage(e206, t10, n10) {
    let r10 = this._localChannels.get(e206);
    if (!r10) return Promise.reject(Error(`Missing channel ${e206} on main thread`));
    let i10 = r10[t10];
    if (typeof i10 != `function`) return Promise.reject(Error(`Missing method ${t10} on main thread channel ${e206}`));
    try {
      return Promise.resolve(i10.apply(r10, n10));
    } catch (e207) {
      return Promise.reject(e207);
    }
  }
  _handleEvent(e206, t10, n10) {
    let r10 = this._localChannels.get(e206);
    if (!r10) throw Error(`Missing channel ${e206} on main thread`);
    if (gf(t10)) {
      let i10 = r10[t10];
      if (typeof i10 != `function`) throw Error(`Missing dynamic event ${t10} on main thread channel ${e206}.`);
      let a10 = i10.call(r10, n10);
      if (typeof a10 != `function`) throw Error(`Missing dynamic event ${t10} on main thread channel ${e206}.`);
      return a10;
    }
    if (hf(t10)) {
      let n11 = r10[t10];
      if (typeof n11 != `function`) throw Error(`Missing event ${t10} on main thread channel ${e206}.`);
      return n11;
    }
    throw Error(`Malformed event name ${t10}`);
  }
  setChannel(e206, t10) {
    this._localChannels.set(e206, t10);
  }
  _onError(e206, t10) {
    console.error(e206), console.info(t10);
  }
};
function hf(e206) {
  return e206[0] === `o` && e206[1] === `n` && eo(e206.charCodeAt(2));
}
function gf(e206) {
  return /^onDynamic/.test(e206) && eo(e206.charCodeAt(9));
}
function _f2(e206, t10) {
  let n10 = zo();
  if (n10?.createTrustedTypesPolicy) try {
    return n10.createTrustedTypesPolicy(e206, t10);
  } catch (e207) {
    be(e207);
    return;
  }
  try {
    return globalThis.trustedTypes?.createPolicy(e206, t10);
  } catch (e207) {
    be(e207);
    return;
  }
}
var vf = typeof self == `object` && self.constructor && self.constructor.name === `DedicatedWorkerGlobalScope` && globalThis.workerttPolicy !== void 0 ? globalThis.workerttPolicy : _f2(`defaultWorkerFactory`, { createScriptURL: (e206) => e206 });
function Cre(e206, t10) {
  let n10 = e206.label || `anonymous` + t10, r10 = zo();
  if (r10) {
    if (typeof r10.getWorker == `function`) return r10.getWorker(`workerMain.js`, n10);
    if (typeof r10.getWorkerUrl == `function`) {
      let e207 = r10.getWorkerUrl(`workerMain.js`, n10);
      return new Worker(vf ? vf.createScriptURL(e207) : e207, { name: n10, type: `module` });
    }
  }
  let i10 = e206.esmModuleLocation;
  if (i10) {
    let e207 = wre(n10, i10.toString(true));
    return yf(new Worker(vf ? vf.createScriptURL(e207) : e207, { name: n10, type: `module` }));
  }
  throw Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`);
}
function wre(e206, t10) {
  if (!(/^((http:)|(https:)|(file:))/.test(t10) && t10.substring(0, globalThis.origin.length) !== globalThis.origin)) {
    let n11 = t10.lastIndexOf(`?`), r10 = t10.lastIndexOf(`#`, n11), i10 = n11 > 0 ? new URLSearchParams(t10.substring(n11 + 1, ~r10 ? r10 : void 0)) : new URLSearchParams();
    Ds.addSearchParam(i10, true, true), t10 = i10.toString() ? `${t10}?${i10.toString()}#${e206}` : `${t10}#${e206}`;
  }
  let n10 = new Blob([h([`/*${e206}*/`, `globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(st())};`, `globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(ct())};`, `globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`, `const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });`, `globalThis.workerttPolicy = ttPolicy;`, `await import(ttPolicy?.createScriptURL(${JSON.stringify(t10)}) ?? ${JSON.stringify(t10)});`, `globalThis.postMessage({ type: 'vscode-worker-ready' });`, `/*${e206}*/`]).join(``)], { type: `application/javascript` });
  return URL.createObjectURL(n10);
}
function yf(e206) {
  return new Promise((t10, n10) => {
    e206.onmessage = function(n11) {
      n11.data.type === `vscode-worker-ready` && (e206.onmessage = null, t10(e206));
    }, e206.onerror = n10;
  });
}
function bf(e206) {
  return !!e206 && typeof e206.then == `function`;
}
var Tre = (_H = class extends D {
  constructor(t10) {
    super(), this._onMessage = this._register(new k()), this.onMessage = this._onMessage.event, this._onError = this._register(new k()), this.onError = this._onError.event, this.id = ++_H.LAST_WORKER_ID;
    let n10 = t10 instanceof Worker || `then` in t10 ? t10 : Cre(t10, this.id);
    bf(n10) ? this.worker = n10 : this.worker = Promise.resolve(n10), this.postMessage(`-please-ignore-`, []);
    let r10 = (e206) => {
      this._onError.fire(e206);
    };
    this.worker.then((e206) => {
      e206.onmessage = (e207) => {
        this._onMessage.fire(e207.data);
      }, e206.onmessageerror = (e207) => {
        this._onError.fire(e207);
      }, typeof e206.addEventListener == `function` && e206.addEventListener(`error`, r10);
    }), this._register(T(() => {
      this.worker?.then((e206) => {
        e206.onmessage = null, e206.onmessageerror = null, e206.removeEventListener(`error`, r10), e206.terminate();
      }), this.worker = null;
    }));
  }
  getId() {
    return this.id;
  }
  postMessage(e206, t10) {
    this.worker?.then((n10) => {
      try {
        n10.postMessage(e206, t10);
      } catch (e207) {
        be(e207), be(Error(`FAILED to post message to worker`, { cause: e207 }));
      }
    });
  }
}, _H.LAST_WORKER_ID = 0, _H), Ere = class {
  constructor(e206, t10) {
    this.esmModuleLocation = e206, this.label = t10;
  }
};
function Dre(e206, t10) {
  return new Sre(new Tre($r.isUri(e206) ? new Ere(e206, t10) : e206));
}
var xf;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.Indent = 1] = `Indent`, e206[e206.IndentOutdent = 2] = `IndentOutdent`, e206[e206.Outdent = 3] = `Outdent`;
})(xf || (xf = {}));
var Sf = class {
  constructor(e206) {
    if (this._neutralCharacter = null, this._neutralCharacterSearched = false, this.open = e206.open, this.close = e206.close, this._inString = true, this._inComment = true, this._inRegEx = true, Array.isArray(e206.notIn)) for (let t10 = 0, n10 = e206.notIn.length; t10 < n10; t10++) switch (e206.notIn[t10]) {
      case `string`:
        this._inString = false;
        break;
      case `comment`:
        this._inComment = false;
        break;
      case `regex`:
        this._inRegEx = false;
        break;
    }
  }
  isOK(e206) {
    switch (e206) {
      case 0:
        return true;
      case 1:
        return this._inComment;
      case 2:
        return this._inString;
      case 3:
        return this._inRegEx;
    }
  }
  shouldAutoClose(e206, t10) {
    if (e206.getTokenCount() === 0) return true;
    let n10 = e206.findTokenIndexAtOffset(t10 - 2), r10 = e206.getStandardTokenType(n10);
    return this.isOK(r10);
  }
  _findNeutralCharacterInRange(e206, t10) {
    for (let n10 = e206; n10 <= t10; n10++) {
      let e207 = String.fromCharCode(n10);
      if (!this.open.includes(e207) && !this.close.includes(e207)) return e207;
    }
    return null;
  }
  findNeutralCharacter() {
    return this._neutralCharacterSearched || (this._neutralCharacterSearched = true, this._neutralCharacter || (this._neutralCharacter = this._findNeutralCharacterInRange(48, 57)), this._neutralCharacter || (this._neutralCharacter = this._findNeutralCharacterInRange(97, 122)), this._neutralCharacter || (this._neutralCharacter = this._findNeutralCharacterInRange(65, 90))), this._neutralCharacter;
  }
}, Cf = class {
  constructor(e206) {
    this.autoClosingPairsOpenByStart = /* @__PURE__ */ new Map(), this.autoClosingPairsOpenByEnd = /* @__PURE__ */ new Map(), this.autoClosingPairsCloseByStart = /* @__PURE__ */ new Map(), this.autoClosingPairsCloseByEnd = /* @__PURE__ */ new Map(), this.autoClosingPairsCloseSingleChar = /* @__PURE__ */ new Map();
    for (let t10 of e206) wf(this.autoClosingPairsOpenByStart, t10.open.charAt(0), t10), wf(this.autoClosingPairsOpenByEnd, t10.open.charAt(t10.open.length - 1), t10), wf(this.autoClosingPairsCloseByStart, t10.close.charAt(0), t10), wf(this.autoClosingPairsCloseByEnd, t10.close.charAt(t10.close.length - 1), t10), t10.close.length === 1 && t10.open.length === 1 && wf(this.autoClosingPairsCloseSingleChar, t10.close, t10);
  }
};
function wf(e206, t10, n10) {
  e206.has(t10) ? e206.get(t10).push(n10) : e206.set(t10, [n10]);
}
var Tf = (_I = class {
  constructor(t10) {
    if (t10.autoClosingPairs ? this._autoClosingPairs = t10.autoClosingPairs.map((e206) => new Sf(e206)) : t10.brackets ? this._autoClosingPairs = t10.brackets.map((e206) => new Sf({ open: e206[0], close: e206[1] })) : this._autoClosingPairs = [], t10.__electricCharacterSupport && t10.__electricCharacterSupport.docComment) {
      let e206 = t10.__electricCharacterSupport.docComment;
      this._autoClosingPairs.push(new Sf({ open: e206.open, close: e206.close || `` }));
    }
    this._autoCloseBeforeForQuotes = typeof t10.autoCloseBefore == `string` ? t10.autoCloseBefore : _I.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES, this._autoCloseBeforeForBrackets = typeof t10.autoCloseBefore == `string` ? t10.autoCloseBefore : _I.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS, this._surroundingPairs = t10.surroundingPairs || this._autoClosingPairs;
  }
  getAutoClosingPairs() {
    return this._autoClosingPairs;
  }
  getAutoCloseBeforeSet(e206) {
    return e206 ? this._autoCloseBeforeForQuotes : this._autoCloseBeforeForBrackets;
  }
  getSurroundingPairs() {
    return this._surroundingPairs;
  }
}, _I.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES = `;:.,=}])> 
	`, _I.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS = `'"\`;:.,=}])> 
	`, _I);
function Ef(e206, t10) {
  let n10 = e206.getCount(), r10 = e206.findTokenIndexAtOffset(t10), i10 = e206.getLanguageId(r10), a10 = r10;
  for (; a10 + 1 < n10 && e206.getLanguageId(a10 + 1) === i10; ) a10++;
  let o10 = r10;
  for (; o10 > 0 && e206.getLanguageId(o10 - 1) === i10; ) o10--;
  return new Ore(e206, i10, o10, a10 + 1, e206.getStartOffset(o10), e206.getEndOffset(a10));
}
var Ore = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._scopedLineTokensBrand = void 0, this._actual = e206, this.languageId = t10, this._firstTokenIndex = n10, this._lastTokenIndex = r10, this.firstCharOffset = i10, this._lastCharOffset = a10, this.languageIdCodec = e206.languageIdCodec;
  }
  getLineContent() {
    return this._actual.getLineContent().substring(this.firstCharOffset, this._lastCharOffset);
  }
  getLineLength() {
    return this._lastCharOffset - this.firstCharOffset;
  }
  getActualLineContentBefore(e206) {
    return this._actual.getLineContent().substring(0, this.firstCharOffset + e206);
  }
  getTokenCount() {
    return this._lastTokenIndex - this._firstTokenIndex;
  }
  findTokenIndexAtOffset(e206) {
    return this._actual.findTokenIndexAtOffset(e206 + this.firstCharOffset) - this._firstTokenIndex;
  }
  getStandardTokenType(e206) {
    return this._actual.getStandardTokenType(e206 + this._firstTokenIndex);
  }
  toIViewLineTokens() {
    return this._actual.sliceAndInflate(this.firstCharOffset, this._lastCharOffset, 0);
  }
};
function Df(e206) {
  return (e206 & 3) != 0;
}
var Of;
function kf() {
  return Of || (Of = new TextDecoder(`UTF-16LE`)), Of;
}
var Af;
function kre() {
  return Af || (Af = new TextDecoder(`UTF-16BE`)), Af;
}
var jf;
function Mf() {
  return jf || (jf = Lt() ? kf() : kre()), jf;
}
function Nf(e206, t10, n10) {
  let r10 = new Uint16Array(e206.buffer, t10, n10);
  return n10 > 0 && (r10[0] === 65279 || r10[0] === 65534) ? Pf(e206, t10, n10) : kf().decode(r10);
}
function Pf(e206, t10, n10) {
  let r10 = [], i10 = 0;
  for (let a10 = 0; a10 < n10; a10++) {
    let n11 = Vte(e206, t10);
    t10 += 2, r10[i10++] = String.fromCharCode(n11);
  }
  return r10.join(``);
}
var Ff = class {
  constructor(e206) {
    this._capacity = e206 | 0, this._buffer = new Uint16Array(this._capacity), this._completedStrings = null, this._bufferLength = 0;
  }
  reset() {
    this._completedStrings = null, this._bufferLength = 0;
  }
  build() {
    return this._completedStrings === null ? this._buildBuffer() : (this._flushBuffer(), this._completedStrings.join(``));
  }
  _buildBuffer() {
    if (this._bufferLength === 0) return ``;
    let e206 = new Uint16Array(this._buffer.buffer, 0, this._bufferLength);
    return Mf().decode(e206);
  }
  _flushBuffer() {
    let e206 = this._buildBuffer();
    this._bufferLength = 0, this._completedStrings === null ? this._completedStrings = [e206] : this._completedStrings[this._completedStrings.length] = e206;
  }
  appendCharCode(e206) {
    let t10 = this._capacity - this._bufferLength;
    t10 <= 1 && (t10 === 0 || ao(e206)) && this._flushBuffer(), this._buffer[this._bufferLength++] = e206;
  }
  appendASCIICharCode(e206) {
    this._bufferLength === this._capacity && this._flushBuffer(), this._buffer[this._bufferLength++] = e206;
  }
  appendString(e206) {
    let t10 = e206.length;
    if (this._bufferLength + t10 >= this._capacity) {
      this._flushBuffer(), this._completedStrings[this._completedStrings.length] = e206;
      return;
    }
    for (let n10 = 0; n10 < t10; n10++) this._buffer[this._bufferLength++] = e206.charCodeAt(n10);
  }
}, Are = class e43 {
  constructor(t10, n10, r10, i10, a10, o10) {
    this._richEditBracketBrand = void 0, this.languageId = t10, this.index = n10, this.open = r10, this.close = i10, this.forwardRegex = a10, this.reversedRegex = o10, this._openSet = e43._toSet(this.open), this._closeSet = e43._toSet(this.close);
  }
  isOpen(e206) {
    return this._openSet.has(e206);
  }
  isClose(e206) {
    return this._closeSet.has(e206);
  }
  static _toSet(e206) {
    let t10 = /* @__PURE__ */ new Set();
    for (let n10 of e206) t10.add(n10);
    return t10;
  }
};
function jre(e206) {
  let t10 = e206.length;
  e206 = e206.map((e207) => [e207[0].toLowerCase(), e207[1].toLowerCase()]);
  let n10 = [];
  for (let e207 = 0; e207 < t10; e207++) n10[e207] = e207;
  let r10 = (e207, t11) => {
    let [n11, r11] = e207, [i11, a11] = t11;
    return n11 === i11 || n11 === a11 || r11 === i11 || r11 === a11;
  }, i10 = (e207, r11) => {
    let i11 = Math.min(e207, r11), a11 = Math.max(e207, r11);
    for (let e208 = 0; e208 < t10; e208++) n10[e208] === a11 && (n10[e208] = i11);
  };
  for (let a11 = 0; a11 < t10; a11++) {
    let o10 = e206[a11];
    for (let s10 = a11 + 1; s10 < t10; s10++) {
      let t11 = e206[s10];
      r10(o10, t11) && i10(n10[a11], n10[s10]);
    }
  }
  let a10 = [];
  for (let r11 = 0; r11 < t10; r11++) {
    let i11 = [], o10 = [];
    for (let a11 = 0; a11 < t10; a11++) if (n10[a11] === r11) {
      let [t11, n11] = e206[a11];
      i11.push(t11), o10.push(n11);
    }
    i11.length > 0 && a10.push({ open: i11, close: o10 });
  }
  return a10;
}
var Mre = class {
  constructor(e206, t10) {
    this._richEditBracketsBrand = void 0;
    let n10 = jre(t10);
    this.brackets = n10.map((t11, r10) => new Are(e206, r10, t11.open, t11.close, Nre(t11.open, t11.close, n10, r10), Pre(t11.open, t11.close, n10, r10))), this.forwardRegex = Fre(this.brackets), this.reversedRegex = Ire(this.brackets), this.textIsBracket = {}, this.textIsOpenBracket = {}, this.maxBracketLength = 0;
    for (let e207 of this.brackets) {
      for (let t11 of e207.open) this.textIsBracket[t11] = e207, this.textIsOpenBracket[t11] = true, this.maxBracketLength = Math.max(this.maxBracketLength, t11.length);
      for (let t11 of e207.close) this.textIsBracket[t11] = e207, this.textIsOpenBracket[t11] = false, this.maxBracketLength = Math.max(this.maxBracketLength, t11.length);
    }
  }
};
function If(e206, t10, n10, r10) {
  for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
    if (i10 === n10) continue;
    let a11 = t10[i10];
    for (let t11 of a11.open) t11.indexOf(e206) >= 0 && r10.push(t11);
    for (let t11 of a11.close) t11.indexOf(e206) >= 0 && r10.push(t11);
  }
}
function Lf(e206, t10) {
  return e206.length - t10.length;
}
function Rf(e206) {
  if (e206.length <= 1) return e206;
  let t10 = [], n10 = /* @__PURE__ */ new Set();
  for (let r10 of e206) n10.has(r10) || (t10.push(r10), n10.add(r10));
  return t10;
}
function Nre(e206, t10, n10, r10) {
  let i10 = [];
  i10 = i10.concat(e206), i10 = i10.concat(t10);
  for (let e207 = 0, t11 = i10.length; e207 < t11; e207++) If(i10[e207], n10, r10, i10);
  return i10 = Rf(i10), i10.sort(Lf), i10.reverse(), zf(i10);
}
function Pre(e206, t10, n10, r10) {
  let i10 = [];
  i10 = i10.concat(e206), i10 = i10.concat(t10);
  for (let e207 = 0, t11 = i10.length; e207 < t11; e207++) If(i10[e207], n10, r10, i10);
  return i10 = Rf(i10), i10.sort(Lf), i10.reverse(), zf(i10.map(Bf));
}
function Fre(e206) {
  let t10 = [];
  for (let n10 of e206) {
    for (let e207 of n10.open) t10.push(e207);
    for (let e207 of n10.close) t10.push(e207);
  }
  return t10 = Rf(t10), zf(t10);
}
function Ire(e206) {
  let t10 = [];
  for (let n10 of e206) {
    for (let e207 of n10.open) t10.push(e207);
    for (let e207 of n10.close) t10.push(e207);
  }
  return t10 = Rf(t10), zf(t10.map(Bf));
}
function Lre(e206) {
  let t10 = /^[\w ]+$/.test(e206);
  return e206 = za(e206), t10 ? `\\b${e206}\\b` : e206;
}
function zf(e206, t10) {
  return Ha(`(${e206.map(Lre).join(`)|(`)})`, true, t10);
}
var Bf = /* @__PURE__ */ (function() {
  function e206(e207) {
    let t11 = new Uint16Array(e207.length), n11 = 0;
    for (let r10 = e207.length - 1; r10 >= 0; r10--) t11[n11++] = e207.charCodeAt(r10);
    return Mf().decode(t11);
  }
  let t10 = null, n10 = null;
  return function(r10) {
    return t10 !== r10 && (t10 = r10, n10 = e206(t10)), n10;
  };
})(), Vf = class {
  static _findPrevBracketInText(e206, t10, n10, r10) {
    let i10 = n10.match(e206);
    if (!i10) return null;
    let a10 = n10.length - (i10.index || 0), o10 = i10[0].length, s10 = r10 + a10;
    return new M(t10, s10 - o10 + 1, t10, s10 + 1);
  }
  static findPrevBracketInRange(e206, t10, n10, r10, i10) {
    let a10 = Bf(n10).substring(n10.length - i10, n10.length - r10);
    return this._findPrevBracketInText(e206, t10, a10, r10);
  }
  static findNextBracketInText(e206, t10, n10, r10) {
    let i10 = n10.match(e206);
    if (!i10) return null;
    let a10 = i10.index || 0, o10 = i10[0].length;
    if (o10 === 0) return null;
    let s10 = r10 + a10;
    return new M(t10, s10 + 1, t10, s10 + 1 + o10);
  }
  static findNextBracketInRange(e206, t10, n10, r10, i10) {
    let a10 = n10.substring(r10, i10);
    return this.findNextBracketInText(e206, t10, a10, r10);
  }
}, Rre = class {
  constructor(e206) {
    this._richEditBrackets = e206;
  }
  getElectricCharacters() {
    let e206 = [];
    if (this._richEditBrackets) for (let t10 of this._richEditBrackets.brackets) for (let n10 of t10.close) {
      let t11 = n10.charAt(n10.length - 1);
      e206.push(t11);
    }
    return y(e206);
  }
  onElectricCharacter(e206, t10, n10) {
    if (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) return null;
    let r10 = t10.findTokenIndexAtOffset(n10 - 1);
    if (Df(t10.getStandardTokenType(r10))) return null;
    let i10 = this._richEditBrackets.reversedRegex, a10 = t10.getLineContent().substring(0, n10 - 1) + e206, o10 = Vf.findPrevBracketInRange(i10, 1, a10, 0, a10.length);
    if (!o10) return null;
    let s10 = a10.substring(o10.startColumn - 1, o10.endColumn - 1).toLowerCase();
    if (this._richEditBrackets.textIsOpenBracket[s10]) return null;
    let c10 = t10.getActualLineContentBefore(o10.startColumn - 1);
    return /^\s*$/.test(c10) ? { matchOpenBracket: s10 } : null;
  }
};
function Hf(e206) {
  return e206.global && (e206.lastIndex = 0), true;
}
var zre = class {
  constructor(e206) {
    this._indentationRules = e206;
  }
  shouldIncrease(e206) {
    return !!(this._indentationRules && this._indentationRules.increaseIndentPattern && Hf(this._indentationRules.increaseIndentPattern) && this._indentationRules.increaseIndentPattern.test(e206));
  }
  shouldDecrease(e206) {
    return !!(this._indentationRules && this._indentationRules.decreaseIndentPattern && Hf(this._indentationRules.decreaseIndentPattern) && this._indentationRules.decreaseIndentPattern.test(e206));
  }
  shouldIndentNextLine(e206) {
    return !!(this._indentationRules && this._indentationRules.indentNextLinePattern && Hf(this._indentationRules.indentNextLinePattern) && this._indentationRules.indentNextLinePattern.test(e206));
  }
  shouldIgnore(e206) {
    return !!(this._indentationRules && this._indentationRules.unIndentedLinePattern && Hf(this._indentationRules.unIndentedLinePattern) && this._indentationRules.unIndentedLinePattern.test(e206));
  }
  getIndentMetadata(e206) {
    let t10 = 0;
    return this.shouldIncrease(e206) && (t10 += 1), this.shouldDecrease(e206) && (t10 += 2), this.shouldIndentNextLine(e206) && (t10 += 4), this.shouldIgnore(e206) && (t10 += 8), t10;
  }
}, Bre = class e44 {
  constructor(t10) {
    t10 || (t10 = {}), t10.brackets = t10.brackets || [[`(`, `)`], [`{`, `}`], [`[`, `]`]], this._brackets = [], t10.brackets.forEach((t11) => {
      let n10 = e44._createOpenBracketRegExp(t11[0]), r10 = e44._createCloseBracketRegExp(t11[1]);
      n10 && r10 && this._brackets.push({ open: t11[0], openRegExp: n10, close: t11[1], closeRegExp: r10 });
    }), this._regExpRules = t10.onEnterRules || [];
  }
  onEnter(e206, t10, n10, r10) {
    if (e206 >= 3) for (let e207 = 0, i10 = this._regExpRules.length; e207 < i10; e207++) {
      let i11 = this._regExpRules[e207];
      if ([{ reg: i11.beforeText, text: n10 }, { reg: i11.afterText, text: r10 }, { reg: i11.previousLineText, text: t10 }].every((e208) => e208.reg ? (e208.reg.lastIndex = 0, e208.reg.test(e208.text)) : true)) return i11.action;
    }
    if (e206 >= 2 && n10.length > 0 && r10.length > 0) for (let e207 = 0, t11 = this._brackets.length; e207 < t11; e207++) {
      let t12 = this._brackets[e207];
      if (t12.openRegExp.test(n10) && t12.closeRegExp.test(r10)) return { indentAction: xf.IndentOutdent };
    }
    if (e206 >= 2 && n10.length > 0) {
      for (let e207 = 0, t11 = this._brackets.length; e207 < t11; e207++) if (this._brackets[e207].openRegExp.test(n10)) return { indentAction: xf.Indent };
    }
    return null;
  }
  static _createOpenBracketRegExp(t10) {
    let n10 = za(t10);
    return /\B/.test(n10.charAt(0)) || (n10 = `\\b` + n10), n10 += `\\s*$`, e44._safeRegExp(n10);
  }
  static _createCloseBracketRegExp(t10) {
    let n10 = za(t10);
    return /\B/.test(n10.charAt(n10.length - 1)) || (n10 += `\\b`), n10 = `^\\s*` + n10, e44._safeRegExp(n10);
  }
  static _safeRegExp(e206) {
    try {
      return new RegExp(e206);
    } catch (e207) {
      return be(e207), null;
    }
  }
}, Uf = xu(`configurationService`);
function Wf(e206, t10) {
  let n10 = /* @__PURE__ */ Object.create(null);
  for (let r10 in e206) Gf(n10, r10, e206[r10], t10);
  return n10;
}
function Gf(e206, t10, n10, r10) {
  let i10 = t10.split(`.`), a10 = i10.pop(), o10 = e206;
  for (let e207 = 0; e207 < i10.length; e207++) {
    let n11 = i10[e207], a11 = o10[n11];
    switch (typeof a11) {
      case `undefined`:
        a11 = o10[n11] = /* @__PURE__ */ Object.create(null);
        break;
      case `object`:
        if (a11 === null) {
          r10(`Ignoring ${t10} as ${i10.slice(0, e207 + 1).join(`.`)} is null`);
          return;
        }
        break;
      default:
        r10(`Ignoring ${t10} as ${i10.slice(0, e207 + 1).join(`.`)} is ${JSON.stringify(a11)}`);
        return;
    }
    o10 = a11;
  }
  if (typeof o10 == `object` && o10) try {
    o10[a10] = n10;
  } catch {
    r10(`Ignoring ${t10} as ${i10.join(`.`)} is ${JSON.stringify(o10)}`);
  }
  else r10(`Ignoring ${t10} as ${i10.join(`.`)} is ${JSON.stringify(o10)}`);
}
function Vre(e206, t10) {
  Kf(e206, t10.split(`.`));
}
function Kf(e206, t10) {
  if (!e206) return;
  let n10 = t10.shift();
  if (t10.length === 0) {
    delete e206[n10];
    return;
  }
  if (Object.keys(e206).indexOf(n10) !== -1) {
    let r10 = e206[n10];
    typeof r10 == `object` && !Array.isArray(r10) && (Kf(r10, t10), Object.keys(r10).length === 0 && delete e206[n10]);
  }
}
function qf(e206, t10, n10) {
  function r10(e207, t11) {
    let n11 = e207;
    for (let e208 of t11) {
      if (typeof n11 != `object` || !n11) return;
      n11 = n11[e208];
    }
    return n11;
  }
  let i10 = r10(e206, t10.split(`.`));
  return i10 === void 0 ? n10 : i10;
}
function Hre(e206) {
  return e206.replace(/^\[/, ``).replace(/]$/g, ``).replace(/\]\[/g, `, `);
}
var Jf = xu(`languageService`), Yf = class {
  constructor(e206, t10 = [], n10 = false) {
    this.ctor = e206, this.staticArguments = t10, this.supportsDelayedInstantiation = n10;
  }
}, Xf = [];
function Zf(e206, t10, n10) {
  t10 instanceof Yf || (t10 = new Yf(t10, [], !!n10)), Xf.push([e206, t10]);
}
function Qf() {
  return Xf;
}
var $f = Object.freeze({ text: `text/plain`, binary: `application/octet-stream`, unknown: `application/unknown`, markdown: `text/markdown`, latex: `text/latex`, uriList: `text/uri-list`, html: `text/html` }), ep = { JSONContribution: `base.contributions.json` };
function tp(e206) {
  return e206.length > 0 && e206.charAt(e206.length - 1) === `#` ? e206.substring(0, e206.length - 1) : e206;
}
var np = new class extends D {
  constructor() {
    super(...arguments), this.schemasById = {}, this._onDidChangeSchema = this._register(new k());
  }
  registerSchema(e206, t10, n10) {
    let r10 = tp(e206);
    this.schemasById[r10] = t10, this._onDidChangeSchema.fire(e206), n10 && n10.add(T(() => {
      delete this.schemasById[r10], this._onDidChangeSchema.fire(e206);
    }));
  }
  notifySchemaChanged(e206) {
    this._onDidChangeSchema.fire(e206);
  }
}();
cd.add(ep.JSONContribution, np);
var rp, ip = globalThis.vscode;
if (ip !== void 0 && ip.context !== void 0) {
  let e206 = ip.context.configuration();
  if (e206) rp = e206.product;
  else throw Error(`Sandbox: unable to resolve product configuration from preload script.`);
} else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
  if (rp = globalThis._VSCODE_PRODUCT_JSON, Er.VSCODE_DEV && Object.assign(rp, { nameShort: `${rp.nameShort} Dev`, nameLong: `${rp.nameLong} Dev`, dataFolderName: `${rp.dataFolderName}-dev`, serverDataFolderName: rp.serverDataFolderName ? `${rp.serverDataFolderName}-dev` : void 0 }), !rp.version) {
    let e206 = globalThis._VSCODE_PACKAGE_JSON;
    Object.assign(rp, { version: e206.version });
  }
} else rp = {}, Object.keys(rp).length === 0 && Object.assign(rp, { version: `1.104.0-dev`, nameShort: `Code - OSS Dev`, nameLong: `Code - OSS Dev`, applicationName: `code-oss`, dataFolderName: `.vscode-oss`, urlProtocol: `code-oss`, reportIssueUrl: `https://github.com/microsoft/vscode/issues/new`, licenseName: `MIT`, licenseUrl: `https://github.com/microsoft/vscode/blob/main/LICENSE.txt`, serverLicenseUrl: `https://github.com/microsoft/vscode/blob/main/LICENSE.txt` });
var ap = rp, op = { Configuration: `base.contributions.configuration` }, sp = `vscode://schemas/settings/resourceLanguage`, cp = cd.as(ep.JSONContribution), Ure = class extends D {
  constructor() {
    super(), this.registeredConfigurationDefaults = [], this.overrideIdentifiers = /* @__PURE__ */ new Set(), this._onDidSchemaChange = this._register(new k()), this._onDidUpdateConfiguration = this._register(new k()), this.configurationDefaultsOverrides = /* @__PURE__ */ new Map(), this.defaultLanguageConfigurationOverridesNode = { id: `defaultOverrides`, title: C(1664, `Default Language Configuration Overrides`), properties: {} }, this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode], this.resourceLanguageSettingsSchema = { properties: {}, patternProperties: {}, additionalProperties: true, allowTrailingCommas: true, allowComments: true }, this.configurationProperties = {}, this.policyConfigurations = /* @__PURE__ */ new Map(), this.excludedConfigurationProperties = {}, cp.registerSchema(sp, this.resourceLanguageSettingsSchema), this.registerOverridePropertyPatternKey();
  }
  registerConfiguration(e206, t10 = true) {
    return this.registerConfigurations([e206], t10), e206;
  }
  registerConfigurations(e206, t10 = true) {
    let n10 = /* @__PURE__ */ new Set();
    this.doRegisterConfigurations(e206, t10, n10), cp.registerSchema(sp, this.resourceLanguageSettingsSchema), this._onDidSchemaChange.fire(), this._onDidUpdateConfiguration.fire({ properties: n10 });
  }
  registerDefaultConfigurations(e206) {
    let t10 = /* @__PURE__ */ new Set();
    this.doRegisterDefaultConfigurations(e206, t10), this._onDidSchemaChange.fire(), this._onDidUpdateConfiguration.fire({ properties: t10, defaultsOverrides: true });
  }
  doRegisterDefaultConfigurations(e206, t10) {
    this.registeredConfigurationDefaults.push(...e206);
    let n10 = [];
    for (let { overrides: r10, source: i10 } of e206) for (let e207 in r10) {
      t10.add(e207);
      let a10 = this.configurationDefaultsOverrides.get(e207) ?? this.configurationDefaultsOverrides.set(e207, { configurationDefaultOverrides: [] }).get(e207), o10 = r10[e207];
      if (a10.configurationDefaultOverrides.push({ value: o10, source: i10 }), dp.test(e207)) {
        let t11 = this.mergeDefaultConfigurationsForOverrideIdentifier(e207, o10, i10, a10.configurationDefaultOverrideValue);
        if (!t11) continue;
        a10.configurationDefaultOverrideValue = t11, this.updateDefaultOverrideProperty(e207, t11, i10), n10.push(...fp(e207));
      } else {
        let t11 = this.mergeDefaultConfigurationsForConfigurationProperty(e207, o10, i10, a10.configurationDefaultOverrideValue);
        if (!t11) continue;
        a10.configurationDefaultOverrideValue = t11;
        let n11 = this.configurationProperties[e207];
        n11 && (this.updatePropertyDefaultValue(e207, n11), this.updateSchema(e207, n11));
      }
    }
    this.doRegisterOverrideIdentifiers(n10);
  }
  updateDefaultOverrideProperty(e206, t10, n10) {
    let r10 = { section: { id: this.defaultLanguageConfigurationOverridesNode.id, title: this.defaultLanguageConfigurationOverridesNode.title, order: this.defaultLanguageConfigurationOverridesNode.order, extensionInfo: this.defaultLanguageConfigurationOverridesNode.extensionInfo }, type: `object`, default: t10.value, description: C(1665, `Configure settings to be overridden for {0}.`, Hre(e206)), $ref: sp, defaultDefaultValue: t10.value, source: n10, defaultValueSource: n10 };
    this.configurationProperties[e206] = r10, this.defaultLanguageConfigurationOverridesNode.properties[e206] = r10;
  }
  mergeDefaultConfigurationsForOverrideIdentifier(e206, t10, n10, r10) {
    let i10 = r10?.value || {}, a10 = r10?.source ?? /* @__PURE__ */ new Map();
    if (!(a10 instanceof Map)) {
      console.error(`objectConfigurationSources is not a Map`);
      return;
    }
    for (let e207 of Object.keys(t10)) {
      let r11 = t10[e207];
      if (Be(r11) && (Ge(i10[e207]) || Be(i10[e207]))) {
        if (i10[e207] = { ...i10[e207] ?? {}, ...r11 }, n10) for (let t11 in r11) a10.set(`${e207}.${t11}`, n10);
      } else i10[e207] = r11, n10 ? a10.set(e207, n10) : a10.delete(e207);
    }
    return { value: i10, source: a10 };
  }
  mergeDefaultConfigurationsForConfigurationProperty(e206, t10, n10, r10) {
    let i10 = this.configurationProperties[e206], a10 = r10?.value ?? i10?.defaultDefaultValue, o10 = n10;
    if (Be(t10) && (i10 !== void 0 && i10.type === `object` || i10 === void 0 && (Ge(a10) || Be(a10)))) {
      if (o10 = r10?.source ?? /* @__PURE__ */ new Map(), !(o10 instanceof Map)) {
        console.error(`defaultValueSource is not a Map`);
        return;
      }
      for (let r11 in t10) n10 && o10.set(`${e206}.${r11}`, n10);
      t10 = { ...Be(a10) ? a10 : {}, ...t10 };
    }
    return { value: t10, source: o10 };
  }
  registerOverrideIdentifiers(e206) {
    this.doRegisterOverrideIdentifiers(e206), this._onDidSchemaChange.fire();
  }
  doRegisterOverrideIdentifiers(e206) {
    for (let t10 of e206) this.overrideIdentifiers.add(t10);
    this.updateOverridePropertyPatternKey();
  }
  doRegisterConfigurations(e206, t10, n10) {
    e206.forEach((e207) => {
      this.validateAndRegisterProperties(e207, t10, e207.extensionInfo, e207.restrictedProperties, void 0, n10), this.configurationContributors.push(e207), this.registerJSONConfiguration(e207);
    });
  }
  validateAndRegisterProperties(e206, t10 = true, n10, r10, i10 = 4, a10) {
    i10 = qe(e206.scope) ? i10 : e206.scope;
    let o10 = e206.properties;
    if (o10) for (let s11 in o10) {
      let c10 = o10[s11];
      if (c10.section = { id: e206.id, title: e206.title, order: e206.order, extensionInfo: e206.extensionInfo }, t10 && Kre(s11, c10, n10?.id)) {
        delete o10[s11];
        continue;
      }
      c10.source = n10, c10.defaultDefaultValue = o10[s11].default, this.updatePropertyDefaultValue(s11, c10), dp.test(s11) ? c10.scope = void 0 : (c10.scope = qe(c10.scope) ? i10 : c10.scope, c10.restricted = qe(c10.restricted) ? !!r10?.includes(s11) : c10.restricted), c10.experiment ? c10.tags?.some((e207) => e207.toLowerCase() === `onexp`) || (c10.tags = c10.tags ?? [], c10.tags.push(`onExP`)) : c10.tags?.some((e207) => e207.toLowerCase() === `onexp`) && (console.error(`Invalid tag 'onExP' found for property '${s11}'. Please use 'experiment' property instead.`), c10.experiment = { mode: `startup` });
      let l10 = o10[s11].hasOwnProperty(`included`) && !o10[s11].included, u10 = o10[s11].policy?.name;
      l10 ? (this.excludedConfigurationProperties[s11] = o10[s11], u10 && (this.policyConfigurations.set(u10, s11), a10.add(s11)), delete o10[s11]) : (a10.add(s11), u10 && this.policyConfigurations.set(u10, s11), this.configurationProperties[s11] = o10[s11], !o10[s11].deprecationMessage && o10[s11].markdownDeprecationMessage && (o10[s11].deprecationMessage = o10[s11].markdownDeprecationMessage));
    }
    let s10 = e206.allOf;
    if (s10) for (let e207 of s10) this.validateAndRegisterProperties(e207, t10, n10, r10, i10, a10);
  }
  getConfigurationProperties() {
    return this.configurationProperties;
  }
  getPolicyConfigurations() {
    return this.policyConfigurations;
  }
  getExcludedConfigurationProperties() {
    return this.excludedConfigurationProperties;
  }
  registerJSONConfiguration(e206) {
    let t10 = (e207) => {
      let n10 = e207.properties;
      if (n10) for (let e208 in n10) this.updateSchema(e208, n10[e208]);
      e207.allOf?.forEach(t10);
    };
    t10(e206);
  }
  updateSchema(e206, t10) {
    switch (t10.scope) {
      case 1:
        break;
      case 2:
        break;
      case 3:
        break;
      case 7:
        break;
      case 4:
        break;
      case 5:
        break;
      case 6:
        this.resourceLanguageSettingsSchema.properties[e206] = t10;
        break;
    }
  }
  updateOverridePropertyPatternKey() {
    for (let e206 of this.overrideIdentifiers.values()) {
      let t10 = `[${e206}]`, n10 = { type: `object`, description: C(1666, `Configure editor settings to be overridden for a language.`), errorMessage: C(1667, `This setting does not support per-language configuration.`), $ref: sp };
      this.updatePropertyDefaultValue(t10, n10);
    }
  }
  registerOverridePropertyPatternKey() {
    C(1668, `Configure editor settings to be overridden for a language.`), C(1669, `This setting does not support per-language configuration.`), this._onDidSchemaChange.fire();
  }
  updatePropertyDefaultValue(e206, t10) {
    let n10 = this.configurationDefaultsOverrides.get(e206)?.configurationDefaultOverrideValue, r10, i10;
    n10 && (!t10.disallowConfigurationDefault || !n10.source) && (r10 = n10.value, i10 = n10.source), Ge(r10) && (r10 = t10.defaultDefaultValue, i10 = void 0), Ge(r10) && (r10 = Gre(t10.type)), t10.default = r10, t10.defaultValueSource = i10;
  }
}, lp = `\\[([^\\]]+)\\]`, up = new RegExp(lp, `g`), Wre = `^(${lp})+$`, dp = new RegExp(Wre);
function fp(e206) {
  let t10 = [];
  if (dp.test(e206)) {
    let n10 = up.exec(e206);
    for (; n10?.length; ) {
      let r10 = n10[1].trim();
      r10 && t10.push(r10), n10 = up.exec(e206);
    }
  }
  return y(t10);
}
function Gre(e206) {
  switch (Array.isArray(e206) ? e206[0] : e206) {
    case `boolean`:
      return false;
    case `integer`:
    case `number`:
      return 0;
    case `string`:
      return ``;
    case `array`:
      return [];
    case `object`:
      return {};
    default:
      return null;
  }
}
var pp = new Ure();
cd.add(op.Configuration, pp);
function Kre(e206, t10, n10) {
  return e206.trim() ? dp.test(e206) ? C(1671, `Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.`, e206) : pp.getConfigurationProperties()[e206] !== void 0 && (!n10 || !qre.has(n10.toLowerCase())) ? C(1672, `Cannot register '{0}'. This property is already registered.`, e206) : t10.policy?.name && pp.getPolicyConfigurations().get(t10.policy?.name) !== void 0 ? C(1673, `Cannot register '{0}'. The associated policy {1} is already registered with {2}.`, e206, t10.policy?.name, pp.getPolicyConfigurations().get(t10.policy?.name)) : null : C(1670, `Cannot register an empty property`);
}
var qre = new Set(ap.defaultChatAgent ? [ap.defaultChatAgent.extensionId, ap.defaultChatAgent.chatExtensionId].map((e206) => e206.toLowerCase()) : []), Jre = { ModesRegistry: `editor.modesRegistry` }, mp = new class extends D {
  constructor() {
    super(), this._onDidChangeLanguages = this._register(new k()), this.onDidChangeLanguages = this._onDidChangeLanguages.event, this._languages = [];
  }
  registerLanguage(e206) {
    return this._languages.push(e206), this._onDidChangeLanguages.fire(void 0), { dispose: () => {
      for (let t10 = 0, n10 = this._languages.length; t10 < n10; t10++) if (this._languages[t10] === e206) {
        this._languages.splice(t10, 1);
        return;
      }
    } };
  }
  getLanguages() {
    return this._languages;
  }
}();
cd.add(Jre.ModesRegistry, mp);
var hp = `plaintext`;
mp.registerLanguage({ id: hp, extensions: [`.txt`], aliases: [C(784, `Plain Text`), `text`], mimetypes: [$f.text] }), cd.as(op.Configuration).registerDefaultConfigurations([{ overrides: { "[plaintext]": { "editor.unicodeHighlight.ambiguousCharacters": false, "editor.unicodeHighlight.invisibleCharacters": false }, "[go]": { "editor.insertSpaces": false }, "[makefile]": { "editor.insertSpaces": false }, "[shellscript]": { "files.eol": `
` }, "[yaml]": { "editor.insertSpaces": true, "editor.tabSize": 2 } } }]);
var Yre = class {
  constructor(e206, t10) {
    this.languageId = e206;
    let n10 = t10.brackets ? gp(t10.brackets) : [], r10 = new Na((e207) => {
      let t11 = /* @__PURE__ */ new Set();
      return { info: new Xre(this, e207, t11), closing: t11 };
    }), i10 = new Na((e207) => {
      let t11 = /* @__PURE__ */ new Set(), n11 = /* @__PURE__ */ new Set();
      return { info: new Zre(this, e207, t11, n11), opening: t11, openingColorized: n11 };
    });
    for (let [e207, t11] of n10) {
      let n11 = r10.get(e207), a11 = i10.get(t11);
      n11.closing.add(a11.info), a11.opening.add(n11.info);
    }
    let a10 = t10.colorizedBracketPairs ? gp(t10.colorizedBracketPairs) : n10.filter((e207) => !(e207[0] === `<` && e207[1] === `>`));
    for (let [e207, t11] of a10) {
      let n11 = r10.get(e207), a11 = i10.get(t11);
      n11.closing.add(a11.info), a11.openingColorized.add(n11.info), a11.opening.add(n11.info);
    }
    this._openingBrackets = new Map([...r10.cachedValues].map(([e207, t11]) => [e207, t11.info])), this._closingBrackets = new Map([...i10.cachedValues].map(([e207, t11]) => [e207, t11.info]));
  }
  get openingBrackets() {
    return [...this._openingBrackets.values()];
  }
  get closingBrackets() {
    return [...this._closingBrackets.values()];
  }
  getOpeningBracketInfo(e206) {
    return this._openingBrackets.get(e206);
  }
  getClosingBracketInfo(e206) {
    return this._closingBrackets.get(e206);
  }
  getBracketInfo(e206) {
    return this.getOpeningBracketInfo(e206) || this.getClosingBracketInfo(e206);
  }
  getBracketRegExp(e206) {
    return zf(Array.from([...this._openingBrackets.keys(), ...this._closingBrackets.keys()]), e206);
  }
};
function gp(e206) {
  return e206.filter(([e207, t10]) => e207 !== `` && t10 !== ``);
}
var _p2 = class {
  constructor(e206, t10) {
    this.config = e206, this.bracketText = t10;
  }
  get languageId() {
    return this.config.languageId;
  }
}, Xre = class extends _p2 {
  constructor(e206, t10, n10) {
    super(e206, t10), this.openedBrackets = n10, this.isOpeningBracket = true;
  }
}, Zre = class extends _p2 {
  constructor(e206, t10, n10, r10) {
    super(e206, t10), this.openingBrackets = n10, this.openingColorizedBrackets = r10, this.isOpeningBracket = false;
  }
  closes(e206) {
    return e206.config === this.config ? this.openingBrackets.has(e206) : false;
  }
  closesColorized(e206) {
    return e206.config === this.config ? this.openingColorizedBrackets.has(e206) : false;
  }
  getOpeningBrackets() {
    return [...this.openingBrackets];
  }
}, Qre = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, vp = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, yp = class {
  constructor(e206) {
    this.languageId = e206;
  }
  affects(e206) {
    return this.languageId ? this.languageId === e206 : true;
  }
}, bp = xu(`languageConfigurationService`), xp = class extends D {
  constructor(e206, t10) {
    super(), this.configurationService = e206, this.languageService = t10, this._registry = this._register(new nie()), this.onDidChangeEmitter = this._register(new k()), this.onDidChange = this.onDidChangeEmitter.event, this.configurations = /* @__PURE__ */ new Map();
    let n10 = new Set(Object.values(Sp));
    this._register(this.configurationService.onDidChangeConfiguration((e207) => {
      let t11 = e207.change.keys.some((e208) => n10.has(e208)), r10 = e207.change.overrides.filter(([e208, t12]) => t12.some((e209) => n10.has(e209))).map(([e208]) => e208);
      if (t11) this.configurations.clear(), this.onDidChangeEmitter.fire(new yp(void 0));
      else for (let e208 of r10) this.languageService.isRegisteredLanguageId(e208) && (this.configurations.delete(e208), this.onDidChangeEmitter.fire(new yp(e208)));
    })), this._register(this._registry.onDidChange((e207) => {
      this.configurations.delete(e207.languageId), this.onDidChangeEmitter.fire(new yp(e207.languageId));
    }));
  }
  register(e206, t10, n10) {
    return this._registry.register(e206, t10, n10);
  }
  getLanguageConfiguration(e206) {
    let t10 = this.configurations.get(e206);
    return t10 || (t10 = $re(e206, this._registry, this.configurationService, this.languageService), this.configurations.set(e206, t10)), t10;
  }
};
xp = Qre([vp(0, Uf), vp(1, Jf)], xp);
function $re(e206, t10, n10, r10) {
  let i10 = t10.getLanguageConfiguration(e206);
  if (!i10) {
    if (!r10.isRegisteredLanguageId(e206)) return new Op(e206, {});
    i10 = new Op(e206, {});
  }
  let a10 = eie(i10.languageId, n10), o10 = Tp([i10.underlyingConfig, a10]);
  return new Op(i10.languageId, o10);
}
var Sp = { brackets: `editor.language.brackets`, colorizedBracketPairs: `editor.language.colorizedBracketPairs` };
function eie(e206, t10) {
  let n10 = t10.getValue(Sp.brackets, { overrideIdentifier: e206 }), r10 = t10.getValue(Sp.colorizedBracketPairs, { overrideIdentifier: e206 });
  return { brackets: Cp(n10), colorizedBracketPairs: Cp(r10) };
}
function Cp(e206) {
  if (Array.isArray(e206)) return e206.map((e207) => {
    if (!(!Array.isArray(e207) || e207.length !== 2)) return [e207[0], e207[1]];
  }).filter((e207) => !!e207);
}
function wp(e206, t10, n10) {
  let r10 = Ka(e206.getLineContent(t10));
  return r10.length > n10 - 1 && (r10 = r10.substring(0, n10 - 1)), r10;
}
var tie = class {
  constructor(e206) {
    this.languageId = e206, this._resolved = null, this._entries = [], this._order = 0, this._resolved = null;
  }
  register(e206, t10) {
    let n10 = new Ep(e206, t10, ++this._order);
    return this._entries.push(n10), this._resolved = null, Wt(T(() => {
      for (let e207 = 0; e207 < this._entries.length; e207++) if (this._entries[e207] === n10) {
        this._entries.splice(e207, 1), this._resolved = null;
        break;
      }
    }));
  }
  getResolvedConfiguration() {
    if (!this._resolved) {
      let e206 = this._resolve();
      e206 && (this._resolved = new Op(this.languageId, e206));
    }
    return this._resolved;
  }
  _resolve() {
    return this._entries.length === 0 ? null : (this._entries.sort(Ep.cmp), Tp(this._entries.map((e206) => e206.configuration)));
  }
};
function Tp(e206) {
  let t10 = { comments: void 0, brackets: void 0, wordPattern: void 0, indentationRules: void 0, onEnterRules: void 0, autoClosingPairs: void 0, surroundingPairs: void 0, autoCloseBefore: void 0, folding: void 0, colorizedBracketPairs: void 0, __electricCharacterSupport: void 0 };
  for (let n10 of e206) t10 = { comments: n10.comments || t10.comments, brackets: n10.brackets || t10.brackets, wordPattern: n10.wordPattern || t10.wordPattern, indentationRules: n10.indentationRules || t10.indentationRules, onEnterRules: n10.onEnterRules || t10.onEnterRules, autoClosingPairs: n10.autoClosingPairs || t10.autoClosingPairs, surroundingPairs: n10.surroundingPairs || t10.surroundingPairs, autoCloseBefore: n10.autoCloseBefore || t10.autoCloseBefore, folding: n10.folding || t10.folding, colorizedBracketPairs: n10.colorizedBracketPairs || t10.colorizedBracketPairs, __electricCharacterSupport: n10.__electricCharacterSupport || t10.__electricCharacterSupport };
  return t10;
}
var Ep = class {
  constructor(e206, t10, n10) {
    this.configuration = e206, this.priority = t10, this.order = n10;
  }
  static cmp(e206, t10) {
    return e206.priority === t10.priority ? e206.order - t10.order : e206.priority - t10.priority;
  }
}, Dp = class {
  constructor(e206) {
    this.languageId = e206;
  }
}, nie = class extends D {
  constructor() {
    super(), this._entries = /* @__PURE__ */ new Map(), this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, this._register(this.register(hp, { brackets: [[`(`, `)`], [`[`, `]`], [`{`, `}`]], surroundingPairs: [{ open: `{`, close: `}` }, { open: `[`, close: `]` }, { open: `(`, close: `)` }, { open: `<`, close: `>` }, { open: `"`, close: `"` }, { open: `'`, close: `'` }, { open: "`", close: "`" }], colorizedBracketPairs: [], folding: { offSide: true } }, 0));
  }
  register(e206, t10, n10 = 0) {
    let r10 = this._entries.get(e206);
    r10 || (r10 = new tie(e206), this._entries.set(e206, r10));
    let i10 = r10.register(t10, n10);
    return this._onDidChange.fire(new Dp(e206)), Wt(T(() => {
      i10.dispose(), this._onDidChange.fire(new Dp(e206));
    }));
  }
  getLanguageConfiguration(e206) {
    return this._entries.get(e206)?.getResolvedConfiguration() || null;
  }
}, Op = class e45 {
  constructor(t10, n10) {
    this.languageId = t10, this.underlyingConfig = n10, this._brackets = null, this._electricCharacter = null, this._onEnterSupport = this.underlyingConfig.brackets || this.underlyingConfig.indentationRules || this.underlyingConfig.onEnterRules ? new Bre(this.underlyingConfig) : null, this.comments = e45._handleComments(this.underlyingConfig), this.characterPair = new Tf(this.underlyingConfig), this.wordDefinition = this.underlyingConfig.wordPattern || xn, this.indentationRules = this.underlyingConfig.indentationRules, this.underlyingConfig.indentationRules ? this.indentRulesSupport = new zre(this.underlyingConfig.indentationRules) : this.indentRulesSupport = null, this.foldingRules = this.underlyingConfig.folding || {}, this.bracketsNew = new Yre(t10, this.underlyingConfig);
  }
  getWordDefinition() {
    return Sn(this.wordDefinition);
  }
  get brackets() {
    return !this._brackets && this.underlyingConfig.brackets && (this._brackets = new Mre(this.languageId, this.underlyingConfig.brackets)), this._brackets;
  }
  get electricCharacter() {
    return this._electricCharacter || (this._electricCharacter = new Rre(this.brackets)), this._electricCharacter;
  }
  onEnter(e206, t10, n10, r10) {
    return this._onEnterSupport ? this._onEnterSupport.onEnter(e206, t10, n10, r10) : null;
  }
  getAutoClosingPairs() {
    return new Cf(this.characterPair.getAutoClosingPairs());
  }
  getAutoCloseBeforeSet(e206) {
    return this.characterPair.getAutoCloseBeforeSet(e206);
  }
  getSurroundingPairs() {
    return this.characterPair.getSurroundingPairs();
  }
  static _handleComments(e206) {
    let t10 = e206.comments;
    if (!t10) return null;
    let n10 = {};
    if (t10.lineComment && (typeof t10.lineComment == `string` ? n10.lineCommentToken = t10.lineComment : (n10.lineCommentToken = t10.lineComment.comment, n10.lineCommentNoIndent = t10.lineComment.noIndent)), t10.blockComment) {
      let [e207, r10] = t10.blockComment;
      n10.blockCommentStartToken = e207, n10.blockCommentEndToken = r10;
    }
    return n10;
  }
};
Zf(bp, xp, 1);
var kp = class {
  constructor(e206, t10, n10, r10) {
    this.originalStart = e206, this.originalLength = t10, this.modifiedStart = n10, this.modifiedLength = r10;
  }
  getOriginalEnd() {
    return this.originalStart + this.originalLength;
  }
  getModifiedEnd() {
    return this.modifiedStart + this.modifiedLength;
  }
}, Ap = class {
  constructor(e206) {
    this.source = e206;
  }
  getElements() {
    let e206 = this.source, t10 = new Int32Array(e206.length);
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) t10[n10] = e206.charCodeAt(n10);
    return t10;
  }
};
function rie(e206, t10, n10) {
  return new Pp(new Ap(e206), new Ap(t10)).ComputeDiff(n10).changes;
}
var jp = class {
  static Assert(e206, t10) {
    if (!e206) throw Error(t10);
  }
}, Mp = class {
  static Copy(e206, t10, n10, r10, i10) {
    for (let a10 = 0; a10 < i10; a10++) n10[r10 + a10] = e206[t10 + a10];
  }
  static Copy2(e206, t10, n10, r10, i10) {
    for (let a10 = 0; a10 < i10; a10++) n10[r10 + a10] = e206[t10 + a10];
  }
}, Np = class {
  constructor() {
    this.m_changes = [], this.m_originalStart = 1073741824, this.m_modifiedStart = 1073741824, this.m_originalCount = 0, this.m_modifiedCount = 0;
  }
  MarkNextChange() {
    (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.m_changes.push(new kp(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)), this.m_originalCount = 0, this.m_modifiedCount = 0, this.m_originalStart = 1073741824, this.m_modifiedStart = 1073741824;
  }
  AddOriginalElement(e206, t10) {
    this.m_originalStart = Math.min(this.m_originalStart, e206), this.m_modifiedStart = Math.min(this.m_modifiedStart, t10), this.m_originalCount++;
  }
  AddModifiedElement(e206, t10) {
    this.m_originalStart = Math.min(this.m_originalStart, e206), this.m_modifiedStart = Math.min(this.m_modifiedStart, t10), this.m_modifiedCount++;
  }
  getChanges() {
    return (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.MarkNextChange(), this.m_changes;
  }
  getReverseChanges() {
    return (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.MarkNextChange(), this.m_changes.reverse(), this.m_changes;
  }
}, Pp = class e46 {
  constructor(t10, n10, r10 = null) {
    this.ContinueProcessingPredicate = r10, this._originalSequence = t10, this._modifiedSequence = n10;
    let [i10, a10, o10] = e46._getElements(t10), [s10, c10, l10] = e46._getElements(n10);
    this._hasStrings = o10 && l10, this._originalStringElements = i10, this._originalElementsOrHash = a10, this._modifiedStringElements = s10, this._modifiedElementsOrHash = c10, this.m_forwardHistory = [], this.m_reverseHistory = [];
  }
  static _isStringArray(e206) {
    return e206.length > 0 && typeof e206[0] == `string`;
  }
  static _getElements(t10) {
    let n10 = t10.getElements();
    if (e46._isStringArray(n10)) {
      let e206 = new Int32Array(n10.length);
      for (let t11 = 0, r10 = n10.length; t11 < r10; t11++) e206[t11] = zs(n10[t11], 0);
      return [n10, e206, true];
    }
    return n10 instanceof Int32Array ? [[], n10, false] : [[], new Int32Array(n10), false];
  }
  ElementsAreEqual(e206, t10) {
    return this._originalElementsOrHash[e206] === this._modifiedElementsOrHash[t10] ? this._hasStrings ? this._originalStringElements[e206] === this._modifiedStringElements[t10] : true : false;
  }
  ElementsAreStrictEqual(t10, n10) {
    return this.ElementsAreEqual(t10, n10) ? e46._getStrictElement(this._originalSequence, t10) === e46._getStrictElement(this._modifiedSequence, n10) : false;
  }
  static _getStrictElement(e206, t10) {
    return typeof e206.getStrictElement == `function` ? e206.getStrictElement(t10) : null;
  }
  OriginalElementsAreEqual(e206, t10) {
    return this._originalElementsOrHash[e206] === this._originalElementsOrHash[t10] ? this._hasStrings ? this._originalStringElements[e206] === this._originalStringElements[t10] : true : false;
  }
  ModifiedElementsAreEqual(e206, t10) {
    return this._modifiedElementsOrHash[e206] === this._modifiedElementsOrHash[t10] ? this._hasStrings ? this._modifiedStringElements[e206] === this._modifiedStringElements[t10] : true : false;
  }
  ComputeDiff(e206) {
    return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, e206);
  }
  _ComputeDiff(e206, t10, n10, r10, i10) {
    let a10 = [false], o10 = this.ComputeDiffRecursive(e206, t10, n10, r10, a10);
    return i10 && (o10 = this.PrettifyChanges(o10)), { quitEarly: a10[0], changes: o10 };
  }
  ComputeDiffRecursive(e206, t10, n10, r10, i10) {
    for (i10[0] = false; e206 <= t10 && n10 <= r10 && this.ElementsAreEqual(e206, n10); ) e206++, n10++;
    for (; t10 >= e206 && r10 >= n10 && this.ElementsAreEqual(t10, r10); ) t10--, r10--;
    if (e206 > t10 || n10 > r10) {
      let i11;
      return n10 <= r10 ? (jp.Assert(e206 === t10 + 1, `originalStart should only be one more than originalEnd`), i11 = [new kp(e206, 0, n10, r10 - n10 + 1)]) : e206 <= t10 ? (jp.Assert(n10 === r10 + 1, `modifiedStart should only be one more than modifiedEnd`), i11 = [new kp(e206, t10 - e206 + 1, n10, 0)]) : (jp.Assert(e206 === t10 + 1, `originalStart should only be one more than originalEnd`), jp.Assert(n10 === r10 + 1, `modifiedStart should only be one more than modifiedEnd`), i11 = []), i11;
    }
    let a10 = [0], o10 = [0], s10 = this.ComputeRecursionPoint(e206, t10, n10, r10, a10, o10, i10), c10 = a10[0], l10 = o10[0];
    if (s10 !== null) return s10;
    if (!i10[0]) {
      let a11 = this.ComputeDiffRecursive(e206, c10, n10, l10, i10), o11 = [];
      return o11 = i10[0] ? [new kp(c10 + 1, t10 - (c10 + 1) + 1, l10 + 1, r10 - (l10 + 1) + 1)] : this.ComputeDiffRecursive(c10 + 1, t10, l10 + 1, r10, i10), this.ConcatenateChanges(a11, o11);
    }
    return [new kp(e206, t10 - e206 + 1, n10, r10 - n10 + 1)];
  }
  WALKTRACE(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10, p10, m10, h10, g10, _10) {
    let v10 = null, y10 = null, b10 = new Np(), x10 = t10, S10 = n10, ee2 = f10[0] - h10[0] - r10, te2 = -1073741824, ne2 = this.m_forwardHistory.length - 1;
    do {
      let t11 = ee2 + e206;
      t11 === x10 || t11 < S10 && c10[t11 - 1] < c10[t11 + 1] ? (u10 = c10[t11 + 1], p10 = u10 - ee2 - r10, u10 < te2 && b10.MarkNextChange(), te2 = u10, b10.AddModifiedElement(u10 + 1, p10), ee2 = t11 + 1 - e206) : (u10 = c10[t11 - 1] + 1, p10 = u10 - ee2 - r10, u10 < te2 && b10.MarkNextChange(), te2 = u10 - 1, b10.AddOriginalElement(u10, p10 + 1), ee2 = t11 - 1 - e206), ne2 >= 0 && (c10 = this.m_forwardHistory[ne2], e206 = c10[0], x10 = 1, S10 = c10.length - 1);
    } while (--ne2 >= -1);
    if (v10 = b10.getReverseChanges(), _10[0]) {
      let e207 = f10[0] + 1, t11 = h10[0] + 1;
      if (v10 !== null && v10.length > 0) {
        let n11 = v10[v10.length - 1];
        e207 = Math.max(e207, n11.getOriginalEnd()), t11 = Math.max(t11, n11.getModifiedEnd());
      }
      y10 = [new kp(e207, d10 - e207 + 1, t11, m10 - t11 + 1)];
    } else {
      b10 = new Np(), x10 = a10, S10 = o10, ee2 = f10[0] - h10[0] - s10, te2 = 1073741824, ne2 = g10 ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
      do {
        let e207 = ee2 + i10;
        e207 === x10 || e207 < S10 && l10[e207 - 1] >= l10[e207 + 1] ? (u10 = l10[e207 + 1] - 1, p10 = u10 - ee2 - s10, u10 > te2 && b10.MarkNextChange(), te2 = u10 + 1, b10.AddOriginalElement(u10 + 1, p10 + 1), ee2 = e207 + 1 - i10) : (u10 = l10[e207 - 1], p10 = u10 - ee2 - s10, u10 > te2 && b10.MarkNextChange(), te2 = u10, b10.AddModifiedElement(u10 + 1, p10 + 1), ee2 = e207 - 1 - i10), ne2 >= 0 && (l10 = this.m_reverseHistory[ne2], i10 = l10[0], x10 = 1, S10 = l10.length - 1);
      } while (--ne2 >= -1);
      y10 = b10.getChanges();
    }
    return this.ConcatenateChanges(v10, y10);
  }
  ComputeRecursionPoint(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = 0, c10 = 0, l10 = 0, u10 = 0, d10 = 0, f10 = 0;
    e206--, n10--, i10[0] = 0, a10[0] = 0, this.m_forwardHistory = [], this.m_reverseHistory = [];
    let p10 = t10 - e206 + (r10 - n10), m10 = p10 + 1, h10 = new Int32Array(m10), g10 = new Int32Array(m10), _10 = r10 - n10, v10 = t10 - e206, y10 = e206 - n10, b10 = t10 - r10, x10 = (v10 - _10) % 2 == 0;
    h10[_10] = e206, g10[v10] = t10, o10[0] = false;
    for (let S10 = 1; S10 <= p10 / 2 + 1; S10++) {
      let p11 = 0, ee2 = 0;
      l10 = this.ClipDiagonalBound(_10 - S10, S10, _10, m10), u10 = this.ClipDiagonalBound(_10 + S10, S10, _10, m10);
      for (let e207 = l10; e207 <= u10; e207 += 2) {
        s10 = e207 === l10 || e207 < u10 && h10[e207 - 1] < h10[e207 + 1] ? h10[e207 + 1] : h10[e207 - 1] + 1, c10 = s10 - (e207 - _10) - y10;
        let n11 = s10;
        for (; s10 < t10 && c10 < r10 && this.ElementsAreEqual(s10 + 1, c10 + 1); ) s10++, c10++;
        if (h10[e207] = s10, s10 + c10 > p11 + ee2 && (p11 = s10, ee2 = c10), !x10 && Math.abs(e207 - v10) <= S10 - 1 && s10 >= g10[e207]) return i10[0] = s10, a10[0] = c10, n11 <= g10[e207] && S10 <= 1448 ? this.WALKTRACE(_10, l10, u10, y10, v10, d10, f10, b10, h10, g10, s10, t10, i10, c10, r10, a10, x10, o10) : null;
      }
      let te2 = (p11 - e206 + (ee2 - n10) - S10) / 2;
      if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(p11, te2)) return o10[0] = true, i10[0] = p11, a10[0] = ee2, te2 > 0 && S10 <= 1448 ? this.WALKTRACE(_10, l10, u10, y10, v10, d10, f10, b10, h10, g10, s10, t10, i10, c10, r10, a10, x10, o10) : (e206++, n10++, [new kp(e206, t10 - e206 + 1, n10, r10 - n10 + 1)]);
      d10 = this.ClipDiagonalBound(v10 - S10, S10, v10, m10), f10 = this.ClipDiagonalBound(v10 + S10, S10, v10, m10);
      for (let p12 = d10; p12 <= f10; p12 += 2) {
        s10 = p12 === d10 || p12 < f10 && g10[p12 - 1] >= g10[p12 + 1] ? g10[p12 + 1] - 1 : g10[p12 - 1], c10 = s10 - (p12 - v10) - b10;
        let m11 = s10;
        for (; s10 > e206 && c10 > n10 && this.ElementsAreEqual(s10, c10); ) s10--, c10--;
        if (g10[p12] = s10, x10 && Math.abs(p12 - _10) <= S10 && s10 <= h10[p12]) return i10[0] = s10, a10[0] = c10, m11 >= h10[p12] && S10 <= 1448 ? this.WALKTRACE(_10, l10, u10, y10, v10, d10, f10, b10, h10, g10, s10, t10, i10, c10, r10, a10, x10, o10) : null;
      }
      if (S10 <= 1447) {
        let e207 = new Int32Array(u10 - l10 + 2);
        e207[0] = _10 - l10 + 1, Mp.Copy2(h10, l10, e207, 1, u10 - l10 + 1), this.m_forwardHistory.push(e207), e207 = new Int32Array(f10 - d10 + 2), e207[0] = v10 - d10 + 1, Mp.Copy2(g10, d10, e207, 1, f10 - d10 + 1), this.m_reverseHistory.push(e207);
      }
    }
    return this.WALKTRACE(_10, l10, u10, y10, v10, d10, f10, b10, h10, g10, s10, t10, i10, c10, r10, a10, x10, o10);
  }
  PrettifyChanges(e206) {
    for (let t10 = 0; t10 < e206.length; t10++) {
      let n10 = e206[t10], r10 = t10 < e206.length - 1 ? e206[t10 + 1].originalStart : this._originalElementsOrHash.length, i10 = t10 < e206.length - 1 ? e206[t10 + 1].modifiedStart : this._modifiedElementsOrHash.length, a10 = n10.originalLength > 0, o10 = n10.modifiedLength > 0;
      for (; n10.originalStart + n10.originalLength < r10 && n10.modifiedStart + n10.modifiedLength < i10 && (!a10 || this.OriginalElementsAreEqual(n10.originalStart, n10.originalStart + n10.originalLength)) && (!o10 || this.ModifiedElementsAreEqual(n10.modifiedStart, n10.modifiedStart + n10.modifiedLength)); ) {
        let e207 = this.ElementsAreStrictEqual(n10.originalStart, n10.modifiedStart);
        if (this.ElementsAreStrictEqual(n10.originalStart + n10.originalLength, n10.modifiedStart + n10.modifiedLength) && !e207) break;
        n10.originalStart++, n10.modifiedStart++;
      }
      let s10 = [null];
      if (t10 < e206.length - 1 && this.ChangesOverlap(e206[t10], e206[t10 + 1], s10)) {
        e206[t10] = s10[0], e206.splice(t10 + 1, 1), t10--;
        continue;
      }
    }
    for (let t10 = e206.length - 1; t10 >= 0; t10--) {
      let n10 = e206[t10], r10 = 0, i10 = 0;
      if (t10 > 0) {
        let n11 = e206[t10 - 1];
        r10 = n11.originalStart + n11.originalLength, i10 = n11.modifiedStart + n11.modifiedLength;
      }
      let a10 = n10.originalLength > 0, o10 = n10.modifiedLength > 0, s10 = 0, c10 = this._boundaryScore(n10.originalStart, n10.originalLength, n10.modifiedStart, n10.modifiedLength);
      for (let e207 = 1; ; e207++) {
        let t11 = n10.originalStart - e207, l11 = n10.modifiedStart - e207;
        if (t11 < r10 || l11 < i10 || a10 && !this.OriginalElementsAreEqual(t11, t11 + n10.originalLength) || o10 && !this.ModifiedElementsAreEqual(l11, l11 + n10.modifiedLength)) break;
        let u10 = (t11 === r10 && l11 === i10 ? 5 : 0) + this._boundaryScore(t11, n10.originalLength, l11, n10.modifiedLength);
        u10 > c10 && (c10 = u10, s10 = e207);
      }
      n10.originalStart -= s10, n10.modifiedStart -= s10;
      let l10 = [null];
      if (t10 > 0 && this.ChangesOverlap(e206[t10 - 1], e206[t10], l10)) {
        e206[t10 - 1] = l10[0], e206.splice(t10, 1), t10++;
        continue;
      }
    }
    if (this._hasStrings) for (let t10 = 1, n10 = e206.length; t10 < n10; t10++) {
      let n11 = e206[t10 - 1], r10 = e206[t10], i10 = r10.originalStart - n11.originalStart - n11.originalLength, a10 = n11.originalStart, o10 = r10.originalStart + r10.originalLength, s10 = o10 - a10, c10 = n11.modifiedStart, l10 = r10.modifiedStart + r10.modifiedLength, u10 = l10 - c10;
      if (i10 < 5 && s10 < 20 && u10 < 20) {
        let e207 = this._findBetterContiguousSequence(a10, s10, c10, u10, i10);
        if (e207) {
          let [t11, a11] = e207;
          (t11 !== n11.originalStart + n11.originalLength || a11 !== n11.modifiedStart + n11.modifiedLength) && (n11.originalLength = t11 - n11.originalStart, n11.modifiedLength = a11 - n11.modifiedStart, r10.originalStart = t11 + i10, r10.modifiedStart = a11 + i10, r10.originalLength = o10 - r10.originalStart, r10.modifiedLength = l10 - r10.modifiedStart);
        }
      }
    }
    return e206;
  }
  _findBetterContiguousSequence(e206, t10, n10, r10, i10) {
    if (t10 < i10 || r10 < i10) return null;
    let a10 = e206 + t10 - i10 + 1, o10 = n10 + r10 - i10 + 1, s10 = 0, c10 = 0, l10 = 0;
    for (let t11 = e206; t11 < a10; t11++) for (let e207 = n10; e207 < o10; e207++) {
      let n11 = this._contiguousSequenceScore(t11, e207, i10);
      n11 > 0 && n11 > s10 && (s10 = n11, c10 = t11, l10 = e207);
    }
    return s10 > 0 ? [c10, l10] : null;
  }
  _contiguousSequenceScore(e206, t10, n10) {
    let r10 = 0;
    for (let i10 = 0; i10 < n10; i10++) {
      if (!this.ElementsAreEqual(e206 + i10, t10 + i10)) return 0;
      r10 += this._originalStringElements[e206 + i10].length;
    }
    return r10;
  }
  _OriginalIsBoundary(e206) {
    return e206 <= 0 || e206 >= this._originalElementsOrHash.length - 1 ? true : this._hasStrings && /^\s*$/.test(this._originalStringElements[e206]);
  }
  _OriginalRegionIsBoundary(e206, t10) {
    if (this._OriginalIsBoundary(e206) || this._OriginalIsBoundary(e206 - 1)) return true;
    if (t10 > 0) {
      let n10 = e206 + t10;
      if (this._OriginalIsBoundary(n10 - 1) || this._OriginalIsBoundary(n10)) return true;
    }
    return false;
  }
  _ModifiedIsBoundary(e206) {
    return e206 <= 0 || e206 >= this._modifiedElementsOrHash.length - 1 ? true : this._hasStrings && /^\s*$/.test(this._modifiedStringElements[e206]);
  }
  _ModifiedRegionIsBoundary(e206, t10) {
    if (this._ModifiedIsBoundary(e206) || this._ModifiedIsBoundary(e206 - 1)) return true;
    if (t10 > 0) {
      let n10 = e206 + t10;
      if (this._ModifiedIsBoundary(n10 - 1) || this._ModifiedIsBoundary(n10)) return true;
    }
    return false;
  }
  _boundaryScore(e206, t10, n10, r10) {
    return +!!this._OriginalRegionIsBoundary(e206, t10) + +!!this._ModifiedRegionIsBoundary(n10, r10);
  }
  ConcatenateChanges(e206, t10) {
    let n10 = [];
    if (e206.length === 0 || t10.length === 0) return t10.length > 0 ? t10 : e206;
    if (this.ChangesOverlap(e206[e206.length - 1], t10[0], n10)) {
      let r10 = Array(e206.length + t10.length - 1);
      return Mp.Copy(e206, 0, r10, 0, e206.length - 1), r10[e206.length - 1] = n10[0], Mp.Copy(t10, 1, r10, e206.length, t10.length - 1), r10;
    } else {
      let n11 = Array(e206.length + t10.length);
      return Mp.Copy(e206, 0, n11, 0, e206.length), Mp.Copy(t10, 0, n11, e206.length, t10.length), n11;
    }
  }
  ChangesOverlap(e206, t10, n10) {
    if (jp.Assert(e206.originalStart <= t10.originalStart, `Left change is not less than or equal to right change`), jp.Assert(e206.modifiedStart <= t10.modifiedStart, `Left change is not less than or equal to right change`), e206.originalStart + e206.originalLength >= t10.originalStart || e206.modifiedStart + e206.modifiedLength >= t10.modifiedStart) {
      let r10 = e206.originalStart, i10 = e206.originalLength, a10 = e206.modifiedStart, o10 = e206.modifiedLength;
      return e206.originalStart + e206.originalLength >= t10.originalStart && (i10 = t10.originalStart + t10.originalLength - e206.originalStart), e206.modifiedStart + e206.modifiedLength >= t10.modifiedStart && (o10 = t10.modifiedStart + t10.modifiedLength - e206.modifiedStart), n10[0] = new kp(r10, i10, a10, o10), true;
    } else return n10[0] = null, false;
  }
  ClipDiagonalBound(e206, t10, n10, r10) {
    if (e206 >= 0 && e206 < r10) return e206;
    let i10 = n10, a10 = r10 - n10 - 1, o10 = t10 % 2 == 0;
    return e206 < 0 ? o10 === (i10 % 2 == 0) ? 0 : 1 : o10 === (a10 % 2 == 0) ? r10 - 1 : r10 - 2;
  }
};
function Fp(e206) {
  return e206 < 0 ? 0 : e206 > 255 ? 255 : e206 | 0;
}
function Ip(e206) {
  return e206 < 0 ? 0 : e206 > 4294967295 ? 4294967295 : e206 | 0;
}
var Lp = class e47 {
  constructor(t10) {
    let n10 = Fp(t10);
    this._defaultValue = n10, this._asciiMap = e47._createAsciiMap(n10), this._map = /* @__PURE__ */ new Map();
  }
  static _createAsciiMap(e206) {
    let t10 = new Uint8Array(256);
    return t10.fill(e206), t10;
  }
  set(e206, t10) {
    let n10 = Fp(t10);
    e206 >= 0 && e206 < 256 ? this._asciiMap[e206] = n10 : this._map.set(e206, n10);
  }
  get(e206) {
    return e206 >= 0 && e206 < 256 ? this._asciiMap[e206] : this._map.get(e206) || this._defaultValue;
  }
  clear() {
    this._asciiMap.fill(this._defaultValue), this._map.clear();
  }
}, Rp = class {
  constructor() {
    this._actual = new Lp(0);
  }
  add(e206) {
    this._actual.set(e206, 1);
  }
  has(e206) {
    return this._actual.get(e206) === 1;
  }
  clear() {
    return this._actual.clear();
  }
}, zp = class {
  constructor(e206, t10, n10) {
    let r10 = new Uint8Array(e206 * t10);
    for (let i10 = 0, a10 = e206 * t10; i10 < a10; i10++) r10[i10] = n10;
    this._data = r10, this.rows = e206, this.cols = t10;
  }
  get(e206, t10) {
    return this._data[e206 * this.cols + t10];
  }
  set(e206, t10, n10) {
    this._data[e206 * this.cols + t10] = n10;
  }
}, Bp = class {
  constructor(e206) {
    let t10 = 0, n10 = 0;
    for (let r11 = 0, i10 = e206.length; r11 < i10; r11++) {
      let [i11, a10, o10] = e206[r11];
      a10 > t10 && (t10 = a10), i11 > n10 && (n10 = i11), o10 > n10 && (n10 = o10);
    }
    t10++, n10++;
    let r10 = new zp(n10, t10, 0);
    for (let t11 = 0, n11 = e206.length; t11 < n11; t11++) {
      let [n12, i10, a10] = e206[t11];
      r10.set(n12, i10, a10);
    }
    this._states = r10, this._maxCharCode = t10;
  }
  nextState(e206, t10) {
    return t10 < 0 || t10 >= this._maxCharCode ? 0 : this._states.get(e206, t10);
  }
}, Vp = null;
function Hp() {
  return Vp === null && (Vp = new Bp([[1, 104, 2], [1, 72, 2], [1, 102, 6], [1, 70, 6], [2, 116, 3], [2, 84, 3], [3, 116, 4], [3, 84, 4], [4, 112, 5], [4, 80, 5], [5, 115, 9], [5, 83, 9], [5, 58, 10], [6, 105, 7], [6, 73, 7], [7, 108, 8], [7, 76, 8], [8, 101, 9], [8, 69, 9], [9, 58, 10], [10, 47, 11], [11, 47, 12]])), Vp;
}
var Up = null;
function Wp() {
  if (Up === null) {
    Up = new Lp(0);
    for (let e206 = 0; e206 < 36; e206++) Up.set(` 	<>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026|`.charCodeAt(e206), 1);
    for (let e206 = 0; e206 < 4; e206++) Up.set(`.,;:`.charCodeAt(e206), 2);
  }
  return Up;
}
var Gp = class e48 {
  static _createLink(e206, t10, n10, r10, i10) {
    let a10 = i10 - 1;
    do {
      let n11 = t10.charCodeAt(a10);
      if (e206.get(n11) !== 2) break;
      a10--;
    } while (a10 > r10);
    if (r10 > 0) {
      let e207 = t10.charCodeAt(r10 - 1), n11 = t10.charCodeAt(a10);
      (e207 === 40 && n11 === 41 || e207 === 91 && n11 === 93 || e207 === 123 && n11 === 125) && a10--;
    }
    return { range: { startLineNumber: n10, startColumn: r10 + 1, endLineNumber: n10, endColumn: a10 + 2 }, url: t10.substring(r10, a10 + 1) };
  }
  static computeLinks(t10, n10 = Hp()) {
    let r10 = Wp(), i10 = [];
    for (let a10 = 1, o10 = t10.getLineCount(); a10 <= o10; a10++) {
      let o11 = t10.getLineContent(a10), s10 = o11.length, c10 = 0, l10 = 0, u10 = 0, d10 = 1, f10 = false, p10 = false, m10 = false, h10 = false;
      for (; c10 < s10; ) {
        let t11 = false, s11 = o11.charCodeAt(c10);
        if (d10 === 13) {
          let n11;
          switch (s11) {
            case 40:
              f10 = true, n11 = 0;
              break;
            case 41:
              n11 = +!f10;
              break;
            case 91:
              m10 = true, p10 = true, n11 = 0;
              break;
            case 93:
              m10 = false, n11 = +!p10;
              break;
            case 123:
              h10 = true, n11 = 0;
              break;
            case 125:
              n11 = +!h10;
              break;
            case 39:
            case 34:
            case 96:
              n11 = u10 === s11 ? 1 : u10 === 39 || u10 === 34 || u10 === 96 ? 0 : 1;
              break;
            case 42:
              n11 = +(u10 === 42);
              break;
            case 32:
              n11 = +!m10;
              break;
            default:
              n11 = r10.get(s11);
          }
          n11 === 1 && (i10.push(e48._createLink(r10, o11, a10, l10, c10)), t11 = true);
        } else if (d10 === 12) {
          let e206;
          s11 === 91 ? (p10 = true, e206 = 0) : e206 = r10.get(s11), e206 === 1 ? t11 = true : d10 = 13;
        } else d10 = n10.nextState(d10, s11), d10 === 0 && (t11 = true);
        t11 && (d10 = 1, f10 = false, p10 = false, h10 = false, l10 = c10 + 1, u10 = s11), c10++;
      }
      d10 === 13 && i10.push(e48._createLink(r10, o11, a10, l10, s10));
    }
    return i10;
  }
};
function Kp(e206) {
  return !e206 || typeof e206.getLineCount != `function` || typeof e206.getLineContent != `function` ? [] : Gp.computeLinks(e206);
}
var qp = (_J = class {
  constructor() {
    this._defaultValueSet = [[`true`, `false`], [`True`, `False`], [`Private`, `Public`, `Friend`, `ReadOnly`, `Partial`, `Protected`, `WriteOnly`], [`public`, `protected`, `private`]];
  }
  navigateValueSet(e206, t10, n10, r10, i10) {
    if (e206 && t10) {
      let n11 = this.doNavigateValueSet(t10, i10);
      if (n11) return { range: e206, value: n11 };
    }
    if (n10 && r10) {
      let e207 = this.doNavigateValueSet(r10, i10);
      if (e207) return { range: n10, value: e207 };
    }
    return null;
  }
  doNavigateValueSet(e206, t10) {
    let n10 = this.numberReplace(e206, t10);
    return n10 === null ? this.textReplace(e206, t10) : n10;
  }
  numberReplace(e206, t10) {
    let n10 = 10 ** (e206.length - (e206.lastIndexOf(`.`) + 1)), r10 = Number(e206), i10 = parseFloat(e206);
    return !isNaN(r10) && !isNaN(i10) && r10 === i10 ? r10 === 0 && !t10 ? null : (r10 = Math.floor(r10 * n10), r10 += t10 ? n10 : -n10, String(r10 / n10)) : null;
  }
  textReplace(e206, t10) {
    return this.valueSetsReplace(this._defaultValueSet, e206, t10);
  }
  valueSetsReplace(e206, t10, n10) {
    let r10 = null;
    for (let i10 = 0, a10 = e206.length; r10 === null && i10 < a10; i10++) r10 = this.valueSetReplace(e206[i10], t10, n10);
    return r10;
  }
  valueSetReplace(e206, t10, n10) {
    let r10 = e206.indexOf(t10);
    return r10 >= 0 ? (r10 += n10 ? 1 : -1, r10 < 0 ? r10 = e206.length - 1 : r10 %= e206.length, e206[r10]) : null;
  }
}, _J.INSTANCE = new _J(), _J), Jp = { DateTimeFormat(e206, t10) {
  return new Fa(() => {
    try {
      return new Intl.DateTimeFormat(e206, t10);
    } catch {
      return new Intl.DateTimeFormat(void 0, t10);
    }
  });
}, Collator(e206, t10) {
  return new Fa(() => {
    try {
      return new Intl.Collator(e206, t10);
    } catch {
      return new Intl.Collator(void 0, t10);
    }
  });
}, Segmenter(e206, t10) {
  return new Fa(() => {
    try {
      return new Intl.Segmenter(e206, t10);
    } catch {
      return new Intl.Segmenter(void 0, t10);
    }
  });
}, Locale(e206, t10) {
  return new Fa(() => {
    try {
      return new Intl.Locale(e206, t10);
    } catch {
      return new Intl.Locale(`en`, t10);
    }
  });
}, NumberFormat(e206, t10) {
  return new Fa(() => {
    try {
      return new Intl.NumberFormat(e206, t10);
    } catch {
      return new Intl.NumberFormat(void 0, t10);
    }
  });
} }, Yp = class extends Lp {
  constructor(e206, t10) {
    super(0), this._segmenter = null, this._cachedLine = null, this._cachedSegments = [], this.intlSegmenterLocales = t10, this.intlSegmenterLocales.length > 0 ? this._segmenter = Jp.Segmenter(this.intlSegmenterLocales, { granularity: `word` }) : this._segmenter = null;
    for (let t11 = 0, n10 = e206.length; t11 < n10; t11++) this.set(e206.charCodeAt(t11), 2);
    this.set(32, 1), this.set(9, 1);
  }
  findPrevIntlWordBeforeOrAtOffset(e206, t10) {
    let n10 = null;
    for (let r10 of this._getIntlSegmenterWordsOnLine(e206)) {
      if (r10.index > t10) break;
      n10 = r10;
    }
    return n10;
  }
  findNextIntlWordAtOrAfterOffset(e206, t10) {
    for (let n10 of this._getIntlSegmenterWordsOnLine(e206)) if (!(n10.index < t10)) return n10;
    return null;
  }
  _getIntlSegmenterWordsOnLine(e206) {
    return this._segmenter ? this._cachedLine === e206 ? this._cachedSegments : (this._cachedLine = e206, this._cachedSegments = this._filterWordSegments(this._segmenter.value.segment(e206)), this._cachedSegments) : [];
  }
  _filterWordSegments(e206) {
    let t10 = [];
    for (let n10 of e206) this._isWordLike(n10) && t10.push(n10);
    return t10;
  }
  _isWordLike(e206) {
    return !!e206.isWordLike;
  }
}, Xp = new Td(10);
function Zp(e206, t10) {
  let n10 = `${e206}/${t10.join(`,`)}`, r10 = Xp.get(n10);
  return r10 || (r10 = new Yp(e206, t10), Xp.set(n10, r10)), r10;
}
var Qp;
(function(e206) {
  e206[e206.Left = 1] = `Left`, e206[e206.Center = 2] = `Center`, e206[e206.Right = 4] = `Right`, e206[e206.Full = 7] = `Full`;
})(Qp || (Qp = {}));
var $p;
(function(e206) {
  e206[e206.Left = 1] = `Left`, e206[e206.Center = 2] = `Center`, e206[e206.Right = 3] = `Right`;
})($p || ($p = {}));
var em;
(function(e206) {
  e206[e206.LTR = 0] = `LTR`, e206[e206.RTL = 1] = `RTL`;
})(em || (em = {}));
var tm;
(function(e206) {
  e206[e206.Both = 0] = `Both`, e206[e206.Right = 1] = `Right`, e206[e206.Left = 2] = `Left`, e206[e206.None = 3] = `None`;
})(tm || (tm = {}));
var nm = class {
  get originalIndentSize() {
    return this._indentSizeIsTabSize ? `tabSize` : this.indentSize;
  }
  constructor(e206) {
    this._textModelResolvedOptionsBrand = void 0, this.tabSize = Math.max(1, e206.tabSize | 0), e206.indentSize === `tabSize` ? (this.indentSize = this.tabSize, this._indentSizeIsTabSize = true) : (this.indentSize = Math.max(1, e206.indentSize | 0), this._indentSizeIsTabSize = false), this.insertSpaces = !!e206.insertSpaces, this.defaultEOL = e206.defaultEOL | 0, this.trimAutoWhitespace = !!e206.trimAutoWhitespace, this.bracketPairColorizationOptions = e206.bracketPairColorizationOptions;
  }
  equals(e206) {
    return this.tabSize === e206.tabSize && this._indentSizeIsTabSize === e206._indentSizeIsTabSize && this.indentSize === e206.indentSize && this.insertSpaces === e206.insertSpaces && this.defaultEOL === e206.defaultEOL && this.trimAutoWhitespace === e206.trimAutoWhitespace && ot(this.bracketPairColorizationOptions, e206.bracketPairColorizationOptions);
  }
  createChangeEvent(e206) {
    return { tabSize: this.tabSize !== e206.tabSize, indentSize: this.indentSize !== e206.indentSize, insertSpaces: this.insertSpaces !== e206.insertSpaces, trimAutoWhitespace: this.trimAutoWhitespace !== e206.trimAutoWhitespace };
  }
}, rm = class {
  constructor(e206, t10) {
    this._findMatchBrand = void 0, this.range = e206, this.matches = t10;
  }
};
function im(e206) {
  return !!e206 && typeof e206.read == `function`;
}
var am = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this.identifier = e206, this.range = t10, this.text = n10, this.forceMoveMarkers = r10, this.isAutoWhitespaceEdit = i10, this._isTracked = a10;
  }
}, om = class {
  constructor(e206, t10, n10) {
    this.regex = e206, this.wordSeparators = t10, this.simpleSearch = n10;
  }
}, sm = class {
  constructor(e206, t10, n10) {
    this.reverseEdits = e206, this.changes = t10, this.trimAutoWhitespaceLineNumbers = n10;
  }
};
function cm(e206) {
  return !e206.isTooLargeForSyncing() && !e206.isForSimpleWidget;
}
var lm = 999, um = class {
  constructor(e206, t10, n10, r10) {
    this.searchString = e206, this.isRegex = t10, this.matchCase = n10, this.wordSeparators = r10;
  }
  parseSearchRequest() {
    if (this.searchString === ``) return null;
    let e206;
    e206 = this.isRegex ? dm(this.searchString) : this.searchString.indexOf(`
`) >= 0;
    let t10 = null;
    try {
      t10 = Ha(this.searchString, this.isRegex, { matchCase: this.matchCase, wholeWord: false, multiline: e206, global: true, unicode: true });
    } catch {
      return null;
    }
    if (!t10) return null;
    let n10 = !this.isRegex && !e206;
    return n10 && this.searchString.toLowerCase() !== this.searchString.toUpperCase() && (n10 = this.matchCase), new om(t10, this.wordSeparators ? Zp(this.wordSeparators, []) : null, n10 ? this.searchString : null);
  }
};
function dm(e206) {
  if (!e206 || e206.length === 0) return false;
  for (let t10 = 0, n10 = e206.length; t10 < n10; t10++) {
    let r10 = e206.charCodeAt(t10);
    if (r10 === 10) return true;
    if (r10 === 92) {
      if (t10++, t10 >= n10) break;
      let r11 = e206.charCodeAt(t10);
      if (r11 === 110 || r11 === 114 || r11 === 87) return true;
    }
  }
  return false;
}
function fm(e206, t10, n10) {
  if (!n10) return new rm(e206, null);
  let r10 = [];
  for (let e207 = 0, n11 = t10.length; e207 < n11; e207++) r10[e207] = t10[e207];
  return new rm(e206, r10);
}
var pm = class {
  constructor(e206) {
    let t10 = [], n10 = 0;
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) e206.charCodeAt(r10) === 10 && (t10[n10++] = r10);
    this._lineFeedsOffsets = t10;
  }
  findLineFeedCountBeforeOffset(e206) {
    let t10 = this._lineFeedsOffsets, n10 = 0, r10 = t10.length - 1;
    if (r10 === -1 || e206 <= t10[0]) return 0;
    for (; n10 < r10; ) {
      let i10 = n10 + ((r10 - n10) / 2 >> 0);
      t10[i10] >= e206 ? r10 = i10 - 1 : t10[i10 + 1] >= e206 ? (n10 = i10, r10 = i10) : n10 = i10 + 1;
    }
    return n10 + 1;
  }
}, mm = class {
  static findMatches(e206, t10, n10, r10, i10) {
    let a10 = t10.parseSearchRequest();
    return a10 ? a10.regex.multiline ? this._doFindMatchesMultiline(e206, n10, new vm(a10.wordSeparators, a10.regex), r10, i10) : this._doFindMatchesLineByLine(e206, n10, a10, r10, i10) : [];
  }
  static _getMultilineMatchRange(e206, t10, n10, r10, i10, a10) {
    let o10, s10 = 0;
    r10 ? (s10 = r10.findLineFeedCountBeforeOffset(i10), o10 = t10 + i10 + s10) : o10 = t10 + i10;
    let c10;
    if (r10) {
      let e207 = r10.findLineFeedCountBeforeOffset(i10 + a10.length) - s10;
      c10 = o10 + a10.length + e207;
    } else c10 = o10 + a10.length;
    let l10 = e206.getPositionAt(o10), u10 = e206.getPositionAt(c10);
    return new M(l10.lineNumber, l10.column, u10.lineNumber, u10.column);
  }
  static _doFindMatchesMultiline(e206, t10, n10, r10, i10) {
    let a10 = e206.getOffsetAt(t10.getStartPosition()), o10 = e206.getValueInRange(t10, 1), s10 = e206.getEOL() === `\r
` ? new pm(o10) : null, c10 = [], l10 = 0, u10;
    for (n10.reset(0); u10 = n10.next(o10); ) if (c10[l10++] = fm(this._getMultilineMatchRange(e206, a10, o10, s10, u10.index, u10[0]), u10, r10), l10 >= i10) return c10;
    return c10;
  }
  static _doFindMatchesLineByLine(e206, t10, n10, r10, i10) {
    let a10 = [], o10 = 0;
    if (t10.startLineNumber === t10.endLineNumber) {
      let s11 = e206.getLineContent(t10.startLineNumber).substring(t10.startColumn - 1, t10.endColumn - 1);
      return o10 = this._findMatchesInLine(n10, s11, t10.startLineNumber, t10.startColumn - 1, o10, a10, r10, i10), a10;
    }
    let s10 = e206.getLineContent(t10.startLineNumber).substring(t10.startColumn - 1);
    o10 = this._findMatchesInLine(n10, s10, t10.startLineNumber, t10.startColumn - 1, o10, a10, r10, i10);
    for (let s11 = t10.startLineNumber + 1; s11 < t10.endLineNumber && o10 < i10; s11++) o10 = this._findMatchesInLine(n10, e206.getLineContent(s11), s11, 0, o10, a10, r10, i10);
    if (o10 < i10) {
      let s11 = e206.getLineContent(t10.endLineNumber).substring(0, t10.endColumn - 1);
      o10 = this._findMatchesInLine(n10, s11, t10.endLineNumber, 0, o10, a10, r10, i10);
    }
    return a10;
  }
  static _findMatchesInLine(e206, t10, n10, r10, i10, a10, o10, s10) {
    let c10 = e206.wordSeparators;
    if (!o10 && e206.simpleSearch) {
      let o11 = e206.simpleSearch, l11 = o11.length, u11 = t10.length, d10 = -l11;
      for (; (d10 = t10.indexOf(o11, d10 + l11)) !== -1; ) if ((!c10 || _m2(c10, t10, u11, d10, l11)) && (a10[i10++] = new rm(new M(n10, d10 + 1 + r10, n10, d10 + 1 + l11 + r10), null), i10 >= s10)) return i10;
      return i10;
    }
    let l10 = new vm(e206.wordSeparators, e206.regex), u10;
    l10.reset(0);
    do
      if (u10 = l10.next(t10), u10 && (a10[i10++] = fm(new M(n10, u10.index + 1 + r10, n10, u10.index + 1 + u10[0].length + r10), u10, o10), i10 >= s10)) return i10;
    while (u10);
    return i10;
  }
  static findNextMatch(e206, t10, n10, r10) {
    let i10 = t10.parseSearchRequest();
    if (!i10) return null;
    let a10 = new vm(i10.wordSeparators, i10.regex);
    return i10.regex.multiline ? this._doFindNextMatchMultiline(e206, n10, a10, r10) : this._doFindNextMatchLineByLine(e206, n10, a10, r10);
  }
  static _doFindNextMatchMultiline(e206, t10, n10, r10) {
    let i10 = new j(t10.lineNumber, 1), a10 = e206.getOffsetAt(i10), o10 = e206.getLineCount(), s10 = e206.getValueInRange(new M(i10.lineNumber, i10.column, o10, e206.getLineMaxColumn(o10)), 1), c10 = e206.getEOL() === `\r
` ? new pm(s10) : null;
    n10.reset(t10.column - 1);
    let l10 = n10.next(s10);
    return l10 ? fm(this._getMultilineMatchRange(e206, a10, s10, c10, l10.index, l10[0]), l10, r10) : t10.lineNumber !== 1 || t10.column !== 1 ? this._doFindNextMatchMultiline(e206, new j(1, 1), n10, r10) : null;
  }
  static _doFindNextMatchLineByLine(e206, t10, n10, r10) {
    let i10 = e206.getLineCount(), a10 = t10.lineNumber, o10 = e206.getLineContent(a10), s10 = this._findFirstMatchInLine(n10, o10, a10, t10.column, r10);
    if (s10) return s10;
    for (let t11 = 1; t11 <= i10; t11++) {
      let o11 = (a10 + t11 - 1) % i10, s11 = e206.getLineContent(o11 + 1), c10 = this._findFirstMatchInLine(n10, s11, o11 + 1, 1, r10);
      if (c10) return c10;
    }
    return null;
  }
  static _findFirstMatchInLine(e206, t10, n10, r10, i10) {
    e206.reset(r10 - 1);
    let a10 = e206.next(t10);
    return a10 ? fm(new M(n10, a10.index + 1, n10, a10.index + 1 + a10[0].length), a10, i10) : null;
  }
  static findPreviousMatch(e206, t10, n10, r10) {
    let i10 = t10.parseSearchRequest();
    if (!i10) return null;
    let a10 = new vm(i10.wordSeparators, i10.regex);
    return i10.regex.multiline ? this._doFindPreviousMatchMultiline(e206, n10, a10, r10) : this._doFindPreviousMatchLineByLine(e206, n10, a10, r10);
  }
  static _doFindPreviousMatchMultiline(e206, t10, n10, r10) {
    let i10 = this._doFindMatchesMultiline(e206, new M(1, 1, t10.lineNumber, t10.column), n10, r10, 10 * lm);
    if (i10.length > 0) return i10[i10.length - 1];
    let a10 = e206.getLineCount();
    return t10.lineNumber !== a10 || t10.column !== e206.getLineMaxColumn(a10) ? this._doFindPreviousMatchMultiline(e206, new j(a10, e206.getLineMaxColumn(a10)), n10, r10) : null;
  }
  static _doFindPreviousMatchLineByLine(e206, t10, n10, r10) {
    let i10 = e206.getLineCount(), a10 = t10.lineNumber, o10 = e206.getLineContent(a10).substring(0, t10.column - 1), s10 = this._findLastMatchInLine(n10, o10, a10, r10);
    if (s10) return s10;
    for (let t11 = 1; t11 <= i10; t11++) {
      let o11 = (i10 + a10 - t11 - 1) % i10, s11 = e206.getLineContent(o11 + 1), c10 = this._findLastMatchInLine(n10, s11, o11 + 1, r10);
      if (c10) return c10;
    }
    return null;
  }
  static _findLastMatchInLine(e206, t10, n10, r10) {
    let i10 = null, a10;
    for (e206.reset(0); a10 = e206.next(t10); ) i10 = fm(new M(n10, a10.index + 1, n10, a10.index + 1 + a10[0].length), a10, r10);
    return i10;
  }
};
function hm(e206, t10, n10, r10, i10) {
  if (r10 === 0) return true;
  let a10 = t10.charCodeAt(r10 - 1);
  if (e206.get(a10) !== 0 || a10 === 13 || a10 === 10) return true;
  if (i10 > 0) {
    let n11 = t10.charCodeAt(r10);
    if (e206.get(n11) !== 0) return true;
  }
  return false;
}
function gm(e206, t10, n10, r10, i10) {
  if (r10 + i10 === n10) return true;
  let a10 = t10.charCodeAt(r10 + i10);
  if (e206.get(a10) !== 0 || a10 === 13 || a10 === 10) return true;
  if (i10 > 0) {
    let n11 = t10.charCodeAt(r10 + i10 - 1);
    if (e206.get(n11) !== 0) return true;
  }
  return false;
}
function _m2(e206, t10, n10, r10, i10) {
  return hm(e206, t10, n10, r10, i10) && gm(e206, t10, n10, r10, i10);
}
var vm = class {
  constructor(e206, t10) {
    this._wordSeparators = e206, this._searchRegex = t10, this._prevMatchStartIndex = -1, this._prevMatchLength = 0;
  }
  reset(e206) {
    this._searchRegex.lastIndex = e206, this._prevMatchStartIndex = -1, this._prevMatchLength = 0;
  }
  next(e206) {
    let t10 = e206.length, n10;
    do {
      if (this._prevMatchStartIndex + this._prevMatchLength === t10 || (n10 = this._searchRegex.exec(e206), !n10)) return null;
      let r10 = n10.index, i10 = n10[0].length;
      if (r10 === this._prevMatchStartIndex && i10 === this._prevMatchLength) {
        if (i10 === 0) {
          co(e206, t10, this._searchRegex.lastIndex) > 65535 ? this._searchRegex.lastIndex += 2 : this._searchRegex.lastIndex += 1;
          continue;
        }
        return null;
      }
      if (this._prevMatchStartIndex = r10, this._prevMatchLength = i10, !this._wordSeparators || _m2(this._wordSeparators, e206, t10, r10, i10)) return n10;
    } while (n10);
    return null;
  }
}, ym = class {
  static computeUnicodeHighlights(e206, t10, n10) {
    let r10 = n10 ? n10.startLineNumber : 1, i10 = n10 ? n10.endLineNumber : e206.getLineCount(), a10 = new xm(t10), o10 = a10.getCandidateCodePoints(), s10;
    s10 = RegExp(o10 === `allNonBasicAscii` ? `[^\\t\\n\\r\\x20-\\x7E]` : `${bm(Array.from(o10))}`, `g`);
    let c10 = new vm(null, s10), l10 = [], u10 = false, d10, f10 = 0, p10 = 0, m10 = 0;
    forLoop: for (let t11 = r10, n11 = i10; t11 <= n11; t11++) {
      let n12 = e206.getLineContent(t11), r11 = n12.length;
      c10.reset(0);
      do
        if (d10 = c10.next(n12), d10) {
          let e207 = d10.index, i11 = d10.index + d10[0].length;
          e207 > 0 && ao(n12.charCodeAt(e207 - 1)) && e207--, i11 + 1 < r11 && ao(n12.charCodeAt(i11 - 1)) && i11++;
          let o11 = n12.substring(e207, i11), s11 = wn(e207 + 1, xn, n12, 0);
          s11 && s11.endColumn <= e207 + 1 && (s11 = null);
          let c11 = a10.shouldHighlightNonBasicASCII(o11, s11 ? s11.word : null);
          if (c11 !== 0) {
            if (c11 === 3 ? f10++ : c11 === 2 ? p10++ : c11 === 1 ? m10++ : Ne(), l10.length >= 1e3) {
              u10 = true;
              break forLoop;
            }
            l10.push(new M(t11, e207 + 1, t11, i11 + 1));
          }
        }
      while (d10);
    }
    return { ranges: l10, hasMore: u10, ambiguousCharacterCount: f10, invisibleCharacterCount: p10, nonBasicAsciiCharacterCount: m10 };
  }
  static computeUnicodeHighlightReason(e206, t10) {
    let n10 = new xm(t10);
    switch (n10.shouldHighlightNonBasicASCII(e206, null)) {
      case 0:
        return null;
      case 2:
        return { kind: 1 };
      case 3: {
        let r10 = e206.codePointAt(0), i10 = n10.ambiguousCharacters.getPrimaryConfusable(r10), a10 = Eo.getLocales().filter((e207) => !Eo.getInstance(/* @__PURE__ */ new Set([...t10.allowedLocales, e207])).isAmbiguous(r10));
        return { kind: 0, confusableWith: String.fromCodePoint(i10), notAmbiguousInLocales: a10 };
      }
      case 1:
        return { kind: 2 };
    }
  }
};
function bm(e206, t10) {
  return `[${za(e206.map((e207) => String.fromCodePoint(e207)).join(``))}]`;
}
var xm = class {
  constructor(e206) {
    this.options = e206, this.allowedCodePoints = new Set(e206.allowedCodePoints), this.ambiguousCharacters = Eo.getInstance(new Set(e206.allowedLocales));
  }
  getCandidateCodePoints() {
    if (this.options.nonBasicASCII) return `allNonBasicAscii`;
    let e206 = /* @__PURE__ */ new Set();
    if (this.options.invisibleCharacters) for (let t10 of Do.codePoints) Sm(String.fromCodePoint(t10)) || e206.add(t10);
    if (this.options.ambiguousCharacters) for (let t10 of this.ambiguousCharacters.getConfusableCodePoints()) e206.add(t10);
    for (let t10 of this.allowedCodePoints) e206.delete(t10);
    return e206;
  }
  shouldHighlightNonBasicASCII(e206, t10) {
    let n10 = e206.codePointAt(0);
    if (this.allowedCodePoints.has(n10)) return 0;
    if (this.options.nonBasicASCII) return 1;
    let r10 = false, i10 = false;
    if (t10) for (let e207 of t10) {
      let t11 = e207.codePointAt(0), n11 = go(e207);
      r10 || (r10 = n11), !n11 && !this.ambiguousCharacters.isAmbiguous(t11) && !Do.isInvisibleCharacter(t11) && (i10 = true);
    }
    return !r10 && i10 ? 0 : this.options.invisibleCharacters && !Sm(e206) && Do.isInvisibleCharacter(n10) ? 2 : this.options.ambiguousCharacters && this.ambiguousCharacters.isAmbiguous(n10) ? 3 : 0;
  }
};
function Sm(e206) {
  return e206 === ` ` || e206 === `
` || e206 === `	`;
}
var Cm = class {
  constructor(e206, t10, n10) {
    this.changes = e206, this.moves = t10, this.hitTimeout = n10;
  }
}, wm = class {
  constructor(e206, t10) {
    this.lineRangeMapping = e206, this.changes = t10;
  }
}, Tm = class e49 {
  static fromTo(t10, n10) {
    return new e49(t10, n10);
  }
  static addRange(t10, n10) {
    let r10 = 0;
    for (; r10 < n10.length && n10[r10].endExclusive < t10.start; ) r10++;
    let i10 = r10;
    for (; i10 < n10.length && n10[i10].start <= t10.endExclusive; ) i10++;
    if (r10 === i10) n10.splice(r10, 0, t10);
    else {
      let a10 = Math.min(t10.start, n10[r10].start), o10 = Math.max(t10.endExclusive, n10[i10 - 1].endExclusive);
      n10.splice(r10, i10 - r10, new e49(a10, o10));
    }
  }
  static tryCreate(t10, n10) {
    if (!(t10 > n10)) return new e49(t10, n10);
  }
  static ofLength(t10) {
    return new e49(0, t10);
  }
  static ofStartAndLength(t10, n10) {
    return new e49(t10, t10 + n10);
  }
  static emptyAt(t10) {
    return new e49(t10, t10);
  }
  constructor(e206, t10) {
    if (this.start = e206, this.endExclusive = t10, e206 > t10) throw new je(`Invalid range: ${this.toString()}`);
  }
  get isEmpty() {
    return this.start === this.endExclusive;
  }
  delta(t10) {
    return new e49(this.start + t10, this.endExclusive + t10);
  }
  deltaStart(t10) {
    return new e49(this.start + t10, this.endExclusive);
  }
  deltaEnd(t10) {
    return new e49(this.start, this.endExclusive + t10);
  }
  get length() {
    return this.endExclusive - this.start;
  }
  toString() {
    return `[${this.start}, ${this.endExclusive})`;
  }
  equals(e206) {
    return this.start === e206.start && this.endExclusive === e206.endExclusive;
  }
  contains(e206) {
    return this.start <= e206 && e206 < this.endExclusive;
  }
  join(t10) {
    return new e49(Math.min(this.start, t10.start), Math.max(this.endExclusive, t10.endExclusive));
  }
  intersect(t10) {
    let n10 = Math.max(this.start, t10.start), r10 = Math.min(this.endExclusive, t10.endExclusive);
    if (n10 <= r10) return new e49(n10, r10);
  }
  intersectionLength(e206) {
    let t10 = Math.max(this.start, e206.start), n10 = Math.min(this.endExclusive, e206.endExclusive);
    return Math.max(0, n10 - t10);
  }
  intersects(e206) {
    return Math.max(this.start, e206.start) < Math.min(this.endExclusive, e206.endExclusive);
  }
  intersectsOrTouches(e206) {
    return Math.max(this.start, e206.start) <= Math.min(this.endExclusive, e206.endExclusive);
  }
  isBefore(e206) {
    return this.endExclusive <= e206.start;
  }
  isAfter(e206) {
    return this.start >= e206.endExclusive;
  }
  slice(e206) {
    return e206.slice(this.start, this.endExclusive);
  }
  substring(e206) {
    return e206.substring(this.start, this.endExclusive);
  }
  clip(e206) {
    if (this.isEmpty) throw new je(`Invalid clipping range: ${this.toString()}`);
    return Math.max(this.start, Math.min(this.endExclusive - 1, e206));
  }
  clipCyclic(e206) {
    if (this.isEmpty) throw new je(`Invalid clipping range: ${this.toString()}`);
    return e206 < this.start ? this.endExclusive - (this.start - e206) % this.length : e206 >= this.endExclusive ? this.start + (e206 - this.start) % this.length : e206;
  }
  forEach(e206) {
    for (let t10 = this.start; t10 < this.endExclusive; t10++) e206(t10);
  }
  joinRightTouching(t10) {
    if (this.endExclusive !== t10.start) throw new je(`Invalid join: ${this.toString()} and ${t10.toString()}`);
    return new e49(this.start, t10.endExclusive);
  }
}, Em = class e50 {
  constructor() {
    this._sortedRanges = [];
  }
  addRange(e206) {
    let t10 = 0;
    for (; t10 < this._sortedRanges.length && this._sortedRanges[t10].endExclusive < e206.start; ) t10++;
    let n10 = t10;
    for (; n10 < this._sortedRanges.length && this._sortedRanges[n10].start <= e206.endExclusive; ) n10++;
    if (t10 === n10) this._sortedRanges.splice(t10, 0, e206);
    else {
      let r10 = Math.min(e206.start, this._sortedRanges[t10].start), i10 = Math.max(e206.endExclusive, this._sortedRanges[n10 - 1].endExclusive);
      this._sortedRanges.splice(t10, n10 - t10, new Tm(r10, i10));
    }
  }
  toString() {
    return this._sortedRanges.map((e206) => e206.toString()).join(`, `);
  }
  intersectsStrict(e206) {
    let t10 = 0;
    for (; t10 < this._sortedRanges.length && this._sortedRanges[t10].endExclusive <= e206.start; ) t10++;
    return t10 < this._sortedRanges.length && this._sortedRanges[t10].start < e206.endExclusive;
  }
  intersectWithRange(t10) {
    let n10 = new e50();
    for (let e206 of this._sortedRanges) {
      let r10 = e206.intersect(t10);
      r10 && n10.addRange(r10);
    }
    return n10;
  }
  intersectWithRangeLength(e206) {
    return this.intersectWithRange(e206).length;
  }
  get length() {
    return this._sortedRanges.reduce((e206, t10) => e206 + t10.length, 0);
  }
};
function Dm(e206, t10, n10 = e206.length - 1) {
  let r10 = Om(e206, t10, n10);
  if (r10 !== -1) return e206[r10];
}
function Om(e206, t10, n10 = e206.length - 1) {
  for (let r10 = n10; r10 >= 0; r10--) {
    let n11 = e206[r10];
    if (t10(n11, r10)) return r10;
  }
  return -1;
}
function km(e206, t10) {
  let n10 = Am(e206, t10);
  return n10 === -1 ? void 0 : e206[n10];
}
function Am(e206, t10, n10 = 0, r10 = e206.length) {
  let i10 = n10, a10 = r10;
  for (; i10 < a10; ) {
    let n11 = Math.floor((i10 + a10) / 2);
    t10(e206[n11]) ? i10 = n11 + 1 : a10 = n11;
  }
  return i10 - 1;
}
function jm(e206, t10) {
  let n10 = Mm(e206, t10);
  return n10 === e206.length ? void 0 : e206[n10];
}
function Mm(e206, t10, n10 = 0, r10 = e206.length) {
  let i10 = n10, a10 = r10;
  for (; i10 < a10; ) {
    let n11 = Math.floor((i10 + a10) / 2);
    t10(e206[n11]) ? a10 = n11 : i10 = n11 + 1;
  }
  return i10;
}
var Nm = (_K = class {
  constructor(e206) {
    this._array = e206, this._findLastMonotonousLastIdx = 0;
  }
  findLastMonotonous(t10) {
    if (_K.assertInvariants) {
      if (this._prevFindLastPredicate) {
        for (let e206 of this._array) if (this._prevFindLastPredicate(e206) && !t10(e206)) throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`);
      }
      this._prevFindLastPredicate = t10;
    }
    let n10 = Am(this._array, t10, this._findLastMonotonousLastIdx);
    return this._findLastMonotonousLastIdx = n10 + 1, n10 === -1 ? void 0 : this._array[n10];
  }
}, _K.assertInvariants = false, _K);
function Pm(e206, t10) {
  if (e206.length === 0) return;
  let n10 = e206[0];
  for (let r10 = 1; r10 < e206.length; r10++) {
    let i10 = e206[r10];
    t10(i10, n10) > 0 && (n10 = i10);
  }
  return n10;
}
function Fm(e206, t10) {
  if (e206.length === 0) return;
  let n10 = e206[0];
  for (let r10 = 1; r10 < e206.length; r10++) {
    let i10 = e206[r10];
    t10(i10, n10) >= 0 && (n10 = i10);
  }
  return n10;
}
function Im(e206, t10) {
  return Pm(e206, (e207, n10) => -t10(e207, n10));
}
function Lm(e206, t10) {
  if (e206.length === 0) return -1;
  let n10 = 0;
  for (let r10 = 1; r10 < e206.length; r10++) {
    let i10 = e206[r10];
    t10(i10, e206[n10]) > 0 && (n10 = r10);
  }
  return n10;
}
function Rm(e206, t10) {
  for (let n10 of e206) {
    let e207 = t10(n10);
    if (e207 !== void 0) return e207;
  }
}
var zm = (_L = class {
  static ofLength(t10, n10) {
    return new _L(t10, t10 + n10);
  }
  static fromRange(t10) {
    return new _L(t10.startLineNumber, t10.endLineNumber);
  }
  static fromRangeInclusive(t10) {
    return new _L(t10.startLineNumber, t10.endLineNumber + 1);
  }
  static joinMany(e206) {
    if (e206.length === 0) return [];
    let t10 = new Bm(e206[0].slice());
    for (let n10 = 1; n10 < e206.length; n10++) t10 = t10.getUnion(new Bm(e206[n10].slice()));
    return t10.ranges;
  }
  static join(t10) {
    if (t10.length === 0) throw new je(`lineRanges cannot be empty`);
    let n10 = t10[0].startLineNumber, r10 = t10[0].endLineNumberExclusive;
    for (let e206 = 1; e206 < t10.length; e206++) n10 = Math.min(n10, t10[e206].startLineNumber), r10 = Math.max(r10, t10[e206].endLineNumberExclusive);
    return new _L(n10, r10);
  }
  static deserialize(t10) {
    return new _L(t10[0], t10[1]);
  }
  constructor(e206, t10) {
    if (e206 > t10) throw new je(`startLineNumber ${e206} cannot be after endLineNumberExclusive ${t10}`);
    this.startLineNumber = e206, this.endLineNumberExclusive = t10;
  }
  contains(e206) {
    return this.startLineNumber <= e206 && e206 < this.endLineNumberExclusive;
  }
  get isEmpty() {
    return this.startLineNumber === this.endLineNumberExclusive;
  }
  delta(t10) {
    return new _L(this.startLineNumber + t10, this.endLineNumberExclusive + t10);
  }
  deltaLength(t10) {
    return new _L(this.startLineNumber, this.endLineNumberExclusive + t10);
  }
  get length() {
    return this.endLineNumberExclusive - this.startLineNumber;
  }
  join(t10) {
    return new _L(Math.min(this.startLineNumber, t10.startLineNumber), Math.max(this.endLineNumberExclusive, t10.endLineNumberExclusive));
  }
  toString() {
    return `[${this.startLineNumber},${this.endLineNumberExclusive})`;
  }
  intersect(t10) {
    let n10 = Math.max(this.startLineNumber, t10.startLineNumber), r10 = Math.min(this.endLineNumberExclusive, t10.endLineNumberExclusive);
    if (n10 <= r10) return new _L(n10, r10);
  }
  intersectsStrict(e206) {
    return this.startLineNumber < e206.endLineNumberExclusive && e206.startLineNumber < this.endLineNumberExclusive;
  }
  intersectsOrTouches(e206) {
    return this.startLineNumber <= e206.endLineNumberExclusive && e206.startLineNumber <= this.endLineNumberExclusive;
  }
  equals(e206) {
    return this.startLineNumber === e206.startLineNumber && this.endLineNumberExclusive === e206.endLineNumberExclusive;
  }
  toInclusiveRange() {
    return this.isEmpty ? null : new M(this.startLineNumber, 1, this.endLineNumberExclusive - 1, 2 ** 53 - 1);
  }
  toExclusiveRange() {
    return new M(this.startLineNumber, 1, this.endLineNumberExclusive, 1);
  }
  mapToLineArray(e206) {
    let t10 = [];
    for (let n10 = this.startLineNumber; n10 < this.endLineNumberExclusive; n10++) t10.push(e206(n10));
    return t10;
  }
  forEach(e206) {
    for (let t10 = this.startLineNumber; t10 < this.endLineNumberExclusive; t10++) e206(t10);
  }
  serialize() {
    return [this.startLineNumber, this.endLineNumberExclusive];
  }
  toOffsetRange() {
    return new Tm(this.startLineNumber - 1, this.endLineNumberExclusive - 1);
  }
  addMargin(t10, n10) {
    return new _L(this.startLineNumber - t10, this.endLineNumberExclusive + n10);
  }
}, _L.compareByStart = ce((e206) => e206.startLineNumber, ue), _L), Bm = class e51 {
  constructor(e206 = []) {
    this._normalizedRanges = e206;
  }
  get ranges() {
    return this._normalizedRanges;
  }
  addRange(e206) {
    if (e206.length === 0) return;
    let t10 = Mm(this._normalizedRanges, (t11) => t11.endLineNumberExclusive >= e206.startLineNumber), n10 = Am(this._normalizedRanges, (t11) => t11.startLineNumber <= e206.endLineNumberExclusive) + 1;
    if (t10 === n10) this._normalizedRanges.splice(t10, 0, e206);
    else if (t10 === n10 - 1) {
      let n11 = this._normalizedRanges[t10];
      this._normalizedRanges[t10] = n11.join(e206);
    } else {
      let r10 = this._normalizedRanges[t10].join(this._normalizedRanges[n10 - 1]).join(e206);
      this._normalizedRanges.splice(t10, n10 - t10, r10);
    }
  }
  contains(e206) {
    let t10 = km(this._normalizedRanges, (t11) => t11.startLineNumber <= e206);
    return !!t10 && t10.endLineNumberExclusive > e206;
  }
  intersects(e206) {
    let t10 = km(this._normalizedRanges, (t11) => t11.startLineNumber < e206.endLineNumberExclusive);
    return !!t10 && t10.endLineNumberExclusive > e206.startLineNumber;
  }
  getUnion(t10) {
    if (this._normalizedRanges.length === 0) return t10;
    if (t10._normalizedRanges.length === 0) return this;
    let n10 = [], r10 = 0, i10 = 0, a10 = null;
    for (; r10 < this._normalizedRanges.length || i10 < t10._normalizedRanges.length; ) {
      let e206 = null;
      if (r10 < this._normalizedRanges.length && i10 < t10._normalizedRanges.length) {
        let n11 = this._normalizedRanges[r10], a11 = t10._normalizedRanges[i10];
        n11.startLineNumber < a11.startLineNumber ? (e206 = n11, r10++) : (e206 = a11, i10++);
      } else r10 < this._normalizedRanges.length ? (e206 = this._normalizedRanges[r10], r10++) : (e206 = t10._normalizedRanges[i10], i10++);
      a10 === null ? a10 = e206 : a10.endLineNumberExclusive >= e206.startLineNumber ? a10 = new zm(a10.startLineNumber, Math.max(a10.endLineNumberExclusive, e206.endLineNumberExclusive)) : (n10.push(a10), a10 = e206);
    }
    return a10 !== null && n10.push(a10), new e51(n10);
  }
  subtractFrom(t10) {
    let n10 = Mm(this._normalizedRanges, (e206) => e206.endLineNumberExclusive >= t10.startLineNumber), r10 = Am(this._normalizedRanges, (e206) => e206.startLineNumber <= t10.endLineNumberExclusive) + 1;
    if (n10 === r10) return new e51([t10]);
    let i10 = [], a10 = t10.startLineNumber;
    for (let e206 = n10; e206 < r10; e206++) {
      let t11 = this._normalizedRanges[e206];
      t11.startLineNumber > a10 && i10.push(new zm(a10, t11.startLineNumber)), a10 = t11.endLineNumberExclusive;
    }
    return a10 < t10.endLineNumberExclusive && i10.push(new zm(a10, t10.endLineNumberExclusive)), new e51(i10);
  }
  toString() {
    return this._normalizedRanges.map((e206) => e206.toString()).join(`, `);
  }
  getIntersection(t10) {
    let n10 = [], r10 = 0, i10 = 0;
    for (; r10 < this._normalizedRanges.length && i10 < t10._normalizedRanges.length; ) {
      let e206 = this._normalizedRanges[r10], a10 = t10._normalizedRanges[i10], o10 = e206.intersect(a10);
      o10 && !o10.isEmpty && n10.push(o10), e206.endLineNumberExclusive < a10.endLineNumberExclusive ? r10++ : i10++;
    }
    return new e51(n10);
  }
  getWithDelta(t10) {
    return new e51(this._normalizedRanges.map((e206) => e206.delta(t10)));
  }
}, Vm = (_M = class {
  static betweenPositions(t10, n10) {
    return t10.lineNumber === n10.lineNumber ? new _M(0, n10.column - t10.column) : new _M(n10.lineNumber - t10.lineNumber, n10.column - 1);
  }
  static fromPosition(t10) {
    return new _M(t10.lineNumber - 1, t10.column - 1);
  }
  static ofRange(t10) {
    return _M.betweenPositions(t10.getStartPosition(), t10.getEndPosition());
  }
  static ofText(t10) {
    let n10 = 0, r10 = 0;
    for (let e206 of t10) e206 === `
` ? (n10++, r10 = 0) : r10++;
    return new _M(n10, r10);
  }
  constructor(e206, t10) {
    this.lineCount = e206, this.columnCount = t10;
  }
  isGreaterThanOrEqualTo(e206) {
    return this.lineCount === e206.lineCount ? this.columnCount >= e206.columnCount : this.lineCount > e206.lineCount;
  }
  add(t10) {
    return t10.lineCount === 0 ? new _M(this.lineCount, this.columnCount + t10.columnCount) : new _M(this.lineCount + t10.lineCount, t10.columnCount);
  }
  createRange(e206) {
    return this.lineCount === 0 ? new M(e206.lineNumber, e206.column, e206.lineNumber, e206.column + this.columnCount) : new M(e206.lineNumber, e206.column, e206.lineNumber + this.lineCount, this.columnCount + 1);
  }
  toRange() {
    return new M(1, 1, this.lineCount + 1, this.columnCount + 1);
  }
  toLineRange() {
    return zm.ofLength(1, this.lineCount + 1);
  }
  addToPosition(e206) {
    return this.lineCount === 0 ? new j(e206.lineNumber, e206.column + this.columnCount) : new j(e206.lineNumber + this.lineCount, this.columnCount + 1);
  }
  toString() {
    return `${this.lineCount},${this.columnCount}`;
  }
}, _M.zero = new _M(0, 0), _M), Hm = class {
  getOffsetRange(e206) {
    return new Tm(this.getOffset(e206.getStartPosition()), this.getOffset(e206.getEndPosition()));
  }
  getRange(e206) {
    return M.fromPositions(this.getPosition(e206.start), this.getPosition(e206.endExclusive));
  }
  getStringReplacement(e206) {
    return new Um.deps.StringReplacement(this.getOffsetRange(e206.range), e206.text);
  }
  getTextReplacement(e206) {
    return new Um.deps.TextReplacement(this.getRange(e206.replaceRange), e206.newText);
  }
  getTextEdit(e206) {
    let t10 = e206.replacements.map((e207) => this.getTextReplacement(e207));
    return new Um.deps.TextEdit(t10);
  }
}, Um = (_N2 = class {
  static get deps() {
    if (!this._deps) throw Error(`Dependencies not set. Call _setDependencies first.`);
    return this._deps;
  }
}, _N2._deps = void 0, _N2);
function iie(e206) {
  Um._deps = e206;
}
var Wm = class extends Hm {
  constructor(e206) {
    super(), this.text = e206, this.lineStartOffsetByLineIdx = [], this.lineEndOffsetByLineIdx = [], this.lineStartOffsetByLineIdx.push(0);
    for (let t10 = 0; t10 < e206.length; t10++) e206.charAt(t10) === `
` && (this.lineStartOffsetByLineIdx.push(t10 + 1), t10 > 0 && e206.charAt(t10 - 1) === `\r` ? this.lineEndOffsetByLineIdx.push(t10 - 1) : this.lineEndOffsetByLineIdx.push(t10));
    this.lineEndOffsetByLineIdx.push(e206.length);
  }
  getOffset(e206) {
    let t10 = this._validatePosition(e206);
    return this.lineStartOffsetByLineIdx[t10.lineNumber - 1] + t10.column - 1;
  }
  _validatePosition(e206) {
    if (e206.lineNumber < 1) return new j(1, 1);
    let t10 = this.textLength.lineCount + 1;
    if (e206.lineNumber > t10) return new j(t10, this.getLineLength(t10) + 1);
    if (e206.column < 1) return new j(e206.lineNumber, 1);
    let n10 = this.getLineLength(e206.lineNumber);
    return e206.column - 1 > n10 ? new j(e206.lineNumber, n10 + 1) : e206;
  }
  getPosition(e206) {
    let t10 = Am(this.lineStartOffsetByLineIdx, (t11) => t11 <= e206);
    return new j(t10 + 1, e206 - this.lineStartOffsetByLineIdx[t10] + 1);
  }
  get textLength() {
    let e206 = this.lineStartOffsetByLineIdx.length - 1;
    return new Um.deps.TextLength(e206, this.text.length - this.lineStartOffsetByLineIdx[e206]);
  }
  getLineLength(e206) {
    return this.lineEndOffsetByLineIdx[e206 - 1] - this.lineStartOffsetByLineIdx[e206 - 1];
  }
}, Gm = class {
  constructor() {
    this._transformer = void 0;
  }
  get endPositionExclusive() {
    return this.length.addToPosition(new j(1, 1));
  }
  get lineRange() {
    return this.length.toLineRange();
  }
  getValue() {
    return this.getValueOfRange(this.length.toRange());
  }
  getValueOfOffsetRange(e206) {
    return this.getValueOfRange(this.getTransformer().getRange(e206));
  }
  getLineLength(e206) {
    return this.getValueOfRange(new M(e206, 1, e206, 2 ** 53 - 1)).length;
  }
  getTransformer() {
    return this._transformer || (this._transformer = new Wm(this.getValue())), this._transformer;
  }
  getLineAt(e206) {
    return this.getValueOfRange(new M(e206, 1, e206, 2 ** 53 - 1));
  }
}, aie = class extends Gm {
  constructor(e206, t10) {
    Pe(t10 >= 1), super(), this._getLineContent = e206, this._lineCount = t10;
  }
  getValueOfRange(e206) {
    if (e206.startLineNumber === e206.endLineNumber) return this._getLineContent(e206.startLineNumber).substring(e206.startColumn - 1, e206.endColumn - 1);
    let t10 = this._getLineContent(e206.startLineNumber).substring(e206.startColumn - 1);
    for (let n10 = e206.startLineNumber + 1; n10 < e206.endLineNumber; n10++) t10 += `
` + this._getLineContent(n10);
    return t10 += `
` + this._getLineContent(e206.endLineNumber).substring(0, e206.endColumn - 1), t10;
  }
  getLineLength(e206) {
    return this._getLineContent(e206).length;
  }
  get length() {
    let e206 = this._getLineContent(this._lineCount);
    return new Vm(this._lineCount - 1, e206.length);
  }
}, Km = class extends aie {
  constructor(e206) {
    super((t10) => e206[t10 - 1], e206.length);
  }
}, qm = class extends Gm {
  constructor(e206) {
    super(), this.value = e206, this._t = new Wm(this.value);
  }
  getValueOfRange(e206) {
    return this._t.getOffsetRange(e206).substring(this.value);
  }
  get length() {
    return this._t.textLength;
  }
  getTransformer() {
    return this._t;
  }
}, Jm = class e52 {
  static fromStringEdit(t10, n10) {
    return new e52(t10.replacements.map((e206) => Ym.fromStringReplacement(e206, n10)));
  }
  static fromParallelReplacementsUnsorted(t10) {
    return new e52(t10.slice().sort(ce((e206) => e206.range, M.compareRangesUsingStarts)));
  }
  constructor(e206) {
    this.replacements = e206, Ie(() => Le(e206, (e207, t10) => e207.range.getEndPosition().isBeforeOrEqual(t10.range.getStartPosition())));
  }
  mapPosition(e206) {
    let t10 = 0, n10 = 0, r10 = 0;
    for (let i10 of this.replacements) {
      let a10 = i10.range.getStartPosition();
      if (e206.isBeforeOrEqual(a10)) break;
      let o10 = i10.range.getEndPosition(), s10 = Vm.ofText(i10.text);
      if (e206.isBefore(o10)) {
        let e207 = new j(a10.lineNumber + t10, a10.column + (a10.lineNumber + t10 === n10 ? r10 : 0));
        return Xm(e207, s10.addToPosition(e207));
      }
      a10.lineNumber + t10 !== n10 && (r10 = 0), t10 += s10.lineCount - (i10.range.endLineNumber - i10.range.startLineNumber), s10.lineCount === 0 ? o10.lineNumber === a10.lineNumber ? r10 += s10.columnCount - (o10.column - a10.column) : r10 += s10.columnCount - (o10.column - 1) : r10 = s10.columnCount, n10 = o10.lineNumber + t10;
    }
    return new j(e206.lineNumber + t10, e206.column + (e206.lineNumber + t10 === n10 ? r10 : 0));
  }
  mapRange(e206) {
    function t10(e207) {
      return e207 instanceof j ? e207 : e207.getStartPosition();
    }
    function n10(e207) {
      return e207 instanceof j ? e207 : e207.getEndPosition();
    }
    return Xm(t10(this.mapPosition(e206.getStartPosition())), n10(this.mapPosition(e206.getEndPosition())));
  }
  apply(e206) {
    let t10 = ``, n10 = new j(1, 1);
    for (let r11 of this.replacements) {
      let i10 = r11.range, a10 = i10.getStartPosition(), o10 = i10.getEndPosition(), s10 = Xm(n10, a10);
      s10.isEmpty() || (t10 += e206.getValueOfRange(s10)), t10 += r11.text, n10 = o10;
    }
    let r10 = Xm(n10, e206.endPositionExclusive);
    return r10.isEmpty() || (t10 += e206.getValueOfRange(r10)), t10;
  }
  applyToString(e206) {
    let t10 = new qm(e206);
    return this.apply(t10);
  }
  getNewRanges() {
    let e206 = [], t10 = 0, n10 = 0, r10 = 0;
    for (let i10 of this.replacements) {
      let a10 = Vm.ofText(i10.text), o10 = j.lift({ lineNumber: i10.range.startLineNumber + n10, column: i10.range.startColumn + (i10.range.startLineNumber === t10 ? r10 : 0) }), s10 = a10.createRange(o10);
      e206.push(s10), n10 = s10.endLineNumber - i10.range.endLineNumber, r10 = s10.endColumn - i10.range.endColumn, t10 = i10.range.endLineNumber;
    }
    return e206;
  }
  toReplacement(e206) {
    if (this.replacements.length === 0) throw new je();
    if (this.replacements.length === 1) return this.replacements[0];
    let t10 = this.replacements[0].range.getStartPosition(), n10 = this.replacements[this.replacements.length - 1].range.getEndPosition(), r10 = ``;
    for (let t11 = 0; t11 < this.replacements.length; t11++) {
      let n11 = this.replacements[t11];
      if (r10 += n11.text, t11 < this.replacements.length - 1) {
        let i10 = this.replacements[t11 + 1], a10 = M.fromPositions(n11.range.getEndPosition(), i10.range.getStartPosition()), o10 = e206.getValueOfRange(a10);
        r10 += o10;
      }
    }
    return new Ym(M.fromPositions(t10, n10), r10);
  }
  toString(e206) {
    return e206 === void 0 ? this.replacements.map((e207) => e207.toString()).join(`
`) : typeof e206 == `string` ? this.toString(new qm(e206)) : this.replacements.length === 0 ? `` : this.replacements.map((t10) => {
      let n10 = e206.getValueOfRange(t10.range), r10 = M.fromPositions(new j(Math.max(1, t10.range.startLineNumber - 1), 1), t10.range.getStartPosition()), i10 = e206.getValueOfRange(r10);
      i10.length > 10 && (i10 = `...` + i10.substring(i10.length - 10));
      let a10 = M.fromPositions(t10.range.getEndPosition(), new j(t10.range.endLineNumber + 1, 1)), o10 = e206.getValueOfRange(a10);
      o10.length > 10 && (o10 = o10.substring(0, 10) + `...`);
      let s10 = n10;
      s10.length > 10 && (s10 = s10.substring(0, 5) + `...` + s10.substring(s10.length - 5));
      let c10 = t10.text;
      return c10.length > 10 && (c10 = c10.substring(0, 5) + `...` + c10.substring(c10.length - 5)), s10.length === 0 ? `${i10}\u2770${c10}\u2771${o10}` : `${i10}\u2770${s10}\u21A6${c10}\u2771${o10}`;
    }).join(`
`);
  }
}, Ym = class e53 {
  static joinReplacements(t10, n10) {
    if (t10.length === 0) throw new je();
    if (t10.length === 1) return t10[0];
    let r10 = t10[0].range.getStartPosition(), i10 = t10[t10.length - 1].range.getEndPosition(), a10 = ``;
    for (let e206 = 0; e206 < t10.length; e206++) {
      let r11 = t10[e206];
      if (a10 += r11.text, e206 < t10.length - 1) {
        let i11 = t10[e206 + 1], o10 = M.fromPositions(r11.range.getEndPosition(), i11.range.getStartPosition()), s10 = n10.getValueOfRange(o10);
        a10 += s10;
      }
    }
    return new e53(M.fromPositions(r10, i10), a10);
  }
  static fromStringReplacement(t10, n10) {
    return new e53(n10.getTransformer().getRange(t10.replaceRange), t10.newText);
  }
  static delete(t10) {
    return new e53(t10, ``);
  }
  constructor(e206, t10) {
    this.range = e206, this.text = t10;
  }
  get isEmpty() {
    return this.range.isEmpty() && this.text.length === 0;
  }
  static equals(e206, t10) {
    return e206.range.equalsRange(t10.range) && e206.text === t10.text;
  }
  equals(t10) {
    return e53.equals(this, t10);
  }
  removeCommonPrefixAndSuffix(e206) {
    return this.removeCommonPrefix(e206).removeCommonSuffix(e206);
  }
  removeCommonPrefix(t10) {
    let n10 = t10.getValueOfRange(this.range).replaceAll(`\r
`, `
`), r10 = this.text.replaceAll(`\r
`, `
`), i10 = ro(n10, r10), a10 = Vm.ofText(n10.substring(0, i10)).addToPosition(this.range.getStartPosition()), o10 = r10.substring(i10);
    return new e53(M.fromPositions(a10, this.range.getEndPosition()), o10);
  }
  removeCommonSuffix(t10) {
    let n10 = t10.getValueOfRange(this.range).replaceAll(`\r
`, `
`), r10 = this.text.replaceAll(`\r
`, `
`), i10 = io(n10, r10), a10 = Vm.ofText(n10.substring(0, n10.length - i10)).addToPosition(this.range.getStartPosition()), o10 = r10.substring(0, r10.length - i10);
    return new e53(M.fromPositions(this.range.getStartPosition(), a10), o10);
  }
  toString() {
    let e206 = this.range.getStartPosition(), t10 = this.range.getEndPosition();
    return `(${e206.lineNumber},${e206.column} -> ${t10.lineNumber},${t10.column}): "${this.text}"`;
  }
};
function Xm(e206, t10) {
  if (e206.lineNumber === t10.lineNumber && e206.column === 2 ** 53 - 1) return M.fromPositions(t10, t10);
  if (!e206.isBeforeOrEqual(t10)) throw new je(`start must be before end`);
  return new M(e206.lineNumber, e206.column, t10.lineNumber, t10.column);
}
var Zm = class e54 {
  static inverse(t10, n10, r10) {
    let i10 = [], a10 = 1, o10 = 1;
    for (let n11 of t10) {
      let t11 = new e54(new zm(a10, n11.original.startLineNumber), new zm(o10, n11.modified.startLineNumber));
      t11.modified.isEmpty || i10.push(t11), a10 = n11.original.endLineNumberExclusive, o10 = n11.modified.endLineNumberExclusive;
    }
    let s10 = new e54(new zm(a10, n10 + 1), new zm(o10, r10 + 1));
    return s10.modified.isEmpty || i10.push(s10), i10;
  }
  static clip(t10, n10, r10) {
    let i10 = [];
    for (let a10 of t10) {
      let t11 = a10.original.intersect(n10), o10 = a10.modified.intersect(r10);
      t11 && !t11.isEmpty && o10 && !o10.isEmpty && i10.push(new e54(t11, o10));
    }
    return i10;
  }
  constructor(e206, t10) {
    this.original = e206, this.modified = t10;
  }
  toString() {
    return `{${this.original.toString()}->${this.modified.toString()}}`;
  }
  flip() {
    return new e54(this.modified, this.original);
  }
  join(t10) {
    return new e54(this.original.join(t10.original), this.modified.join(t10.modified));
  }
  toRangeMapping() {
    let e206 = this.original.toInclusiveRange(), t10 = this.modified.toInclusiveRange();
    if (e206 && t10) return new th(e206, t10);
    if (this.original.startLineNumber === 1 || this.modified.startLineNumber === 1) {
      if (!(this.modified.startLineNumber === 1 && this.original.startLineNumber === 1)) throw new je(`not a valid diff`);
      return new th(new M(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new M(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
    } else return new th(new M(this.original.startLineNumber - 1, 2 ** 53 - 1, this.original.endLineNumberExclusive - 1, 2 ** 53 - 1), new M(this.modified.startLineNumber - 1, 2 ** 53 - 1, this.modified.endLineNumberExclusive - 1, 2 ** 53 - 1));
  }
  toRangeMapping2(e206, t10) {
    if ($m(this.original.endLineNumberExclusive, e206) && $m(this.modified.endLineNumberExclusive, t10)) return new th(new M(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new M(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
    if (!this.original.isEmpty && !this.modified.isEmpty) return new th(M.fromPositions(new j(this.original.startLineNumber, 1), Qm(new j(this.original.endLineNumberExclusive - 1, 2 ** 53 - 1), e206)), M.fromPositions(new j(this.modified.startLineNumber, 1), Qm(new j(this.modified.endLineNumberExclusive - 1, 2 ** 53 - 1), t10)));
    if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1) return new th(M.fromPositions(Qm(new j(this.original.startLineNumber - 1, 2 ** 53 - 1), e206), Qm(new j(this.original.endLineNumberExclusive - 1, 2 ** 53 - 1), e206)), M.fromPositions(Qm(new j(this.modified.startLineNumber - 1, 2 ** 53 - 1), t10), Qm(new j(this.modified.endLineNumberExclusive - 1, 2 ** 53 - 1), t10)));
    throw new je();
  }
};
function Qm(e206, t10) {
  if (e206.lineNumber < 1) return new j(1, 1);
  if (e206.lineNumber > t10.length) return new j(t10.length, t10[t10.length - 1].length + 1);
  let n10 = t10[e206.lineNumber - 1];
  return e206.column > n10.length + 1 ? new j(e206.lineNumber, n10.length + 1) : e206;
}
function $m(e206, t10) {
  return e206 >= 1 && e206 <= t10.length;
}
var eh = class e55 extends Zm {
  static fromRangeMappings(t10) {
    return new e55(zm.join(t10.map((e206) => zm.fromRangeInclusive(e206.originalRange))), zm.join(t10.map((e206) => zm.fromRangeInclusive(e206.modifiedRange))), t10);
  }
  constructor(e206, t10, n10) {
    super(e206, t10), this.innerChanges = n10;
  }
  flip() {
    return new e55(this.modified, this.original, this.innerChanges?.map((e206) => e206.flip()));
  }
  withInnerChangesFromLineRanges() {
    return new e55(this.original, this.modified, [this.toRangeMapping()]);
  }
}, th = class e56 {
  static fromEdit(t10) {
    let n10 = t10.getNewRanges();
    return t10.replacements.map((t11, r10) => new e56(t11.range, n10[r10]));
  }
  static assertSorted(e206) {
    for (let t10 = 1; t10 < e206.length; t10++) {
      let n10 = e206[t10 - 1], r10 = e206[t10];
      if (!(n10.originalRange.getEndPosition().isBeforeOrEqual(r10.originalRange.getStartPosition()) && n10.modifiedRange.getEndPosition().isBeforeOrEqual(r10.modifiedRange.getStartPosition()))) throw new je(`Range mappings must be sorted`);
    }
  }
  constructor(e206, t10) {
    this.originalRange = e206, this.modifiedRange = t10;
  }
  toString() {
    return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
  }
  flip() {
    return new e56(this.modifiedRange, this.originalRange);
  }
  toTextEdit(e206) {
    let t10 = e206.getValueOfRange(this.modifiedRange);
    return new Ym(this.originalRange, t10);
  }
};
function nh(e206, t10, n10, r10 = false) {
  let i10 = [];
  for (let r11 of f(e206.map((e207) => oie(e207, t10, n10)), (e207, t11) => e207.original.intersectsOrTouches(t11.original) || e207.modified.intersectsOrTouches(t11.modified))) {
    let e207 = r11[0], t11 = r11[r11.length - 1];
    i10.push(new eh(e207.original.join(t11.original), e207.modified.join(t11.modified), r11.map((e208) => e208.innerChanges[0])));
  }
  return Ie(() => !r10 && i10.length > 0 && (i10[0].modified.startLineNumber !== i10[0].original.startLineNumber || n10.length.lineCount - i10[i10.length - 1].modified.endLineNumberExclusive !== t10.length.lineCount - i10[i10.length - 1].original.endLineNumberExclusive) ? false : Le(i10, (e207, t11) => t11.original.startLineNumber - e207.original.endLineNumberExclusive === t11.modified.startLineNumber - e207.modified.endLineNumberExclusive && e207.original.endLineNumberExclusive < t11.original.startLineNumber && e207.modified.endLineNumberExclusive < t11.modified.startLineNumber)), i10;
}
function oie(e206, t10, n10) {
  let r10 = 0, i10 = 0;
  return e206.modifiedRange.endColumn === 1 && e206.originalRange.endColumn === 1 && e206.originalRange.startLineNumber + r10 <= e206.originalRange.endLineNumber && e206.modifiedRange.startLineNumber + r10 <= e206.modifiedRange.endLineNumber && (i10 = -1), e206.modifiedRange.startColumn - 1 >= n10.getLineLength(e206.modifiedRange.startLineNumber) && e206.originalRange.startColumn - 1 >= t10.getLineLength(e206.originalRange.startLineNumber) && e206.originalRange.startLineNumber <= e206.originalRange.endLineNumber + i10 && e206.modifiedRange.startLineNumber <= e206.modifiedRange.endLineNumber + i10 && (r10 = 1), new eh(new zm(e206.originalRange.startLineNumber + r10, e206.originalRange.endLineNumber + 1 + i10), new zm(e206.modifiedRange.startLineNumber + r10, e206.modifiedRange.endLineNumber + 1 + i10), [e206]);
}
var sie = 3, cie = class {
  computeDiff(e206, t10, n10) {
    let r10 = new die(e206, t10, { maxComputationTime: n10.maxComputationTimeMs, shouldIgnoreTrimWhitespace: n10.ignoreTrimWhitespace, shouldComputeCharChanges: true, shouldMakePrettyDiff: true, shouldPostProcessCharChanges: true }).computeDiff(), i10 = [], a10 = null;
    for (let e207 of r10.changes) {
      let t11;
      t11 = e207.originalEndLineNumber === 0 ? new zm(e207.originalStartLineNumber + 1, e207.originalStartLineNumber + 1) : new zm(e207.originalStartLineNumber, e207.originalEndLineNumber + 1);
      let n11;
      n11 = e207.modifiedEndLineNumber === 0 ? new zm(e207.modifiedStartLineNumber + 1, e207.modifiedStartLineNumber + 1) : new zm(e207.modifiedStartLineNumber, e207.modifiedEndLineNumber + 1);
      let r11 = new eh(t11, n11, e207.charChanges?.map((e208) => new th(new M(e208.originalStartLineNumber, e208.originalStartColumn, e208.originalEndLineNumber, e208.originalEndColumn), new M(e208.modifiedStartLineNumber, e208.modifiedStartColumn, e208.modifiedEndLineNumber, e208.modifiedEndColumn))));
      a10 && (a10.modified.endLineNumberExclusive === r11.modified.startLineNumber || a10.original.endLineNumberExclusive === r11.original.startLineNumber) && (r11 = new eh(a10.original.join(r11.original), a10.modified.join(r11.modified), a10.innerChanges && r11.innerChanges ? a10.innerChanges.concat(r11.innerChanges) : void 0), i10.pop()), i10.push(r11), a10 = r11;
    }
    return Ie(() => Le(i10, (e207, t11) => t11.original.startLineNumber - e207.original.endLineNumberExclusive === t11.modified.startLineNumber - e207.modified.endLineNumberExclusive && e207.original.endLineNumberExclusive < t11.original.startLineNumber && e207.modified.endLineNumberExclusive < t11.modified.startLineNumber)), new Cm(i10, [], r10.quitEarly);
  }
};
function rh(e206, t10, n10, r10) {
  return new Pp(e206, t10, n10).ComputeDiff(r10);
}
var ih = class {
  constructor(e206) {
    let t10 = [], n10 = [];
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) t10[r10] = sh(e206[r10], 1), n10[r10] = ch(e206[r10], 1);
    this.lines = e206, this._startColumns = t10, this._endColumns = n10;
  }
  getElements() {
    let e206 = [];
    for (let t10 = 0, n10 = this.lines.length; t10 < n10; t10++) e206[t10] = this.lines[t10].substring(this._startColumns[t10] - 1, this._endColumns[t10] - 1);
    return e206;
  }
  getStrictElement(e206) {
    return this.lines[e206];
  }
  getStartLineNumber(e206) {
    return e206 + 1;
  }
  getEndLineNumber(e206) {
    return e206 + 1;
  }
  createCharSequence(e206, t10, n10) {
    let r10 = [], i10 = [], a10 = [], o10 = 0;
    for (let s10 = t10; s10 <= n10; s10++) {
      let t11 = this.lines[s10], c10 = e206 ? this._startColumns[s10] : 1, l10 = e206 ? this._endColumns[s10] : t11.length + 1;
      for (let e207 = c10; e207 < l10; e207++) r10[o10] = t11.charCodeAt(e207 - 1), i10[o10] = s10 + 1, a10[o10] = e207, o10++;
      !e206 && s10 < n10 && (r10[o10] = 10, i10[o10] = s10 + 1, a10[o10] = t11.length + 1, o10++);
    }
    return new lie(r10, i10, a10);
  }
}, lie = class {
  constructor(e206, t10, n10) {
    this._charCodes = e206, this._lineNumbers = t10, this._columns = n10;
  }
  toString() {
    return `[` + this._charCodes.map((e206, t10) => (e206 === 10 ? `\\n` : String.fromCharCode(e206)) + `-(${this._lineNumbers[t10]},${this._columns[t10]})`).join(`, `) + `]`;
  }
  _assertIndex(e206, t10) {
    if (e206 < 0 || e206 >= t10.length) throw Error(`Illegal index`);
  }
  getElements() {
    return this._charCodes;
  }
  getStartLineNumber(e206) {
    return e206 > 0 && e206 === this._lineNumbers.length ? this.getEndLineNumber(e206 - 1) : (this._assertIndex(e206, this._lineNumbers), this._lineNumbers[e206]);
  }
  getEndLineNumber(e206) {
    return e206 === -1 ? this.getStartLineNumber(e206 + 1) : (this._assertIndex(e206, this._lineNumbers), this._charCodes[e206] === 10 ? this._lineNumbers[e206] + 1 : this._lineNumbers[e206]);
  }
  getStartColumn(e206) {
    return e206 > 0 && e206 === this._columns.length ? this.getEndColumn(e206 - 1) : (this._assertIndex(e206, this._columns), this._columns[e206]);
  }
  getEndColumn(e206) {
    return e206 === -1 ? this.getStartColumn(e206 + 1) : (this._assertIndex(e206, this._columns), this._charCodes[e206] === 10 ? 1 : this._columns[e206] + 1);
  }
}, ah = class e57 {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this.originalStartLineNumber = e206, this.originalStartColumn = t10, this.originalEndLineNumber = n10, this.originalEndColumn = r10, this.modifiedStartLineNumber = i10, this.modifiedStartColumn = a10, this.modifiedEndLineNumber = o10, this.modifiedEndColumn = s10;
  }
  static createFromDiffChange(t10, n10, r10) {
    return new e57(n10.getStartLineNumber(t10.originalStart), n10.getStartColumn(t10.originalStart), n10.getEndLineNumber(t10.originalStart + t10.originalLength - 1), n10.getEndColumn(t10.originalStart + t10.originalLength - 1), r10.getStartLineNumber(t10.modifiedStart), r10.getStartColumn(t10.modifiedStart), r10.getEndLineNumber(t10.modifiedStart + t10.modifiedLength - 1), r10.getEndColumn(t10.modifiedStart + t10.modifiedLength - 1));
  }
};
function uie(e206) {
  if (e206.length <= 1) return e206;
  let t10 = [e206[0]], n10 = t10[0];
  for (let r10 = 1, i10 = e206.length; r10 < i10; r10++) {
    let i11 = e206[r10], a10 = i11.originalStart - (n10.originalStart + n10.originalLength), o10 = i11.modifiedStart - (n10.modifiedStart + n10.modifiedLength);
    Math.min(a10, o10) < sie ? (n10.originalLength = i11.originalStart + i11.originalLength - n10.originalStart, n10.modifiedLength = i11.modifiedStart + i11.modifiedLength - n10.modifiedStart) : (t10.push(i11), n10 = i11);
  }
  return t10;
}
var oh = class e58 {
  constructor(e206, t10, n10, r10, i10) {
    this.originalStartLineNumber = e206, this.originalEndLineNumber = t10, this.modifiedStartLineNumber = n10, this.modifiedEndLineNumber = r10, this.charChanges = i10;
  }
  static createFromDiffResult(t10, n10, r10, i10, a10, o10, s10) {
    let c10, l10, u10, d10, f10;
    if (n10.originalLength === 0 ? (c10 = r10.getStartLineNumber(n10.originalStart) - 1, l10 = 0) : (c10 = r10.getStartLineNumber(n10.originalStart), l10 = r10.getEndLineNumber(n10.originalStart + n10.originalLength - 1)), n10.modifiedLength === 0 ? (u10 = i10.getStartLineNumber(n10.modifiedStart) - 1, d10 = 0) : (u10 = i10.getStartLineNumber(n10.modifiedStart), d10 = i10.getEndLineNumber(n10.modifiedStart + n10.modifiedLength - 1)), o10 && n10.originalLength > 0 && n10.originalLength < 20 && n10.modifiedLength > 0 && n10.modifiedLength < 20 && a10()) {
      let e206 = r10.createCharSequence(t10, n10.originalStart, n10.originalStart + n10.originalLength - 1), o11 = i10.createCharSequence(t10, n10.modifiedStart, n10.modifiedStart + n10.modifiedLength - 1);
      if (e206.getElements().length > 0 && o11.getElements().length > 0) {
        let t11 = rh(e206, o11, a10, true).changes;
        s10 && (t11 = uie(t11)), f10 = [];
        for (let n11 = 0, r11 = t11.length; n11 < r11; n11++) f10.push(ah.createFromDiffChange(t11[n11], e206, o11));
      }
    }
    return new e58(c10, l10, u10, d10, f10);
  }
}, die = class {
  constructor(e206, t10, n10) {
    this.shouldComputeCharChanges = n10.shouldComputeCharChanges, this.shouldPostProcessCharChanges = n10.shouldPostProcessCharChanges, this.shouldIgnoreTrimWhitespace = n10.shouldIgnoreTrimWhitespace, this.shouldMakePrettyDiff = n10.shouldMakePrettyDiff, this.originalLines = e206, this.modifiedLines = t10, this.original = new ih(e206), this.modified = new ih(t10), this.continueLineDiff = lh(n10.maxComputationTime), this.continueCharDiff = lh(n10.maxComputationTime === 0 ? 0 : Math.min(n10.maxComputationTime, 5e3));
  }
  computeDiff() {
    if (this.original.lines.length === 1 && this.original.lines[0].length === 0) return this.modified.lines.length === 1 && this.modified.lines[0].length === 0 ? { quitEarly: false, changes: [] } : { quitEarly: false, changes: [{ originalStartLineNumber: 1, originalEndLineNumber: 1, modifiedStartLineNumber: 1, modifiedEndLineNumber: this.modified.lines.length, charChanges: void 0 }] };
    if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) return { quitEarly: false, changes: [{ originalStartLineNumber: 1, originalEndLineNumber: this.original.lines.length, modifiedStartLineNumber: 1, modifiedEndLineNumber: 1, charChanges: void 0 }] };
    let e206 = rh(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff), t10 = e206.changes, n10 = e206.quitEarly;
    if (this.shouldIgnoreTrimWhitespace) {
      let e207 = [];
      for (let n11 = 0, r11 = t10.length; n11 < r11; n11++) e207.push(oh.createFromDiffResult(this.shouldIgnoreTrimWhitespace, t10[n11], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
      return { quitEarly: n10, changes: e207 };
    }
    let r10 = [], i10 = 0, a10 = 0;
    for (let e207 = -1, n11 = t10.length; e207 < n11; e207++) {
      let o10 = e207 + 1 < n11 ? t10[e207 + 1] : null, s10 = o10 ? o10.originalStart : this.originalLines.length, c10 = o10 ? o10.modifiedStart : this.modifiedLines.length;
      for (; i10 < s10 && a10 < c10; ) {
        let e208 = this.originalLines[i10], t11 = this.modifiedLines[a10];
        if (e208 !== t11) {
          {
            let n12 = sh(e208, 1), o11 = sh(t11, 1);
            for (; n12 > 1 && o11 > 1 && e208.charCodeAt(n12 - 2) === t11.charCodeAt(o11 - 2); ) n12--, o11--;
            (n12 > 1 || o11 > 1) && this._pushTrimWhitespaceCharChange(r10, i10 + 1, 1, n12, a10 + 1, 1, o11);
          }
          {
            let n12 = ch(e208, 1), o11 = ch(t11, 1), s11 = e208.length + 1, c11 = t11.length + 1;
            for (; n12 < s11 && o11 < c11 && e208.charCodeAt(n12 - 1) === e208.charCodeAt(o11 - 1); ) n12++, o11++;
            (n12 < s11 || o11 < c11) && this._pushTrimWhitespaceCharChange(r10, i10 + 1, n12, s11, a10 + 1, o11, c11);
          }
        }
        i10++, a10++;
      }
      o10 && (r10.push(oh.createFromDiffResult(this.shouldIgnoreTrimWhitespace, o10, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)), i10 += o10.originalLength, a10 += o10.modifiedLength);
    }
    return { quitEarly: n10, changes: r10 };
  }
  _pushTrimWhitespaceCharChange(e206, t10, n10, r10, i10, a10, o10) {
    if (this._mergeTrimWhitespaceCharChange(e206, t10, n10, r10, i10, a10, o10)) return;
    let s10;
    this.shouldComputeCharChanges && (s10 = [new ah(t10, n10, t10, r10, i10, a10, i10, o10)]), e206.push(new oh(t10, t10, i10, i10, s10));
  }
  _mergeTrimWhitespaceCharChange(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = e206.length;
    if (s10 === 0) return false;
    let c10 = e206[s10 - 1];
    return c10.originalEndLineNumber === 0 || c10.modifiedEndLineNumber === 0 ? false : c10.originalEndLineNumber === t10 && c10.modifiedEndLineNumber === i10 ? (this.shouldComputeCharChanges && c10.charChanges && c10.charChanges.push(new ah(t10, n10, t10, r10, i10, a10, i10, o10)), true) : c10.originalEndLineNumber + 1 === t10 && c10.modifiedEndLineNumber + 1 === i10 ? (c10.originalEndLineNumber = t10, c10.modifiedEndLineNumber = i10, this.shouldComputeCharChanges && c10.charChanges && c10.charChanges.push(new ah(t10, n10, t10, r10, i10, a10, i10, o10)), true) : false;
  }
};
function sh(e206, t10) {
  let n10 = Ga(e206);
  return n10 === -1 ? t10 : n10 + 1;
}
function ch(e206, t10) {
  let n10 = qa(e206);
  return n10 === -1 ? t10 : n10 + 2;
}
function lh(e206) {
  if (e206 === 0) return () => true;
  let t10 = Date.now();
  return () => Date.now() - t10 < e206;
}
var uh = class e59 {
  static trivial(t10, n10) {
    return new e59([new dh(Tm.ofLength(t10.length), Tm.ofLength(n10.length))], false);
  }
  static trivialTimedOut(t10, n10) {
    return new e59([new dh(Tm.ofLength(t10.length), Tm.ofLength(n10.length))], true);
  }
  constructor(e206, t10) {
    this.diffs = e206, this.hitTimeout = t10;
  }
}, dh = class e60 {
  static invert(t10, n10) {
    let r10 = [];
    return p(t10, (t11, i10) => {
      r10.push(e60.fromOffsetPairs(t11 ? t11.getEndExclusives() : fh.zero, i10 ? i10.getStarts() : new fh(n10, (t11 ? t11.seq2Range.endExclusive - t11.seq1Range.endExclusive : 0) + n10)));
    }), r10;
  }
  static fromOffsetPairs(t10, n10) {
    return new e60(new Tm(t10.offset1, n10.offset1), new Tm(t10.offset2, n10.offset2));
  }
  static assertSorted(e206) {
    let t10;
    for (let n10 of e206) {
      if (t10 && !(t10.seq1Range.endExclusive <= n10.seq1Range.start && t10.seq2Range.endExclusive <= n10.seq2Range.start)) throw new je(`Sequence diffs must be sorted`);
      t10 = n10;
    }
  }
  constructor(e206, t10) {
    this.seq1Range = e206, this.seq2Range = t10;
  }
  swap() {
    return new e60(this.seq2Range, this.seq1Range);
  }
  toString() {
    return `${this.seq1Range} <-> ${this.seq2Range}`;
  }
  join(t10) {
    return new e60(this.seq1Range.join(t10.seq1Range), this.seq2Range.join(t10.seq2Range));
  }
  delta(t10) {
    return t10 === 0 ? this : new e60(this.seq1Range.delta(t10), this.seq2Range.delta(t10));
  }
  deltaStart(t10) {
    return t10 === 0 ? this : new e60(this.seq1Range.deltaStart(t10), this.seq2Range.deltaStart(t10));
  }
  deltaEnd(t10) {
    return t10 === 0 ? this : new e60(this.seq1Range.deltaEnd(t10), this.seq2Range.deltaEnd(t10));
  }
  intersect(t10) {
    let n10 = this.seq1Range.intersect(t10.seq1Range), r10 = this.seq2Range.intersect(t10.seq2Range);
    if (!(!n10 || !r10)) return new e60(n10, r10);
  }
  getStarts() {
    return new fh(this.seq1Range.start, this.seq2Range.start);
  }
  getEndExclusives() {
    return new fh(this.seq1Range.endExclusive, this.seq2Range.endExclusive);
  }
}, fh = (_O = class {
  constructor(e206, t10) {
    this.offset1 = e206, this.offset2 = t10;
  }
  toString() {
    return `${this.offset1} <-> ${this.offset2}`;
  }
  delta(t10) {
    return t10 === 0 ? this : new _O(this.offset1 + t10, this.offset2 + t10);
  }
  equals(e206) {
    return this.offset1 === e206.offset1 && this.offset2 === e206.offset2;
  }
}, _O.zero = new _O(0, 0), _O.max = new _O(2 ** 53 - 1, 2 ** 53 - 1), _O), ph = (_P = class {
  isValid() {
    return true;
  }
}, _P.instance = new _P(), _P), fie = class {
  constructor(e206) {
    if (this.timeout = e206, this.startTime = Date.now(), this.valid = true, e206 <= 0) throw new je(`timeout must be positive`);
  }
  isValid() {
    return !(Date.now() - this.startTime < this.timeout) && this.valid && (this.valid = false), this.valid;
  }
}, mh = class {
  constructor(e206, t10) {
    this.width = e206, this.height = t10, this.array = [], this.array = Array(e206 * t10);
  }
  get(e206, t10) {
    return this.array[e206 + t10 * this.width];
  }
  set(e206, t10, n10) {
    this.array[e206 + t10 * this.width] = n10;
  }
};
function hh(e206) {
  return e206 === 32 || e206 === 9;
}
var gh = (_Q = class {
  static getKey(e206) {
    let t10 = this.chrKeys.get(e206);
    return t10 === void 0 && (t10 = this.chrKeys.size, this.chrKeys.set(e206, t10)), t10;
  }
  constructor(t10, n10, r10) {
    this.range = t10, this.lines = n10, this.source = r10, this.histogram = [];
    let i10 = 0;
    for (let r11 = t10.startLineNumber - 1; r11 < t10.endLineNumberExclusive - 1; r11++) {
      let t11 = n10[r11];
      for (let n11 = 0; n11 < t11.length; n11++) {
        i10++;
        let r12 = t11[n11], a11 = _Q.getKey(r12);
        this.histogram[a11] = (this.histogram[a11] || 0) + 1;
      }
      i10++;
      let a10 = _Q.getKey(`
`);
      this.histogram[a10] = (this.histogram[a10] || 0) + 1;
    }
    this.totalCount = i10;
  }
  computeSimilarity(e206) {
    let t10 = 0, n10 = Math.max(this.histogram.length, e206.histogram.length);
    for (let r10 = 0; r10 < n10; r10++) t10 += Math.abs((this.histogram[r10] ?? 0) - (e206.histogram[r10] ?? 0));
    return 1 - t10 / (this.totalCount + e206.totalCount);
  }
}, _Q.chrKeys = /* @__PURE__ */ new Map(), _Q), pie = class {
  compute(e206, t10, n10 = ph.instance, r10) {
    if (e206.length === 0 || t10.length === 0) return uh.trivial(e206, t10);
    let i10 = new mh(e206.length, t10.length), a10 = new mh(e206.length, t10.length), o10 = new mh(e206.length, t10.length);
    for (let s11 = 0; s11 < e206.length; s11++) for (let c11 = 0; c11 < t10.length; c11++) {
      if (!n10.isValid()) return uh.trivialTimedOut(e206, t10);
      let l11 = s11 === 0 ? 0 : i10.get(s11 - 1, c11), u11 = c11 === 0 ? 0 : i10.get(s11, c11 - 1), d11;
      e206.getElement(s11) === t10.getElement(c11) ? (d11 = s11 === 0 || c11 === 0 ? 0 : i10.get(s11 - 1, c11 - 1), s11 > 0 && c11 > 0 && a10.get(s11 - 1, c11 - 1) === 3 && (d11 += o10.get(s11 - 1, c11 - 1)), d11 += r10 ? r10(s11, c11) : 1) : d11 = -1;
      let f11 = Math.max(l11, u11, d11);
      if (f11 === d11) {
        let e207 = s11 > 0 && c11 > 0 ? o10.get(s11 - 1, c11 - 1) : 0;
        o10.set(s11, c11, e207 + 1), a10.set(s11, c11, 3);
      } else f11 === l11 ? (o10.set(s11, c11, 0), a10.set(s11, c11, 1)) : f11 === u11 && (o10.set(s11, c11, 0), a10.set(s11, c11, 2));
      i10.set(s11, c11, f11);
    }
    let s10 = [], c10 = e206.length, l10 = t10.length;
    function u10(e207, t11) {
      (e207 + 1 !== c10 || t11 + 1 !== l10) && s10.push(new dh(new Tm(e207 + 1, c10), new Tm(t11 + 1, l10))), c10 = e207, l10 = t11;
    }
    let d10 = e206.length - 1, f10 = t10.length - 1;
    for (; d10 >= 0 && f10 >= 0; ) a10.get(d10, f10) === 3 ? (u10(d10, f10), d10--, f10--) : a10.get(d10, f10) === 1 ? d10-- : f10--;
    return u10(-1, -1), s10.reverse(), new uh(s10, false);
  }
}, _h2 = class {
  compute(e206, t10, n10 = ph.instance) {
    if (e206.length === 0 || t10.length === 0) return uh.trivial(e206, t10);
    let r10 = e206, i10 = t10;
    function a10(e207, t11) {
      for (; e207 < r10.length && t11 < i10.length && r10.getElement(e207) === i10.getElement(t11); ) e207++, t11++;
      return e207;
    }
    let o10 = 0, s10 = new mie();
    s10.set(0, a10(0, 0));
    let c10 = new hie();
    c10.set(0, s10.get(0) === 0 ? null : new vh(null, 0, 0, s10.get(0)));
    let l10 = 0;
    loop: for (; ; ) {
      if (o10++, !n10.isValid()) return uh.trivialTimedOut(r10, i10);
      let e207 = -Math.min(o10, i10.length + o10 % 2), t11 = Math.min(o10, r10.length + o10 % 2);
      for (l10 = e207; l10 <= t11; l10 += 2) {
        let n11 = l10 === t11 ? -1 : s10.get(l10 + 1), o11 = l10 === e207 ? -1 : s10.get(l10 - 1) + 1, u11 = Math.min(Math.max(n11, o11), r10.length), d11 = u11 - l10;
        if (u11 > r10.length || d11 > i10.length) continue;
        let f11 = a10(u11, d11);
        s10.set(l10, f11);
        let p11 = u11 === n11 ? c10.get(l10 + 1) : c10.get(l10 - 1);
        if (c10.set(l10, f11 === u11 ? p11 : new vh(p11, u11, d11, f11 - u11)), s10.get(l10) === r10.length && s10.get(l10) - l10 === i10.length) break loop;
      }
    }
    let u10 = c10.get(l10), d10 = [], f10 = r10.length, p10 = i10.length;
    for (; ; ) {
      let e207 = u10 ? u10.x + u10.length : 0, t11 = u10 ? u10.y + u10.length : 0;
      if ((e207 !== f10 || t11 !== p10) && d10.push(new dh(new Tm(e207, f10), new Tm(t11, p10))), !u10) break;
      f10 = u10.x, p10 = u10.y, u10 = u10.prev;
    }
    return d10.reverse(), new uh(d10, false);
  }
}, vh = class {
  constructor(e206, t10, n10, r10) {
    this.prev = e206, this.x = t10, this.y = n10, this.length = r10;
  }
}, mie = class {
  constructor() {
    this.positiveArr = new Int32Array(10), this.negativeArr = new Int32Array(10);
  }
  get(e206) {
    return e206 < 0 ? (e206 = -e206 - 1, this.negativeArr[e206]) : this.positiveArr[e206];
  }
  set(e206, t10) {
    if (e206 < 0) {
      if (e206 = -e206 - 1, e206 >= this.negativeArr.length) {
        let e207 = this.negativeArr;
        this.negativeArr = new Int32Array(e207.length * 2), this.negativeArr.set(e207);
      }
      this.negativeArr[e206] = t10;
    } else {
      if (e206 >= this.positiveArr.length) {
        let e207 = this.positiveArr;
        this.positiveArr = new Int32Array(e207.length * 2), this.positiveArr.set(e207);
      }
      this.positiveArr[e206] = t10;
    }
  }
}, hie = class {
  constructor() {
    this.positiveArr = [], this.negativeArr = [];
  }
  get(e206) {
    return e206 < 0 ? (e206 = -e206 - 1, this.negativeArr[e206]) : this.positiveArr[e206];
  }
  set(e206, t10) {
    e206 < 0 ? (e206 = -e206 - 1, this.negativeArr[e206] = t10) : this.positiveArr[e206] = t10;
  }
}, yh = class {
  constructor(e206, t10, n10) {
    this.lines = e206, this.range = t10, this.considerWhitespaceChanges = n10, this.elements = [], this.firstElementOffsetByLineIdx = [], this.lineStartOffsets = [], this.trimmedWsLengthsByLineIdx = [], this.firstElementOffsetByLineIdx.push(0);
    for (let t11 = this.range.startLineNumber; t11 <= this.range.endLineNumber; t11++) {
      let r10 = e206[t11 - 1], i10 = 0;
      t11 === this.range.startLineNumber && this.range.startColumn > 1 && (i10 = this.range.startColumn - 1, r10 = r10.substring(i10)), this.lineStartOffsets.push(i10);
      let a10 = 0;
      if (!n10) {
        let e207 = r10.trimStart();
        a10 = r10.length - e207.length, r10 = e207.trimEnd();
      }
      this.trimmedWsLengthsByLineIdx.push(a10);
      let o10 = t11 === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - i10 - a10, r10.length) : r10.length;
      for (let e207 = 0; e207 < o10; e207++) this.elements.push(r10.charCodeAt(e207));
      t11 < this.range.endLineNumber && (this.elements.push(10), this.firstElementOffsetByLineIdx.push(this.elements.length));
    }
  }
  toString() {
    return `Slice: "${this.text}"`;
  }
  get text() {
    return this.getText(new Tm(0, this.length));
  }
  getText(e206) {
    return this.elements.slice(e206.start, e206.endExclusive).map((e207) => String.fromCharCode(e207)).join(``);
  }
  getElement(e206) {
    return this.elements[e206];
  }
  get length() {
    return this.elements.length;
  }
  getBoundaryScore(e206) {
    let t10 = Ch(e206 > 0 ? this.elements[e206 - 1] : -1), n10 = Ch(e206 < this.elements.length ? this.elements[e206] : -1);
    if (t10 === 7 && n10 === 8) return 0;
    if (t10 === 8) return 150;
    let r10 = 0;
    return t10 !== n10 && (r10 += 10, t10 === 0 && n10 === 1 && (r10 += 1)), r10 += Sh(t10), r10 += Sh(n10), r10;
  }
  translateOffset(e206, t10 = `right`) {
    let n10 = Am(this.firstElementOffsetByLineIdx, (t11) => t11 <= e206), r10 = e206 - this.firstElementOffsetByLineIdx[n10];
    return new j(this.range.startLineNumber + n10, 1 + this.lineStartOffsets[n10] + r10 + (r10 === 0 && t10 === `left` ? 0 : this.trimmedWsLengthsByLineIdx[n10]));
  }
  translateRange(e206) {
    let t10 = this.translateOffset(e206.start, `right`), n10 = this.translateOffset(e206.endExclusive, `left`);
    return n10.isBefore(t10) ? M.fromPositions(n10, n10) : M.fromPositions(t10, n10);
  }
  findWordContaining(e206) {
    if (e206 < 0 || e206 >= this.elements.length || !bh(this.elements[e206])) return;
    let t10 = e206;
    for (; t10 > 0 && bh(this.elements[t10 - 1]); ) t10--;
    let n10 = e206;
    for (; n10 < this.elements.length && bh(this.elements[n10]); ) n10++;
    return new Tm(t10, n10);
  }
  findSubWordContaining(e206) {
    if (e206 < 0 || e206 >= this.elements.length || !bh(this.elements[e206])) return;
    let t10 = e206;
    for (; t10 > 0 && bh(this.elements[t10 - 1]) && !xh(this.elements[t10]); ) t10--;
    let n10 = e206;
    for (; n10 < this.elements.length && bh(this.elements[n10]) && !xh(this.elements[n10]); ) n10++;
    return new Tm(t10, n10);
  }
  countLinesIn(e206) {
    return this.translateOffset(e206.endExclusive).lineNumber - this.translateOffset(e206.start).lineNumber;
  }
  isStronglyEqual(e206, t10) {
    return this.elements[e206] === this.elements[t10];
  }
  extendToFullLines(e206) {
    return new Tm(km(this.firstElementOffsetByLineIdx, (t10) => t10 <= e206.start) ?? 0, jm(this.firstElementOffsetByLineIdx, (t10) => e206.endExclusive <= t10) ?? this.elements.length);
  }
};
function bh(e206) {
  return e206 >= 97 && e206 <= 122 || e206 >= 65 && e206 <= 90 || e206 >= 48 && e206 <= 57;
}
function xh(e206) {
  return e206 >= 65 && e206 <= 90;
}
var gie = { 0: 0, 1: 0, 2: 0, 3: 10, 4: 2, 5: 30, 6: 3, 7: 10, 8: 10 };
function Sh(e206) {
  return gie[e206];
}
function Ch(e206) {
  return e206 === 10 ? 8 : e206 === 13 ? 7 : hh(e206) ? 6 : e206 >= 97 && e206 <= 122 ? 0 : e206 >= 65 && e206 <= 90 ? 1 : e206 >= 48 && e206 <= 57 ? 2 : e206 === -1 ? 3 : e206 === 44 || e206 === 59 ? 5 : 4;
}
function _ie(e206, t10, n10, r10, i10, a10) {
  let { moves: o10, excludedChanges: s10 } = yie(e206, t10, n10, a10);
  if (!a10.isValid()) return [];
  let c10 = bie(e206.filter((e207) => !s10.has(e207)), r10, i10, t10, n10, a10);
  return te(o10, c10), o10 = xie(o10), o10 = o10.filter((e207) => {
    let n11 = e207.original.toOffsetRange().slice(t10).map((e208) => e208.trim());
    return n11.join(`
`).length >= 15 && vie(n11, (e208) => e208.length >= 2) >= 2;
  }), o10 = Sie(e206, o10), o10;
}
function vie(e206, t10) {
  let n10 = 0;
  for (let r10 of e206) t10(r10) && n10++;
  return n10;
}
function yie(e206, t10, n10, r10) {
  let i10 = [], a10 = e206.filter((e207) => e207.modified.isEmpty && e207.original.length >= 3).map((e207) => new gh(e207.original, t10, e207)), o10 = new Set(e206.filter((e207) => e207.original.isEmpty && e207.modified.length >= 3).map((e207) => new gh(e207.modified, n10, e207))), s10 = /* @__PURE__ */ new Set();
  for (let e207 of a10) {
    let t11 = -1, n11;
    for (let r11 of o10) {
      let i11 = e207.computeSimilarity(r11);
      i11 > t11 && (t11 = i11, n11 = r11);
    }
    if (t11 > 0.9 && n11 && (o10.delete(n11), i10.push(new Zm(e207.range, n11.range)), s10.add(e207.source), s10.add(n11.source)), !r10.isValid()) return { moves: i10, excludedChanges: s10 };
  }
  return { moves: i10, excludedChanges: s10 };
}
function bie(e206, t10, n10, r10, i10, a10) {
  let o10 = [], s10 = new Ed();
  for (let n11 of e206) for (let e207 = n11.original.startLineNumber; e207 < n11.original.endLineNumberExclusive - 2; e207++) {
    let n12 = `${t10[e207 - 1]}:${t10[e207 + 1 - 1]}:${t10[e207 + 2 - 1]}`;
    s10.add(n12, { range: new zm(e207, e207 + 3) });
  }
  let c10 = [];
  e206.sort(ce((e207) => e207.modified.startLineNumber, ue));
  for (let t11 of e206) {
    let e207 = [];
    for (let r11 = t11.modified.startLineNumber; r11 < t11.modified.endLineNumberExclusive - 2; r11++) {
      let t12 = `${n10[r11 - 1]}:${n10[r11 + 1 - 1]}:${n10[r11 + 2 - 1]}`, i11 = new zm(r11, r11 + 3), a11 = [];
      s10.forEach(t12, ({ range: t13 }) => {
        for (let n12 of e207) if (n12.originalLineRange.endLineNumberExclusive + 1 === t13.endLineNumberExclusive && n12.modifiedLineRange.endLineNumberExclusive + 1 === i11.endLineNumberExclusive) {
          n12.originalLineRange = new zm(n12.originalLineRange.startLineNumber, t13.endLineNumberExclusive), n12.modifiedLineRange = new zm(n12.modifiedLineRange.startLineNumber, i11.endLineNumberExclusive), a11.push(n12);
          return;
        }
        let n11 = { modifiedLineRange: i11, originalLineRange: t13 };
        c10.push(n11), a11.push(n11);
      }), e207 = a11;
    }
    if (!a10.isValid()) return [];
  }
  c10.sort(fe(ce((e207) => e207.modifiedLineRange.length, ue)));
  let l10 = new Bm(), u10 = new Bm();
  for (let e207 of c10) {
    let t11 = e207.modifiedLineRange.startLineNumber - e207.originalLineRange.startLineNumber, n11 = l10.subtractFrom(e207.modifiedLineRange), r11 = u10.subtractFrom(e207.originalLineRange).getWithDelta(t11), i11 = n11.getIntersection(r11);
    for (let e208 of i11.ranges) {
      if (e208.length < 3) continue;
      let n12 = e208, r12 = e208.delta(-t11);
      o10.push(new Zm(r12, n12)), l10.addRange(n12), u10.addRange(r12);
    }
  }
  o10.sort(ce((e207) => e207.original.startLineNumber, ue));
  let d10 = new Nm(e206);
  for (let t11 = 0; t11 < o10.length; t11++) {
    let n11 = o10[t11], s11 = d10.findLastMonotonous((e207) => e207.original.startLineNumber <= n11.original.startLineNumber), c11 = km(e206, (e207) => e207.modified.startLineNumber <= n11.modified.startLineNumber), f10 = Math.max(n11.original.startLineNumber - s11.original.startLineNumber, n11.modified.startLineNumber - c11.modified.startLineNumber), p10 = d10.findLastMonotonous((e207) => e207.original.startLineNumber < n11.original.endLineNumberExclusive), m10 = km(e206, (e207) => e207.modified.startLineNumber < n11.modified.endLineNumberExclusive), h10 = Math.max(p10.original.endLineNumberExclusive - n11.original.endLineNumberExclusive, m10.modified.endLineNumberExclusive - n11.modified.endLineNumberExclusive), g10;
    for (g10 = 0; g10 < f10; g10++) {
      let e207 = n11.original.startLineNumber - g10 - 1, t12 = n11.modified.startLineNumber - g10 - 1;
      if (e207 > r10.length || t12 > i10.length || l10.contains(t12) || u10.contains(e207) || !wh(r10[e207 - 1], i10[t12 - 1], a10)) break;
    }
    g10 > 0 && (u10.addRange(new zm(n11.original.startLineNumber - g10, n11.original.startLineNumber)), l10.addRange(new zm(n11.modified.startLineNumber - g10, n11.modified.startLineNumber)));
    let _10;
    for (_10 = 0; _10 < h10; _10++) {
      let e207 = n11.original.endLineNumberExclusive + _10, t12 = n11.modified.endLineNumberExclusive + _10;
      if (e207 > r10.length || t12 > i10.length || l10.contains(t12) || u10.contains(e207) || !wh(r10[e207 - 1], i10[t12 - 1], a10)) break;
    }
    _10 > 0 && (u10.addRange(new zm(n11.original.endLineNumberExclusive, n11.original.endLineNumberExclusive + _10)), l10.addRange(new zm(n11.modified.endLineNumberExclusive, n11.modified.endLineNumberExclusive + _10))), (g10 > 0 || _10 > 0) && (o10[t11] = new Zm(new zm(n11.original.startLineNumber - g10, n11.original.endLineNumberExclusive + _10), new zm(n11.modified.startLineNumber - g10, n11.modified.endLineNumberExclusive + _10)));
  }
  return o10;
}
function wh(e206, t10, n10) {
  if (e206.trim() === t10.trim()) return true;
  if (e206.length > 300 && t10.length > 300) return false;
  let r10 = new _h2().compute(new yh([e206], new M(1, 1, 1, e206.length), false), new yh([t10], new M(1, 1, 1, t10.length), false), n10), i10 = 0, a10 = dh.invert(r10.diffs, e206.length);
  for (let t11 of a10) t11.seq1Range.forEach((t12) => {
    hh(e206.charCodeAt(t12)) || i10++;
  });
  function o10(t11) {
    let n11 = 0;
    for (let r11 = 0; r11 < e206.length; r11++) hh(t11.charCodeAt(r11)) || n11++;
    return n11;
  }
  let s10 = o10(e206.length > t10.length ? e206 : t10);
  return i10 / s10 > 0.6 && s10 > 10;
}
function xie(e206) {
  if (e206.length === 0) return e206;
  e206.sort(ce((e207) => e207.original.startLineNumber, ue));
  let t10 = [e206[0]];
  for (let n10 = 1; n10 < e206.length; n10++) {
    let r10 = t10[t10.length - 1], i10 = e206[n10], a10 = i10.original.startLineNumber - r10.original.endLineNumberExclusive, o10 = i10.modified.startLineNumber - r10.modified.endLineNumberExclusive;
    if (a10 >= 0 && o10 >= 0 && a10 + o10 <= 2) {
      t10[t10.length - 1] = r10.join(i10);
      continue;
    }
    t10.push(i10);
  }
  return t10;
}
function Sie(e206, t10) {
  let n10 = new Nm(e206);
  return t10 = t10.filter((t11) => (n10.findLastMonotonous((e207) => e207.original.startLineNumber < t11.original.endLineNumberExclusive) || new Zm(new zm(1, 1), new zm(1, 1))) !== km(e206, (e207) => e207.modified.startLineNumber < t11.modified.endLineNumberExclusive)), t10;
}
function Th(e206, t10, n10) {
  let r10 = n10;
  return r10 = Eh(e206, t10, r10), r10 = Eh(e206, t10, r10), r10 = Cie(e206, t10, r10), r10;
}
function Eh(e206, t10, n10) {
  if (n10.length === 0) return n10;
  let r10 = [];
  r10.push(n10[0]);
  for (let i11 = 1; i11 < n10.length; i11++) {
    let a10 = r10[r10.length - 1], o10 = n10[i11];
    if (o10.seq1Range.isEmpty || o10.seq2Range.isEmpty) {
      let n11 = o10.seq1Range.start - a10.seq1Range.endExclusive, i12;
      for (i12 = 1; i12 <= n11 && !(e206.getElement(o10.seq1Range.start - i12) !== e206.getElement(o10.seq1Range.endExclusive - i12) || t10.getElement(o10.seq2Range.start - i12) !== t10.getElement(o10.seq2Range.endExclusive - i12)); i12++) ;
      if (i12--, i12 === n11) {
        r10[r10.length - 1] = new dh(new Tm(a10.seq1Range.start, o10.seq1Range.endExclusive - n11), new Tm(a10.seq2Range.start, o10.seq2Range.endExclusive - n11));
        continue;
      }
      o10 = o10.delta(-i12);
    }
    r10.push(o10);
  }
  let i10 = [];
  for (let n11 = 0; n11 < r10.length - 1; n11++) {
    let a10 = r10[n11 + 1], o10 = r10[n11];
    if (o10.seq1Range.isEmpty || o10.seq2Range.isEmpty) {
      let i11 = a10.seq1Range.start - o10.seq1Range.endExclusive, s10;
      for (s10 = 0; s10 < i11 && !(!e206.isStronglyEqual(o10.seq1Range.start + s10, o10.seq1Range.endExclusive + s10) || !t10.isStronglyEqual(o10.seq2Range.start + s10, o10.seq2Range.endExclusive + s10)); s10++) ;
      if (s10 === i11) {
        r10[n11 + 1] = new dh(new Tm(o10.seq1Range.start + i11, a10.seq1Range.endExclusive), new Tm(o10.seq2Range.start + i11, a10.seq2Range.endExclusive));
        continue;
      }
      s10 > 0 && (o10 = o10.delta(s10));
    }
    i10.push(o10);
  }
  return r10.length > 0 && i10.push(r10[r10.length - 1]), i10;
}
function Cie(e206, t10, n10) {
  if (!e206.getBoundaryScore || !t10.getBoundaryScore) return n10;
  for (let r10 = 0; r10 < n10.length; r10++) {
    let i10 = r10 > 0 ? n10[r10 - 1] : void 0, a10 = n10[r10], o10 = r10 + 1 < n10.length ? n10[r10 + 1] : void 0, s10 = new Tm(i10 ? i10.seq1Range.endExclusive + 1 : 0, o10 ? o10.seq1Range.start - 1 : e206.length), c10 = new Tm(i10 ? i10.seq2Range.endExclusive + 1 : 0, o10 ? o10.seq2Range.start - 1 : t10.length);
    a10.seq1Range.isEmpty ? n10[r10] = Dh(a10, e206, t10, s10, c10) : a10.seq2Range.isEmpty && (n10[r10] = Dh(a10.swap(), t10, e206, c10, s10).swap());
  }
  return n10;
}
function Dh(e206, t10, n10, r10, i10) {
  let a10 = 1;
  for (; e206.seq1Range.start - a10 >= r10.start && e206.seq2Range.start - a10 >= i10.start && n10.isStronglyEqual(e206.seq2Range.start - a10, e206.seq2Range.endExclusive - a10) && a10 < 100; ) a10++;
  a10--;
  let o10 = 0;
  for (; e206.seq1Range.start + o10 < r10.endExclusive && e206.seq2Range.endExclusive + o10 < i10.endExclusive && n10.isStronglyEqual(e206.seq2Range.start + o10, e206.seq2Range.endExclusive + o10) && o10 < 100; ) o10++;
  if (a10 === 0 && o10 === 0) return e206;
  let s10 = 0, c10 = -1;
  for (let r11 = -a10; r11 <= o10; r11++) {
    let i11 = e206.seq2Range.start + r11, a11 = e206.seq2Range.endExclusive + r11, o11 = e206.seq1Range.start + r11, l10 = t10.getBoundaryScore(o11) + n10.getBoundaryScore(i11) + n10.getBoundaryScore(a11);
    l10 > c10 && (c10 = l10, s10 = r11);
  }
  return e206.delta(s10);
}
function wie(e206, t10, n10) {
  let r10 = [];
  for (let e207 of n10) {
    let t11 = r10[r10.length - 1];
    if (!t11) {
      r10.push(e207);
      continue;
    }
    e207.seq1Range.start - t11.seq1Range.endExclusive <= 2 || e207.seq2Range.start - t11.seq2Range.endExclusive <= 2 ? r10[r10.length - 1] = new dh(t11.seq1Range.join(e207.seq1Range), t11.seq2Range.join(e207.seq2Range)) : r10.push(e207);
  }
  return r10;
}
function Oh(e206, t10, n10, r10, i10 = false) {
  let a10 = dh.invert(n10, e206.length), o10 = [], s10 = new fh(0, 0);
  function c10(n11, c11) {
    if (n11.offset1 < s10.offset1 || n11.offset2 < s10.offset2) return;
    let l10 = r10(e206, n11.offset1), u10 = r10(t10, n11.offset2);
    if (!l10 || !u10) return;
    let d10 = new dh(l10, u10), f10 = d10.intersect(c11), p10 = f10.seq1Range.length, m10 = f10.seq2Range.length;
    for (; a10.length > 0; ) {
      let n12 = a10[0];
      if (!(n12.seq1Range.intersects(d10.seq1Range) || n12.seq2Range.intersects(d10.seq2Range))) break;
      let i11 = new dh(r10(e206, n12.seq1Range.start), r10(t10, n12.seq2Range.start)), o11 = i11.intersect(n12);
      if (p10 += o11.seq1Range.length, m10 += o11.seq2Range.length, d10 = d10.join(i11), d10.seq1Range.endExclusive >= n12.seq1Range.endExclusive) a10.shift();
      else break;
    }
    (i10 && p10 + m10 < d10.seq1Range.length + d10.seq2Range.length || p10 + m10 < (d10.seq1Range.length + d10.seq2Range.length) * 2 / 3) && o10.push(d10), s10 = d10.getEndExclusives();
  }
  for (; a10.length > 0; ) {
    let e207 = a10.shift();
    e207.seq1Range.isEmpty || (c10(e207.getStarts(), e207), c10(e207.getEndExclusives().delta(-1), e207));
  }
  return Tie(n10, o10);
}
function Tie(e206, t10) {
  let n10 = [];
  for (; e206.length > 0 || t10.length > 0; ) {
    let r10 = e206[0], i10 = t10[0], a10;
    a10 = r10 && (!i10 || r10.seq1Range.start < i10.seq1Range.start) ? e206.shift() : t10.shift(), n10.length > 0 && n10[n10.length - 1].seq1Range.endExclusive >= a10.seq1Range.start ? n10[n10.length - 1] = n10[n10.length - 1].join(a10) : n10.push(a10);
  }
  return n10;
}
function Eie(e206, t10, n10) {
  let r10 = n10;
  if (r10.length === 0) return r10;
  let i10 = 0, a10;
  do {
    a10 = false;
    let t11 = [r10[0]];
    for (let n11 = 1; n11 < r10.length; n11++) {
      let s10 = function(t12, n12) {
        let r11 = new Tm(o10.seq1Range.endExclusive, i11.seq1Range.start);
        return e206.getText(r11).replace(/\s/g, ``).length <= 4 && (t12.seq1Range.length + t12.seq2Range.length > 5 || n12.seq1Range.length + n12.seq2Range.length > 5);
      };
      let i11 = r10[n11], o10 = t11[t11.length - 1];
      s10(o10, i11) ? (a10 = true, t11[t11.length - 1] = t11[t11.length - 1].join(i11)) : t11.push(i11);
    }
    r10 = t11;
  } while (i10++ < 10 && a10);
  return r10;
}
function Die(e206, t10, n10) {
  let r10 = n10;
  if (r10.length === 0) return r10;
  let i10 = 0, a10;
  do {
    a10 = false;
    let n11 = [r10[0]];
    for (let i11 = 1; i11 < r10.length; i11++) {
      let c10 = function(n12, r11) {
        let i12 = new Tm(s10.seq1Range.endExclusive, o11.seq1Range.start);
        if (e206.countLinesIn(i12) > 5 || i12.length > 500) return false;
        let a11 = e206.getText(i12).trim();
        if (a11.length > 20 || a11.split(/\r\n|\r|\n/).length > 1) return false;
        let c11 = e206.countLinesIn(n12.seq1Range), l10 = n12.seq1Range.length, u10 = t10.countLinesIn(n12.seq2Range), d10 = n12.seq2Range.length, f10 = e206.countLinesIn(r11.seq1Range), p10 = r11.seq1Range.length, m10 = t10.countLinesIn(r11.seq2Range), h10 = r11.seq2Range.length;
        function g10(e207) {
          return Math.min(e207, 130);
        }
        return (g10(c11 * 40 + l10) ** 1.5 + g10(u10 * 40 + d10) ** 1.5) ** 1.5 + (g10(f10 * 40 + p10) ** 1.5 + g10(m10 * 40 + h10) ** 1.5) ** 1.5 > (130 ** 1.5) ** 1.5 * 1.3;
      };
      let o11 = r10[i11], s10 = n11[n11.length - 1];
      c10(s10, o11) ? (a10 = true, n11[n11.length - 1] = n11[n11.length - 1].join(o11)) : n11.push(o11);
    }
    r10 = n11;
  } while (i10++ < 10 && a10);
  let o10 = [];
  return m(r10, (t11, n11, r11) => {
    let i11 = n11;
    function a11(e207) {
      return e207.length > 0 && e207.trim().length <= 3 && n11.seq1Range.length + n11.seq2Range.length > 100;
    }
    let s10 = e206.extendToFullLines(n11.seq1Range), c10 = e206.getText(new Tm(s10.start, n11.seq1Range.start));
    a11(c10) && (i11 = i11.deltaStart(-c10.length));
    let l10 = e206.getText(new Tm(n11.seq1Range.endExclusive, s10.endExclusive));
    a11(l10) && (i11 = i11.deltaEnd(l10.length));
    let u10 = dh.fromOffsetPairs(t11 ? t11.getEndExclusives() : fh.zero, r11 ? r11.getStarts() : fh.max), d10 = i11.intersect(u10);
    o10.length > 0 && d10.getStarts().equals(o10[o10.length - 1].getEndExclusives()) ? o10[o10.length - 1] = o10[o10.length - 1].join(d10) : o10.push(d10);
  }), o10;
}
var kh = class {
  constructor(e206, t10) {
    this.trimmedHash = e206, this.lines = t10;
  }
  getElement(e206) {
    return this.trimmedHash[e206];
  }
  get length() {
    return this.trimmedHash.length;
  }
  getBoundaryScore(e206) {
    return 1e3 - ((e206 === 0 ? 0 : Ah(this.lines[e206 - 1])) + (e206 === this.lines.length ? 0 : Ah(this.lines[e206])));
  }
  getText(e206) {
    return this.lines.slice(e206.start, e206.endExclusive).join(`
`);
  }
  isStronglyEqual(e206, t10) {
    return this.lines[e206] === this.lines[t10];
  }
};
function Ah(e206) {
  let t10 = 0;
  for (; t10 < e206.length && (e206.charCodeAt(t10) === 32 || e206.charCodeAt(t10) === 9); ) t10++;
  return t10;
}
var Oie = class {
  constructor() {
    this.dynamicProgrammingDiffing = new pie(), this.myersDiffingAlgorithm = new _h2();
  }
  computeDiff(e206, t10, n10) {
    if (e206.length <= 1 && o(e206, t10, (e207, t11) => e207 === t11)) return new Cm([], [], false);
    if (e206.length === 1 && e206[0].length === 0 || t10.length === 1 && t10[0].length === 0) return new Cm([new eh(new zm(1, e206.length + 1), new zm(1, t10.length + 1), [new th(new M(1, 1, e206.length, e206[e206.length - 1].length + 1), new M(1, 1, t10.length, t10[t10.length - 1].length + 1))])], [], false);
    let r10 = n10.maxComputationTimeMs === 0 ? ph.instance : new fie(n10.maxComputationTimeMs), i10 = !n10.ignoreTrimWhitespace, a10 = /* @__PURE__ */ new Map();
    function s10(e207) {
      let t11 = a10.get(e207);
      return t11 === void 0 && (t11 = a10.size, a10.set(e207, t11)), t11;
    }
    let c10 = e206.map((e207) => s10(e207.trim())), l10 = t10.map((e207) => s10(e207.trim())), u10 = new kh(c10, e206), d10 = new kh(l10, t10), f10 = u10.length + d10.length < 1700 ? this.dynamicProgrammingDiffing.compute(u10, d10, r10, (n11, r11) => e206[n11] === t10[r11] ? t10[r11].length === 0 ? 0.1 : 1 + Math.log(1 + t10[r11].length) : 0.99) : this.myersDiffingAlgorithm.compute(u10, d10, r10), p10 = f10.diffs, m10 = f10.hitTimeout;
    p10 = Th(u10, d10, p10), p10 = Eie(u10, d10, p10);
    let h10 = [], g10 = (a11) => {
      if (i10) for (let o10 = 0; o10 < a11; o10++) {
        let a12 = _10 + o10, s11 = v10 + o10;
        if (e206[a12] !== t10[s11]) {
          let o11 = this.refineDiff(e206, t10, new dh(new Tm(a12, a12 + 1), new Tm(s11, s11 + 1)), r10, i10, n10);
          for (let e207 of o11.mappings) h10.push(e207);
          o11.hitTimeout && (m10 = true);
        }
      }
    }, _10 = 0, v10 = 0;
    for (let a11 of p10) {
      Ie(() => a11.seq1Range.start - _10 === a11.seq2Range.start - v10), g10(a11.seq1Range.start - _10), _10 = a11.seq1Range.endExclusive, v10 = a11.seq2Range.endExclusive;
      let o10 = this.refineDiff(e206, t10, a11, r10, i10, n10);
      o10.hitTimeout && (m10 = true);
      for (let e207 of o10.mappings) h10.push(e207);
    }
    g10(e206.length - _10);
    let y10 = nh(h10, new Km(e206), new Km(t10)), b10 = [];
    return n10.computeMoves && (b10 = this.computeMoves(y10, e206, t10, c10, l10, r10, i10, n10)), Ie(() => {
      function n11(e207, t11) {
        if (e207.lineNumber < 1 || e207.lineNumber > t11.length) return false;
        let n12 = t11[e207.lineNumber - 1];
        return !(e207.column < 1 || e207.column > n12.length + 1);
      }
      function r11(e207, t11) {
        return !(e207.startLineNumber < 1 || e207.startLineNumber > t11.length + 1 || e207.endLineNumberExclusive < 1 || e207.endLineNumberExclusive > t11.length + 1);
      }
      for (let i11 of y10) {
        if (!i11.innerChanges) return false;
        for (let r12 of i11.innerChanges) if (!(n11(r12.modifiedRange.getStartPosition(), t10) && n11(r12.modifiedRange.getEndPosition(), t10) && n11(r12.originalRange.getStartPosition(), e206) && n11(r12.originalRange.getEndPosition(), e206))) return false;
        if (!r11(i11.modified, t10) || !r11(i11.original, e206)) return false;
      }
      return true;
    }), new Cm(y10, b10, m10);
  }
  computeMoves(e206, t10, n10, r10, i10, a10, o10, s10) {
    return _ie(e206, t10, n10, r10, i10, a10).map((e207) => new wm(e207, nh(this.refineDiff(t10, n10, new dh(e207.original.toOffsetRange(), e207.modified.toOffsetRange()), a10, o10, s10).mappings, new Km(t10), new Km(n10), true)));
  }
  refineDiff(e206, t10, n10, r10, i10, a10) {
    let o10 = kie(n10).toRangeMapping2(e206, t10), s10 = new yh(e206, o10.originalRange, i10), c10 = new yh(t10, o10.modifiedRange, i10), l10 = s10.length + c10.length < 500 ? this.dynamicProgrammingDiffing.compute(s10, c10, r10) : this.myersDiffingAlgorithm.compute(s10, c10, r10), u10 = l10.diffs;
    return u10 = Th(s10, c10, u10), u10 = Oh(s10, c10, u10, (e207, t11) => e207.findWordContaining(t11)), a10.extendToSubwords && (u10 = Oh(s10, c10, u10, (e207, t11) => e207.findSubWordContaining(t11), true)), u10 = wie(s10, c10, u10), u10 = Die(s10, c10, u10), { mappings: u10.map((e207) => new th(s10.translateRange(e207.seq1Range), c10.translateRange(e207.seq2Range))), hitTimeout: l10.hitTimeout };
  }
};
function kie(e206) {
  return new Zm(new zm(e206.seq1Range.start + 1, e206.seq1Range.endExclusive + 1), new zm(e206.seq2Range.start + 1, e206.seq2Range.endExclusive + 1));
}
var jh = { getLegacy: () => new cie(), getDefault: () => new Oie() };
function Mh(e206, t10) {
  let n10 = 10 ** t10;
  return Math.round(e206 * n10) / n10;
}
var J = class {
  constructor(e206, t10, n10, r10 = 1) {
    this._rgbaBrand = void 0, this.r = Math.min(255, Math.max(0, e206)) | 0, this.g = Math.min(255, Math.max(0, t10)) | 0, this.b = Math.min(255, Math.max(0, n10)) | 0, this.a = Mh(Math.max(Math.min(1, r10), 0), 3);
  }
  static equals(e206, t10) {
    return e206.r === t10.r && e206.g === t10.g && e206.b === t10.b && e206.a === t10.a;
  }
}, Nh = class e61 {
  constructor(e206, t10, n10, r10) {
    this._hslaBrand = void 0, this.h = Math.max(Math.min(360, e206), 0) | 0, this.s = Mh(Math.max(Math.min(1, t10), 0), 3), this.l = Mh(Math.max(Math.min(1, n10), 0), 3), this.a = Mh(Math.max(Math.min(1, r10), 0), 3);
  }
  static equals(e206, t10) {
    return e206.h === t10.h && e206.s === t10.s && e206.l === t10.l && e206.a === t10.a;
  }
  static fromRGBA(t10) {
    let n10 = t10.r / 255, r10 = t10.g / 255, i10 = t10.b / 255, a10 = t10.a, o10 = Math.max(n10, r10, i10), s10 = Math.min(n10, r10, i10), c10 = 0, l10 = 0, u10 = (s10 + o10) / 2, d10 = o10 - s10;
    if (d10 > 0) {
      switch (l10 = Math.min(u10 <= 0.5 ? d10 / (2 * u10) : d10 / (2 - 2 * u10), 1), o10) {
        case n10:
          c10 = (r10 - i10) / d10 + (r10 < i10 ? 6 : 0);
          break;
        case r10:
          c10 = (i10 - n10) / d10 + 2;
          break;
        case i10:
          c10 = (n10 - r10) / d10 + 4;
          break;
      }
      c10 *= 60, c10 = Math.round(c10);
    }
    return new e61(c10, l10, u10, a10);
  }
  static _hue2rgb(e206, t10, n10) {
    return n10 < 0 && (n10 += 1), n10 > 1 && --n10, n10 < 1 / 6 ? e206 + (t10 - e206) * 6 * n10 : n10 < 1 / 2 ? t10 : n10 < 2 / 3 ? e206 + (t10 - e206) * (2 / 3 - n10) * 6 : e206;
  }
  static toRGBA(t10) {
    let n10 = t10.h / 360, { s: r10, l: i10, a: a10 } = t10, o10, s10, c10;
    if (r10 === 0) o10 = s10 = c10 = i10;
    else {
      let t11 = i10 < 0.5 ? i10 * (1 + r10) : i10 + r10 - i10 * r10, a11 = 2 * i10 - t11;
      o10 = e61._hue2rgb(a11, t11, n10 + 1 / 3), s10 = e61._hue2rgb(a11, t11, n10), c10 = e61._hue2rgb(a11, t11, n10 - 1 / 3);
    }
    return new J(Math.round(o10 * 255), Math.round(s10 * 255), Math.round(c10 * 255), a10);
  }
}, Ph = class e62 {
  constructor(e206, t10, n10, r10) {
    this._hsvaBrand = void 0, this.h = Math.max(Math.min(360, e206), 0) | 0, this.s = Mh(Math.max(Math.min(1, t10), 0), 3), this.v = Mh(Math.max(Math.min(1, n10), 0), 3), this.a = Mh(Math.max(Math.min(1, r10), 0), 3);
  }
  static equals(e206, t10) {
    return e206.h === t10.h && e206.s === t10.s && e206.v === t10.v && e206.a === t10.a;
  }
  static fromRGBA(t10) {
    let n10 = t10.r / 255, r10 = t10.g / 255, i10 = t10.b / 255, a10 = Math.max(n10, r10, i10), o10 = a10 - Math.min(n10, r10, i10), s10 = a10 === 0 ? 0 : o10 / a10, c10;
    return c10 = o10 === 0 ? 0 : a10 === n10 ? ((r10 - i10) / o10 % 6 + 6) % 6 : a10 === r10 ? (i10 - n10) / o10 + 2 : (n10 - r10) / o10 + 4, new e62(Math.round(c10 * 60), s10, a10, t10.a);
  }
  static toRGBA(e206) {
    let { h: t10, s: n10, v: r10, a: i10 } = e206, a10 = r10 * n10, o10 = a10 * (1 - Math.abs(t10 / 60 % 2 - 1)), s10 = r10 - a10, [c10, l10, u10] = [0, 0, 0];
    return t10 < 60 ? (c10 = a10, l10 = o10) : t10 < 120 ? (c10 = o10, l10 = a10) : t10 < 180 ? (l10 = a10, u10 = o10) : t10 < 240 ? (l10 = o10, u10 = a10) : t10 < 300 ? (c10 = o10, u10 = a10) : t10 <= 360 && (c10 = a10, u10 = o10), c10 = Math.round((c10 + s10) * 255), l10 = Math.round((l10 + s10) * 255), u10 = Math.round((u10 + s10) * 255), new J(c10, l10, u10, i10);
  }
}, Y = (_R = class {
  static fromHex(t10) {
    return _R.Format.CSS.parseHex(t10) || _R.red;
  }
  static equals(e206, t10) {
    return !e206 && !t10 ? true : !e206 || !t10 ? false : e206.equals(t10);
  }
  get hsla() {
    return this._hsla ? this._hsla : Nh.fromRGBA(this.rgba);
  }
  get hsva() {
    return this._hsva ? this._hsva : Ph.fromRGBA(this.rgba);
  }
  constructor(e206) {
    if (!e206) throw Error(`Color needs a value`);
    if (e206 instanceof J) this.rgba = e206;
    else if (e206 instanceof Nh) this._hsla = e206, this.rgba = Nh.toRGBA(e206);
    else if (e206 instanceof Ph) this._hsva = e206, this.rgba = Ph.toRGBA(e206);
    else throw Error(`Invalid color ctor argument`);
  }
  equals(e206) {
    return !!e206 && J.equals(this.rgba, e206.rgba) && Nh.equals(this.hsla, e206.hsla) && Ph.equals(this.hsva, e206.hsva);
  }
  getRelativeLuminance() {
    let t10 = _R._relativeLuminanceForComponent(this.rgba.r), n10 = _R._relativeLuminanceForComponent(this.rgba.g), r10 = _R._relativeLuminanceForComponent(this.rgba.b);
    return Mh(0.2126 * t10 + 0.7152 * n10 + 0.0722 * r10, 4);
  }
  static _relativeLuminanceForComponent(e206) {
    let t10 = e206 / 255;
    return t10 <= 0.03928 ? t10 / 12.92 : ((t10 + 0.055) / 1.055) ** 2.4;
  }
  isLighter() {
    return (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1e3 >= 128;
  }
  isLighterThan(e206) {
    return this.getRelativeLuminance() > e206.getRelativeLuminance();
  }
  isDarkerThan(e206) {
    return this.getRelativeLuminance() < e206.getRelativeLuminance();
  }
  lighten(t10) {
    return new _R(new Nh(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * t10, this.hsla.a));
  }
  darken(t10) {
    return new _R(new Nh(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * t10, this.hsla.a));
  }
  transparent(t10) {
    let { r: n10, g: r10, b: i10, a: a10 } = this.rgba;
    return new _R(new J(n10, r10, i10, a10 * t10));
  }
  isTransparent() {
    return this.rgba.a === 0;
  }
  isOpaque() {
    return this.rgba.a === 1;
  }
  opposite() {
    return new _R(new J(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a));
  }
  mix(t10, n10 = 0.5) {
    let r10 = Math.min(Math.max(n10, 0), 1), i10 = this.rgba, a10 = t10.rgba;
    return new _R(new J(i10.r + (a10.r - i10.r) * r10, i10.g + (a10.g - i10.g) * r10, i10.b + (a10.b - i10.b) * r10, i10.a + (a10.a - i10.a) * r10));
  }
  makeOpaque(t10) {
    if (this.isOpaque() || t10.rgba.a !== 1) return this;
    let { r: n10, g: r10, b: i10, a: a10 } = this.rgba;
    return new _R(new J(t10.rgba.r - a10 * (t10.rgba.r - n10), t10.rgba.g - a10 * (t10.rgba.g - r10), t10.rgba.b - a10 * (t10.rgba.b - i10), 1));
  }
  toString() {
    return this._toString || (this._toString = _R.Format.CSS.format(this)), this._toString;
  }
  toNumber32Bit() {
    return this._toNumber32Bit || (this._toNumber32Bit = (this.rgba.r << 24 | this.rgba.g << 16 | this.rgba.b << 8 | this.rgba.a * 255 << 0) >>> 0), this._toNumber32Bit;
  }
  static getLighterColor(e206, t10, n10) {
    if (e206.isLighterThan(t10)) return e206;
    n10 || (n10 = 0.5);
    let r10 = e206.getRelativeLuminance(), i10 = t10.getRelativeLuminance();
    return n10 = n10 * (i10 - r10) / i10, e206.lighten(n10);
  }
  static getDarkerColor(e206, t10, n10) {
    if (e206.isDarkerThan(t10)) return e206;
    n10 || (n10 = 0.5);
    let r10 = e206.getRelativeLuminance(), i10 = t10.getRelativeLuminance();
    return n10 = n10 * (r10 - i10) / r10, e206.darken(n10);
  }
}, _R.white = new _R(new J(255, 255, 255, 1)), _R.black = new _R(new J(0, 0, 0, 1)), _R.red = new _R(new J(255, 0, 0, 1)), _R.blue = new _R(new J(0, 0, 255, 1)), _R.green = new _R(new J(0, 255, 0, 1)), _R.cyan = new _R(new J(0, 255, 255, 1)), _R.lightgrey = new _R(new J(211, 211, 211, 1)), _R.transparent = new _R(new J(0, 0, 0, 0)), _R);
(function(e206) {
  (function(t10) {
    (function(t11) {
      function n10(t12) {
        return t12.rgba.a === 1 ? `rgb(${t12.rgba.r}, ${t12.rgba.g}, ${t12.rgba.b})` : e206.Format.CSS.formatRGBA(t12);
      }
      t11.formatRGB = n10;
      function r10(e207) {
        return `rgba(${e207.rgba.r}, ${e207.rgba.g}, ${e207.rgba.b}, ${+e207.rgba.a.toFixed(2)})`;
      }
      t11.formatRGBA = r10;
      function i10(t12) {
        return t12.hsla.a === 1 ? `hsl(${t12.hsla.h}, ${Math.round(t12.hsla.s * 100)}%, ${Math.round(t12.hsla.l * 100)}%)` : e206.Format.CSS.formatHSLA(t12);
      }
      t11.formatHSL = i10;
      function a10(e207) {
        return `hsla(${e207.hsla.h}, ${Math.round(e207.hsla.s * 100)}%, ${Math.round(e207.hsla.l * 100)}%, ${e207.hsla.a.toFixed(2)})`;
      }
      t11.formatHSLA = a10;
      function o10(e207) {
        let t12 = e207.toString(16);
        return t12.length === 2 ? t12 : `0` + t12;
      }
      function s10(e207) {
        return `#${o10(e207.rgba.r)}${o10(e207.rgba.g)}${o10(e207.rgba.b)}`;
      }
      t11.formatHex = s10;
      function c10(t12, n11 = false) {
        return n11 && t12.rgba.a === 1 ? e206.Format.CSS.formatHex(t12) : `#${o10(t12.rgba.r)}${o10(t12.rgba.g)}${o10(t12.rgba.b)}${o10(Math.round(t12.rgba.a * 255))}`;
      }
      t11.formatHexA = c10;
      function l10(t12) {
        return t12.isOpaque() ? e206.Format.CSS.formatHex(t12) : e206.Format.CSS.formatRGBA(t12);
      }
      t11.format = l10;
      function u10(t12) {
        if (t12 === `transparent`) return e206.transparent;
        if (t12.startsWith(`#`)) return f10(t12);
        if (t12.startsWith(`rgba(`)) {
          let n11 = t12.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);
          if (!n11) throw Error(`Invalid color format ` + t12);
          return new e206(new J(parseInt(n11.groups?.r ?? `0`), parseInt(n11.groups?.g ?? `0`), parseInt(n11.groups?.b ?? `0`), parseFloat(n11.groups?.a ?? `0`)));
        }
        if (t12.startsWith(`rgb(`)) {
          let n11 = t12.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);
          if (!n11) throw Error(`Invalid color format ` + t12);
          return new e206(new J(parseInt(n11.groups?.r ?? `0`), parseInt(n11.groups?.g ?? `0`), parseInt(n11.groups?.b ?? `0`)));
        }
        return d10(t12);
      }
      t11.parse = u10;
      function d10(t12) {
        switch (t12) {
          case `aliceblue`:
            return new e206(new J(240, 248, 255, 1));
          case `antiquewhite`:
            return new e206(new J(250, 235, 215, 1));
          case `aqua`:
            return new e206(new J(0, 255, 255, 1));
          case `aquamarine`:
            return new e206(new J(127, 255, 212, 1));
          case `azure`:
            return new e206(new J(240, 255, 255, 1));
          case `beige`:
            return new e206(new J(245, 245, 220, 1));
          case `bisque`:
            return new e206(new J(255, 228, 196, 1));
          case `black`:
            return new e206(new J(0, 0, 0, 1));
          case `blanchedalmond`:
            return new e206(new J(255, 235, 205, 1));
          case `blue`:
            return new e206(new J(0, 0, 255, 1));
          case `blueviolet`:
            return new e206(new J(138, 43, 226, 1));
          case `brown`:
            return new e206(new J(165, 42, 42, 1));
          case `burlywood`:
            return new e206(new J(222, 184, 135, 1));
          case `cadetblue`:
            return new e206(new J(95, 158, 160, 1));
          case `chartreuse`:
            return new e206(new J(127, 255, 0, 1));
          case `chocolate`:
            return new e206(new J(210, 105, 30, 1));
          case `coral`:
            return new e206(new J(255, 127, 80, 1));
          case `cornflowerblue`:
            return new e206(new J(100, 149, 237, 1));
          case `cornsilk`:
            return new e206(new J(255, 248, 220, 1));
          case `crimson`:
            return new e206(new J(220, 20, 60, 1));
          case `cyan`:
            return new e206(new J(0, 255, 255, 1));
          case `darkblue`:
            return new e206(new J(0, 0, 139, 1));
          case `darkcyan`:
            return new e206(new J(0, 139, 139, 1));
          case `darkgoldenrod`:
            return new e206(new J(184, 134, 11, 1));
          case `darkgray`:
            return new e206(new J(169, 169, 169, 1));
          case `darkgreen`:
            return new e206(new J(0, 100, 0, 1));
          case `darkgrey`:
            return new e206(new J(169, 169, 169, 1));
          case `darkkhaki`:
            return new e206(new J(189, 183, 107, 1));
          case `darkmagenta`:
            return new e206(new J(139, 0, 139, 1));
          case `darkolivegreen`:
            return new e206(new J(85, 107, 47, 1));
          case `darkorange`:
            return new e206(new J(255, 140, 0, 1));
          case `darkorchid`:
            return new e206(new J(153, 50, 204, 1));
          case `darkred`:
            return new e206(new J(139, 0, 0, 1));
          case `darksalmon`:
            return new e206(new J(233, 150, 122, 1));
          case `darkseagreen`:
            return new e206(new J(143, 188, 143, 1));
          case `darkslateblue`:
            return new e206(new J(72, 61, 139, 1));
          case `darkslategray`:
            return new e206(new J(47, 79, 79, 1));
          case `darkslategrey`:
            return new e206(new J(47, 79, 79, 1));
          case `darkturquoise`:
            return new e206(new J(0, 206, 209, 1));
          case `darkviolet`:
            return new e206(new J(148, 0, 211, 1));
          case `deeppink`:
            return new e206(new J(255, 20, 147, 1));
          case `deepskyblue`:
            return new e206(new J(0, 191, 255, 1));
          case `dimgray`:
            return new e206(new J(105, 105, 105, 1));
          case `dimgrey`:
            return new e206(new J(105, 105, 105, 1));
          case `dodgerblue`:
            return new e206(new J(30, 144, 255, 1));
          case `firebrick`:
            return new e206(new J(178, 34, 34, 1));
          case `floralwhite`:
            return new e206(new J(255, 250, 240, 1));
          case `forestgreen`:
            return new e206(new J(34, 139, 34, 1));
          case `fuchsia`:
            return new e206(new J(255, 0, 255, 1));
          case `gainsboro`:
            return new e206(new J(220, 220, 220, 1));
          case `ghostwhite`:
            return new e206(new J(248, 248, 255, 1));
          case `gold`:
            return new e206(new J(255, 215, 0, 1));
          case `goldenrod`:
            return new e206(new J(218, 165, 32, 1));
          case `gray`:
            return new e206(new J(128, 128, 128, 1));
          case `green`:
            return new e206(new J(0, 128, 0, 1));
          case `greenyellow`:
            return new e206(new J(173, 255, 47, 1));
          case `grey`:
            return new e206(new J(128, 128, 128, 1));
          case `honeydew`:
            return new e206(new J(240, 255, 240, 1));
          case `hotpink`:
            return new e206(new J(255, 105, 180, 1));
          case `indianred`:
            return new e206(new J(205, 92, 92, 1));
          case `indigo`:
            return new e206(new J(75, 0, 130, 1));
          case `ivory`:
            return new e206(new J(255, 255, 240, 1));
          case `khaki`:
            return new e206(new J(240, 230, 140, 1));
          case `lavender`:
            return new e206(new J(230, 230, 250, 1));
          case `lavenderblush`:
            return new e206(new J(255, 240, 245, 1));
          case `lawngreen`:
            return new e206(new J(124, 252, 0, 1));
          case `lemonchiffon`:
            return new e206(new J(255, 250, 205, 1));
          case `lightblue`:
            return new e206(new J(173, 216, 230, 1));
          case `lightcoral`:
            return new e206(new J(240, 128, 128, 1));
          case `lightcyan`:
            return new e206(new J(224, 255, 255, 1));
          case `lightgoldenrodyellow`:
            return new e206(new J(250, 250, 210, 1));
          case `lightgray`:
            return new e206(new J(211, 211, 211, 1));
          case `lightgreen`:
            return new e206(new J(144, 238, 144, 1));
          case `lightgrey`:
            return new e206(new J(211, 211, 211, 1));
          case `lightpink`:
            return new e206(new J(255, 182, 193, 1));
          case `lightsalmon`:
            return new e206(new J(255, 160, 122, 1));
          case `lightseagreen`:
            return new e206(new J(32, 178, 170, 1));
          case `lightskyblue`:
            return new e206(new J(135, 206, 250, 1));
          case `lightslategray`:
            return new e206(new J(119, 136, 153, 1));
          case `lightslategrey`:
            return new e206(new J(119, 136, 153, 1));
          case `lightsteelblue`:
            return new e206(new J(176, 196, 222, 1));
          case `lightyellow`:
            return new e206(new J(255, 255, 224, 1));
          case `lime`:
            return new e206(new J(0, 255, 0, 1));
          case `limegreen`:
            return new e206(new J(50, 205, 50, 1));
          case `linen`:
            return new e206(new J(250, 240, 230, 1));
          case `magenta`:
            return new e206(new J(255, 0, 255, 1));
          case `maroon`:
            return new e206(new J(128, 0, 0, 1));
          case `mediumaquamarine`:
            return new e206(new J(102, 205, 170, 1));
          case `mediumblue`:
            return new e206(new J(0, 0, 205, 1));
          case `mediumorchid`:
            return new e206(new J(186, 85, 211, 1));
          case `mediumpurple`:
            return new e206(new J(147, 112, 219, 1));
          case `mediumseagreen`:
            return new e206(new J(60, 179, 113, 1));
          case `mediumslateblue`:
            return new e206(new J(123, 104, 238, 1));
          case `mediumspringgreen`:
            return new e206(new J(0, 250, 154, 1));
          case `mediumturquoise`:
            return new e206(new J(72, 209, 204, 1));
          case `mediumvioletred`:
            return new e206(new J(199, 21, 133, 1));
          case `midnightblue`:
            return new e206(new J(25, 25, 112, 1));
          case `mintcream`:
            return new e206(new J(245, 255, 250, 1));
          case `mistyrose`:
            return new e206(new J(255, 228, 225, 1));
          case `moccasin`:
            return new e206(new J(255, 228, 181, 1));
          case `navajowhite`:
            return new e206(new J(255, 222, 173, 1));
          case `navy`:
            return new e206(new J(0, 0, 128, 1));
          case `oldlace`:
            return new e206(new J(253, 245, 230, 1));
          case `olive`:
            return new e206(new J(128, 128, 0, 1));
          case `olivedrab`:
            return new e206(new J(107, 142, 35, 1));
          case `orange`:
            return new e206(new J(255, 165, 0, 1));
          case `orangered`:
            return new e206(new J(255, 69, 0, 1));
          case `orchid`:
            return new e206(new J(218, 112, 214, 1));
          case `palegoldenrod`:
            return new e206(new J(238, 232, 170, 1));
          case `palegreen`:
            return new e206(new J(152, 251, 152, 1));
          case `paleturquoise`:
            return new e206(new J(175, 238, 238, 1));
          case `palevioletred`:
            return new e206(new J(219, 112, 147, 1));
          case `papayawhip`:
            return new e206(new J(255, 239, 213, 1));
          case `peachpuff`:
            return new e206(new J(255, 218, 185, 1));
          case `peru`:
            return new e206(new J(205, 133, 63, 1));
          case `pink`:
            return new e206(new J(255, 192, 203, 1));
          case `plum`:
            return new e206(new J(221, 160, 221, 1));
          case `powderblue`:
            return new e206(new J(176, 224, 230, 1));
          case `purple`:
            return new e206(new J(128, 0, 128, 1));
          case `rebeccapurple`:
            return new e206(new J(102, 51, 153, 1));
          case `red`:
            return new e206(new J(255, 0, 0, 1));
          case `rosybrown`:
            return new e206(new J(188, 143, 143, 1));
          case `royalblue`:
            return new e206(new J(65, 105, 225, 1));
          case `saddlebrown`:
            return new e206(new J(139, 69, 19, 1));
          case `salmon`:
            return new e206(new J(250, 128, 114, 1));
          case `sandybrown`:
            return new e206(new J(244, 164, 96, 1));
          case `seagreen`:
            return new e206(new J(46, 139, 87, 1));
          case `seashell`:
            return new e206(new J(255, 245, 238, 1));
          case `sienna`:
            return new e206(new J(160, 82, 45, 1));
          case `silver`:
            return new e206(new J(192, 192, 192, 1));
          case `skyblue`:
            return new e206(new J(135, 206, 235, 1));
          case `slateblue`:
            return new e206(new J(106, 90, 205, 1));
          case `slategray`:
            return new e206(new J(112, 128, 144, 1));
          case `slategrey`:
            return new e206(new J(112, 128, 144, 1));
          case `snow`:
            return new e206(new J(255, 250, 250, 1));
          case `springgreen`:
            return new e206(new J(0, 255, 127, 1));
          case `steelblue`:
            return new e206(new J(70, 130, 180, 1));
          case `tan`:
            return new e206(new J(210, 180, 140, 1));
          case `teal`:
            return new e206(new J(0, 128, 128, 1));
          case `thistle`:
            return new e206(new J(216, 191, 216, 1));
          case `tomato`:
            return new e206(new J(255, 99, 71, 1));
          case `turquoise`:
            return new e206(new J(64, 224, 208, 1));
          case `violet`:
            return new e206(new J(238, 130, 238, 1));
          case `wheat`:
            return new e206(new J(245, 222, 179, 1));
          case `white`:
            return new e206(new J(255, 255, 255, 1));
          case `whitesmoke`:
            return new e206(new J(245, 245, 245, 1));
          case `yellow`:
            return new e206(new J(255, 255, 0, 1));
          case `yellowgreen`:
            return new e206(new J(154, 205, 50, 1));
          default:
            return null;
        }
      }
      function f10(t12) {
        let n11 = t12.length;
        if (n11 === 0 || t12.charCodeAt(0) !== 35) return null;
        if (n11 === 7) return new e206(new J(16 * p10(t12.charCodeAt(1)) + p10(t12.charCodeAt(2)), 16 * p10(t12.charCodeAt(3)) + p10(t12.charCodeAt(4)), 16 * p10(t12.charCodeAt(5)) + p10(t12.charCodeAt(6)), 1));
        if (n11 === 9) return new e206(new J(16 * p10(t12.charCodeAt(1)) + p10(t12.charCodeAt(2)), 16 * p10(t12.charCodeAt(3)) + p10(t12.charCodeAt(4)), 16 * p10(t12.charCodeAt(5)) + p10(t12.charCodeAt(6)), (16 * p10(t12.charCodeAt(7)) + p10(t12.charCodeAt(8))) / 255));
        if (n11 === 4) {
          let n12 = p10(t12.charCodeAt(1)), r11 = p10(t12.charCodeAt(2)), i11 = p10(t12.charCodeAt(3));
          return new e206(new J(16 * n12 + n12, 16 * r11 + r11, 16 * i11 + i11));
        }
        if (n11 === 5) {
          let n12 = p10(t12.charCodeAt(1)), r11 = p10(t12.charCodeAt(2)), i11 = p10(t12.charCodeAt(3)), a11 = p10(t12.charCodeAt(4));
          return new e206(new J(16 * n12 + n12, 16 * r11 + r11, 16 * i11 + i11, (16 * a11 + a11) / 255));
        }
        return null;
      }
      t11.parseHex = f10;
      function p10(e207) {
        switch (e207) {
          case 48:
            return 0;
          case 49:
            return 1;
          case 50:
            return 2;
          case 51:
            return 3;
          case 52:
            return 4;
          case 53:
            return 5;
          case 54:
            return 6;
          case 55:
            return 7;
          case 56:
            return 8;
          case 57:
            return 9;
          case 97:
            return 10;
          case 65:
            return 10;
          case 98:
            return 11;
          case 66:
            return 11;
          case 99:
            return 12;
          case 67:
            return 12;
          case 100:
            return 13;
          case 68:
            return 13;
          case 101:
            return 14;
          case 69:
            return 14;
          case 102:
            return 15;
          case 70:
            return 15;
        }
        return 0;
      }
    })(t10.CSS || (t10.CSS = {}));
  })(e206.Format || (e206.Format = {}));
})(Y || (Y = {}));
function Fh(e206) {
  let t10 = [];
  for (let n10 of e206) {
    let e207 = Number(n10);
    (e207 || e207 === 0 && n10.replace(/\s/g, ``) !== ``) && t10.push(e207);
  }
  return t10;
}
function Ih(e206, t10, n10, r10) {
  return { red: e206 / 255, blue: n10 / 255, green: t10 / 255, alpha: r10 };
}
function Lh(e206, t10) {
  let n10 = t10.index, r10 = t10[0].length;
  if (n10 === void 0) return;
  let i10 = e206.positionAt(n10);
  return { startLineNumber: i10.lineNumber, startColumn: i10.column, endLineNumber: i10.lineNumber, endColumn: i10.column + r10 };
}
function Aie(e206, t10) {
  if (!e206) return;
  let n10 = Y.Format.CSS.parseHex(t10);
  if (n10) return { range: e206, color: Ih(n10.rgba.r, n10.rgba.g, n10.rgba.b, n10.rgba.a) };
}
function Rh(e206, t10, n10) {
  if (!e206 || t10.length !== 1) return;
  let r10 = Fh(t10[0].values());
  return { range: e206, color: Ih(r10[0], r10[1], r10[2], n10 ? r10[3] : 1) };
}
function zh(e206, t10, n10) {
  if (!e206 || t10.length !== 1) return;
  let r10 = Fh(t10[0].values()), i10 = new Y(new Nh(r10[0], r10[1] / 100, r10[2] / 100, n10 ? r10[3] : 1));
  return { range: e206, color: Ih(i10.rgba.r, i10.rgba.g, i10.rgba.b, i10.rgba.a) };
}
function Bh(e206, t10) {
  return typeof e206 == `string` ? [...e206.matchAll(t10)] : e206.findMatches(t10);
}
function jie(e206) {
  let t10 = [], n10 = Bh(e206, /\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm);
  if (n10.length > 0) for (let r10 of n10) {
    let n11 = r10.filter((e207) => e207 !== void 0), i10 = n11[1], a10 = n11[2];
    if (!a10) continue;
    let o10;
    i10 === `rgb` ? o10 = Rh(Lh(e206, r10), Bh(a10, /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm), false) : i10 === `rgba` ? o10 = Rh(Lh(e206, r10), Bh(a10, /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm), true) : i10 === `hsl` ? o10 = zh(Lh(e206, r10), Bh(a10, /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm), false) : i10 === `hsla` ? o10 = zh(Lh(e206, r10), Bh(a10, /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm), true) : i10 === `#` && (o10 = Aie(Lh(e206, r10), i10 + a10)), o10 && t10.push(o10);
  }
  return t10;
}
function Mie(e206) {
  return !e206 || typeof e206.getValue != `function` || typeof e206.positionAt != `function` ? [] : jie(e206);
}
var Nie = /^-+|-+$/g, Vh = 100, Pie = 5;
function Fie(e206, t10) {
  let n10 = [];
  if (t10.findRegionSectionHeaders && t10.foldingRules?.markers) {
    let r10 = Iie(e206, t10);
    n10 = n10.concat(r10);
  }
  if (t10.findMarkSectionHeaders) {
    let r10 = Lie(e206, t10);
    n10 = n10.concat(r10);
  }
  return n10;
}
function Iie(e206, t10) {
  let n10 = [], r10 = e206.getLineCount();
  for (let i10 = 1; i10 <= r10; i10++) {
    let r11 = e206.getLineContent(i10), a10 = r11.match(t10.foldingRules.markers.start);
    if (a10) {
      let e207 = { startLineNumber: i10, startColumn: a10[0].length + 1, endLineNumber: i10, endColumn: r11.length + 1 };
      if (e207.endColumn > e207.startColumn) {
        let t11 = { range: e207, ...Rie(r11.substring(a10[0].length)), shouldBeInComments: false };
        (t11.text || t11.hasSeparatorLine) && n10.push(t11);
      }
    }
  }
  return n10;
}
function Lie(e206, t10) {
  let n10 = [], r10 = e206.getLineCount();
  if (!t10.markSectionHeaderRegex || t10.markSectionHeaderRegex.trim() === ``) return n10;
  let i10 = dm(t10.markSectionHeaderRegex), a10 = new RegExp(t10.markSectionHeaderRegex, `gdm${i10 ? `s` : ``}`);
  if (Ua(a10)) return n10;
  for (let t11 = 1; t11 <= r10; t11 += Vh - Pie) {
    let i11 = Math.min(t11 + Vh - 1, r10), o10 = [];
    for (let n11 = t11; n11 <= i11; n11++) o10.push(e206.getLineContent(n11));
    let s10 = o10.join(`
`);
    a10.lastIndex = 0;
    let c10;
    for (; (c10 = a10.exec(s10)) !== null; ) {
      let e207 = s10.substring(0, c10.index), r11 = (e207.match(/\n/g) || []).length, i12 = t11 + r11, o11 = c10[0].split(`
`), l10 = o11.length, u10 = i12 + l10 - 1, d10 = e207.lastIndexOf(`
`) + 1, f10 = c10.index - d10 + 1, p10 = o11[o11.length - 1], m10 = { range: { startLineNumber: i12, startColumn: f10, endLineNumber: u10, endColumn: l10 === 1 ? f10 + c10[0].length : p10.length + 1 }, text: (c10.groups ?? {}).label ?? ``, hasSeparatorLine: ((c10.groups ?? {}).separator ?? ``) !== ``, shouldBeInComments: true };
      (m10.text || m10.hasSeparatorLine) && (n10.length === 0 || n10[n10.length - 1].range.endLineNumber < m10.range.startLineNumber) && n10.push(m10), a10.lastIndex = c10.index + c10[0].length;
    }
  }
  return n10;
}
function Rie(e206) {
  e206 = e206.trim();
  let t10 = e206.startsWith(`-`);
  return e206 = e206.replace(Nie, ``), { text: e206, hasSeparatorLine: t10 };
}
var zie = class {
  constructor(e206) {
    this.values = e206, this.prefixSum = new Uint32Array(e206.length), this.prefixSumValidIndex = new Int32Array(1), this.prefixSumValidIndex[0] = -1;
  }
  insertValues(e206, t10) {
    e206 = Ip(e206);
    let n10 = this.values, r10 = this.prefixSum, i10 = t10.length;
    return i10 === 0 ? false : (this.values = new Uint32Array(n10.length + i10), this.values.set(n10.subarray(0, e206), 0), this.values.set(n10.subarray(e206), e206 + i10), this.values.set(t10, e206), e206 - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e206 - 1), this.prefixSum = new Uint32Array(this.values.length), this.prefixSumValidIndex[0] >= 0 && this.prefixSum.set(r10.subarray(0, this.prefixSumValidIndex[0] + 1)), true);
  }
  setValue(e206, t10) {
    return e206 = Ip(e206), t10 = Ip(t10), this.values[e206] === t10 ? false : (this.values[e206] = t10, e206 - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e206 - 1), true);
  }
  removeValues(e206, t10) {
    e206 = Ip(e206), t10 = Ip(t10);
    let n10 = this.values, r10 = this.prefixSum;
    if (e206 >= n10.length) return false;
    let i10 = n10.length - e206;
    return t10 >= i10 && (t10 = i10), t10 === 0 ? false : (this.values = new Uint32Array(n10.length - t10), this.values.set(n10.subarray(0, e206), 0), this.values.set(n10.subarray(e206 + t10), e206), this.prefixSum = new Uint32Array(this.values.length), e206 - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e206 - 1), this.prefixSumValidIndex[0] >= 0 && this.prefixSum.set(r10.subarray(0, this.prefixSumValidIndex[0] + 1)), true);
  }
  getTotalSum() {
    return this.values.length === 0 ? 0 : this._getPrefixSum(this.values.length - 1);
  }
  getPrefixSum(e206) {
    return e206 < 0 ? 0 : (e206 = Ip(e206), this._getPrefixSum(e206));
  }
  _getPrefixSum(e206) {
    if (e206 <= this.prefixSumValidIndex[0]) return this.prefixSum[e206];
    let t10 = this.prefixSumValidIndex[0] + 1;
    t10 === 0 && (this.prefixSum[0] = this.values[0], t10++), e206 >= this.values.length && (e206 = this.values.length - 1);
    for (let n10 = t10; n10 <= e206; n10++) this.prefixSum[n10] = this.prefixSum[n10 - 1] + this.values[n10];
    return this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], e206), this.prefixSum[e206];
  }
  getIndexOf(e206) {
    e206 = Math.floor(e206), this.getTotalSum();
    let t10 = 0, n10 = this.values.length - 1, r10 = 0, i10 = 0, a10 = 0;
    for (; t10 <= n10; ) if (r10 = t10 + (n10 - t10) / 2 | 0, i10 = this.prefixSum[r10], a10 = i10 - this.values[r10], e206 < a10) n10 = r10 - 1;
    else if (e206 >= i10) t10 = r10 + 1;
    else break;
    return new Hh(r10, e206 - a10);
  }
}, Bie = class {
  constructor(e206) {
    this._values = e206, this._isValid = false, this._validEndIndex = -1, this._prefixSum = [], this._indexBySum = [];
  }
  getTotalSum() {
    return this._ensureValid(), this._indexBySum.length;
  }
  getPrefixSum(e206) {
    return this._ensureValid(), e206 === 0 ? 0 : this._prefixSum[e206 - 1];
  }
  getIndexOf(e206) {
    this._ensureValid();
    let t10 = this._indexBySum[e206];
    return new Hh(t10, e206 - (t10 > 0 ? this._prefixSum[t10 - 1] : 0));
  }
  removeValues(e206, t10) {
    this._values.splice(e206, t10), this._invalidate(e206);
  }
  insertValues(e206, t10) {
    this._values = x(this._values, e206, t10), this._invalidate(e206);
  }
  _invalidate(e206) {
    this._isValid = false, this._validEndIndex = Math.min(this._validEndIndex, e206 - 1);
  }
  _ensureValid() {
    if (!this._isValid) {
      for (let e206 = this._validEndIndex + 1, t10 = this._values.length; e206 < t10; e206++) {
        let t11 = this._values[e206], n10 = e206 > 0 ? this._prefixSum[e206 - 1] : 0;
        this._prefixSum[e206] = n10 + t11;
        for (let r10 = 0; r10 < t11; r10++) this._indexBySum[n10 + r10] = e206;
      }
      this._prefixSum.length = this._values.length, this._indexBySum.length = this._prefixSum[this._prefixSum.length - 1], this._isValid = true, this._validEndIndex = this._values.length - 1;
    }
  }
  setValue(e206, t10) {
    this._values[e206] !== t10 && (this._values[e206] = t10, this._invalidate(e206));
  }
}, Hh = class {
  constructor(e206, t10) {
    this.index = e206, this.remainder = t10, this._prefixSumIndexOfResultBrand = void 0, this.index = e206, this.remainder = t10;
  }
}, Vie = class {
  constructor(e206, t10, n10, r10) {
    this._uri = e206, this._lines = t10, this._eol = n10, this._versionId = r10, this._lineStarts = null, this._cachedTextValue = null;
  }
  dispose() {
    this._lines.length = 0;
  }
  get version() {
    return this._versionId;
  }
  getText() {
    return this._cachedTextValue === null && (this._cachedTextValue = this._lines.join(this._eol)), this._cachedTextValue;
  }
  onEvents(e206) {
    e206.eol && e206.eol !== this._eol && (this._eol = e206.eol, this._lineStarts = null);
    let t10 = e206.changes;
    for (let e207 of t10) this._acceptDeleteRange(e207.range), this._acceptInsertText(new j(e207.range.startLineNumber, e207.range.startColumn), e207.text);
    this._versionId = e206.versionId, this._cachedTextValue = null;
  }
  _ensureLineStarts() {
    if (!this._lineStarts) {
      let e206 = this._eol.length, t10 = this._lines.length, n10 = new Uint32Array(t10);
      for (let r10 = 0; r10 < t10; r10++) n10[r10] = this._lines[r10].length + e206;
      this._lineStarts = new zie(n10);
    }
  }
  _setLineText(e206, t10) {
    this._lines[e206] = t10, this._lineStarts && this._lineStarts.setValue(e206, this._lines[e206].length + this._eol.length);
  }
  _acceptDeleteRange(e206) {
    if (e206.startLineNumber === e206.endLineNumber) {
      if (e206.startColumn === e206.endColumn) return;
      this._setLineText(e206.startLineNumber - 1, this._lines[e206.startLineNumber - 1].substring(0, e206.startColumn - 1) + this._lines[e206.startLineNumber - 1].substring(e206.endColumn - 1));
      return;
    }
    this._setLineText(e206.startLineNumber - 1, this._lines[e206.startLineNumber - 1].substring(0, e206.startColumn - 1) + this._lines[e206.endLineNumber - 1].substring(e206.endColumn - 1)), this._lines.splice(e206.startLineNumber, e206.endLineNumber - e206.startLineNumber), this._lineStarts && this._lineStarts.removeValues(e206.startLineNumber, e206.endLineNumber - e206.startLineNumber);
  }
  _acceptInsertText(e206, t10) {
    if (t10.length === 0) return;
    let n10 = Wa(t10);
    if (n10.length === 1) {
      this._setLineText(e206.lineNumber - 1, this._lines[e206.lineNumber - 1].substring(0, e206.column - 1) + n10[0] + this._lines[e206.lineNumber - 1].substring(e206.column - 1));
      return;
    }
    n10[n10.length - 1] += this._lines[e206.lineNumber - 1].substring(e206.column - 1), this._setLineText(e206.lineNumber - 1, this._lines[e206.lineNumber - 1].substring(0, e206.column - 1) + n10[0]);
    let r10 = new Uint32Array(n10.length - 1);
    for (let t11 = 1; t11 < n10.length; t11++) this._lines.splice(e206.lineNumber + t11 - 1, 0, n10[t11]), r10[t11 - 1] = n10[t11].length + this._eol.length;
    this._lineStarts && this._lineStarts.insertValues(e206.lineNumber, r10);
  }
}, Hie = 60 * 1e3, Uie = class extends D {
  constructor(e206, t10, n10 = false) {
    if (super(), this._syncedModels = /* @__PURE__ */ Object.create(null), this._syncedModelsLastUsedTime = /* @__PURE__ */ Object.create(null), this._proxy = e206, this._modelService = t10, !n10) {
      let e207 = new ls();
      e207.cancelAndSet(() => this._checkStopModelSync(), Math.round(Hie / 2)), this._register(e207);
    }
  }
  dispose() {
    for (let e206 in this._syncedModels) Kt(this._syncedModels[e206]);
    this._syncedModels = /* @__PURE__ */ Object.create(null), this._syncedModelsLastUsedTime = /* @__PURE__ */ Object.create(null), super.dispose();
  }
  ensureSyncedResources(e206, t10 = false) {
    for (let n10 of e206) {
      let e207 = n10.toString();
      this._syncedModels[e207] || this._beginModelSync(n10, t10), this._syncedModels[e207] && (this._syncedModelsLastUsedTime[e207] = (/* @__PURE__ */ new Date()).getTime());
    }
  }
  _checkStopModelSync() {
    let e206 = (/* @__PURE__ */ new Date()).getTime(), t10 = [];
    for (let n10 in this._syncedModelsLastUsedTime) e206 - this._syncedModelsLastUsedTime[n10] > 6e4 && t10.push(n10);
    for (let e207 of t10) this._stopModelSync(e207);
  }
  _beginModelSync(e206, t10) {
    let n10 = this._modelService.getModel(e206);
    if (!n10 || !t10 && n10.isTooLargeForSyncing()) return;
    let r10 = e206.toString();
    this._proxy.$acceptNewModel({ url: n10.uri.toString(), lines: n10.getLinesContent(), EOL: n10.getEOL(), versionId: n10.getVersionId() });
    let i10 = new E();
    i10.add(n10.onDidChangeContent((e207) => {
      this._proxy.$acceptModelChanged(r10.toString(), e207);
    })), i10.add(n10.onWillDispose(() => {
      this._stopModelSync(r10);
    })), i10.add(T(() => {
      this._proxy.$acceptRemovedModel(r10);
    })), this._syncedModels[r10] = i10;
  }
  _stopModelSync(e206) {
    let t10 = this._syncedModels[e206];
    delete this._syncedModels[e206], delete this._syncedModelsLastUsedTime[e206], Kt(t10);
  }
}, Wie = class {
  constructor() {
    this._models = /* @__PURE__ */ Object.create(null);
  }
  getModel(e206) {
    return this._models[e206];
  }
  getModels() {
    let e206 = [];
    return Object.keys(this._models).forEach((t10) => e206.push(this._models[t10])), e206;
  }
  $acceptNewModel(e206) {
    this._models[e206.url] = new Gie($r.parse(e206.url), e206.lines, e206.EOL, e206.versionId);
  }
  $acceptModelChanged(e206, t10) {
    this._models[e206] && this._models[e206].onEvents(t10);
  }
  $acceptRemovedModel(e206) {
    this._models[e206] && delete this._models[e206];
  }
}, Gie = class extends Vie {
  get uri() {
    return this._uri;
  }
  get eol() {
    return this._eol;
  }
  getValue() {
    return this.getText();
  }
  findMatches(e206) {
    let t10 = [];
    for (let n10 = 0; n10 < this._lines.length; n10++) {
      let r10 = this._lines[n10], i10 = this.offsetAt(new j(n10 + 1, 1)), a10 = r10.matchAll(e206);
      for (let e207 of a10) (e207.index || e207.index === 0) && (e207.index += i10), t10.push(e207);
    }
    return t10;
  }
  getLinesContent() {
    return this._lines.slice(0);
  }
  getLineCount() {
    return this._lines.length;
  }
  getLineContent(e206) {
    return this._lines[e206 - 1];
  }
  getWordAtPosition(e206, t10) {
    let n10 = wn(e206.column, Sn(t10), this._lines[e206.lineNumber - 1], 0);
    return n10 ? new M(e206.lineNumber, n10.startColumn, e206.lineNumber, n10.endColumn) : null;
  }
  words(e206) {
    let t10 = this._lines, n10 = this._wordenize.bind(this), r10 = 0, i10 = ``, a10 = 0, o10 = [];
    return { *[Symbol.iterator]() {
      for (; ; ) if (a10 < o10.length) {
        let e207 = i10.substring(o10[a10].start, o10[a10].end);
        a10 += 1, yield e207;
      } else if (r10 < t10.length) i10 = t10[r10], o10 = n10(i10, e206), a10 = 0, r10 += 1;
      else break;
    } };
  }
  getLineWords(e206, t10) {
    let n10 = this._lines[e206 - 1], r10 = this._wordenize(n10, t10), i10 = [];
    for (let e207 of r10) i10.push({ word: n10.substring(e207.start, e207.end), startColumn: e207.start + 1, endColumn: e207.end + 1 });
    return i10;
  }
  _wordenize(e206, t10) {
    let n10 = [], r10;
    for (t10.lastIndex = 0; (r10 = t10.exec(e206)) && r10[0].length !== 0; ) n10.push({ start: r10.index, end: r10.index + r10[0].length });
    return n10;
  }
  getValueInRange(e206) {
    if (e206 = this._validateRange(e206), e206.startLineNumber === e206.endLineNumber) return this._lines[e206.startLineNumber - 1].substring(e206.startColumn - 1, e206.endColumn - 1);
    let t10 = this._eol, n10 = e206.startLineNumber - 1, r10 = e206.endLineNumber - 1, i10 = [];
    i10.push(this._lines[n10].substring(e206.startColumn - 1));
    for (let e207 = n10 + 1; e207 < r10; e207++) i10.push(this._lines[e207]);
    return i10.push(this._lines[r10].substring(0, e206.endColumn - 1)), i10.join(t10);
  }
  offsetAt(e206) {
    return e206 = this._validatePosition(e206), this._ensureLineStarts(), this._lineStarts.getPrefixSum(e206.lineNumber - 2) + (e206.column - 1);
  }
  positionAt(e206) {
    e206 = Math.floor(e206), e206 = Math.max(0, e206), this._ensureLineStarts();
    let t10 = this._lineStarts.getIndexOf(e206), n10 = this._lines[t10.index].length;
    return { lineNumber: 1 + t10.index, column: 1 + Math.min(t10.remainder, n10) };
  }
  _validateRange(e206) {
    let t10 = this._validatePosition({ lineNumber: e206.startLineNumber, column: e206.startColumn }), n10 = this._validatePosition({ lineNumber: e206.endLineNumber, column: e206.endColumn });
    return t10.lineNumber !== e206.startLineNumber || t10.column !== e206.startColumn || n10.lineNumber !== e206.endLineNumber || n10.column !== e206.endColumn ? { startLineNumber: t10.lineNumber, startColumn: t10.column, endLineNumber: n10.lineNumber, endColumn: n10.column } : e206;
  }
  _validatePosition(e206) {
    if (!j.isIPosition(e206)) throw Error(`bad position`);
    let { lineNumber: t10, column: n10 } = e206, r10 = false;
    if (t10 < 1) t10 = 1, n10 = 1, r10 = true;
    else if (t10 > this._lines.length) t10 = this._lines.length, n10 = this._lines[t10 - 1].length + 1, r10 = true;
    else {
      let e207 = this._lines[t10 - 1].length + 1;
      n10 < 1 ? (n10 = 1, r10 = true) : n10 > e207 && (n10 = e207, r10 = true);
    }
    return r10 ? { lineNumber: t10, column: n10 } : e206;
  }
}, Kie = (_S = class {
  constructor(e206 = null) {
    this._foreignModule = e206, this._requestHandlerBrand = void 0, this._workerTextModelSyncServer = new Wie();
  }
  dispose() {
  }
  async $ping() {
    return `pong`;
  }
  _getModel(e206) {
    return this._workerTextModelSyncServer.getModel(e206);
  }
  getModels() {
    return this._workerTextModelSyncServer.getModels();
  }
  $acceptNewModel(e206) {
    this._workerTextModelSyncServer.$acceptNewModel(e206);
  }
  $acceptModelChanged(e206, t10) {
    this._workerTextModelSyncServer.$acceptModelChanged(e206, t10);
  }
  $acceptRemovedModel(e206) {
    this._workerTextModelSyncServer.$acceptRemovedModel(e206);
  }
  async $computeUnicodeHighlights(e206, t10, n10) {
    let r10 = this._getModel(e206);
    return r10 ? ym.computeUnicodeHighlights(r10, t10, n10) : { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 };
  }
  async $findSectionHeaders(e206, t10) {
    let n10 = this._getModel(e206);
    return n10 ? Fie(n10, t10) : [];
  }
  async $computeDiff(t10, n10, r10, i10) {
    let a10 = this._getModel(t10), o10 = this._getModel(n10);
    return !a10 || !o10 ? null : _S.computeDiff(a10, o10, r10, i10);
  }
  static computeDiff(e206, t10, n10, r10) {
    let i10 = r10 === `advanced` ? jh.getDefault() : jh.getLegacy(), a10 = e206.getLinesContent(), o10 = t10.getLinesContent(), s10 = i10.computeDiff(a10, o10, n10), c10 = s10.changes.length > 0 ? false : this._modelsAreIdentical(e206, t10);
    function l10(e207) {
      return e207.map((e208) => [e208.original.startLineNumber, e208.original.endLineNumberExclusive, e208.modified.startLineNumber, e208.modified.endLineNumberExclusive, e208.innerChanges?.map((e209) => [e209.originalRange.startLineNumber, e209.originalRange.startColumn, e209.originalRange.endLineNumber, e209.originalRange.endColumn, e209.modifiedRange.startLineNumber, e209.modifiedRange.startColumn, e209.modifiedRange.endLineNumber, e209.modifiedRange.endColumn])]);
    }
    return { identical: c10, quitEarly: s10.hitTimeout, changes: l10(s10.changes), moves: s10.moves.map((e207) => [e207.lineRangeMapping.original.startLineNumber, e207.lineRangeMapping.original.endLineNumberExclusive, e207.lineRangeMapping.modified.startLineNumber, e207.lineRangeMapping.modified.endLineNumberExclusive, l10(e207.changes)]) };
  }
  static _modelsAreIdentical(e206, t10) {
    let n10 = e206.getLineCount();
    if (n10 !== t10.getLineCount()) return false;
    for (let r10 = 1; r10 <= n10; r10++) if (e206.getLineContent(r10) !== t10.getLineContent(r10)) return false;
    return true;
  }
  async $computeMoreMinimalEdits(t10, n10, r10) {
    let i10 = this._getModel(t10);
    if (!i10) return n10;
    let a10 = [], o10;
    n10 = n10.slice(0).sort((e206, t11) => e206.range && t11.range ? M.compareRangesUsingStarts(e206.range, t11.range) : !e206.range - +!t11.range);
    let s10 = 0;
    for (let e206 = 1; e206 < n10.length; e206++) M.getEndPosition(n10[s10].range).equals(M.getStartPosition(n10[e206].range)) ? (n10[s10].range = M.fromPositions(M.getStartPosition(n10[s10].range), M.getEndPosition(n10[e206].range)), n10[s10].text += n10[e206].text) : (s10++, n10[s10] = n10[e206]);
    n10.length = s10 + 1;
    for (let { range: t11, text: s11, eol: c10 } of n10) {
      if (typeof c10 == `number` && (o10 = c10), M.isEmpty(t11) && !s11) continue;
      let n11 = i10.getValueInRange(t11);
      if (s11 = s11.replace(/\r\n|\n|\r/g, i10.eol), n11 === s11) continue;
      if (Math.max(s11.length, n11.length) > _S._diffLimit) {
        a10.push({ range: t11, text: s11 });
        continue;
      }
      let l10 = rie(n11, s11, r10), u10 = i10.offsetAt(M.lift(t11).getStartPosition());
      for (let e206 of l10) {
        let t12 = i10.positionAt(u10 + e206.originalStart), n12 = i10.positionAt(u10 + e206.originalStart + e206.originalLength), r11 = { text: s11.substr(e206.modifiedStart, e206.modifiedLength), range: { startLineNumber: t12.lineNumber, startColumn: t12.column, endLineNumber: n12.lineNumber, endColumn: n12.column } };
        i10.getValueInRange(r11.range) !== r11.text && a10.push(r11);
      }
    }
    return typeof o10 == `number` && a10.push({ eol: o10, text: ``, range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }), a10;
  }
  async $computeLinks(e206) {
    let t10 = this._getModel(e206);
    return t10 ? Kp(t10) : null;
  }
  async $computeDefaultDocumentColors(e206) {
    let t10 = this._getModel(e206);
    return t10 ? Mie(t10) : null;
  }
  async $textualSuggest(t10, n10, r10, i10) {
    let a10 = new $t(), o10 = new RegExp(r10, i10), s10 = /* @__PURE__ */ new Set();
    outer: for (let r11 of t10) {
      let t11 = this._getModel(r11);
      if (t11) {
        for (let r12 of t11.words(o10)) if (!(r12 === n10 || !isNaN(Number(r12))) && (s10.add(r12), s10.size > _S._suggestionsLimit)) break outer;
      }
    }
    return { words: Array.from(s10), duration: a10.elapsed() };
  }
  async $computeWordRanges(e206, t10, n10, r10) {
    let i10 = this._getModel(e206);
    if (!i10) return /* @__PURE__ */ Object.create(null);
    let a10 = new RegExp(n10, r10), o10 = /* @__PURE__ */ Object.create(null);
    for (let e207 = t10.startLineNumber; e207 < t10.endLineNumber; e207++) {
      let t11 = i10.getLineWords(e207, a10);
      for (let n11 of t11) {
        if (!isNaN(Number(n11.word))) continue;
        let t12 = o10[n11.word];
        t12 || (t12 = [], o10[n11.word] = t12), t12.push({ startLineNumber: e207, startColumn: n11.startColumn, endLineNumber: e207, endColumn: n11.endColumn });
      }
    }
    return o10;
  }
  async $navigateValueSet(e206, t10, n10, r10, i10) {
    let a10 = this._getModel(e206);
    if (!a10) return null;
    let o10 = new RegExp(r10, i10);
    t10.startColumn === t10.endColumn && (t10 = { startLineNumber: t10.startLineNumber, startColumn: t10.startColumn, endLineNumber: t10.endLineNumber, endColumn: t10.endColumn + 1 });
    let s10 = a10.getValueInRange(t10), c10 = a10.getWordAtPosition({ lineNumber: t10.startLineNumber, column: t10.startColumn }, o10);
    if (!c10) return null;
    let l10 = a10.getValueInRange(c10);
    return qp.INSTANCE.navigateValueSet(t10, s10, c10, l10, n10);
  }
  $fmr(e206, t10) {
    if (!this._foreignModule || typeof this._foreignModule[e206] != `function`) return Promise.reject(Error(`Missing requestHandler or method: ` + e206));
    try {
      return Promise.resolve(this._foreignModule[e206].apply(this._foreignModule, t10));
    } catch (e207) {
      return Promise.reject(e207);
    }
  }
}, _S._diffLimit = 1e5, _S._suggestionsLimit = 1e4, _S);
typeof importScripts == `function` && (globalThis.monaco = ka());
var Uh = xu(`textResourceConfigurationService`), Wh = xu(`textResourcePropertiesService`), X = xu(`ILanguageFeaturesService`), qie = (_T = class {
  static getChannel(t10) {
    return t10.getChannel(_T.CHANNEL_NAME);
  }
  static setChannel(t10, n10) {
    t10.setChannel(_T.CHANNEL_NAME, n10);
  }
}, _T.CHANNEL_NAME = `editorWorkerHost`, _T), Gh = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Kh = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, qh = 300 * 1e3;
function Jh(e206, t10) {
  let n10 = e206.getModel(t10);
  return !(!n10 || n10.isTooLargeForSyncing());
}
var Yh = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._languageConfigurationService = i10, this._modelService = t10, this._workerManager = this._register(new Xh(e206, this._modelService)), this._logService = r10, this._register(a10.linkProvider.register({ language: `*`, hasAccessToAllModels: true }, { provideLinks: async (e207, t11) => {
      if (!Jh(this._modelService, e207.uri)) return Promise.resolve({ links: [] });
      let n11 = await (await this._workerWithResources([e207.uri])).$computeLinks(e207.uri.toString());
      return n11 && { links: n11 };
    } })), this._register(a10.completionProvider.register(`*`, new Jie(this._workerManager, n10, this._modelService, this._languageConfigurationService, this._logService)));
  }
  dispose() {
    super.dispose();
  }
  canComputeUnicodeHighlights(e206) {
    return Jh(this._modelService, e206);
  }
  async computedUnicodeHighlights(e206, t10, n10) {
    return (await this._workerWithResources([e206])).$computeUnicodeHighlights(e206.toString(), t10, n10);
  }
  async computeDiff(e206, t10, n10, r10) {
    let i10 = await (await this._workerWithResources([e206, t10], true)).$computeDiff(e206.toString(), t10.toString(), n10, r10);
    if (!i10) return null;
    return { identical: i10.identical, quitEarly: i10.quitEarly, changes: a10(i10.changes), moves: i10.moves.map((e207) => new wm(new Zm(new zm(e207[0], e207[1]), new zm(e207[2], e207[3])), a10(e207[4]))) };
    function a10(e207) {
      return e207.map((e208) => new eh(new zm(e208[0], e208[1]), new zm(e208[2], e208[3]), e208[4]?.map((e209) => new th(new M(e209[0], e209[1], e209[2], e209[3]), new M(e209[4], e209[5], e209[6], e209[7])))));
    }
  }
  async computeMoreMinimalEdits(e206, t10, n10 = false) {
    if (v(t10)) {
      if (!Jh(this._modelService, e206)) return Promise.resolve(t10);
      let r10 = $t.create(), i10 = this._workerWithResources([e206]).then((r11) => r11.$computeMoreMinimalEdits(e206.toString(), t10, n10));
      return i10.finally(() => this._logService.trace(`FORMAT#computeMoreMinimalEdits`, e206.toString(true), r10.elapsed())), Promise.race([i10, is(1e3).then(() => t10)]);
    } else return Promise.resolve(void 0);
  }
  canNavigateValueSet(e206) {
    return Jh(this._modelService, e206);
  }
  async navigateValueSet(e206, t10, n10) {
    let r10 = this._modelService.getModel(e206);
    if (!r10) return null;
    let i10 = this._languageConfigurationService.getLanguageConfiguration(r10.getLanguageId()).getWordDefinition(), a10 = i10.source, o10 = i10.flags;
    return (await this._workerWithResources([e206])).$navigateValueSet(e206.toString(), t10, n10, a10, o10);
  }
  canComputeWordRanges(e206) {
    return Jh(this._modelService, e206);
  }
  async computeWordRanges(e206, t10) {
    let n10 = this._modelService.getModel(e206);
    if (!n10) return Promise.resolve(null);
    let r10 = this._languageConfigurationService.getLanguageConfiguration(n10.getLanguageId()).getWordDefinition(), i10 = r10.source, a10 = r10.flags;
    return (await this._workerWithResources([e206])).$computeWordRanges(e206.toString(), t10, i10, a10);
  }
  async findSectionHeaders(e206, t10) {
    return (await this._workerWithResources([e206])).$findSectionHeaders(e206.toString(), t10);
  }
  async computeDefaultDocumentColors(e206) {
    return (await this._workerWithResources([e206])).$computeDefaultDocumentColors(e206.toString());
  }
  async _workerWithResources(e206, t10 = false) {
    return await (await this._workerManager.withWorker()).workerWithSyncedResources(e206, t10);
  }
};
Yh = Gh([Kh(1, Cu), Kh(2, Uh), Kh(3, Ud), Kh(4, bp), Kh(5, X)], Yh);
var Jie = class {
  constructor(e206, t10, n10, r10, i10) {
    this.languageConfigurationService = r10, this.logService = i10, this._debugDisplayName = `wordbasedCompletions`, this._workerManager = e206, this._configurationService = t10, this._modelService = n10;
  }
  async provideCompletionItems(e206, t10) {
    let n10 = this._configurationService.getValue(e206.uri, t10, `editor`);
    if (n10.wordBasedSuggestions === `off`) return;
    let r10 = [];
    if (n10.wordBasedSuggestions === `currentDocument`) Jh(this._modelService, e206.uri) && r10.push(e206.uri);
    else for (let t11 of this._modelService.getModels()) Jh(this._modelService, t11.uri) && (t11 === e206 ? r10.unshift(t11.uri) : (n10.wordBasedSuggestions === `allDocuments` || t11.getLanguageId() === e206.getLanguageId()) && r10.push(t11.uri));
    if (r10.length === 0) return;
    let i10 = this.languageConfigurationService.getLanguageConfiguration(e206.getLanguageId()).getWordDefinition(), a10 = e206.getWordAtPosition(t10), o10 = a10 ? new M(t10.lineNumber, a10.startColumn, t10.lineNumber, a10.endColumn) : M.fromPositions(t10), s10 = o10.setEndPosition(t10.lineNumber, t10.column);
    this.logService.trace(`[WordBasedCompletionItemProvider]`, `word: "${a10?.word || ``}", wordDef: "${i10}", replace: [${o10.toString()}], insert: [${s10.toString()}]`);
    let c10 = await (await this._workerManager.withWorker()).textualSuggest(r10, a10?.word, i10);
    if (c10) return { duration: c10.duration, suggestions: c10.words.map((e207) => ({ kind: 18, label: e207, insertText: e207, range: { insert: s10, replace: o10 } })) };
  }
}, Xh = class extends D {
  constructor(e206, t10) {
    super(), this._workerDescriptor = e206, this._modelService = t10, this._editorWorkerClient = null, this._lastWorkerUsedTime = (/* @__PURE__ */ new Date()).getTime(), this._register(new ll()).cancelAndSet(() => this._checkStopIdleWorker(), Math.round(qh / 2), Aa), this._register(this._modelService.onModelRemoved((e207) => this._checkStopEmptyWorker()));
  }
  dispose() {
    this._editorWorkerClient && (this._editorWorkerClient = (this._editorWorkerClient.dispose(), null)), super.dispose();
  }
  _checkStopEmptyWorker() {
    this._editorWorkerClient && this._modelService.getModels().length === 0 && (this._editorWorkerClient.dispose(), this._editorWorkerClient = null);
  }
  _checkStopIdleWorker() {
    this._editorWorkerClient && (/* @__PURE__ */ new Date()).getTime() - this._lastWorkerUsedTime > qh && (this._editorWorkerClient.dispose(), this._editorWorkerClient = null);
  }
  withWorker() {
    return this._lastWorkerUsedTime = (/* @__PURE__ */ new Date()).getTime(), this._editorWorkerClient || (this._editorWorkerClient = new Zh(this._workerDescriptor, false, this._modelService)), Promise.resolve(this._editorWorkerClient);
  }
};
Xh = Gh([Kh(1, Cu)], Xh);
var Yie = class {
  constructor(e206) {
    this._instance = e206, this.proxy = this._instance;
  }
  dispose() {
    this._instance.dispose();
  }
  setChannel(e206, t10) {
    throw Error(`Not supported`);
  }
}, Zh = class extends D {
  constructor(e206, t10, n10) {
    super(), this._workerDescriptorOrWorker = e206, this._disposed = false, this._modelService = n10, this._keepIdleModels = t10, this._worker = null, this._modelManager = null;
  }
  fhr(e206, t10) {
    throw Error(`Not implemented!`);
  }
  _getOrCreateWorker() {
    if (!this._worker) try {
      this._worker = this._register(Dre(this._workerDescriptorOrWorker)), qie.setChannel(this._worker, this._createEditorWorkerHost());
    } catch (e206) {
      pf(e206), this._worker = this._createFallbackLocalWorker();
    }
    return this._worker;
  }
  async _getProxy() {
    try {
      let e206 = this._getOrCreateWorker().proxy;
      return await e206.$ping(), e206;
    } catch (e206) {
      return pf(e206), this._worker = this._createFallbackLocalWorker(), this._worker.proxy;
    }
  }
  _createFallbackLocalWorker() {
    return new Yie(new Kie(null));
  }
  _createEditorWorkerHost() {
    return { $fhr: (e206, t10) => this.fhr(e206, t10) };
  }
  _getOrCreateModelManager(e206) {
    return this._modelManager || (this._modelManager = this._register(new Uie(e206, this._modelService, this._keepIdleModels))), this._modelManager;
  }
  async workerWithSyncedResources(e206, t10 = false) {
    if (this._disposed) return Promise.reject(Ee());
    let n10 = await this._getProxy();
    return this._getOrCreateModelManager(n10).ensureSyncedResources(e206, t10), n10;
  }
  async textualSuggest(e206, t10, n10) {
    let r10 = await this.workerWithSyncedResources(e206), i10 = n10.source, a10 = n10.flags;
    return r10.$textualSuggest(e206.map((e207) => e207.toString()), t10, i10, a10);
  }
  dispose() {
    super.dispose(), this._disposed = true;
  }
};
Zh = Gh([Kh(2, Cu)], Zh);
function Xie(e206, t10) {
  return new Zie(e206, t10);
}
var Zie = class extends Zh {
  constructor(e206, t10) {
    super(t10.worker, t10.keepIdleModels || false, e206), this._foreignModuleHost = t10.host || null, this._foreignProxy = this._getProxy().then((e207) => new Proxy({}, { get(t11, n10, r10) {
      if (n10 !== `then`) {
        if (typeof n10 != `string`) throw Error(`Not supported`);
        return (...t12) => e207.$fmr(n10, t12);
      }
    } }));
  }
  fhr(e206, t10) {
    if (!this._foreignModuleHost || typeof this._foreignModuleHost[e206] != `function`) return Promise.reject(Error(`Missing method ` + e206 + ` or missing main thread foreign host.`));
    try {
      return Promise.resolve(this._foreignModuleHost[e206].apply(this._foreignModuleHost, t10));
    } catch (e207) {
      return Promise.reject(e207);
    }
  }
  getProxy() {
    return this._foreignProxy;
  }
  withSyncedResources(e206) {
    return this.workerWithSyncedResources(e206).then((e207) => this.getProxy());
  }
}, Qh = { ICodeEditor: `vs.editor.ICodeEditor`, IDiffEditor: `vs.editor.IDiffEditor` }, $h = new class {
  clone() {
    return this;
  }
  equals(e206) {
    return this === e206;
  }
}();
function eg(e206, t10) {
  return new fi([new di(0, ``, e206)], t10);
}
function tg(e206, t10) {
  let n10 = new Uint32Array(2);
  return n10[0] = 0, n10[1] = (e206 << 0 | 33587200) >>> 0, new pi(n10, t10 === null ? $h : t10);
}
var ng = class {
  static getLanguageId(e206) {
    return (e206 & 255) >>> 0;
  }
  static getTokenType(e206) {
    return (e206 & 768) >>> 8;
  }
  static containsBalancedBrackets(e206) {
    return (e206 & 1024) != 0;
  }
  static getFontStyle(e206) {
    return (e206 & 30720) >>> 11;
  }
  static getForeground(e206) {
    return (e206 & 16744448) >>> 15;
  }
  static getBackground(e206) {
    return (e206 & 4278190080) >>> 24;
  }
  static getClassNameFromMetadata(e206) {
    let t10 = `mtk` + this.getForeground(e206), n10 = this.getFontStyle(e206);
    return n10 & 1 && (t10 += ` mtki`), n10 & 2 && (t10 += ` mtkb`), n10 & 4 && (t10 += ` mtku`), n10 & 8 && (t10 += ` mtks`), t10;
  }
  static getInlineStyleFromMetadata(e206, t10) {
    let n10 = this.getForeground(e206), r10 = this.getFontStyle(e206), i10 = `color: ${t10[n10]};`;
    r10 & 1 && (i10 += `font-style: italic;`), r10 & 2 && (i10 += `font-weight: bold;`);
    let a10 = ``;
    return r10 & 4 && (a10 += ` underline`), r10 & 8 && (a10 += ` line-through`), a10 && (i10 += `text-decoration:${a10};`), i10;
  }
  static getPresentationFromMetadata(e206) {
    let t10 = this.getForeground(e206), n10 = this.getFontStyle(e206);
    return { foreground: t10, italic: !!(n10 & 1), bold: !!(n10 & 2), underline: !!(n10 & 4), strikethrough: !!(n10 & 8) };
  }
}, rg = (_U = class {
  static createEmpty(t10, n10) {
    let r10 = _U.defaultTokenMetadata, i10 = new Uint32Array(2);
    return i10[0] = t10.length, i10[1] = r10, new _U(i10, t10, n10);
  }
  static createFromTextAndMetadata(t10, n10) {
    let r10 = 0, i10 = ``, a10 = [];
    for (let { text: e206, metadata: n11 } of t10) a10.push(r10 + e206.length, n11), r10 += e206.length, i10 += e206;
    return new _U(new Uint32Array(a10), i10, n10);
  }
  static convertToEndOffset(e206, t10) {
    let n10 = (e206.length >>> 1) - 1;
    for (let t11 = 0; t11 < n10; t11++) e206[t11 << 1] = e206[t11 + 1 << 1];
    e206[n10 << 1] = t10;
  }
  static findIndexInTokensArray(e206, t10) {
    if (e206.length <= 2) return 0;
    let n10 = 0, r10 = (e206.length >>> 1) - 1;
    for (; n10 < r10; ) {
      let i10 = n10 + Math.floor((r10 - n10) / 2), a10 = e206[i10 << 1];
      if (a10 === t10) return i10 + 1;
      a10 < t10 ? n10 = i10 + 1 : a10 > t10 && (r10 = i10);
    }
    return n10;
  }
  constructor(e206, t10, n10) {
    this._lineTokensBrand = void 0, (e206.length > 1 ? e206[e206.length - 2] : 0) !== t10.length && be(Error(`Token length and text length do not match!`)), this._tokens = e206, this._tokensCount = this._tokens.length >>> 1, this._text = t10, this.languageIdCodec = n10;
  }
  getTextLength() {
    return this._text.length;
  }
  equals(t10) {
    return t10 instanceof _U ? this.slicedEquals(t10, 0, this._tokensCount) : false;
  }
  slicedEquals(e206, t10, n10) {
    if (this._text !== e206._text || this._tokensCount !== e206._tokensCount) return false;
    let r10 = t10 << 1, i10 = r10 + (n10 << 1);
    for (let t11 = r10; t11 < i10; t11++) if (this._tokens[t11] !== e206._tokens[t11]) return false;
    return true;
  }
  getLineContent() {
    return this._text;
  }
  getCount() {
    return this._tokensCount;
  }
  getStartOffset(e206) {
    return e206 > 0 ? this._tokens[e206 - 1 << 1] : 0;
  }
  getMetadata(e206) {
    return this._tokens[(e206 << 1) + 1];
  }
  getLanguageId(e206) {
    let t10 = this._tokens[(e206 << 1) + 1], n10 = ng.getLanguageId(t10);
    return this.languageIdCodec.decodeLanguageId(n10);
  }
  getStandardTokenType(e206) {
    let t10 = this._tokens[(e206 << 1) + 1];
    return ng.getTokenType(t10);
  }
  getForeground(e206) {
    let t10 = this._tokens[(e206 << 1) + 1];
    return ng.getForeground(t10);
  }
  getClassName(e206) {
    let t10 = this._tokens[(e206 << 1) + 1];
    return ng.getClassNameFromMetadata(t10);
  }
  getInlineStyle(e206, t10) {
    let n10 = this._tokens[(e206 << 1) + 1];
    return ng.getInlineStyleFromMetadata(n10, t10);
  }
  getPresentation(e206) {
    let t10 = this._tokens[(e206 << 1) + 1];
    return ng.getPresentationFromMetadata(t10);
  }
  getEndOffset(e206) {
    return this._tokens[e206 << 1];
  }
  findTokenIndexAtOffset(t10) {
    return _U.findIndexInTokensArray(this._tokens, t10);
  }
  inflate() {
    return this;
  }
  sliceAndInflate(e206, t10, n10) {
    return new Qie(this, e206, t10, n10);
  }
  sliceZeroCopy(e206) {
    return this.sliceAndInflate(e206.start, e206.endExclusive, 0);
  }
  withInserted(t10) {
    if (t10.length === 0) return this;
    let n10 = 0, r10 = 0, i10 = ``, a10 = [], o10 = 0;
    for (; ; ) {
      let e206 = n10 < this._tokensCount ? this._tokens[n10 << 1] : -1, s10 = r10 < t10.length ? t10[r10] : null;
      if (e206 !== -1 && (s10 === null || e206 <= s10.offset)) {
        i10 += this._text.substring(o10, e206);
        let t11 = this._tokens[(n10 << 1) + 1];
        a10.push(i10.length, t11), n10++, o10 = e206;
      } else if (s10) {
        if (s10.offset > o10) {
          i10 += this._text.substring(o10, s10.offset);
          let e207 = this._tokens[(n10 << 1) + 1];
          a10.push(i10.length, e207), o10 = s10.offset;
        }
        i10 += s10.text, a10.push(i10.length, s10.tokenMetadata), r10++;
      } else break;
    }
    return new _U(new Uint32Array(a10), i10, this.languageIdCodec);
  }
  getTokensInRange(e206) {
    let t10 = new eae(), n10 = this.findTokenIndexAtOffset(e206.start), r10 = this.findTokenIndexAtOffset(e206.endExclusive);
    for (let i10 = n10; i10 <= r10; i10++) {
      let n11 = new Tm(this.getStartOffset(i10), this.getEndOffset(i10)).intersectionLength(e206);
      n11 > 0 && t10.add(n11, this.getMetadata(i10));
    }
    return t10.build();
  }
  getTokenText(e206) {
    let t10 = this.getStartOffset(e206), n10 = this.getEndOffset(e206);
    return this._text.substring(t10, n10);
  }
  forEach(e206) {
    let t10 = this.getCount();
    for (let n10 = 0; n10 < t10; n10++) e206(n10);
  }
  toString() {
    let e206 = ``;
    return this.forEach((t10) => {
      e206 += `[${this.getTokenText(t10)}]{${this.getClassName(t10)}}`;
    }), e206;
  }
}, _U.defaultTokenMetadata = 33587200, _U), Qie = class e63 {
  constructor(e206, t10, n10, r10) {
    this._source = e206, this._startOffset = t10, this._endOffset = n10, this._deltaOffset = r10, this._firstTokenIndex = e206.findTokenIndexAtOffset(t10), this.languageIdCodec = e206.languageIdCodec, this._tokensCount = 0;
    for (let t11 = this._firstTokenIndex, r11 = e206.getCount(); t11 < r11 && !(e206.getStartOffset(t11) >= n10); t11++) this._tokensCount++;
  }
  getMetadata(e206) {
    return this._source.getMetadata(this._firstTokenIndex + e206);
  }
  getLanguageId(e206) {
    return this._source.getLanguageId(this._firstTokenIndex + e206);
  }
  getLineContent() {
    return this._source.getLineContent().substring(this._startOffset, this._endOffset);
  }
  equals(t10) {
    return t10 instanceof e63 ? this._startOffset === t10._startOffset && this._endOffset === t10._endOffset && this._deltaOffset === t10._deltaOffset && this._source.slicedEquals(t10._source, this._firstTokenIndex, this._tokensCount) : false;
  }
  getCount() {
    return this._tokensCount;
  }
  getStandardTokenType(e206) {
    return this._source.getStandardTokenType(this._firstTokenIndex + e206);
  }
  getForeground(e206) {
    return this._source.getForeground(this._firstTokenIndex + e206);
  }
  getEndOffset(e206) {
    let t10 = this._source.getEndOffset(this._firstTokenIndex + e206);
    return Math.min(this._endOffset, t10) - this._startOffset + this._deltaOffset;
  }
  getClassName(e206) {
    return this._source.getClassName(this._firstTokenIndex + e206);
  }
  getInlineStyle(e206, t10) {
    return this._source.getInlineStyle(this._firstTokenIndex + e206, t10);
  }
  getPresentation(e206) {
    return this._source.getPresentation(this._firstTokenIndex + e206);
  }
  findTokenIndexAtOffset(e206) {
    return this._source.findTokenIndexAtOffset(e206 + this._startOffset - this._deltaOffset) - this._firstTokenIndex;
  }
  getTokenText(e206) {
    let t10 = this._firstTokenIndex + e206, n10 = this._source.getStartOffset(t10), r10 = this._source.getEndOffset(t10), i10 = this._source.getTokenText(t10);
    return n10 < this._startOffset && (i10 = i10.substring(this._startOffset - n10)), r10 > this._endOffset && (i10 = i10.substring(0, i10.length - (r10 - this._endOffset))), i10;
  }
  forEach(e206) {
    for (let t10 = 0; t10 < this.getCount(); t10++) e206(t10);
  }
};
function $ie(e206, t10) {
  let n10 = t10.lineNumber;
  if (!e206.tokenization.isCheapToTokenize(n10)) return;
  e206.tokenization.forceTokenization(n10);
  let r10 = e206.tokenization.getLineTokens(n10), i10 = r10.findTokenIndexAtOffset(t10.column - 1);
  return r10.getStandardTokenType(i10);
}
var ig = class e64 {
  static fromLineTokens(t10) {
    let n10 = [];
    for (let e206 = 0; e206 < t10.getCount(); e206++) n10.push(new ag(t10.getEndOffset(e206) - t10.getStartOffset(e206), t10.getMetadata(e206)));
    return e64.create(n10);
  }
  static create(t10) {
    return new e64(t10);
  }
  constructor(e206) {
    this._tokenInfo = e206;
  }
  toLineTokens(e206, t10) {
    return rg.createFromTextAndMetadata(this.map((t11, n10) => ({ text: t11.substring(e206), metadata: n10.metadata })), t10);
  }
  forEach(e206) {
    let t10 = 0;
    for (let n10 of this._tokenInfo) e206(new Tm(t10, t10 + n10.length), n10), t10 += n10.length;
  }
  map(e206) {
    let t10 = [], n10 = 0;
    for (let r10 of this._tokenInfo) {
      let i10 = new Tm(n10, n10 + r10.length);
      t10.push(e206(i10, r10)), n10 += r10.length;
    }
    return t10;
  }
  slice(t10) {
    let n10 = [], r10 = 0;
    for (let e206 of this._tokenInfo) {
      let i10 = r10, a10 = i10 + e206.length;
      if (a10 > t10.start) {
        if (i10 >= t10.endExclusive) break;
        let r11 = Math.max(0, t10.start - i10), o10 = Math.max(0, a10 - t10.endExclusive);
        n10.push(new ag(e206.length - r11 - o10, e206.metadata));
      }
      r10 += e206.length;
    }
    return e64.create(n10);
  }
}, ag = class {
  constructor(e206, t10) {
    this.length = e206, this.metadata = t10;
  }
}, eae = class {
  constructor() {
    this._tokens = [];
  }
  add(e206, t10) {
    this._tokens.push(new ag(e206, t10));
  }
  build() {
    return ig.create(this._tokens);
  }
}, og = class e65 {
  constructor(e206, t10, n10, r10) {
    this.startColumn = e206, this.endColumn = t10, this.className = n10, this.type = r10, this._lineDecorationBrand = void 0;
  }
  static _equals(e206, t10) {
    return e206.startColumn === t10.startColumn && e206.endColumn === t10.endColumn && e206.className === t10.className && e206.type === t10.type;
  }
  static equalsArr(t10, n10) {
    let r10 = t10.length;
    if (r10 !== n10.length) return false;
    for (let i10 = 0; i10 < r10; i10++) if (!e65._equals(t10[i10], n10[i10])) return false;
    return true;
  }
  static extractWrapped(t10, n10, r10) {
    if (t10.length === 0) return t10;
    let i10 = n10 + 1, a10 = r10 + 1, o10 = r10 - n10, s10 = [], c10 = 0;
    for (let n11 of t10) n11.endColumn <= i10 || n11.startColumn >= a10 || (s10[c10++] = new e65(Math.max(1, n11.startColumn - i10 + 1), Math.min(o10 + 1, n11.endColumn - i10 + 1), n11.className, n11.type));
    return s10;
  }
  static filter(t10, n10, r10, i10) {
    if (t10.length === 0) return [];
    let a10 = [], o10 = 0;
    for (let s10 = 0, c10 = t10.length; s10 < c10; s10++) {
      let c11 = t10[s10], l10 = c11.range;
      if (l10.endLineNumber < n10 || l10.startLineNumber > n10 || l10.isEmpty() && (c11.type === 0 || c11.type === 3)) continue;
      let u10 = l10.startLineNumber === n10 ? l10.startColumn : r10, d10 = l10.endLineNumber === n10 ? l10.endColumn : i10;
      a10[o10++] = new e65(u10, d10, c11.inlineClassName, c11.type);
    }
    return a10;
  }
  static _typeCompare(e206, t10) {
    let n10 = [2, 0, 1, 3];
    return n10[e206] - n10[t10];
  }
  static compare(t10, n10) {
    if (t10.startColumn !== n10.startColumn) return t10.startColumn - n10.startColumn;
    if (t10.endColumn !== n10.endColumn) return t10.endColumn - n10.endColumn;
    let r10 = e65._typeCompare(t10.type, n10.type);
    return r10 === 0 ? t10.className === n10.className ? 0 : t10.className < n10.className ? -1 : 1 : r10;
  }
}, sg = class {
  constructor(e206, t10, n10, r10) {
    this.startOffset = e206, this.endOffset = t10, this.className = n10, this.metadata = r10;
  }
}, tae = class e66 {
  constructor() {
    this.stopOffsets = [], this.classNames = [], this.metadata = [], this.count = 0;
  }
  static _metadata(e206) {
    let t10 = 0;
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) t10 |= e206[n10];
    return t10;
  }
  consumeLowerThan(t10, n10, r10) {
    for (; this.count > 0 && this.stopOffsets[0] < t10; ) {
      let t11 = 0;
      for (; t11 + 1 < this.count && this.stopOffsets[t11] === this.stopOffsets[t11 + 1]; ) t11++;
      r10.push(new sg(n10, this.stopOffsets[t11], this.classNames.join(` `), e66._metadata(this.metadata))), n10 = this.stopOffsets[t11] + 1, this.stopOffsets.splice(0, t11 + 1), this.classNames.splice(0, t11 + 1), this.metadata.splice(0, t11 + 1), this.count -= t11 + 1;
    }
    return this.count > 0 && n10 < t10 && (r10.push(new sg(n10, t10 - 1, this.classNames.join(` `), e66._metadata(this.metadata))), n10 = t10), n10;
  }
  insert(e206, t10, n10) {
    if (this.count === 0 || this.stopOffsets[this.count - 1] <= e206) this.stopOffsets.push(e206), this.classNames.push(t10), this.metadata.push(n10);
    else for (let r10 = 0; r10 < this.count; r10++) if (this.stopOffsets[r10] >= e206) {
      this.stopOffsets.splice(r10, 0, e206), this.classNames.splice(r10, 0, t10), this.metadata.splice(r10, 0, n10);
      break;
    }
    this.count++;
  }
}, nae = class {
  static normalize(e206, t10) {
    if (t10.length === 0) return [];
    let n10 = [], r10 = new tae(), i10 = 0;
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10], s10 = o11.startColumn, c10 = o11.endColumn, l10 = o11.className, u10 = o11.type === 1 ? 2 : o11.type === 2 ? 4 : 0;
      s10 > 1 && ao(e206.charCodeAt(s10 - 2)) && s10--, c10 > 1 && ao(e206.charCodeAt(c10 - 2)) && c10--;
      let d10 = s10 - 1, f10 = c10 - 2;
      i10 = r10.consumeLowerThan(d10, i10, n10), r10.count === 0 && (i10 = d10), r10.insert(f10, l10, u10);
    }
    return r10.consumeLowerThan(1073741824, i10, n10), n10;
  }
}, cg = class {
  constructor(e206, t10, n10, r10) {
    this.endIndex = e206, this.type = t10, this.metadata = n10, this.containsRTL = r10, this._linePartBrand = void 0;
  }
  isWhitespace() {
    return !!(this.metadata & 1);
  }
  isPseudoAfter() {
    return !!(this.metadata & 4);
  }
}, lg = class {
  get isLTR() {
    return !this.containsRTL && this.textDirection !== em.RTL;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10, p10, m10, h10, g10, _10, v10, y10, b10, x10 = false) {
    this.useMonospaceOptimizations = e206, this.canUseHalfwidthRightwardsArrow = t10, this.lineContent = n10, this.continuesWithWrappedLine = r10, this.isBasicASCII = i10, this.containsRTL = a10, this.fauxIndentLength = o10, this.lineTokens = s10, this.lineDecorations = c10.sort(og.compare), this.tabSize = l10, this.startVisibleColumn = u10, this.spaceWidth = d10, this.stopRenderingLineAfter = m10, this.renderWhitespace = h10 === `all` ? 4 : h10 === `boundary` ? 1 : h10 === `selection` ? 2 : h10 === `trailing` ? 3 : 0, this.renderControlCharacters = g10, this.fontLigatures = _10, this.selectionsOnLine = v10 && v10.sort((e207, t11) => e207.start < t11.start ? -1 : 1), this.renderNewLineWhenEmpty = x10, this.textDirection = y10, this.verticalScrollbarSize = b10, Math.abs(p10 - d10) < Math.abs(f10 - d10) ? (this.renderSpaceWidth = p10, this.renderSpaceCharCode = 11825) : (this.renderSpaceWidth = f10, this.renderSpaceCharCode = 183);
  }
  sameSelection(e206) {
    if (this.selectionsOnLine === null) return e206 === null;
    if (e206 === null || e206.length !== this.selectionsOnLine.length) return false;
    for (let t10 = 0; t10 < this.selectionsOnLine.length; t10++) if (!this.selectionsOnLine[t10].equals(e206[t10])) return false;
    return true;
  }
  equals(e206) {
    return this.useMonospaceOptimizations === e206.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === e206.canUseHalfwidthRightwardsArrow && this.lineContent === e206.lineContent && this.continuesWithWrappedLine === e206.continuesWithWrappedLine && this.isBasicASCII === e206.isBasicASCII && this.containsRTL === e206.containsRTL && this.fauxIndentLength === e206.fauxIndentLength && this.tabSize === e206.tabSize && this.startVisibleColumn === e206.startVisibleColumn && this.spaceWidth === e206.spaceWidth && this.renderSpaceWidth === e206.renderSpaceWidth && this.renderSpaceCharCode === e206.renderSpaceCharCode && this.stopRenderingLineAfter === e206.stopRenderingLineAfter && this.renderWhitespace === e206.renderWhitespace && this.renderControlCharacters === e206.renderControlCharacters && this.fontLigatures === e206.fontLigatures && og.equalsArr(this.lineDecorations, e206.lineDecorations) && this.lineTokens.equals(e206.lineTokens) && this.sameSelection(e206.selectionsOnLine) && this.textDirection === e206.textDirection && this.verticalScrollbarSize === e206.verticalScrollbarSize && this.renderNewLineWhenEmpty === e206.renderNewLineWhenEmpty;
  }
}, ug = class {
  constructor(e206, t10) {
    this.partIndex = e206, this.charIndex = t10;
  }
}, dg = class e67 {
  static getPartIndex(e206) {
    return (e206 & 4294901760) >>> 16;
  }
  static getCharIndex(e206) {
    return (e206 & 65535) >>> 0;
  }
  constructor(e206, t10) {
    this.length = e206, this._data = new Uint32Array(this.length), this._horizontalOffset = new Uint32Array(this.length);
  }
  setColumnInfo(e206, t10, n10, r10) {
    let i10 = (t10 << 16 | n10 << 0) >>> 0;
    this._data[e206 - 1] = i10, this._horizontalOffset[e206 - 1] = r10;
  }
  getHorizontalOffset(e206) {
    return this._horizontalOffset.length === 0 ? 0 : this._horizontalOffset[e206 - 1];
  }
  charOffsetToPartData(e206) {
    return this.length === 0 ? 0 : e206 < 0 ? this._data[0] : e206 >= this.length ? this._data[this.length - 1] : this._data[e206];
  }
  getDomPosition(t10) {
    let n10 = this.charOffsetToPartData(t10 - 1);
    return new ug(e67.getPartIndex(n10), e67.getCharIndex(n10));
  }
  getColumn(e206, t10) {
    return this.partDataToCharOffset(e206.partIndex, t10, e206.charIndex) + 1;
  }
  partDataToCharOffset(t10, n10, r10) {
    if (this.length === 0) return 0;
    let i10 = (t10 << 16 | r10 << 0) >>> 0, a10 = 0, o10 = this.length - 1;
    for (; a10 + 1 < o10; ) {
      let e206 = a10 + o10 >>> 1, t11 = this._data[e206];
      if (t11 === i10) return e206;
      t11 > i10 ? o10 = e206 : a10 = e206;
    }
    if (a10 === o10) return a10;
    let s10 = this._data[a10], c10 = this._data[o10];
    if (s10 === i10) return a10;
    if (c10 === i10) return o10;
    let l10 = e67.getPartIndex(s10), u10 = e67.getCharIndex(s10), d10 = e67.getPartIndex(c10), f10;
    return f10 = l10 === d10 ? e67.getCharIndex(c10) : n10, r10 - u10 <= f10 - r10 ? a10 : o10;
  }
}, fg = class {
  constructor(e206, t10) {
    this._renderLineOutputBrand = void 0, this.characterMapping = e206, this.containsForeignElements = t10;
  }
};
function pg(e206, t10) {
  if (e206.lineContent.length === 0) {
    if (e206.lineDecorations.length > 0) {
      t10.appendString(`<span>`);
      let n10 = 0, r10 = 0, i10 = 0;
      for (let a11 of e206.lineDecorations) (a11.type === 1 || a11.type === 2) && (t10.appendString(`<span class="`), t10.appendString(a11.className), t10.appendString(`"></span>`), a11.type === 1 && (i10 |= 1, n10++), a11.type === 2 && (i10 |= 2, r10++));
      t10.appendString(`</span>`);
      let a10 = new dg(1, n10 + r10);
      return a10.setColumnInfo(1, n10, 0, 0), new fg(a10, i10);
    }
    return e206.renderNewLineWhenEmpty ? t10.appendString(`<span><span>
</span></span>`) : t10.appendString(`<span><span></span></span>`), new fg(new dg(0, 0), 0);
  }
  return fae(aae(e206), t10);
}
var rae = class {
  constructor(e206, t10, n10) {
    this.characterMapping = e206, this.html = t10, this.containsForeignElements = n10;
  }
};
function mg(e206) {
  let t10 = new Ff(1e4), n10 = pg(e206, t10);
  return new rae(n10.characterMapping, t10.build(), n10.containsForeignElements);
}
var iae = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10, p10, m10) {
    this.fontIsMonospace = e206, this.canUseHalfwidthRightwardsArrow = t10, this.lineContent = n10, this.len = r10, this.isOverflowing = i10, this.overflowingCharCount = a10, this.parts = o10, this.containsForeignElements = s10, this.fauxIndentLength = c10, this.tabSize = l10, this.startVisibleColumn = u10, this.spaceWidth = d10, this.renderSpaceCharCode = f10, this.renderWhitespace = p10, this.renderControlCharacters = m10;
  }
};
function aae(e206) {
  let t10 = e206.lineContent, n10, r10, i10;
  e206.stopRenderingLineAfter !== -1 && e206.stopRenderingLineAfter < t10.length ? (n10 = true, r10 = t10.length - e206.stopRenderingLineAfter, i10 = e206.stopRenderingLineAfter) : (n10 = false, r10 = 0, i10 = t10.length);
  let a10 = oae(t10, e206.containsRTL, e206.lineTokens, e206.fauxIndentLength, i10);
  e206.renderControlCharacters && !e206.isBasicASCII && (a10 = lae(t10, a10)), (e206.renderWhitespace === 4 || e206.renderWhitespace === 1 || e206.renderWhitespace === 2 && e206.selectionsOnLine || e206.renderWhitespace === 3 && !e206.continuesWithWrappedLine) && (a10 = uae(e206, t10, i10, a10));
  let o10 = 0;
  if (e206.lineDecorations.length > 0) {
    for (let t11 = 0, n11 = e206.lineDecorations.length; t11 < n11; t11++) {
      let n12 = e206.lineDecorations[t11];
      n12.type === 3 || n12.type === 1 ? o10 |= 1 : n12.type === 2 && (o10 |= 2);
    }
    a10 = dae(t10, i10, a10, e206.lineDecorations);
  }
  return a10 = e206.containsRTL ? cae(t10, a10) : sae(t10, a10, !e206.isBasicASCII || e206.fontLigatures), new iae(e206.useMonospaceOptimizations, e206.canUseHalfwidthRightwardsArrow, t10, i10, n10, r10, a10, o10, e206.fauxIndentLength, e206.tabSize, e206.startVisibleColumn, e206.spaceWidth, e206.renderSpaceCharCode, e206.renderWhitespace, e206.renderControlCharacters);
}
function oae(e206, t10, n10, r10, i10) {
  let a10 = [], o10 = 0;
  r10 > 0 && (a10[o10++] = new cg(r10, ``, 0, false));
  let s10 = r10;
  for (let c10 = 0, l10 = n10.getCount(); c10 < l10; c10++) {
    let l11 = n10.getEndOffset(c10);
    if (l11 <= r10) continue;
    let u10 = n10.getClassName(c10);
    if (l11 >= i10) {
      let n11 = t10 ? ho(e206.substring(s10, i10)) : false;
      a10[o10++] = new cg(i10, u10, 0, n11);
      break;
    }
    let d10 = t10 ? ho(e206.substring(s10, l11)) : false;
    a10[o10++] = new cg(l11, u10, 0, d10), s10 = l11;
  }
  return a10;
}
function sae(e206, t10, n10) {
  let r10 = 0, i10 = [], a10 = 0;
  if (n10) for (let n11 = 0, o10 = t10.length; n11 < o10; n11++) {
    let o11 = t10[n11], s10 = o11.endIndex;
    if (r10 + 50 < s10) {
      let t11 = o11.type, n12 = o11.metadata, c10 = o11.containsRTL, l10 = -1, u10 = r10;
      for (let o12 = r10; o12 < s10; o12++) e206.charCodeAt(o12) === 32 && (l10 = o12), l10 !== -1 && o12 - u10 >= 50 && (i10[a10++] = new cg(l10 + 1, t11, n12, c10), u10 = l10 + 1, l10 = -1);
      u10 !== s10 && (i10[a10++] = new cg(s10, t11, n12, c10));
    } else i10[a10++] = o11;
    r10 = s10;
  }
  else for (let e207 = 0, n11 = t10.length; e207 < n11; e207++) {
    let n12 = t10[e207], o10 = n12.endIndex, s10 = o10 - r10;
    if (s10 > 50) {
      let e208 = n12.type, t11 = n12.metadata, c10 = n12.containsRTL, l10 = Math.ceil(s10 / 50);
      for (let n13 = 1; n13 < l10; n13++) {
        let o11 = r10 + n13 * 50;
        i10[a10++] = new cg(o11, e208, t11, c10);
      }
      i10[a10++] = new cg(o10, e208, t11, c10);
    } else i10[a10++] = n12;
    r10 = o10;
  }
  return i10;
}
function cae(e206, t10) {
  if (t10.length === 0) return t10;
  let n10 = t10[0];
  if (!n10.containsRTL) return t10;
  let r10 = n10.endIndex, i10 = 0;
  for (let t11 = 0; t11 < r10; t11++) {
    let n11 = e206.charCodeAt(t11);
    if (n11 !== 32 && n11 !== 9) {
      i10 = t11;
      break;
    }
  }
  if (i10 === 0) return t10;
  let a10 = [];
  a10.push(new cg(i10, n10.type, n10.metadata, false)), a10.push(new cg(r10, n10.type, n10.metadata, n10.containsRTL));
  for (let e207 = 1; e207 < t10.length; e207++) a10.push(t10[e207]);
  return a10;
}
function hg(e206) {
  return e206 < 32 ? e206 !== 9 : e206 === 127 || e206 >= 8234 && e206 <= 8238 || e206 >= 8294 && e206 <= 8297 || e206 >= 8206 && e206 <= 8207 || e206 === 1564;
}
function lae(e206, t10) {
  let n10 = [], r10 = new cg(0, ``, 0, false), i10 = 0;
  for (let a10 of t10) {
    let t11 = a10.endIndex;
    for (; i10 < t11; i10++) hg(e206.charCodeAt(i10)) && (i10 > r10.endIndex && (r10 = new cg(i10, a10.type, a10.metadata, a10.containsRTL), n10.push(r10)), r10 = new cg(i10 + 1, `mtkcontrol`, a10.metadata, false), n10.push(r10));
    i10 > r10.endIndex && (r10 = new cg(t11, a10.type, a10.metadata, a10.containsRTL), n10.push(r10));
  }
  return n10;
}
function uae(e206, t10, n10, r10) {
  let i10 = e206.continuesWithWrappedLine, a10 = e206.fauxIndentLength, o10 = e206.tabSize, s10 = e206.startVisibleColumn, c10 = e206.useMonospaceOptimizations, l10 = e206.selectionsOnLine, u10 = e206.renderWhitespace === 1, d10 = e206.renderWhitespace === 3, f10 = e206.renderSpaceWidth !== e206.spaceWidth, p10 = [], m10 = 0, h10 = 0, g10 = r10[h10].type, _10 = r10[h10].containsRTL, v10 = r10[h10].endIndex, y10 = r10.length, b10 = false, x10 = Ga(t10), S10;
  x10 === -1 ? (b10 = true, x10 = n10, S10 = n10) : S10 = qa(t10);
  let ee2 = false, te2 = 0, ne2 = l10 && l10[te2], re2 = s10 % o10;
  for (let e207 = a10; e207 < n10; e207++) {
    let i11 = t10.charCodeAt(e207);
    ne2 && ne2.endExclusive <= e207 && (te2++, ne2 = l10 && l10[te2]);
    let s11;
    if (e207 < x10 || e207 > S10) s11 = true;
    else if (i11 === 9) s11 = true;
    else if (i11 === 32) if (u10) if (ee2) s11 = true;
    else {
      let r11 = e207 + 1 < n10 ? t10.charCodeAt(e207 + 1) : 0;
      s11 = r11 === 32 || r11 === 9;
    }
    else s11 = true;
    else s11 = false;
    if (s11 && l10 && (s11 = !!ne2 && ne2.start <= e207 && e207 < ne2.endExclusive), s11 && d10 && (s11 = b10 || e207 > S10), s11 && _10 && e207 >= x10 && e207 <= S10 && (s11 = false), ee2) {
      if (!s11 || !c10 && re2 >= o10) {
        if (f10) {
          let t11 = m10 > 0 ? p10[m10 - 1].endIndex : a10;
          for (let n11 = t11 + 1; n11 <= e207; n11++) p10[m10++] = new cg(n11, `mtkw`, 1, false);
        } else p10[m10++] = new cg(e207, `mtkw`, 1, false);
        re2 %= o10;
      }
    } else (e207 === v10 || s11 && e207 > a10) && (p10[m10++] = new cg(e207, g10, 0, _10), re2 %= o10);
    for (i11 === 9 ? re2 = o10 : yo(i11) ? re2 += 2 : re2++, ee2 = s11; e207 === v10 && (h10++, h10 < y10); ) g10 = r10[h10].type, _10 = r10[h10].containsRTL, v10 = r10[h10].endIndex;
  }
  let ie2 = false;
  if (ee2) if (i10 && u10) {
    let e207 = n10 > 0 ? t10.charCodeAt(n10 - 1) : 0, r11 = n10 > 1 ? t10.charCodeAt(n10 - 2) : 0;
    e207 === 32 && r11 !== 32 && r11 !== 9 || (ie2 = true);
  } else ie2 = true;
  if (ie2) if (f10) {
    let e207 = m10 > 0 ? p10[m10 - 1].endIndex : a10;
    for (let t11 = e207 + 1; t11 <= n10; t11++) p10[m10++] = new cg(t11, `mtkw`, 1, false);
  } else p10[m10++] = new cg(n10, `mtkw`, 1, false);
  else p10[m10++] = new cg(n10, g10, 0, _10);
  return p10;
}
function dae(e206, t10, n10, r10) {
  r10.sort(og.compare);
  let i10 = nae.normalize(e206, r10), a10 = i10.length, o10 = 0, s10 = [], c10 = 0, l10 = 0;
  for (let e207 = 0, t11 = n10.length; e207 < t11; e207++) {
    let t12 = n10[e207], r11 = t12.endIndex, u11 = t12.type, d10 = t12.metadata, f10 = t12.containsRTL;
    for (; o10 < a10 && i10[o10].startOffset < r11; ) {
      let e208 = i10[o10];
      if (e208.startOffset > l10 && (l10 = e208.startOffset, s10[c10++] = new cg(l10, u11, d10, f10)), e208.endOffset + 1 <= r11) l10 = e208.endOffset + 1, s10[c10++] = new cg(l10, u11 + ` ` + e208.className, d10 | e208.metadata, f10), o10++;
      else {
        l10 = r11, s10[c10++] = new cg(l10, u11 + ` ` + e208.className, d10 | e208.metadata, f10);
        break;
      }
    }
    r11 > l10 && (l10 = r11, s10[c10++] = new cg(l10, u11, d10, f10));
  }
  let u10 = n10[n10.length - 1].endIndex;
  if (o10 < a10 && i10[o10].startOffset === u10) for (; o10 < a10 && i10[o10].startOffset === u10; ) {
    let e207 = i10[o10];
    s10[c10++] = new cg(l10, e207.className, e207.metadata, false), o10++;
  }
  return s10;
}
function fae(e206, t10) {
  let n10 = e206.fontIsMonospace, r10 = e206.canUseHalfwidthRightwardsArrow, i10 = e206.containsForeignElements, a10 = e206.lineContent, o10 = e206.len, s10 = e206.isOverflowing, c10 = e206.overflowingCharCount, l10 = e206.parts, u10 = e206.fauxIndentLength, d10 = e206.tabSize, f10 = e206.startVisibleColumn, p10 = e206.spaceWidth, m10 = e206.renderSpaceCharCode, h10 = e206.renderWhitespace, g10 = e206.renderControlCharacters, _10 = new dg(o10 + 1, l10.length), v10 = false, y10 = 0, b10 = f10, x10 = 0, S10 = 0, ee2 = 0;
  t10.appendString(`<span>`);
  for (let e207 = 0, s11 = l10.length; e207 < s11; e207++) {
    let s12 = l10[e207], c11 = s12.endIndex, f11 = s12.type, te2 = s12.containsRTL, ne2 = h10 !== 0 && s12.isWhitespace(), re2 = ne2 && !n10 && (f11 === `mtkw` || !i10), ie2 = y10 === c11 && s12.isPseudoAfter();
    if (x10 = 0, t10.appendString(`<span `), te2 && t10.appendString(`dir="rtl" style="unicode-bidi:isolate" `), t10.appendString(`class="`), t10.appendString(re2 ? `mtkz` : f11), t10.appendASCIICharCode(34), ne2) {
      let n11 = 0;
      {
        let e208 = y10, t11 = b10;
        for (; e208 < c11; e208++) {
          let r11 = (a10.charCodeAt(e208) === 9 ? d10 - t11 % d10 : 1) | 0;
          n11 += r11, e208 >= u10 && (t11 += r11);
        }
      }
      for (re2 && (t10.appendString(` style="width:`), t10.appendString(String(p10 * n11)), t10.appendString(`px"`)), t10.appendASCIICharCode(62); y10 < c11; y10++) {
        _10.setColumnInfo(y10 + 1, e207 - ee2, x10, S10), ee2 = 0;
        let n12 = a10.charCodeAt(y10), i11, o11;
        if (n12 === 9) {
          i11 = d10 - b10 % d10 | 0, o11 = i11, !r10 || o11 > 1 ? t10.appendCharCode(8594) : t10.appendCharCode(65515);
          for (let e208 = 2; e208 <= o11; e208++) t10.appendCharCode(160);
        } else i11 = 2, o11 = 1, t10.appendCharCode(m10), t10.appendCharCode(8204);
        x10 += i11, S10 += o11, y10 >= u10 && (b10 += o11);
      }
    } else for (t10.appendASCIICharCode(62); y10 < c11; y10++) {
      _10.setColumnInfo(y10 + 1, e207 - ee2, x10, S10), ee2 = 0;
      let n11 = a10.charCodeAt(y10), r11 = 1, i11 = 1;
      switch (n11) {
        case 9:
          r11 = d10 - b10 % d10, i11 = r11;
          for (let e208 = 1; e208 <= r11; e208++) t10.appendCharCode(160);
          break;
        case 32:
          t10.appendCharCode(160);
          break;
        case 60:
          t10.appendString(`&lt;`);
          break;
        case 62:
          t10.appendString(`&gt;`);
          break;
        case 38:
          t10.appendString(`&amp;`);
          break;
        case 0:
          g10 ? t10.appendCharCode(9216) : t10.appendString(`&#00;`);
          break;
        case 65279:
        case 8232:
        case 8233:
        case 133:
          t10.appendCharCode(65533);
          break;
        default:
          yo(n11) && i11++, g10 && n11 < 32 ? t10.appendCharCode(9216 + n11) : g10 && n11 === 127 ? t10.appendCharCode(9249) : g10 && hg(n11) ? (t10.appendString(`[U+`), t10.appendString(pae(n11)), t10.appendString(`]`), r11 = 8, i11 = r11) : t10.appendCharCode(n11);
      }
      x10 += r11, S10 += i11, y10 >= u10 && (b10 += i11);
    }
    ie2 ? ee2++ : ee2 = 0, y10 >= o10 && !v10 && s12.isPseudoAfter() && (v10 = true, _10.setColumnInfo(y10 + 1, e207, x10, S10)), t10.appendString(`</span>`);
  }
  return v10 || _10.setColumnInfo(o10 + 1, l10.length - 1, x10, S10), s10 && (t10.appendString(`<span class="mtkoverflow">`), t10.appendString(C(796, `Show more ({0})`, mae(c10))), t10.appendString(`</span>`)), t10.appendString(`</span>`), new fg(_10, i10);
}
function pae(e206) {
  return e206.toString(16).toUpperCase().padStart(4, `0`);
}
function mae(e206) {
  return e206 < 1024 ? C(797, `{0} chars`, e206) : e206 < 1024 * 1024 ? `${(e206 / 1024).toFixed(1)} KB` : `${(e206 / 1024 / 1024).toFixed(1)} MB`;
}
var gg = class {
  constructor(e206, t10, n10, r10) {
    this._viewportBrand = void 0, this.top = e206 | 0, this.left = t10 | 0, this.width = n10 | 0, this.height = r10 | 0;
  }
}, hae = class {
  constructor(e206, t10) {
    this.tabSize = e206, this.data = t10;
  }
}, _g2 = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this._viewLineDataBrand = void 0, this.content = e206, this.continuesWithWrappedLine = t10, this.minColumn = n10, this.maxColumn = r10, this.startVisibleColumn = i10, this.tokens = a10, this.inlineDecorations = o10;
  }
}, vg = class e68 {
  constructor(t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10) {
    this.minColumn = t10, this.maxColumn = n10, this.content = r10, this.continuesWithWrappedLine = i10, this.isBasicASCII = e68.isBasicASCII(r10, o10), this.containsRTL = e68.containsRTL(r10, this.isBasicASCII, a10), this.tokens = s10, this.inlineDecorations = c10, this.tabSize = l10, this.startVisibleColumn = u10, this.textDirection = d10, this.hasVariableFonts = f10;
  }
  static isBasicASCII(e206, t10) {
    return t10 ? go(e206) : true;
  }
  static containsRTL(e206, t10, n10) {
    return !t10 && n10 ? ho(e206) : false;
  }
}, yg = class e69 {
  constructor(e206, t10, n10) {
    this.color = e206, this.zIndex = t10, this.data = n10;
  }
  static compareByRenderingProps(e206, t10) {
    return e206.zIndex === t10.zIndex ? e206.color < t10.color ? -1 : +(e206.color > t10.color) : e206.zIndex - t10.zIndex;
  }
  static equals(e206, t10) {
    return e206.color === t10.color && e206.zIndex === t10.zIndex && o(e206.data, t10.data);
  }
  static equalsArr(t10, n10) {
    return o(t10, n10, e69.equals);
  }
};
function gae(e206) {
  return Array.isArray(e206);
}
function _ae(e206) {
  return !gae(e206);
}
function bg(e206) {
  return typeof e206 == `string`;
}
function xg(e206) {
  return !bg(e206);
}
function Sg(e206) {
  return !e206;
}
function Cg(e206, t10) {
  return e206.ignoreCase && t10 ? t10.toLowerCase() : t10;
}
function wg(e206) {
  return e206.replace(/[&<>'"_]/g, `-`);
}
function vae(e206, t10) {
  console.log(`${e206.languageId}: ${t10}`);
}
function Tg(e206, t10) {
  return Error(`${e206.languageId}: ${t10}`);
}
function Eg(e206, t10, n10, r10, i10) {
  let a10 = /\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g, o10 = null;
  return t10.replace(a10, function(t11, a11, s10, c10, l10, u10, d10, f10, p10) {
    return Sg(s10) ? Sg(c10) ? !Sg(l10) && l10 < r10.length ? Cg(e206, r10[l10]) : !Sg(d10) && e206 && typeof e206[d10] == `string` ? e206[d10] : (o10 === null && (o10 = i10.split(`.`), o10.unshift(i10)), !Sg(u10) && u10 < o10.length ? Cg(e206, o10[u10]) : ``) : Cg(e206, n10) : `$`;
  });
}
function yae(e206, t10, n10) {
  let r10 = /\$[sS](\d\d?)/g, i10 = null;
  return t10.replace(r10, function(t11, r11) {
    return i10 === null && (i10 = n10.split(`.`), i10.unshift(n10)), !Sg(r11) && r11 < i10.length ? za(Cg(e206, i10[r11])) : ``;
  });
}
function Dg(e206, t10) {
  let n10 = t10;
  for (; n10 && n10.length > 0; ) {
    let t11 = e206.tokenizer[n10];
    if (t11) return t11;
    let r10 = n10.lastIndexOf(`.`);
    n10 = r10 < 0 ? null : n10.substr(0, r10);
  }
  return null;
}
function bae(e206, t10) {
  let n10 = t10;
  for (; n10 && n10.length > 0; ) {
    if (e206.stateNames[n10]) return true;
    let t11 = n10.lastIndexOf(`.`);
    n10 = t11 < 0 ? null : n10.substr(0, t11);
  }
  return false;
}
var xae = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Sae = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Og, kg = 5, Ag = (_V = class {
  static create(e206, t10) {
    return this._INSTANCE.create(e206, t10);
  }
  constructor(e206) {
    this._maxCacheDepth = e206, this._entries = /* @__PURE__ */ Object.create(null);
  }
  create(e206, t10) {
    if (e206 !== null && e206.depth >= this._maxCacheDepth) return new jg(e206, t10);
    let n10 = jg.getStackElementId(e206);
    n10.length > 0 && (n10 += `|`), n10 += t10;
    let r10 = this._entries[n10];
    return r10 || (r10 = new jg(e206, t10), this._entries[n10] = r10, r10);
  }
}, _V._INSTANCE = new _V(kg), _V), jg = class e70 {
  constructor(e206, t10) {
    this.parent = e206, this.state = t10, this.depth = (this.parent ? this.parent.depth : 0) + 1;
  }
  static getStackElementId(e206) {
    let t10 = ``;
    for (; e206 !== null; ) t10.length > 0 && (t10 += `|`), t10 += e206.state, e206 = e206.parent;
    return t10;
  }
  static _equals(e206, t10) {
    for (; e206 !== null && t10 !== null; ) {
      if (e206 === t10) return true;
      if (e206.state !== t10.state) return false;
      e206 = e206.parent, t10 = t10.parent;
    }
    return e206 === null && t10 === null;
  }
  equals(t10) {
    return e70._equals(this, t10);
  }
  push(e206) {
    return Ag.create(this, e206);
  }
  pop() {
    return this.parent;
  }
  popall() {
    let e206 = this;
    for (; e206.parent; ) e206 = e206.parent;
    return e206;
  }
  switchTo(e206) {
    return Ag.create(this.parent, e206);
  }
}, Mg = class e71 {
  constructor(e206, t10) {
    this.languageId = e206, this.state = t10;
  }
  equals(e206) {
    return this.languageId === e206.languageId && this.state.equals(e206.state);
  }
  clone() {
    return this.state.clone() === this.state ? this : new e71(this.languageId, this.state);
  }
}, Ng = (_W = class {
  static create(e206, t10) {
    return this._INSTANCE.create(e206, t10);
  }
  constructor(e206) {
    this._maxCacheDepth = e206, this._entries = /* @__PURE__ */ Object.create(null);
  }
  create(e206, t10) {
    if (t10 !== null || e206 !== null && e206.depth >= this._maxCacheDepth) return new Pg(e206, t10);
    let n10 = jg.getStackElementId(e206), r10 = this._entries[n10];
    return r10 || (r10 = new Pg(e206, null), this._entries[n10] = r10, r10);
  }
}, _W._INSTANCE = new _W(kg), _W), Pg = class e72 {
  constructor(e206, t10) {
    this.stack = e206, this.embeddedLanguageData = t10;
  }
  clone() {
    return (this.embeddedLanguageData ? this.embeddedLanguageData.clone() : null) === this.embeddedLanguageData ? this : Ng.create(this.stack, this.embeddedLanguageData);
  }
  equals(t10) {
    return !(t10 instanceof e72) || !this.stack.equals(t10.stack) ? false : this.embeddedLanguageData === null && t10.embeddedLanguageData === null ? true : this.embeddedLanguageData === null || t10.embeddedLanguageData === null ? false : this.embeddedLanguageData.equals(t10.embeddedLanguageData);
  }
}, Cae = class {
  constructor() {
    this._tokens = [], this._languageId = null, this._lastTokenType = null, this._lastTokenLanguage = null;
  }
  enterLanguage(e206) {
    this._languageId = e206;
  }
  emit(e206, t10) {
    this._lastTokenType === t10 && this._lastTokenLanguage === this._languageId || (this._lastTokenType = t10, this._lastTokenLanguage = this._languageId, this._tokens.push(new di(e206, t10, this._languageId)));
  }
  nestedLanguageTokenize(e206, t10, n10, r10) {
    let i10 = n10.languageId, a10 = n10.state, o10 = Pi.get(i10);
    if (!o10) return this.enterLanguage(i10), this.emit(r10, ``), a10;
    let s10 = o10.tokenize(e206, t10, a10);
    if (r10 !== 0) for (let e207 of s10.tokens) this._tokens.push(new di(e207.offset + r10, e207.type, e207.language));
    else this._tokens = this._tokens.concat(s10.tokens);
    return this._lastTokenType = null, this._lastTokenLanguage = null, this._languageId = null, s10.endState;
  }
  finalize(e206) {
    return new fi(this._tokens, e206);
  }
}, wae = class e73 {
  constructor(e206, t10) {
    this._languageService = e206, this._theme = t10, this._prependTokens = null, this._tokens = [], this._currentLanguageId = 0, this._lastTokenMetadata = 0;
  }
  enterLanguage(e206) {
    this._currentLanguageId = this._languageService.languageIdCodec.encodeLanguageId(e206);
  }
  emit(e206, t10) {
    let n10 = this._theme.match(this._currentLanguageId, t10) | 1024;
    this._lastTokenMetadata !== n10 && (this._lastTokenMetadata = n10, this._tokens.push(e206), this._tokens.push(n10));
  }
  static _merge(e206, t10, n10) {
    let r10 = e206 === null ? 0 : e206.length, i10 = t10.length, a10 = n10 === null ? 0 : n10.length;
    if (r10 === 0 && i10 === 0 && a10 === 0) return new Uint32Array();
    if (r10 === 0 && i10 === 0) return n10;
    if (i10 === 0 && a10 === 0) return e206;
    let o10 = new Uint32Array(r10 + i10 + a10);
    e206 !== null && o10.set(e206);
    for (let e207 = 0; e207 < i10; e207++) o10[r10 + e207] = t10[e207];
    return n10 !== null && o10.set(n10, r10 + i10), o10;
  }
  nestedLanguageTokenize(t10, n10, r10, i10) {
    let a10 = r10.languageId, o10 = r10.state, s10 = Pi.get(a10);
    if (!s10) return this.enterLanguage(a10), this.emit(i10, ``), o10;
    let c10 = s10.tokenizeEncoded(t10, n10, o10);
    if (i10 !== 0) for (let e206 = 0, t11 = c10.tokens.length; e206 < t11; e206 += 2) c10.tokens[e206] += i10;
    return this._prependTokens = e73._merge(this._prependTokens, this._tokens, c10.tokens), this._tokens = [], this._currentLanguageId = 0, this._lastTokenMetadata = 0, c10.endState;
  }
  finalize(t10) {
    return new pi(e73._merge(this._prependTokens, this._tokens, null), t10);
  }
}, Fg = Og = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._configurationService = i10, this._languageService = e206, this._standaloneThemeService = t10, this._languageId = n10, this._lexer = r10, this._embeddedLanguages = /* @__PURE__ */ Object.create(null), this.embeddedLoaded = Promise.resolve(void 0);
    let a10 = false;
    this._register(Pi.onDidChange((e207) => {
      if (a10) return;
      let t11 = false;
      for (let n11 = 0, r11 = e207.changedLanguages.length; n11 < r11; n11++) {
        let r12 = e207.changedLanguages[n11];
        if (this._embeddedLanguages[r12]) {
          t11 = true;
          break;
        }
      }
      t11 && (a10 = true, Pi.handleChange([this._languageId]), a10 = false);
    })), this._maxTokenizationLineLength = this._configurationService.getValue(`editor.maxTokenizationLineLength`, { overrideIdentifier: this._languageId }), this._register(this._configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(`editor.maxTokenizationLineLength`) && (this._maxTokenizationLineLength = this._configurationService.getValue(`editor.maxTokenizationLineLength`, { overrideIdentifier: this._languageId }));
    }));
  }
  getLoadStatus() {
    let e206 = [];
    for (let t10 in this._embeddedLanguages) {
      let n10 = Pi.get(t10);
      if (n10) {
        if (n10 instanceof Og) {
          let t11 = n10.getLoadStatus();
          t11.loaded === false && e206.push(t11.promise);
        }
        continue;
      }
      Pi.isResolved(t10) || e206.push(Pi.getOrCreate(t10));
    }
    return e206.length === 0 ? { loaded: true } : { loaded: false, promise: Promise.all(e206).then((e207) => void 0) };
  }
  getInitialState() {
    let e206 = Ag.create(null, this._lexer.start);
    return Ng.create(e206, null);
  }
  tokenize(e206, t10, n10) {
    if (e206.length >= this._maxTokenizationLineLength) return eg(this._languageId, n10);
    let r10 = new Cae(), i10 = this._tokenize(e206, t10, n10, r10);
    return r10.finalize(i10);
  }
  tokenizeEncoded(e206, t10, n10) {
    if (e206.length >= this._maxTokenizationLineLength) return tg(this._languageService.languageIdCodec.encodeLanguageId(this._languageId), n10);
    let r10 = new wae(this._languageService, this._standaloneThemeService.getColorTheme().tokenTheme), i10 = this._tokenize(e206, t10, n10, r10);
    return r10.finalize(i10);
  }
  _tokenize(e206, t10, n10, r10) {
    return n10.embeddedLanguageData ? this._nestedTokenize(e206, t10, n10, 0, r10) : this._myTokenize(e206, t10, n10, 0, r10);
  }
  _findLeavingNestedLanguageOffset(e206, t10) {
    let n10 = this._lexer.tokenizer[t10.stack.state];
    if (!n10 && (n10 = Dg(this._lexer, t10.stack.state), !n10)) throw Tg(this._lexer, `tokenizer state is not defined: ` + t10.stack.state);
    let r10 = -1, i10 = false;
    for (let a10 of n10) {
      if (!xg(a10.action) || !(a10.action.nextEmbedded === `@pop` || a10.action.hasEmbeddedEndInCases)) continue;
      i10 = true;
      let n11 = a10.resolveRegex(t10.stack.state), o10 = n11.source;
      if (o10.substr(0, 4) === `^(?:` && o10.substr(o10.length - 1, 1) === `)`) {
        let e207 = (n11.ignoreCase ? `i` : ``) + (n11.unicode ? `u` : ``);
        n11 = new RegExp(o10.substr(4, o10.length - 5), e207);
      }
      let s10 = e206.search(n11);
      s10 === -1 || s10 !== 0 && a10.matchOnlyAtLineStart || (r10 === -1 || s10 < r10) && (r10 = s10);
    }
    if (!i10) throw Tg(this._lexer, `no rule containing nextEmbedded: "@pop" in tokenizer embedded state: ` + t10.stack.state);
    return r10;
  }
  _nestedTokenize(e206, t10, n10, r10, i10) {
    let a10 = this._findLeavingNestedLanguageOffset(e206, n10);
    if (a10 === -1) {
      let a11 = i10.nestedLanguageTokenize(e206, t10, n10.embeddedLanguageData, r10);
      return Ng.create(n10.stack, new Mg(n10.embeddedLanguageData.languageId, a11));
    }
    let o10 = e206.substring(0, a10);
    o10.length > 0 && i10.nestedLanguageTokenize(o10, false, n10.embeddedLanguageData, r10);
    let s10 = e206.substring(a10);
    return this._myTokenize(s10, t10, n10, r10 + a10, i10);
  }
  _safeRuleName(e206) {
    return e206 ? e206.name : `(unknown)`;
  }
  _myTokenize(e206, t10, n10, r10, i10) {
    i10.enterLanguage(this._languageId);
    let a10 = e206.length, o10 = t10 && this._lexer.includeLF ? e206 + `
` : e206, s10 = o10.length, c10 = n10.embeddedLanguageData, l10 = n10.stack, u10 = 0, d10 = null, f10 = true;
    for (; f10 || u10 < s10; ) {
      let n11 = u10, p10 = l10.depth, m10 = d10 ? d10.groups.length : 0, h10 = l10.state, g10 = null, _10 = null, v10 = null, y10 = null, b10 = null;
      if (d10) {
        g10 = d10.matches;
        let e207 = d10.groups.shift();
        _10 = e207.matched, v10 = e207.action, y10 = d10.rule, d10.groups.length === 0 && (d10 = null);
      } else {
        if (!f10 && u10 >= s10) break;
        f10 = false;
        let e207 = this._lexer.tokenizer[h10];
        if (!e207 && (e207 = Dg(this._lexer, h10), !e207)) throw Tg(this._lexer, `tokenizer state is not defined: ` + h10);
        let t11 = o10.substr(u10);
        for (let n12 of e207) if ((u10 === 0 || !n12.matchOnlyAtLineStart) && (g10 = t11.match(n12.resolveRegex(h10)), g10)) {
          _10 = g10[0], v10 = n12.action;
          break;
        }
      }
      if (g10 || (g10 = [``], _10 = ``), v10 || (v10 = (u10 < s10 && (g10 = [o10.charAt(u10)], _10 = g10[0]), this._lexer.defaultToken)), _10 === null) break;
      for (u10 += _10.length; _ae(v10) && xg(v10) && v10.test; ) v10 = v10.test(_10, g10, h10, u10 === s10);
      let x10 = null;
      if (typeof v10 == `string` || Array.isArray(v10)) x10 = v10;
      else if (v10.group) x10 = v10.group;
      else if (v10.token !== null && v10.token !== void 0) {
        if (x10 = v10.tokenSubst ? Eg(this._lexer, v10.token, _10, g10, h10) : v10.token, v10.nextEmbedded) if (v10.nextEmbedded === `@pop`) {
          if (!c10) throw Tg(this._lexer, `cannot pop embedded language if not inside one`);
          c10 = null;
        } else if (c10) throw Tg(this._lexer, `cannot enter embedded language from within an embedded language`);
        else b10 = Eg(this._lexer, v10.nextEmbedded, _10, g10, h10);
        if (v10.goBack && (u10 = Math.max(0, u10 - v10.goBack)), v10.switchTo && typeof v10.switchTo == `string`) {
          let e207 = Eg(this._lexer, v10.switchTo, _10, g10, h10);
          if (e207[0] === `@` && (e207 = e207.substr(1)), Dg(this._lexer, e207)) l10 = l10.switchTo(e207);
          else throw Tg(this._lexer, `trying to switch to a state '` + e207 + `' that is undefined in rule: ` + this._safeRuleName(y10));
        } else if (v10.transform && typeof v10.transform == `function`) throw Tg(this._lexer, `action.transform not supported`);
        else if (v10.next) if (v10.next === `@push`) {
          if (l10.depth >= this._lexer.maxStack) throw Tg(this._lexer, `maximum tokenizer stack size reached: [` + l10.state + `,` + l10.parent.state + `,...]`);
          l10 = l10.push(h10);
        } else if (v10.next === `@pop`) {
          if (l10.depth <= 1) throw Tg(this._lexer, `trying to pop an empty stack in rule: ` + this._safeRuleName(y10));
          l10 = l10.pop();
        } else if (v10.next === `@popall`) l10 = l10.popall();
        else {
          let e207 = Eg(this._lexer, v10.next, _10, g10, h10);
          if (e207[0] === `@` && (e207 = e207.substr(1)), Dg(this._lexer, e207)) l10 = l10.push(e207);
          else throw Tg(this._lexer, `trying to set a next state '` + e207 + `' that is undefined in rule: ` + this._safeRuleName(y10));
        }
        v10.log && typeof v10.log == `string` && vae(this._lexer, this._lexer.languageId + `: ` + Eg(this._lexer, v10.log, _10, g10, h10));
      }
      if (x10 === null) throw Tg(this._lexer, `lexer rule has no well-defined action in rule: ` + this._safeRuleName(y10));
      let S10 = (n12) => {
        let a11 = this._languageService.getLanguageIdByLanguageName(n12) || this._languageService.getLanguageIdByMimeType(n12) || n12, o11 = this._getNestedEmbeddedLanguageData(a11);
        if (u10 < s10) {
          let n13 = e206.substr(u10);
          return this._nestedTokenize(n13, t10, Ng.create(l10, o11), r10 + u10, i10);
        } else return Ng.create(l10, o11);
      };
      if (Array.isArray(x10)) {
        if (d10 && d10.groups.length > 0) throw Tg(this._lexer, `groups cannot be nested: ` + this._safeRuleName(y10));
        if (g10.length !== x10.length + 1) throw Tg(this._lexer, `matched number of groups does not match the number of actions in rule: ` + this._safeRuleName(y10));
        let e207 = 0;
        for (let t11 = 1; t11 < g10.length; t11++) e207 += g10[t11].length;
        if (e207 !== _10.length) throw Tg(this._lexer, `with groups, all characters should be matched in consecutive groups in rule: ` + this._safeRuleName(y10));
        d10 = { rule: y10, matches: g10, groups: [] };
        for (let e208 = 0; e208 < x10.length; e208++) d10.groups[e208] = { action: x10[e208], matched: g10[e208 + 1] };
        u10 -= _10.length;
        continue;
      } else {
        if (x10 === `@rematch` && (u10 -= _10.length, _10 = ``, g10 = null, x10 = ``, b10 !== null)) return S10(b10);
        if (_10.length === 0) {
          if (s10 === 0 || p10 !== l10.depth || h10 !== l10.state || (d10 ? d10.groups.length : 0) !== m10) continue;
          throw Tg(this._lexer, `no progress in tokenizer in rule: ` + this._safeRuleName(y10));
        }
        let e207 = null;
        if (bg(x10) && x10.indexOf(`@brackets`) === 0) {
          let t11 = x10.substr(9), n12 = Tae(this._lexer, _10);
          if (!n12) throw Tg(this._lexer, `@brackets token returned but no bracket defined as: ` + _10);
          e207 = wg(n12.token + t11);
        } else e207 = wg(x10 === `` ? `` : x10 + this._lexer.tokenPostfix);
        n11 < a10 && i10.emit(n11 + r10, e207);
      }
      if (b10 !== null) return S10(b10);
    }
    return Ng.create(l10, c10);
  }
  _getNestedEmbeddedLanguageData(e206) {
    if (!this._languageService.isRegisteredLanguageId(e206)) return new Mg(e206, $h);
    e206 !== this._languageId && (this._languageService.requestBasicLanguageFeatures(e206), Pi.getOrCreate(e206), this._embeddedLanguages[e206] = true);
    let t10 = Pi.get(e206);
    return t10 ? new Mg(e206, t10.getInitialState()) : new Mg(e206, $h);
  }
};
Fg = Og = xae([Sae(4, Uf)], Fg);
function Tae(e206, t10) {
  if (!t10) return null;
  t10 = Cg(e206, t10);
  let n10 = e206.brackets;
  for (let e207 of n10) if (e207.open === t10) return { token: e207.token, bracketType: 1 };
  else if (e207.close === t10) return { token: e207.token, bracketType: -1 };
  return null;
}
var Eae = _f2(`standaloneColorizer`, { createHTML: (e206) => e206 }), Ig = class {
  static colorizeElement(e206, t10, n10, r10) {
    r10 || (r10 = {});
    let i10 = r10.theme || `vs`, a10 = r10.mimeType || n10.getAttribute(`lang`) || n10.getAttribute(`data-lang`);
    if (!a10) return console.error(`Mode not detected`), Promise.resolve();
    let o10 = t10.getLanguageIdByMimeType(a10) || a10;
    e206.setTheme(i10);
    let s10 = n10.firstChild ? n10.firstChild.nodeValue : ``;
    return n10.className += ` ` + i10, this.colorize(t10, s10 || ``, o10, r10).then((e207) => {
      n10.innerHTML = Eae?.createHTML(e207) ?? e207;
    }, (e207) => console.error(e207));
  }
  static async colorize(e206, t10, n10, r10) {
    let i10 = e206.languageIdCodec, a10 = 4;
    r10 && typeof r10.tabSize == `number` && (a10 = r10.tabSize), xo(t10) && (t10 = t10.substr(1));
    let o10 = Wa(t10);
    if (!e206.isRegisteredLanguageId(n10)) return Lg(o10, a10, i10);
    let s10 = await Pi.getOrCreate(n10);
    return s10 ? Dae(o10, a10, s10, i10) : Lg(o10, a10, i10);
  }
  static colorizeLine(e206, t10, n10, r10, i10 = 4) {
    let a10 = vg.isBasicASCII(e206, t10);
    return mg(new lg(false, true, e206, false, a10, vg.containsRTL(e206, a10, n10), 0, r10, [], i10, 0, 0, 0, 0, -1, `none`, false, false, null, null, 0)).html;
  }
  static colorizeModelLine(e206, t10, n10 = 4) {
    let r10 = e206.getLineContent(t10);
    e206.tokenization.forceTokenization(t10);
    let i10 = e206.tokenization.getLineTokens(t10).inflate();
    return this.colorizeLine(r10, e206.mightContainNonBasicASCII(), e206.mightContainRTL(), i10, n10);
  }
};
function Dae(e206, t10, n10, r10) {
  return new Promise((i10, a10) => {
    let o10 = () => {
      let s10 = Oae(e206, t10, n10, r10);
      if (n10 instanceof Fg) {
        let e207 = n10.getLoadStatus();
        if (e207.loaded === false) {
          e207.promise.then(o10, a10);
          return;
        }
      }
      i10(s10);
    };
    o10();
  });
}
function Lg(e206, t10, n10) {
  let r10 = [], i10 = new Uint32Array(2);
  i10[0] = 0, i10[1] = 33587200;
  for (let a10 = 0, o10 = e206.length; a10 < o10; a10++) {
    let o11 = e206[a10];
    i10[0] = o11.length;
    let s10 = new rg(i10, o11, n10), c10 = vg.isBasicASCII(o11, true), l10 = mg(new lg(false, true, o11, false, c10, vg.containsRTL(o11, c10, true), 0, s10, [], t10, 0, 0, 0, 0, -1, `none`, false, false, null, null, 0));
    r10 = r10.concat(l10.html), r10.push(`<br/>`);
  }
  return r10.join(``);
}
function Oae(e206, t10, n10, r10) {
  let i10 = [], a10 = n10.getInitialState();
  for (let o10 = 0, s10 = e206.length; o10 < s10; o10++) {
    let s11 = e206[o10], c10 = n10.tokenizeEncoded(s11, true, a10);
    rg.convertToEndOffset(c10.tokens, s11.length);
    let l10 = new rg(c10.tokens, s11, r10), u10 = vg.isBasicASCII(s11, true), d10 = mg(new lg(false, true, s11, false, u10, vg.containsRTL(s11, u10, true), 0, l10.inflate(), [], t10, 0, 0, 0, 0, -1, `none`, false, false, null, null, 0));
    i10 = i10.concat(d10.html), i10.push(`<br/>`), a10 = c10.endState;
  }
  return i10.join(``);
}
var Rg = 2e4, zg, Bg, Vg, Hg, Ug;
function kae(e206) {
  zg = document.createElement(`div`), zg.className = `monaco-aria-container`;
  let t10 = () => {
    let e207 = document.createElement(`div`);
    return e207.className = `monaco-alert`, e207.setAttribute(`role`, `alert`), e207.setAttribute(`aria-atomic`, `true`), zg.appendChild(e207), e207;
  };
  Bg = t10(), Vg = t10();
  let n10 = () => {
    let e207 = document.createElement(`div`);
    return e207.className = `monaco-status`, e207.setAttribute(`aria-live`, `polite`), e207.setAttribute(`aria-atomic`, `true`), zg.appendChild(e207), e207;
  };
  Hg = n10(), Ug = n10(), e206.appendChild(zg);
}
function Wg(e206) {
  zg && (Bg.textContent === e206 ? (Xc(Bg), Kg(Vg, e206)) : (Xc(Vg), Kg(Bg, e206)));
}
function Gg(e206) {
  zg && (Hg.textContent === e206 ? (Xc(Hg), Kg(Ug, e206)) : (Xc(Ug), Kg(Hg, e206)));
}
function Kg(e206, t10) {
  Xc(e206), t10.length > Rg && (t10 = t10.substr(0, Rg)), e206.textContent = t10, e206.style.visibility = `hidden`, e206.style.visibility = `visible`;
}
var qg = xu(`markerDecorationsService`), Aae = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, jae = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Jg = (_X2 = class {
  constructor(e206, t10) {
  }
  dispose() {
  }
}, _X2.ID = `editor.contrib.markerDecorations`, _X2);
Jg = Aae([jae(1, qg)], Jg), af(Jg.ID, Jg, 0);
var Yg = class extends D {
  constructor(e206, t10) {
    super(), this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, this._referenceDomElement = e206, this._width = -1, this._height = -1, this._resizeObserver = null, this.measureReferenceDomElement(false, t10);
  }
  dispose() {
    this.stopObserving(), super.dispose();
  }
  getWidth() {
    return this._width;
  }
  getHeight() {
    return this._height;
  }
  startObserving() {
    if (!this._resizeObserver && this._referenceDomElement) {
      let e206 = null, t10 = () => {
        e206 ? this.observe({ width: e206.width, height: e206.height }) : this.observe();
      }, n10 = false, r10 = false, i10 = () => {
        if (n10 && !r10) try {
          n10 = false, r10 = true, t10();
        } finally {
          cl(Vc(this._referenceDomElement), () => {
            r10 = false, i10();
          });
        }
      };
      this._resizeObserver = new ResizeObserver((t11) => {
        e206 = t11 && t11[0] && t11[0].contentRect ? { width: t11[0].contentRect.width, height: t11[0].contentRect.height } : null, n10 = true, i10();
      }), this._resizeObserver.observe(this._referenceDomElement);
    }
  }
  stopObserving() {
    this._resizeObserver && (this._resizeObserver = (this._resizeObserver.disconnect(), null));
  }
  observe(e206) {
    this.measureReferenceDomElement(true, e206);
  }
  measureReferenceDomElement(e206, t10) {
    let n10 = 0, r10 = 0;
    t10 ? (n10 = t10.width, r10 = t10.height) : this._referenceDomElement && (n10 = this._referenceDomElement.clientWidth, r10 = this._referenceDomElement.clientHeight), n10 = Math.max(5, n10), r10 = Math.max(5, r10), (this._width !== n10 || this._height !== r10) && (this._width = n10, this._height = r10, e206 && this._onDidChange.fire());
  }
}, Xg = (_Y = class {
  constructor(e206, t10) {
    this.key = e206, this.migrate = t10;
  }
  apply(t10) {
    let n10 = _Y._read(t10, this.key);
    this.migrate(n10, (n11) => _Y._read(t10, n11), (n11, r10) => _Y._write(t10, n11, r10));
  }
  static _read(e206, t10) {
    if (e206 == null) return;
    let n10 = t10.indexOf(`.`);
    if (n10 >= 0) {
      let r10 = t10.substring(0, n10);
      return this._read(e206[r10], t10.substring(n10 + 1));
    }
    return e206[t10];
  }
  static _write(e206, t10, n10) {
    let r10 = t10.indexOf(`.`);
    if (r10 >= 0) {
      let i10 = t10.substring(0, r10);
      e206[i10] = e206[i10] || {}, this._write(e206[i10], t10.substring(r10 + 1), n10);
      return;
    }
    e206[t10] = n10;
  }
}, _Y.items = [], _Y);
function Zg(e206, t10) {
  Xg.items.push(new Xg(e206, t10));
}
function Qg(e206, t10) {
  Zg(e206, (n10, r10, i10) => {
    if (n10 !== void 0) {
      for (let [r11, a10] of t10) if (n10 === r11) {
        i10(e206, a10);
        return;
      }
    }
  });
}
function Mae(e206) {
  Xg.items.forEach((t10) => t10.apply(e206));
}
Qg(`wordWrap`, [[true, `on`], [false, `off`]]), Qg(`lineNumbers`, [[true, `on`], [false, `off`]]), Qg(`cursorBlinking`, [[`visible`, `solid`]]), Qg(`renderWhitespace`, [[true, `boundary`], [false, `none`]]), Qg(`renderLineHighlight`, [[true, `line`], [false, `none`]]), Qg(`acceptSuggestionOnEnter`, [[true, `on`], [false, `off`]]), Qg(`tabCompletion`, [[false, `off`], [true, `onlySnippets`]]), Qg(`hover`, [[true, { enabled: true }], [false, { enabled: false }]]), Qg(`parameterHints`, [[true, { enabled: true }], [false, { enabled: false }]]), Qg(`autoIndent`, [[false, `advanced`], [true, `full`]]), Qg(`matchBrackets`, [[true, `always`], [false, `never`]]), Qg(`renderFinalNewline`, [[true, `on`], [false, `off`]]), Qg(`cursorSmoothCaretAnimation`, [[true, `on`], [false, `off`]]), Qg(`occurrencesHighlight`, [[true, `singleFile`], [false, `off`]]), Qg(`wordBasedSuggestions`, [[true, `matchingDocuments`], [false, `off`]]), Qg(`defaultColorDecorators`, [[true, `auto`], [false, `never`]]), Qg(`minimap.autohide`, [[true, `mouseover`], [false, `none`]]), Zg(`autoClosingBrackets`, (e206, t10, n10) => {
  e206 === false && (n10(`autoClosingBrackets`, `never`), t10(`autoClosingQuotes`) === void 0 && n10(`autoClosingQuotes`, `never`), t10(`autoSurround`) === void 0 && n10(`autoSurround`, `never`));
}), Zg(`renderIndentGuides`, (e206, t10, n10) => {
  e206 !== void 0 && (n10(`renderIndentGuides`, void 0), t10(`guides.indentation`) === void 0 && n10(`guides.indentation`, !!e206));
}), Zg(`highlightActiveIndentGuide`, (e206, t10, n10) => {
  e206 !== void 0 && (n10(`highlightActiveIndentGuide`, void 0), t10(`guides.highlightActiveIndentation`) === void 0 && n10(`guides.highlightActiveIndentation`, !!e206));
});
var Nae = { method: `showMethods`, function: `showFunctions`, constructor: `showConstructors`, deprecated: `showDeprecated`, field: `showFields`, variable: `showVariables`, class: `showClasses`, struct: `showStructs`, interface: `showInterfaces`, module: `showModules`, property: `showProperties`, event: `showEvents`, operator: `showOperators`, unit: `showUnits`, value: `showValues`, constant: `showConstants`, enum: `showEnums`, enumMember: `showEnumMembers`, keyword: `showKeywords`, text: `showWords`, color: `showColors`, file: `showFiles`, reference: `showReferences`, folder: `showFolders`, typeParameter: `showTypeParameters`, snippet: `showSnippets` };
Zg(`suggest.filteredTypes`, (e206, t10, n10) => {
  if (e206 && typeof e206 == `object`) {
    for (let r10 of Object.entries(Nae)) e206[r10[0]] === false && t10(`suggest.${r10[1]}`) === void 0 && n10(`suggest.${r10[1]}`, false);
    n10(`suggest.filteredTypes`, void 0);
  }
}), Zg(`quickSuggestions`, (e206, t10, n10) => {
  if (typeof e206 == `boolean`) {
    let t11 = e206 ? `on` : `off`;
    n10(`quickSuggestions`, { comments: t11, strings: t11, other: t11 });
  }
}), Zg(`experimental.stickyScroll.enabled`, (e206, t10, n10) => {
  typeof e206 == `boolean` && (n10(`experimental.stickyScroll.enabled`, void 0), t10(`stickyScroll.enabled`) === void 0 && n10(`stickyScroll.enabled`, e206));
}), Zg(`experimental.stickyScroll.maxLineCount`, (e206, t10, n10) => {
  typeof e206 == `number` && (n10(`experimental.stickyScroll.maxLineCount`, void 0), t10(`stickyScroll.maxLineCount`) === void 0 && n10(`stickyScroll.maxLineCount`, e206));
}), Zg(`editor.experimentalEditContextEnabled`, (e206, t10, n10) => {
  typeof e206 == `boolean` && (n10(`editor.experimentalEditContextEnabled`, void 0), t10(`editor.editContext`) === void 0 && n10(`editor.editContext`, e206));
}), Zg(`codeActionsOnSave`, (e206, t10, n10) => {
  if (e206 && typeof e206 == `object`) {
    let t11 = false, r10 = {};
    for (let n11 of Object.entries(e206)) typeof n11[1] == `boolean` ? (t11 = true, r10[n11[0]] = n11[1] ? `explicit` : `never`) : r10[n11[0]] = n11[1];
    t11 && n10(`codeActionsOnSave`, r10);
  }
}), Zg(`codeActionWidget.includeNearbyQuickfixes`, (e206, t10, n10) => {
  typeof e206 == `boolean` && (n10(`codeActionWidget.includeNearbyQuickfixes`, void 0), t10(`codeActionWidget.includeNearbyQuickFixes`) === void 0 && n10(`codeActionWidget.includeNearbyQuickFixes`, e206));
}), Zg(`lightbulb.enabled`, (e206, t10, n10) => {
  typeof e206 == `boolean` && n10(`lightbulb.enabled`, e206 ? void 0 : `off`);
}), Zg(`inlineSuggest.edits.codeShifting`, (e206, t10, n10) => {
  typeof e206 == `boolean` && (n10(`inlineSuggest.edits.codeShifting`, void 0), n10(`inlineSuggest.edits.allowCodeShifting`, e206 ? `always` : `never`));
});
var $g = new class {
  constructor() {
    this._tabFocus = false, this._onDidChangeTabFocus = new k(), this.onDidChangeTabFocus = this._onDidChangeTabFocus.event;
  }
  getTabFocusMode() {
    return this._tabFocus;
  }
  setTabFocusMode(e206) {
    this._tabFocus = e206, this._onDidChangeTabFocus.fire(this._tabFocus);
  }
}();
function Pae(e206, t10, n10) {
  let r10 = e206.get(58), i10 = e206.get(62), a10 = e206.get(61), o10 = e206.get(60), s10 = e206.get(63), c10 = e206.get(75), l10 = e206.get(72);
  return mn._create(r10, i10, a10, o10, s10, c10, l10, t10, n10);
}
function Fae(e206, t10, n10 = false) {
  let r10 = lr.fontFamily.validate(e206.fontFamily), i10 = lr.fontWeight.validate(e206.fontWeight), a10 = lr.fontSize.validate(e206.fontSize), o10 = lr.fontLigatures2.validate(e206.fontLigatures), s10 = lr.fontVariations.validate(e206.fontVariations), c10 = lr.lineHeight.validate(e206.lineHeight), l10 = lr.letterSpacing.validate(e206.letterSpacing);
  return mn._create(r10, i10, a10, o10, s10, c10, l10, t10, n10);
}
var e_ = xu(`accessibilityService`), t_ = new U(`accessibilityModeEnabled`, false), n_ = new class {
  constructor() {
    this._inputMode = `insert`, this._onDidChangeInputMode = new k(), this.onDidChangeInputMode = this._onDidChangeInputMode.event;
  }
  getInputMode() {
    return this._inputMode;
  }
}(), r_ = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, i_ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, a_ = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._accessibilityService = i10, this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, this._onDidChangeFast = this._register(new k()), this.onDidChangeFast = this._onDidChangeFast.event, this._isDominatedByLongLines = false, this._viewLineCount = 1, this._lineNumbersDigitCount = 1, this._reservedHeight = 0, this._glyphMarginDecorationLaneCount = 1, this._computeOptionsMemory = new Dn(), this.isSimpleWidget = e206, this.contextMenuId = t10, this._containerObserver = this._register(new Yg(r10, n10.dimension)), this._targetWindowId = Vc(r10).vscodeWindowId, this._rawOptions = d_(n10), this._validatedOptions = u_.validateOptions(this._rawOptions), this.options = this._computeOptions(), this.options.get(19) && this._containerObserver.startObserving(), this._register(pn.onDidChangeZoomLevel(() => this._recomputeOptions())), this._register($g.onDidChangeTabFocus(() => this._recomputeOptions())), this._register(this._containerObserver.onDidChange(() => this._recomputeOptions())), this._register(yu.onDidChange(() => this._recomputeOptions())), this._register(mu.getInstance(Vc(r10)).onDidChange(() => this._recomputeOptions())), this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions())), this._register(n_.onDidChangeInputMode(() => this._recomputeOptions()));
  }
  _recomputeOptions() {
    let e206 = this._computeOptions(), t10 = u_.checkEquals(this.options, e206);
    t10 !== null && (this.options = e206, this._onDidChangeFast.fire(t10), this._onDidChange.fire(t10));
  }
  _computeOptions() {
    let e206 = this._readEnvConfiguration(), t10 = Pae(this._validatedOptions, e206.pixelRatio, this.isSimpleWidget), n10 = this._readFontInfo(t10), r10 = { memory: this._computeOptionsMemory, outerWidth: e206.outerWidth, outerHeight: e206.outerHeight - this._reservedHeight, fontInfo: n10, extraEditorClassName: e206.extraEditorClassName, isDominatedByLongLines: this._isDominatedByLongLines, viewLineCount: this._viewLineCount, lineNumbersDigitCount: this._lineNumbersDigitCount, emptySelectionClipboard: e206.emptySelectionClipboard, pixelRatio: e206.pixelRatio, tabFocusMode: this._validatedOptions.get(164) || $g.getTabFocusMode(), inputMode: n_.getInputMode(), accessibilitySupport: e206.accessibilitySupport, glyphMarginDecorationLaneCount: this._glyphMarginDecorationLaneCount, editContextSupported: e206.editContextSupported };
    return u_.computeOptions(this._validatedOptions, r10);
  }
  _readEnvConfiguration() {
    return { extraEditorClassName: s_(), outerWidth: this._containerObserver.getWidth(), outerHeight: this._containerObserver.getHeight(), emptySelectionClipboard: No || Mo, pixelRatio: mu.getInstance(Kc(this._targetWindowId, true).window).value, editContextSupported: typeof globalThis.EditContext == `function`, accessibilitySupport: this._accessibilityService.isScreenReaderOptimized() ? 2 : this._accessibilityService.getAccessibilitySupport() };
  }
  _readFontInfo(e206) {
    return yu.readFontInfo(Kc(this._targetWindowId, true).window, e206);
  }
  getRawOptions() {
    return this._rawOptions;
  }
  updateOptions(e206) {
    let t10 = d_(e206);
    u_.applyUpdate(this._rawOptions, t10) && (this._validatedOptions = u_.validateOptions(this._rawOptions), this._recomputeOptions());
  }
  observeContainer(e206) {
    this._containerObserver.observe(e206);
  }
  setIsDominatedByLongLines(e206) {
    this._isDominatedByLongLines !== e206 && (this._isDominatedByLongLines = e206, this._recomputeOptions());
  }
  setModelLineCount(e206) {
    let t10 = o_(e206);
    this._lineNumbersDigitCount !== t10 && (this._lineNumbersDigitCount = t10, this._recomputeOptions());
  }
  setViewLineCount(e206) {
    this._viewLineCount !== e206 && (this._viewLineCount = e206, this._recomputeOptions());
  }
  setReservedHeight(e206) {
    this._reservedHeight !== e206 && (this._reservedHeight = e206, this._recomputeOptions());
  }
  setGlyphMarginDecorationLaneCount(e206) {
    this._glyphMarginDecorationLaneCount !== e206 && (this._glyphMarginDecorationLaneCount = e206, this._recomputeOptions());
  }
};
a_ = r_([i_(4, e_)], a_);
function o_(e206) {
  let t10 = 0;
  for (; e206; ) e206 = Math.floor(e206 / 10), t10++;
  return t10 || 1;
}
function s_() {
  let e206 = ``;
  return Fo || Io ? (e206 += `no-minimap-shadow `, e206 += `enable-user-select `) : e206 += `no-user-select `, Tt && (e206 += `mac `), e206;
}
var c_ = class {
  constructor() {
    this._values = [];
  }
  _read(e206) {
    return this._values[e206];
  }
  get(e206) {
    return this._values[e206];
  }
  _write(e206, t10) {
    this._values[e206] = t10;
  }
}, l_ = class {
  constructor() {
    this._values = [];
  }
  _read(e206) {
    if (e206 >= this._values.length) throw Error(`Cannot read uninitialized value`);
    return this._values[e206];
  }
  get(e206) {
    return this._read(e206);
  }
  _write(e206, t10) {
    this._values[e206] = t10;
  }
}, u_ = class e74 {
  static validateOptions(e206) {
    let t10 = new c_();
    for (let n10 of cr) {
      let r10 = n10.name === `_never_` ? void 0 : e206[n10.name];
      t10._write(n10.id, n10.validate(r10));
    }
    return t10;
  }
  static computeOptions(e206, t10) {
    let n10 = new l_();
    for (let r10 of cr) n10._write(r10.id, r10.compute(t10, n10, e206._read(r10.id)));
    return n10;
  }
  static _deepEquals(t10, n10) {
    if (typeof t10 != `object` || typeof n10 != `object` || !t10 || !n10) return t10 === n10;
    if (Array.isArray(t10) || Array.isArray(n10)) return Array.isArray(t10) && Array.isArray(n10) ? o(t10, n10) : false;
    if (Object.keys(t10).length !== Object.keys(n10).length) return false;
    for (let r10 in t10) if (!e74._deepEquals(t10[r10], n10[r10])) return false;
    return true;
  }
  static checkEquals(t10, n10) {
    let r10 = [], i10 = false;
    for (let a10 of cr) {
      let o10 = !e74._deepEquals(t10._read(a10.id), n10._read(a10.id));
      r10[a10.id] = o10, o10 && (i10 = true);
    }
    return i10 ? new En(r10) : null;
  }
  static applyUpdate(e206, t10) {
    let n10 = false;
    for (let r10 of cr) if (t10.hasOwnProperty(r10.name)) {
      let i10 = r10.applyUpdate(e206[r10.name], t10[r10.name]);
      e206[r10.name] = i10.newValue, n10 || (n10 = i10.didChange);
    }
    return n10;
  }
};
function d_(e206) {
  let t10 = et(e206);
  return Mae(t10), t10;
}
var f_;
(function(e206) {
  let t10 = { total: 0, min: Number.MAX_VALUE, max: 0 }, n10 = { ...t10 }, r10 = { ...t10 }, i10 = { ...t10 }, a10 = 0, o10 = { keydown: 0, input: 0, render: 0 };
  function s10() {
    _10(), performance.mark(`inputlatency/start`), performance.mark(`keydown/start`), o10.keydown = 1, queueMicrotask(c10);
  }
  e206.onKeyDown = s10;
  function c10() {
    o10.keydown === 1 && (performance.mark(`keydown/end`), o10.keydown = 2);
  }
  function l10() {
    performance.mark(`input/start`), o10.input = 1, g10();
  }
  e206.onBeforeInput = l10;
  function u10() {
    o10.input === 0 && l10(), queueMicrotask(d10);
  }
  e206.onInput = u10;
  function d10() {
    o10.input === 1 && (performance.mark(`input/end`), o10.input = 2);
  }
  function f10() {
    _10();
  }
  e206.onKeyUp = f10;
  function p10() {
    _10();
  }
  e206.onSelectionChange = p10;
  function m10() {
    o10.keydown === 2 && o10.input === 2 && o10.render === 0 && (performance.mark(`render/start`), o10.render = 1, queueMicrotask(h10), g10());
  }
  e206.onRenderStart = m10;
  function h10() {
    o10.render === 1 && (performance.mark(`render/end`), o10.render = 2);
  }
  function g10() {
    setTimeout(_10);
  }
  function _10() {
    o10.keydown === 2 && o10.input === 2 && o10.render === 2 && (performance.mark(`inputlatency/end`), performance.measure(`keydown`, `keydown/start`, `keydown/end`), performance.measure(`input`, `input/start`, `input/end`), performance.measure(`render`, `render/start`, `render/end`), performance.measure(`inputlatency`, `inputlatency/start`, `inputlatency/end`), v10(`keydown`, t10), v10(`input`, n10), v10(`render`, r10), v10(`inputlatency`, i10), a10++, y10());
  }
  function v10(e207, t11) {
    let n11 = performance.getEntriesByName(e207)[0].duration;
    t11.total += n11, t11.min = Math.min(t11.min, n11), t11.max = Math.max(t11.max, n11);
  }
  function y10() {
    performance.clearMarks(`keydown/start`), performance.clearMarks(`keydown/end`), performance.clearMarks(`input/start`), performance.clearMarks(`input/end`), performance.clearMarks(`render/start`), performance.clearMarks(`render/end`), performance.clearMarks(`inputlatency/start`), performance.clearMarks(`inputlatency/end`), performance.clearMeasures(`keydown`), performance.clearMeasures(`input`), performance.clearMeasures(`render`), performance.clearMeasures(`inputlatency`), o10.keydown = 0, o10.input = 0, o10.render = 0;
  }
  function b10() {
    if (a10 === 0) return;
    let e207 = { keydown: x10(t10), input: x10(n10), render: x10(r10), total: x10(i10), sampleCount: a10 };
    return S10(t10), S10(n10), S10(r10), S10(i10), a10 = 0, e207;
  }
  e206.getAndClearMeasurements = b10;
  function x10(e207) {
    return { average: e207.total / a10, max: e207.max, min: e207.min };
  }
  function S10(e207) {
    e207.total = 0, e207.min = Number.MAX_VALUE, e207.max = 0;
  }
})(f_ || (f_ = {}));
var p_ = /* @__PURE__ */ new Map();
function m_() {
  return new h_();
}
var h_ = class {
  constructor() {
    this._currentCssStyle = ``, this._styleSheet = void 0;
  }
  setStyle(e206) {
    e206 !== this._currentCssStyle && (this._currentCssStyle = e206, this._styleSheet ? this._styleSheet.textContent = e206 : this._styleSheet = g_(Aa.document.head, (t10) => t10.textContent = e206));
  }
  dispose() {
    this._styleSheet && (this._styleSheet = (this._styleSheet.remove(), void 0));
  }
};
function g_(e206 = Aa.document.head, t10, n10) {
  let r10 = document.createElement(`style`);
  if (r10.type = `text/css`, r10.media = `screen`, t10?.(r10), e206.appendChild(r10), n10 && n10.add(T(() => r10.remove())), e206 === Aa.document.head) {
    let e207 = /* @__PURE__ */ new Set();
    p_.set(r10, e207), n10 && n10.add(T(() => p_.delete(r10)));
    for (let { window: t11, disposables: i10 } of Uc()) {
      if (t11 === Aa) continue;
      let a10 = i10.add(__(r10, e207, t11));
      n10?.add(a10);
    }
  }
  return r10;
}
function __(e206, t10, n10) {
  let r10 = new E(), i10 = e206.cloneNode(true);
  n10.document.head.appendChild(i10), r10.add(T(() => i10.remove()));
  for (let t11 of b_(e206)) i10.sheet?.insertRule(t11.cssText, i10.sheet?.cssRules.length);
  return r10.add(Pl.observe(e206, r10, { childList: true, subtree: Mo, characterData: Mo })(() => {
    i10.textContent = e206.textContent;
  })), t10.add(i10), r10.add(T(() => t10.delete(i10))), r10;
}
var v_ = null;
function y_() {
  return v_ || (v_ = g_()), v_;
}
function b_(e206) {
  return e206?.sheet?.rules ? e206.sheet.rules : e206?.sheet?.cssRules ? e206.sheet.cssRules : [];
}
function x_(e206, t10, n10 = y_()) {
  if (!(!n10 || !t10)) {
    n10.sheet?.insertRule(`${e206} {${t10}}`, 0);
    for (let r10 of p_.get(n10) ?? []) x_(e206, t10, r10);
  }
}
function S_(e206, t10 = y_()) {
  if (!t10) return;
  let n10 = b_(t10), r10 = [];
  for (let t11 = 0; t11 < n10.length; t11++) {
    let i10 = n10[t11];
    C_(i10) && i10.selectorText.indexOf(e206) !== -1 && r10.push(t11);
  }
  for (let e207 = r10.length - 1; e207 >= 0; e207--) t10.sheet?.deleteRule(r10[e207]);
  for (let n11 of p_.get(t10) ?? []) S_(e206, n11);
}
function C_(e206) {
  return typeof e206.selectorText == `string`;
}
function w_(e206) {
  let t10 = new E(), n10 = t10.add(m_());
  return t10.add(hc((t11) => {
    n10.setStyle(e206.read(t11));
  })), t10;
}
var T_ = class {
  constructor() {
    this._hooks = new E(), this._pointerMoveCallback = null, this._onStopCallback = null;
  }
  dispose() {
    this.stopMonitoring(false), this._hooks.dispose();
  }
  stopMonitoring(e206, t10) {
    if (!this.isMonitoring()) return;
    this._hooks.clear(), this._pointerMoveCallback = null;
    let n10 = this._onStopCallback;
    this._onStopCallback = null, e206 && n10 && n10(t10);
  }
  isMonitoring() {
    return !!this._pointerMoveCallback;
  }
  startMonitoring(e206, t10, n10, r10, i10) {
    this.isMonitoring() && this.stopMonitoring(false), this._pointerMoveCallback = r10, this._onStopCallback = i10;
    let a10 = e206;
    try {
      e206.setPointerCapture(t10), this._hooks.add(T(() => {
        try {
          e206.releasePointerCapture(t10);
        } catch {
        }
      }));
    } catch {
      a10 = Vc(e206);
    }
    this._hooks.add(L(a10, R.POINTER_MOVE, (e207) => {
      if (e207.buttons !== n10) {
        this.stopMonitoring(true);
        return;
      }
      e207.preventDefault(), this._pointerMoveCallback(e207);
    })), this._hooks.add(L(a10, R.POINTER_UP, (e207) => this.stopMonitoring(true)));
  }
};
function E_(e206) {
  return `--vscode-${e206.replace(/\./g, `-`)}`;
}
function Z(e206) {
  return `var(${E_(e206)})`;
}
function D_(e206, t10) {
  return `var(${E_(e206)}, ${t10})`;
}
function O_(e206) {
  return typeof e206 == `object` && !!e206 && `light` in e206 && `dark` in e206;
}
var k_ = { ColorContribution: `base.contributions.colors` }, A_ = `default`, j_ = new class extends D {
  constructor() {
    super(), this._onDidChangeSchema = this._register(new k()), this.onDidChangeSchema = this._onDidChangeSchema.event, this.colorSchema = { type: `object`, properties: {} }, this.colorReferenceSchema = { type: `string`, enum: [], enumDescriptions: [] }, this.colorsById = {};
  }
  registerColor(e206, t10, n10, r10 = false, i10) {
    let a10 = { id: e206, description: n10, defaults: t10, needsTransparency: r10, deprecationMessage: i10 };
    this.colorsById[e206] = a10;
    let o10 = { type: `string`, format: `color-hex`, defaultSnippets: [{ body: "${1:#ff0000}" }] };
    return i10 && (o10.deprecationMessage = i10), r10 && (o10.pattern = `^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$`, o10.patternErrorMessage = C(2022, `This color must be transparent or it will obscure content`)), this.colorSchema.properties[e206] = { description: n10, oneOf: [o10, { type: `string`, const: A_, description: C(2023, `Use the default color.`) }] }, this.colorReferenceSchema.enum.push(e206), this.colorReferenceSchema.enumDescriptions.push(n10), this._onDidChangeSchema.fire(), e206;
  }
  getColors() {
    return Object.keys(this.colorsById).map((e206) => this.colorsById[e206]);
  }
  resolveDefaultColor(e206, t10) {
    let n10 = this.colorsById[e206];
    if (n10?.defaults) return z_(O_(n10.defaults) ? n10.defaults[t10.type] : n10.defaults, t10);
  }
  getColorSchema() {
    return this.colorSchema;
  }
  toString() {
    return Object.keys(this.colorsById).sort((e206, t10) => {
      let n10 = e206.indexOf(`.`) === -1 ? 0 : 1, r10 = t10.indexOf(`.`) === -1 ? 0 : 1;
      return n10 === r10 ? e206.localeCompare(t10) : n10 - r10;
    }).map((e206) => `- \`${e206}\`: ${this.colorsById[e206].description}`).join(`
`);
  }
}();
cd.add(k_.ColorContribution, j_);
function Q(e206, t10, n10, r10, i10) {
  return j_.registerColor(e206, t10, n10, r10, i10);
}
function M_(e206, t10) {
  switch (e206.op) {
    case 0:
      return z_(e206.value, t10)?.darken(e206.factor);
    case 1:
      return z_(e206.value, t10)?.lighten(e206.factor);
    case 2:
      return z_(e206.value, t10)?.transparent(e206.factor);
    case 7: {
      let n10 = z_(e206.color, t10) || Y.transparent, r10 = z_(e206.with, t10) || Y.transparent;
      return n10.mix(r10, e206.ratio);
    }
    case 3: {
      let n10 = z_(e206.background, t10);
      return n10 ? z_(e206.value, t10)?.makeOpaque(n10) : z_(e206.value, t10);
    }
    case 4:
      for (let n10 of e206.values) {
        let e207 = z_(n10, t10);
        if (e207) return e207;
      }
      return;
    case 6:
      return z_(t10.defines(e206.if) ? e206.then : e206.else, t10);
    case 5: {
      let n10 = z_(e206.value, t10);
      if (!n10) return;
      let r10 = z_(e206.background, t10);
      return r10 ? n10.isDarkerThan(r10) ? Y.getLighterColor(n10, r10, e206.factor).transparent(e206.transparency) : Y.getDarkerColor(n10, r10, e206.factor).transparent(e206.transparency) : n10.transparent(e206.factor * e206.transparency);
    }
    default:
      throw Ne();
  }
}
function N_(e206, t10) {
  return { op: 0, value: e206, factor: t10 };
}
function P_(e206, t10) {
  return { op: 1, value: e206, factor: t10 };
}
function F_(e206, t10) {
  return { op: 2, value: e206, factor: t10 };
}
function I_(...e206) {
  return { op: 4, values: e206 };
}
function L_(e206, t10, n10) {
  return { op: 6, if: e206, then: t10, else: n10 };
}
function R_(e206, t10, n10, r10) {
  return { op: 5, value: e206, background: t10, factor: n10, transparency: r10 };
}
function z_(e206, t10) {
  if (e206 !== null) {
    if (typeof e206 == `string`) return e206[0] === `#` ? Y.fromHex(e206) : t10.getColor(e206);
    if (e206 instanceof Y) return e206;
    if (typeof e206 == `object`) return M_(e206, t10);
  }
}
var B_ = `vscode://schemas/workbench-colors`, V_ = cd.as(ep.JSONContribution);
V_.registerSchema(B_, j_.getColorSchema());
var H_ = new us(() => V_.notifySchemaChanged(B_), 200);
j_.onDidChangeSchema(() => {
  H_.isScheduled() || H_.schedule();
});
var U_ = Q(`foreground`, { dark: `#CCCCCC`, light: `#616161`, hcDark: `#FFFFFF`, hcLight: `#292929` }, C(1773, `Overall foreground color. This color is only used if not overridden by a component.`));
Q(`disabledForeground`, { dark: `#CCCCCC80`, light: `#61616180`, hcDark: `#A5A5A5`, hcLight: `#7F7F7F` }, C(1774, `Overall foreground for disabled elements. This color is only used if not overridden by a component.`)), Q(`errorForeground`, { dark: `#F48771`, light: `#A1260D`, hcDark: `#F48771`, hcLight: `#B5200D` }, C(1775, `Overall foreground color for error messages. This color is only used if not overridden by a component.`));
var W_ = Q(`descriptionForeground`, { light: `#717171`, dark: F_(U_, 0.7), hcDark: F_(U_, 0.7), hcLight: F_(U_, 0.7) }, C(1776, `Foreground color for description text providing additional information, for example for a label.`)), G_ = Q(`icon.foreground`, { dark: `#C5C5C5`, light: `#424242`, hcDark: `#FFFFFF`, hcLight: `#292929` }, C(1777, `The default color for icons in the workbench.`)), K_ = Q(`focusBorder`, { dark: `#007FD4`, light: `#0090F1`, hcDark: `#F38518`, hcLight: `#006BBD` }, C(1778, `Overall border color for focused elements. This color is only used if not overridden by a component.`)), q_ = Q(`contrastBorder`, { light: null, dark: null, hcDark: `#6FC3DF`, hcLight: `#0F4A85` }, C(1779, `An extra border around elements to separate them from others for greater contrast.`)), J_ = Q(`contrastActiveBorder`, { light: null, dark: null, hcDark: K_, hcLight: K_ }, C(1780, `An extra border around active elements to separate them from others for greater contrast.`));
Q(`selection.background`, null, C(1781, `The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.`));
var Y_ = Q(`textLink.foreground`, { light: `#006AB1`, dark: `#3794FF`, hcDark: `#21A6FF`, hcLight: `#0F4A85` }, C(1782, `Foreground color for links in text.`));
Q(`textLink.activeForeground`, { light: `#006AB1`, dark: `#3794FF`, hcDark: `#21A6FF`, hcLight: `#0F4A85` }, C(1783, `Foreground color for links in text when clicked on and on mouse hover.`)), Q(`textSeparator.foreground`, { light: `#0000002e`, dark: `#ffffff2e`, hcDark: Y.black, hcLight: `#292929` }, C(1784, `Color for text separators.`)), Q(`textPreformat.foreground`, { light: `#A31515`, dark: `#D7BA7D`, hcDark: `#000000`, hcLight: `#FFFFFF` }, C(1785, `Foreground color for preformatted text segments.`)), Q(`textPreformat.background`, { light: `#0000001A`, dark: `#FFFFFF1A`, hcDark: `#FFFFFF`, hcLight: `#09345f` }, C(1786, `Background color for preformatted text segments.`)), Q(`textBlockQuote.background`, { light: `#f2f2f2`, dark: `#222222`, hcDark: null, hcLight: `#F2F2F2` }, C(1787, `Background color for block quotes in text.`)), Q(`textBlockQuote.border`, { light: `#007acc80`, dark: `#007acc80`, hcDark: Y.white, hcLight: `#292929` }, C(1788, `Border color for block quotes in text.`)), Q(`textCodeBlock.background`, { light: `#dcdcdc66`, dark: `#0a0a0a66`, hcDark: Y.black, hcLight: `#F2F2F2` }, C(1789, `Background color for code blocks in text.`)), Q(`sash.hoverBorder`, K_, C(1994, `Border color of active sashes.`));
var X_ = Q(`badge.background`, { dark: `#4D4D4D`, light: `#C4C4C4`, hcDark: Y.black, hcLight: `#0F4A85` }, C(1995, `Badge background color. Badges are small information labels, e.g. for search results count.`)), Z_ = Q(`badge.foreground`, { dark: Y.white, light: `#333`, hcDark: Y.white, hcLight: Y.white }, C(1996, `Badge foreground color. Badges are small information labels, e.g. for search results count.`));
Q(`activityWarningBadge.foreground`, { dark: Y.black.lighten(0.2), light: Y.white, hcDark: null, hcLight: Y.black.lighten(0.2) }, C(1997, `Foreground color of the warning activity badge`)), Q(`activityWarningBadge.background`, { dark: `#CCA700`, light: `#BF8803`, hcDark: null, hcLight: `#CCA700` }, C(1998, `Background color of the warning activity badge`)), Q(`activityErrorBadge.foreground`, { dark: Y.black.lighten(0.2), light: Y.white, hcDark: null, hcLight: Y.black.lighten(0.2) }, C(1999, `Foreground color of the error activity badge`)), Q(`activityErrorBadge.background`, { dark: `#F14C4C`, light: `#E51400`, hcDark: null, hcLight: `#F14C4C` }, C(2e3, `Background color of the error activity badge`));
var Q_ = Q(`scrollbar.shadow`, { dark: `#000000`, light: `#DDDDDD`, hcDark: null, hcLight: null }, C(2001, `Scrollbar shadow to indicate that the view is scrolled.`)), $_ = Q(`scrollbarSlider.background`, { dark: Y.fromHex(`#797979`).transparent(0.4), light: Y.fromHex(`#646464`).transparent(0.4), hcDark: F_(q_, 0.6), hcLight: F_(q_, 0.4) }, C(2002, `Scrollbar slider background color.`)), ev = Q(`scrollbarSlider.hoverBackground`, { dark: Y.fromHex(`#646464`).transparent(0.7), light: Y.fromHex(`#646464`).transparent(0.7), hcDark: F_(q_, 0.8), hcLight: F_(q_, 0.8) }, C(2003, `Scrollbar slider background color when hovering.`)), tv = Q(`scrollbarSlider.activeBackground`, { dark: Y.fromHex(`#BFBFBF`).transparent(0.4), light: Y.fromHex(`#000000`).transparent(0.6), hcDark: q_, hcLight: q_ }, C(2004, `Scrollbar slider background color when clicked on.`));
Q(`scrollbar.background`, null, C(2005, `Scrollbar track background color.`));
var nv = Q(`progressBar.background`, { dark: Y.fromHex(`#0E70C0`), light: Y.fromHex(`#0E70C0`), hcDark: q_, hcLight: q_ }, C(2006, `Background color of the progress bar that can show for long running operations.`));
Q(`chart.line`, { dark: `#236B8E`, light: `#236B8E`, hcDark: `#236B8E`, hcLight: `#236B8E` }, C(2007, `Line color for the chart.`)), Q(`chart.axis`, { dark: Y.fromHex(`#BFBFBF`).transparent(0.4), light: Y.fromHex(`#000000`).transparent(0.6), hcDark: q_, hcLight: q_ }, C(2008, `Axis color for the chart.`)), Q(`chart.guide`, { dark: Y.fromHex(`#BFBFBF`).transparent(0.2), light: Y.fromHex(`#000000`).transparent(0.2), hcDark: q_, hcLight: q_ }, C(2009, `Guide line for the chart.`));
var rv = Q(`editor.background`, { light: `#ffffff`, dark: `#1E1E1E`, hcDark: Y.black, hcLight: Y.white }, C(1798, `Editor background color.`)), iv = Q(`editor.foreground`, { light: `#333333`, dark: `#BBBBBB`, hcDark: Y.white, hcLight: U_ }, C(1799, `Editor default foreground color.`));
Q(`editorStickyScroll.background`, rv, C(1800, `Background color of sticky scroll in the editor`)), Q(`editorStickyScrollGutter.background`, rv, C(1801, `Background color of the gutter part of sticky scroll in the editor`)), Q(`editorStickyScrollHover.background`, { dark: `#2A2D2E`, light: `#F0F0F0`, hcDark: null, hcLight: Y.fromHex(`#0F4A85`).transparent(0.1) }, C(1802, `Background color of sticky scroll on hover in the editor`)), Q(`editorStickyScroll.border`, { dark: null, light: null, hcDark: q_, hcLight: q_ }, C(1803, `Border color of sticky scroll in the editor`)), Q(`editorStickyScroll.shadow`, Q_, C(1804, ` Shadow color of sticky scroll in the editor`));
var av = Q(`editorWidget.background`, { dark: `#252526`, light: `#F3F3F3`, hcDark: `#0C141F`, hcLight: Y.white }, C(1805, `Background color of editor widgets, such as find/replace.`)), ov = Q(`editorWidget.foreground`, U_, C(1806, `Foreground color of editor widgets, such as find/replace.`)), sv = Q(`editorWidget.border`, { dark: `#454545`, light: `#C8C8C8`, hcDark: q_, hcLight: q_ }, C(1807, `Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.`));
Q(`editorWidget.resizeBorder`, null, C(1808, `Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.`)), Q(`editorError.background`, null, C(1809, `Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations.`), true);
var cv = Q(`editorError.foreground`, { dark: `#F14C4C`, light: `#E51400`, hcDark: `#F48771`, hcLight: `#B5200D` }, C(1810, `Foreground color of error squigglies in the editor.`)), lv = Q(`editorError.border`, { dark: null, light: null, hcDark: Y.fromHex(`#E47777`).transparent(0.8), hcLight: `#B5200D` }, C(1811, `If set, color of double underlines for errors in the editor.`)), uv = Q(`editorWarning.background`, null, C(1812, `Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations.`), true), dv = Q(`editorWarning.foreground`, { dark: `#CCA700`, light: `#BF8803`, hcDark: `#FFD370`, hcLight: `#895503` }, C(1813, `Foreground color of warning squigglies in the editor.`)), fv = Q(`editorWarning.border`, { dark: null, light: null, hcDark: Y.fromHex(`#FFCC00`).transparent(0.8), hcLight: Y.fromHex(`#FFCC00`).transparent(0.8) }, C(1814, `If set, color of double underlines for warnings in the editor.`));
Q(`editorInfo.background`, null, C(1815, `Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations.`), true);
var pv = Q(`editorInfo.foreground`, { dark: `#3794FF`, light: `#1a85ff`, hcDark: `#3794FF`, hcLight: `#1a85ff` }, C(1816, `Foreground color of info squigglies in the editor.`)), mv = Q(`editorInfo.border`, { dark: null, light: null, hcDark: Y.fromHex(`#3794FF`).transparent(0.8), hcLight: `#292929` }, C(1817, `If set, color of double underlines for infos in the editor.`)), hv = Q(`editorHint.foreground`, { dark: Y.fromHex(`#eeeeee`).transparent(0.7), light: `#6c6c6c`, hcDark: null, hcLight: null }, C(1818, `Foreground color of hint squigglies in the editor.`));
Q(`editorHint.border`, { dark: null, light: null, hcDark: Y.fromHex(`#eeeeee`).transparent(0.8), hcLight: `#292929` }, C(1819, `If set, color of double underlines for hints in the editor.`));
var gv = Q(`editorLink.activeForeground`, { dark: `#4E94CE`, light: Y.blue, hcDark: Y.cyan, hcLight: `#292929` }, C(1820, `Color of active links.`)), _v2 = Q(`editor.selectionBackground`, { light: `#ADD6FF`, dark: `#264F78`, hcDark: `#f3f518`, hcLight: `#0F4A85` }, C(1821, `Color of the editor selection.`)), vv = Q(`editor.selectionForeground`, { light: null, dark: null, hcDark: `#000000`, hcLight: Y.white }, C(1822, `Color of the selected text for high contrast.`)), yv = Q(`editor.inactiveSelectionBackground`, { light: F_(_v2, 0.5), dark: F_(_v2, 0.5), hcDark: F_(_v2, 0.7), hcLight: F_(_v2, 0.5) }, C(1823, `Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations.`), true), bv = Q(`editor.selectionHighlightBackground`, { light: R_(_v2, rv, 0.3, 0.6), dark: R_(_v2, rv, 0.3, 0.6), hcDark: null, hcLight: null }, C(1824, `Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`editor.selectionHighlightBorder`, { light: null, dark: null, hcDark: J_, hcLight: J_ }, C(1825, `Border color for regions with the same content as the selection.`)), Q(`editor.compositionBorder`, { light: `#000000`, dark: `#ffffff`, hcLight: `#000000`, hcDark: `#ffffff` }, C(1826, `The border color for an IME composition.`)), Q(`editor.findMatchBackground`, { light: `#A8AC94`, dark: `#515C6A`, hcDark: null, hcLight: null }, C(1827, `Color of the current search match.`));
var xv = Q(`editor.findMatchForeground`, null, C(1828, `Text color of the current search match.`)), Sv = Q(`editor.findMatchHighlightBackground`, { light: `#EA5C0055`, dark: `#EA5C0055`, hcDark: null, hcLight: null }, C(1829, `Color of the other search matches. The color must not be opaque so as not to hide underlying decorations.`), true), Cv = Q(`editor.findMatchHighlightForeground`, null, C(1830, `Foreground color of the other search matches.`), true);
Q(`editor.findRangeHighlightBackground`, { dark: `#3a3d4166`, light: `#b4b4b44d`, hcDark: null, hcLight: null }, C(1831, `Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.`), true), Q(`editor.findMatchBorder`, { light: null, dark: null, hcDark: J_, hcLight: J_ }, C(1832, `Border color of the current search match.`));
var wv = Q(`editor.findMatchHighlightBorder`, { light: null, dark: null, hcDark: J_, hcLight: J_ }, C(1833, `Border color of the other search matches.`)), Tv = Q(`editor.findRangeHighlightBorder`, { dark: null, light: null, hcDark: F_(J_, 0.4), hcLight: F_(J_, 0.4) }, C(1834, `Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`editor.hoverHighlightBackground`, { light: `#ADD6FF26`, dark: `#264f7840`, hcDark: `#ADD6FF26`, hcLight: null }, C(1835, `Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.`), true);
var Ev = Q(`editorHoverWidget.background`, av, C(1836, `Background color of the editor hover.`)), Dv = Q(`editorHoverWidget.foreground`, ov, C(1837, `Foreground color of the editor hover.`)), Ov = Q(`editorHoverWidget.border`, sv, C(1838, `Border color of the editor hover.`));
Q(`editorHoverWidget.statusBarBackground`, { dark: P_(Ev, 0.2), light: N_(Ev, 0.05), hcDark: av, hcLight: av }, C(1839, `Background color of the editor hover status bar.`));
var kv = Q(`editorInlayHint.foreground`, { dark: `#969696`, light: `#969696`, hcDark: Y.white, hcLight: Y.black }, C(1840, `Foreground color of inline hints`)), Av = Q(`editorInlayHint.background`, { dark: F_(X_, 0.1), light: F_(X_, 0.1), hcDark: F_(Y.white, 0.1), hcLight: F_(X_, 0.1) }, C(1841, `Background color of inline hints`)), jv = Q(`editorInlayHint.typeForeground`, kv, C(1842, `Foreground color of inline hints for types`)), Mv = Q(`editorInlayHint.typeBackground`, Av, C(1843, `Background color of inline hints for types`)), Nv = Q(`editorInlayHint.parameterForeground`, kv, C(1844, `Foreground color of inline hints for parameters`)), Pv = Q(`editorInlayHint.parameterBackground`, Av, C(1845, `Background color of inline hints for parameters`)), Fv = Q(`editorLightBulb.foreground`, { dark: `#FFCC00`, light: `#DDB100`, hcDark: `#FFCC00`, hcLight: `#007ACC` }, C(1846, `The color used for the lightbulb actions icon.`));
Q(`editorLightBulbAutoFix.foreground`, { dark: `#75BEFF`, light: `#007ACC`, hcDark: `#75BEFF`, hcLight: `#007ACC` }, C(1847, `The color used for the lightbulb auto fix actions icon.`)), Q(`editorLightBulbAi.foreground`, Fv, C(1848, `The color used for the lightbulb AI icon.`)), Q(`editor.snippetTabstopHighlightBackground`, { dark: new Y(new J(124, 124, 124, 0.3)), light: new Y(new J(10, 50, 100, 0.2)), hcDark: new Y(new J(124, 124, 124, 0.3)), hcLight: new Y(new J(10, 50, 100, 0.2)) }, C(1849, `Highlight background color of a snippet tabstop.`)), Q(`editor.snippetTabstopHighlightBorder`, null, C(1850, `Highlight border color of a snippet tabstop.`)), Q(`editor.snippetFinalTabstopHighlightBackground`, null, C(1851, `Highlight background color of the final tabstop of a snippet.`)), Q(`editor.snippetFinalTabstopHighlightBorder`, { dark: `#525252`, light: new Y(new J(10, 50, 100, 0.5)), hcDark: `#525252`, hcLight: `#292929` }, C(1852, `Highlight border color of the final tabstop of a snippet.`));
var Iv = new Y(new J(155, 185, 85, 0.2)), Lv = new Y(new J(255, 0, 0, 0.2)), Rv = Q(`diffEditor.insertedTextBackground`, { dark: `#9ccc2c33`, light: `#9ccc2c40`, hcDark: null, hcLight: null }, C(1853, `Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.`), true), zv = Q(`diffEditor.removedTextBackground`, { dark: `#ff000033`, light: `#ff000033`, hcDark: null, hcLight: null }, C(1854, `Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.`), true), Bv = Q(`diffEditor.insertedLineBackground`, { dark: Iv, light: Iv, hcDark: null, hcLight: null }, C(1855, `Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`diffEditor.removedLineBackground`, { dark: Lv, light: Lv, hcDark: null, hcLight: null }, C(1856, `Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations.`), true), Q(`diffEditorGutter.insertedLineBackground`, null, C(1857, `Background color for the margin where lines got inserted.`)), Q(`diffEditorGutter.removedLineBackground`, null, C(1858, `Background color for the margin where lines got removed.`));
var Vv = Q(`diffEditorOverview.insertedForeground`, null, C(1859, `Diff overview ruler foreground for inserted content.`)), Hv = Q(`diffEditorOverview.removedForeground`, null, C(1860, `Diff overview ruler foreground for removed content.`));
Q(`diffEditor.insertedTextBorder`, { dark: null, light: null, hcDark: `#33ff2eff`, hcLight: `#374E06` }, C(1861, `Outline color for the text that got inserted.`)), Q(`diffEditor.removedTextBorder`, { dark: null, light: null, hcDark: `#FF008F`, hcLight: `#AD0707` }, C(1862, `Outline color for text that got removed.`)), Q(`diffEditor.border`, { dark: null, light: null, hcDark: q_, hcLight: q_ }, C(1863, `Border color between the two text editors.`)), Q(`diffEditor.diagonalFill`, { dark: `#cccccc33`, light: `#22222233`, hcDark: null, hcLight: null }, C(1864, `Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.`)), Q(`diffEditor.unchangedRegionBackground`, `sideBar.background`, C(1865, `The background color of unchanged blocks in the diff editor.`)), Q(`diffEditor.unchangedRegionForeground`, `foreground`, C(1866, `The foreground color of unchanged blocks in the diff editor.`)), Q(`diffEditor.unchangedCodeBackground`, { dark: `#74747429`, light: `#b8b8b829`, hcDark: null, hcLight: null }, C(1867, `The background color of unchanged code in the diff editor.`));
var Uv = Q(`widget.shadow`, { dark: F_(Y.black, 0.36), light: F_(Y.black, 0.16), hcDark: null, hcLight: null }, C(1868, `Shadow color of widgets such as find/replace inside the editor.`)), Wv = Q(`widget.border`, { dark: null, light: null, hcDark: q_, hcLight: q_ }, C(1869, `Border color of widgets such as find/replace inside the editor.`)), Gv = Q(`toolbar.hoverBackground`, { dark: `#5a5d5e50`, light: `#b8b8b850`, hcDark: null, hcLight: null }, C(1870, `Toolbar background when hovering over actions using the mouse`));
Q(`toolbar.hoverOutline`, { dark: null, light: null, hcDark: J_, hcLight: J_ }, C(1871, `Toolbar outline when hovering over actions using the mouse`)), Q(`toolbar.activeBackground`, { dark: P_(Gv, 0.1), light: N_(Gv, 0.1), hcDark: null, hcLight: null }, C(1872, `Toolbar background when holding the mouse over actions`));
var Kv = Q(`breadcrumb.foreground`, F_(U_, 0.8), C(1873, `Color of focused breadcrumb items.`)), qv = Q(`breadcrumb.background`, rv, C(1874, `Background color of breadcrumb items.`)), Jv = Q(`breadcrumb.focusForeground`, { light: N_(U_, 0.2), dark: P_(U_, 0.1), hcDark: P_(U_, 0.1), hcLight: P_(U_, 0.1) }, C(1875, `Color of focused breadcrumb items.`)), Yv = Q(`breadcrumb.activeSelectionForeground`, { light: N_(U_, 0.2), dark: P_(U_, 0.1), hcDark: P_(U_, 0.1), hcLight: P_(U_, 0.1) }, C(1876, `Color of selected breadcrumb items.`));
Q(`breadcrumbPicker.background`, av, C(1877, `Background color of breadcrumb item picker.`));
var Xv = 0.5, Zv = Y.fromHex(`#40C8AE`).transparent(Xv), Qv = Y.fromHex(`#40A6FF`).transparent(Xv), $v = Y.fromHex(`#606060`).transparent(0.4), ey = 0.4, ty = 1, ny = Q(`merge.currentHeaderBackground`, { dark: Zv, light: Zv, hcDark: null, hcLight: null }, C(1878, `Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`merge.currentContentBackground`, F_(ny, ey), C(1879, `Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`), true);
var ry = Q(`merge.incomingHeaderBackground`, { dark: Qv, light: Qv, hcDark: null, hcLight: null }, C(1880, `Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`merge.incomingContentBackground`, F_(ry, ey), C(1881, `Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`), true);
var iy = Q(`merge.commonHeaderBackground`, { dark: $v, light: $v, hcDark: null, hcLight: null }, C(1882, `Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`merge.commonContentBackground`, F_(iy, ey), C(1883, `Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`), true);
var ay = Q(`merge.border`, { dark: null, light: null, hcDark: `#C3DF6F`, hcLight: `#007ACC` }, C(1884, `Border color on headers and the splitter in inline merge-conflicts.`));
Q(`editorOverviewRuler.currentContentForeground`, { dark: F_(ny, ty), light: F_(ny, ty), hcDark: ay, hcLight: ay }, C(1885, `Current overview ruler foreground for inline merge-conflicts.`)), Q(`editorOverviewRuler.incomingContentForeground`, { dark: F_(ry, ty), light: F_(ry, ty), hcDark: ay, hcLight: ay }, C(1886, `Incoming overview ruler foreground for inline merge-conflicts.`)), Q(`editorOverviewRuler.commonContentForeground`, { dark: F_(iy, ty), light: F_(iy, ty), hcDark: ay, hcLight: ay }, C(1887, `Common ancestor overview ruler foreground for inline merge-conflicts.`));
var oy = Q(`editorOverviewRuler.findMatchForeground`, { dark: `#d186167e`, light: `#d186167e`, hcDark: `#AB5A00`, hcLight: `#AB5A00` }, C(1888, `Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.`), true), sy = Q(`editorOverviewRuler.selectionHighlightForeground`, `#A0A0A0CC`, C(1889, `Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.`), true), cy = Q(`problemsErrorIcon.foreground`, cv, C(1890, `The color used for the problems error icon.`)), ly = Q(`problemsWarningIcon.foreground`, dv, C(1891, `The color used for the problems warning icon.`)), uy = Q(`problemsInfoIcon.foreground`, pv, C(1892, `The color used for the problems info icon.`)), dy = Q(`minimap.findMatchHighlight`, { light: `#d18616`, dark: `#d18616`, hcDark: `#AB5A00`, hcLight: `#0F4A85` }, C(1983, `Minimap marker color for find matches.`), true), fy = Q(`minimap.selectionOccurrenceHighlight`, { light: `#c9c9c9`, dark: `#676767`, hcDark: `#ffffff`, hcLight: `#0F4A85` }, C(1984, `Minimap marker color for repeating editor selections.`), true), py = Q(`minimap.selectionHighlight`, { light: `#ADD6FF`, dark: `#264F78`, hcDark: `#ffffff`, hcLight: `#0F4A85` }, C(1985, `Minimap marker color for the editor selection.`), true), my = Q(`minimap.infoHighlight`, { dark: pv, light: pv, hcDark: mv, hcLight: mv }, C(1986, `Minimap marker color for infos.`)), hy = Q(`minimap.warningHighlight`, { dark: dv, light: dv, hcDark: fv, hcLight: fv }, C(1987, `Minimap marker color for warnings.`)), gy = Q(`minimap.errorHighlight`, { dark: new Y(new J(255, 18, 18, 0.7)), light: new Y(new J(255, 18, 18, 0.7)), hcDark: new Y(new J(255, 50, 50, 1)), hcLight: `#B5200D` }, C(1988, `Minimap marker color for errors.`)), _y = Q(`minimap.background`, null, C(1989, `Minimap background color.`)), vy = Q(`minimap.foregroundOpacity`, Y.fromHex(`#000f`), C(1990, `Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.`));
Q(`minimapSlider.background`, F_($_, 0.5), C(1991, `Minimap slider background color.`)), Q(`minimapSlider.hoverBackground`, F_(ev, 0.5), C(1992, `Minimap slider background color when hovering.`)), Q(`minimapSlider.activeBackground`, F_(tv, 0.5), C(1993, `Minimap slider background color when clicked on.`)), Q(`charts.foreground`, U_, C(1790, `The foreground color used in charts.`)), Q(`charts.lines`, F_(U_, 0.5), C(1791, `The color used for horizontal lines in charts.`)), Q(`charts.red`, cv, C(1792, `The red color used in chart visualizations.`)), Q(`charts.blue`, pv, C(1793, `The blue color used in chart visualizations.`)), Q(`charts.yellow`, dv, C(1794, `The yellow color used in chart visualizations.`)), Q(`charts.orange`, dy, C(1795, `The orange color used in chart visualizations.`)), Q(`charts.green`, { dark: `#89D185`, light: `#388A34`, hcDark: `#89D185`, hcLight: `#374e06` }, C(1796, `The green color used in chart visualizations.`)), Q(`charts.purple`, { dark: `#B180D7`, light: `#652D90`, hcDark: `#B180D7`, hcLight: `#652D90` }, C(1797, `The purple color used in chart visualizations.`));
var yy = Q(`input.background`, { dark: `#3C3C3C`, light: Y.white, hcDark: Y.black, hcLight: Y.white }, C(1893, `Input box background.`)), by = Q(`input.foreground`, U_, C(1894, `Input box foreground.`)), xy = Q(`input.border`, { dark: null, light: null, hcDark: q_, hcLight: q_ }, C(1895, `Input box border.`)), Sy = Q(`inputOption.activeBorder`, { dark: `#007ACC`, light: `#007ACC`, hcDark: q_, hcLight: q_ }, C(1896, `Border color of activated options in input fields.`)), Cy = Q(`inputOption.hoverBackground`, { dark: `#5a5d5e80`, light: `#b8b8b850`, hcDark: null, hcLight: null }, C(1897, `Background color of activated options in input fields.`)), wy = Q(`inputOption.activeBackground`, { dark: F_(K_, 0.4), light: F_(K_, 0.2), hcDark: Y.transparent, hcLight: Y.transparent }, C(1898, `Background hover color of options in input fields.`)), Ty = Q(`inputOption.activeForeground`, { dark: Y.white, light: Y.black, hcDark: U_, hcLight: U_ }, C(1899, `Foreground color of activated options in input fields.`));
Q(`input.placeholderForeground`, { light: F_(U_, 0.5), dark: F_(U_, 0.5), hcDark: F_(U_, 0.7), hcLight: F_(U_, 0.7) }, C(1900, `Input box foreground color for placeholder text.`));
var Ey = Q(`inputValidation.infoBackground`, { dark: `#063B49`, light: `#D6ECF2`, hcDark: Y.black, hcLight: Y.white }, C(1901, `Input validation background color for information severity.`)), Dy = Q(`inputValidation.infoForeground`, { dark: null, light: null, hcDark: null, hcLight: U_ }, C(1902, `Input validation foreground color for information severity.`)), Oy = Q(`inputValidation.infoBorder`, { dark: `#007acc`, light: `#007acc`, hcDark: q_, hcLight: q_ }, C(1903, `Input validation border color for information severity.`)), ky = Q(`inputValidation.warningBackground`, { dark: `#352A05`, light: `#F6F5D2`, hcDark: Y.black, hcLight: Y.white }, C(1904, `Input validation background color for warning severity.`)), Ay = Q(`inputValidation.warningForeground`, { dark: null, light: null, hcDark: null, hcLight: U_ }, C(1905, `Input validation foreground color for warning severity.`)), jy = Q(`inputValidation.warningBorder`, { dark: `#B89500`, light: `#B89500`, hcDark: q_, hcLight: q_ }, C(1906, `Input validation border color for warning severity.`)), My = Q(`inputValidation.errorBackground`, { dark: `#5A1D1D`, light: `#F2DEDE`, hcDark: Y.black, hcLight: Y.white }, C(1907, `Input validation background color for error severity.`)), Ny = Q(`inputValidation.errorForeground`, { dark: null, light: null, hcDark: null, hcLight: U_ }, C(1908, `Input validation foreground color for error severity.`)), Py = Q(`inputValidation.errorBorder`, { dark: `#BE1100`, light: `#BE1100`, hcDark: q_, hcLight: q_ }, C(1909, `Input validation border color for error severity.`)), Fy = Q(`dropdown.background`, { dark: `#3C3C3C`, light: Y.white, hcDark: Y.black, hcLight: Y.white }, C(1910, `Dropdown background.`)), Iy = Q(`dropdown.listBackground`, { dark: null, light: null, hcDark: Y.black, hcLight: Y.white }, C(1911, `Dropdown list background.`)), Ly = Q(`dropdown.foreground`, { dark: `#F0F0F0`, light: U_, hcDark: Y.white, hcLight: U_ }, C(1912, `Dropdown foreground.`)), Ry = Q(`dropdown.border`, { dark: Fy, light: `#CECECE`, hcDark: q_, hcLight: q_ }, C(1913, `Dropdown border.`)), zy = Q(`button.foreground`, Y.white, C(1914, `Button foreground color.`)), By = Q(`button.separator`, F_(zy, 0.4), C(1915, `Button separator color.`)), Vy = Q(`button.background`, { dark: `#0E639C`, light: `#007ACC`, hcDark: Y.black, hcLight: `#0F4A85` }, C(1916, `Button background color.`)), Hy = Q(`button.hoverBackground`, { dark: P_(Vy, 0.2), light: N_(Vy, 0.2), hcDark: Vy, hcLight: Vy }, C(1917, `Button background color when hovering.`)), Uy = Q(`button.border`, q_, C(1918, `Button border color.`)), Wy = Q(`button.secondaryForeground`, { dark: Y.white, light: Y.white, hcDark: Y.white, hcLight: U_ }, C(1919, `Secondary button foreground color.`)), Gy = Q(`button.secondaryBackground`, { dark: `#3A3D41`, light: `#5F6A79`, hcDark: null, hcLight: Y.white }, C(1920, `Secondary button background color.`)), Ky = Q(`button.secondaryHoverBackground`, { dark: P_(Gy, 0.2), light: N_(Gy, 0.2), hcDark: null, hcLight: null }, C(1921, `Secondary button background color when hovering.`)), qy = Q(`radio.activeForeground`, Ty, C(1922, `Foreground color of active radio option.`)), Jy = Q(`radio.activeBackground`, wy, C(1923, `Background color of active radio option.`)), Yy = Q(`radio.activeBorder`, Sy, C(1924, `Border color of the active radio option.`)), Xy = Q(`radio.inactiveForeground`, null, C(1925, `Foreground color of inactive radio option.`)), Zy = Q(`radio.inactiveBackground`, null, C(1926, `Background color of inactive radio option.`)), Qy = Q(`radio.inactiveBorder`, { light: F_(qy, 0.2), dark: F_(qy, 0.2), hcDark: F_(qy, 0.4), hcLight: F_(qy, 0.2) }, C(1927, `Border color of the inactive radio option.`)), $y = Q(`radio.inactiveHoverBackground`, Cy, C(1928, `Background color of inactive active radio option when hovering.`)), eb = Q(`checkbox.background`, Fy, C(1929, `Background color of checkbox widget.`));
Q(`checkbox.selectBackground`, av, C(1930, `Background color of checkbox widget when the element it's in is selected.`));
var tb = Q(`checkbox.foreground`, Ly, C(1931, `Foreground color of checkbox widget.`)), nb = Q(`checkbox.border`, Ry, C(1932, `Border color of checkbox widget.`));
Q(`checkbox.selectBorder`, G_, C(1933, `Border color of checkbox widget when the element it's in is selected.`));
var rb = Q(`checkbox.disabled.background`, { op: 7, color: eb, with: tb, ratio: 0.33 }, C(1934, `Background of a disabled checkbox.`)), ib = Q(`checkbox.disabled.foreground`, { op: 7, color: tb, with: eb, ratio: 0.33 }, C(1935, `Foreground of a disabled checkbox.`)), Iae = Q(`keybindingLabel.background`, { dark: new Y(new J(128, 128, 128, 0.17)), light: new Y(new J(221, 221, 221, 0.4)), hcDark: Y.transparent, hcLight: Y.transparent }, C(1936, `Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.`)), Lae = Q(`keybindingLabel.foreground`, { dark: Y.fromHex(`#CCCCCC`), light: Y.fromHex(`#555555`), hcDark: Y.white, hcLight: U_ }, C(1937, `Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.`)), Rae = Q(`keybindingLabel.border`, { dark: new Y(new J(51, 51, 51, 0.6)), light: new Y(new J(204, 204, 204, 0.4)), hcDark: new Y(new J(111, 195, 223)), hcLight: q_ }, C(1938, `Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.`)), zae = Q(`keybindingLabel.bottomBorder`, { dark: new Y(new J(68, 68, 68, 0.6)), light: new Y(new J(187, 187, 187, 0.4)), hcDark: new Y(new J(111, 195, 223)), hcLight: U_ }, C(1939, `Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.`)), Bae = Q(`list.focusBackground`, null, C(1940, `List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)), Vae = Q(`list.focusForeground`, null, C(1941, `List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)), Hae = Q(`list.focusOutline`, { dark: K_, light: K_, hcDark: J_, hcLight: J_ }, C(1942, `List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)), Uae = Q(`list.focusAndSelectionOutline`, null, C(1943, `List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.`)), ab = Q(`list.activeSelectionBackground`, { dark: `#04395E`, light: `#0060C0`, hcDark: null, hcLight: Y.fromHex(`#0F4A85`).transparent(0.1) }, C(1944, `List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)), ob = Q(`list.activeSelectionForeground`, { dark: Y.white, light: Y.white, hcDark: null, hcLight: null }, C(1945, `List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)), sb = Q(`list.activeSelectionIconForeground`, null, C(1946, `List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)), Wae = Q(`list.inactiveSelectionBackground`, { dark: `#37373D`, light: `#E4E6F1`, hcDark: null, hcLight: Y.fromHex(`#0F4A85`).transparent(0.1) }, C(1947, `List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)), Gae = Q(`list.inactiveSelectionForeground`, null, C(1948, `List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)), Kae = Q(`list.inactiveSelectionIconForeground`, null, C(1949, `List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)), qae = Q(`list.inactiveFocusBackground`, null, C(1950, `List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)), Jae = Q(`list.inactiveFocusOutline`, null, C(1951, `List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)), cb = Q(`list.hoverBackground`, { dark: `#2A2D2E`, light: `#F0F0F0`, hcDark: Y.white.transparent(0.1), hcLight: Y.fromHex(`#0F4A85`).transparent(0.1) }, C(1952, `List/Tree background when hovering over items using the mouse.`)), lb = Q(`list.hoverForeground`, null, C(1953, `List/Tree foreground when hovering over items using the mouse.`)), Yae = Q(`list.dropBackground`, { dark: `#062F4A`, light: `#D6EBFF`, hcDark: null, hcLight: null }, C(1954, `List/Tree drag and drop background when moving items over other items when using the mouse.`)), Xae = Q(`list.dropBetweenBackground`, { dark: G_, light: G_, hcDark: null, hcLight: null }, C(1955, `List/Tree drag and drop border color when moving items between items when using the mouse.`)), ub = Q(`list.highlightForeground`, { dark: `#2AAAFF`, light: `#0066BF`, hcDark: K_, hcLight: K_ }, C(1956, `List/Tree foreground color of the match highlights when searching inside the list/tree.`)), Zae = Q(`list.focusHighlightForeground`, { dark: ub, light: L_(ab, ub, `#BBE7FF`), hcDark: ub, hcLight: ub }, C(1957, `List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.`));
Q(`list.invalidItemForeground`, { dark: `#B89500`, light: `#B89500`, hcDark: `#B89500`, hcLight: `#B5200D` }, C(1958, `List/Tree foreground color for invalid items, for example an unresolved root in explorer.`)), Q(`list.errorForeground`, { dark: `#F88070`, light: `#B01011`, hcDark: null, hcLight: null }, C(1959, `Foreground color of list items containing errors.`)), Q(`list.warningForeground`, { dark: `#CCA700`, light: `#855F00`, hcDark: null, hcLight: null }, C(1960, `Foreground color of list items containing warnings.`));
var Qae = Q(`listFilterWidget.background`, { light: N_(av, 0), dark: P_(av, 0), hcDark: av, hcLight: av }, C(1961, `Background color of the type filter widget in lists and trees.`)), $ae = Q(`listFilterWidget.outline`, { dark: Y.transparent, light: Y.transparent, hcDark: `#f38518`, hcLight: `#007ACC` }, C(1962, `Outline color of the type filter widget in lists and trees.`)), eoe = Q(`listFilterWidget.noMatchesOutline`, { dark: `#BE1100`, light: `#BE1100`, hcDark: q_, hcLight: q_ }, C(1963, `Outline color of the type filter widget in lists and trees, when there are no matches.`)), toe = Q(`listFilterWidget.shadow`, Uv, C(1964, `Shadow color of the type filter widget in lists and trees.`));
Q(`list.filterMatchBackground`, { dark: Sv, light: Sv, hcDark: null, hcLight: null }, C(1965, `Background color of the filtered match.`)), Q(`list.filterMatchBorder`, { dark: wv, light: wv, hcDark: q_, hcLight: J_ }, C(1966, `Border color of the filtered match.`)), Q(`list.deemphasizedForeground`, { dark: `#8C8C8C`, light: `#8E8E90`, hcDark: `#A7A8A9`, hcLight: `#666666` }, C(1967, `List/Tree foreground color for items that are deemphasized.`));
var db = Q(`tree.indentGuidesStroke`, { dark: `#585858`, light: `#a9a9a9`, hcDark: `#a9a9a9`, hcLight: `#a5a5a5` }, C(1968, `Tree stroke color for the indentation guides.`)), noe = Q(`tree.inactiveIndentGuidesStroke`, F_(db, 0.4), C(1969, `Tree stroke color for the indentation guides that are not active.`)), roe = Q(`tree.tableColumnsBorder`, { dark: `#CCCCCC20`, light: `#61616120`, hcDark: null, hcLight: null }, C(1970, `Table border color between columns.`)), ioe = Q(`tree.tableOddRowsBackground`, { dark: F_(U_, 0.04), light: F_(U_, 0.04), hcDark: null, hcLight: null }, C(1971, `Background color for odd table rows.`));
Q(`editorActionList.background`, av, C(1972, `Action List background color.`));
var aoe = Q(`editorActionList.foreground`, ov, C(1973, `Action List foreground color.`));
Q(`editorActionList.focusForeground`, ob, C(1974, `Action List foreground color for the focused item.`)), Q(`editorActionList.focusBackground`, ab, C(1975, `Action List background color for the focused item.`));
var ooe = Q(`menu.border`, { dark: null, light: null, hcDark: q_, hcLight: q_ }, C(1976, `Border color of menus.`)), soe = Q(`menu.foreground`, Ly, C(1977, `Foreground color of menu items.`)), coe = Q(`menu.background`, Fy, C(1978, `Background color of menu items.`)), loe = Q(`menu.selectionForeground`, ob, C(1979, `Foreground color of the selected menu item in menus.`)), uoe = Q(`menu.selectionBackground`, ab, C(1980, `Background color of the selected menu item in menus.`)), doe = Q(`menu.selectionBorder`, { dark: null, light: null, hcDark: J_, hcLight: J_ }, C(1981, `Border color of the selected menu item in menus.`)), foe = Q(`menu.separatorBackground`, { dark: `#606060`, light: `#D4D4D4`, hcDark: q_, hcLight: q_ }, C(1982, `Color of a separator menu item in menus.`)), fb = Q(`quickInput.background`, av, C(2010, `Quick picker background color. The quick picker widget is the container for pickers like the command palette.`)), poe = Q(`quickInput.foreground`, ov, C(2011, `Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.`)), moe = Q(`quickInputTitle.background`, { dark: new Y(new J(255, 255, 255, 0.105)), light: new Y(new J(0, 0, 0, 0.06)), hcDark: `#000000`, hcLight: Y.white }, C(2012, `Quick picker title background color. The quick picker widget is the container for pickers like the command palette.`)), pb = Q(`pickerGroup.foreground`, { dark: `#3794FF`, light: `#0066BF`, hcDark: Y.white, hcLight: `#0F4A85` }, C(2013, `Quick picker color for grouping labels.`)), hoe = Q(`pickerGroup.border`, { dark: `#3F3F46`, light: `#CCCEDB`, hcDark: Y.white, hcLight: `#0F4A85` }, C(2014, `Quick picker color for grouping borders.`)), mb = Q(`quickInput.list.focusBackground`, null, ``, void 0, C(2015, `Please use quickInputList.focusBackground instead`)), hb = Q(`quickInputList.focusForeground`, ob, C(2016, `Quick picker foreground color for the focused item.`)), gb = Q(`quickInputList.focusIconForeground`, sb, C(2017, `Quick picker icon foreground color for the focused item.`)), _b2 = Q(`quickInputList.focusBackground`, { dark: I_(mb, ab), light: I_(mb, ab), hcDark: null, hcLight: null }, C(2018, `Quick picker background color for the focused item.`));
Q(`search.resultsInfoForeground`, { light: U_, dark: F_(U_, 0.65), hcDark: U_, hcLight: U_ }, C(2019, `Color of the text in the search viewlet's completion message.`)), Q(`searchEditor.findMatchBackground`, { light: F_(Sv, 0.66), dark: F_(Sv, 0.66), hcDark: Sv, hcLight: Sv }, C(2020, `Color of the Search Editor query matches.`)), Q(`searchEditor.findMatchBorder`, { light: F_(wv, 0.66), dark: F_(wv, 0.66), hcDark: wv, hcLight: wv }, C(2021, `Border color of the Search Editor query matches.`));
var vb = class {
  constructor(e206, t10) {
    this.x = e206, this.y = t10, this._pageCoordinatesBrand = void 0;
  }
  toClientCoordinates(e206) {
    return new yb(this.x - e206.scrollX, this.y - e206.scrollY);
  }
}, yb = class {
  constructor(e206, t10) {
    this.clientX = e206, this.clientY = t10, this._clientCoordinatesBrand = void 0;
  }
  toPageCoordinates(e206) {
    return new vb(this.clientX + e206.scrollX, this.clientY + e206.scrollY);
  }
}, goe = class {
  constructor(e206, t10, n10, r10) {
    this.x = e206, this.y = t10, this.width = n10, this.height = r10, this._editorPagePositionBrand = void 0;
  }
}, _oe = class {
  constructor(e206, t10) {
    this.x = e206, this.y = t10, this._positionRelativeToEditorBrand = void 0;
  }
};
function bb(e206) {
  let t10 = _l2(e206);
  return new goe(t10.left, t10.top, t10.width, t10.height);
}
function xb(e206, t10, n10) {
  let r10 = t10.width / e206.offsetWidth, i10 = t10.height / e206.offsetHeight;
  return new _oe((n10.x - t10.x) / r10, (n10.y - t10.y) / i10);
}
var Sb = class extends Xo {
  constructor(e206, t10, n10) {
    super(Vc(n10), e206), this._editorMouseEventBrand = void 0, this.isFromPointerCapture = t10, this.pos = new vb(this.posx, this.posy), this.editorPos = bb(n10), this.relativePos = xb(n10, this.editorPos, this.pos);
  }
}, voe = class {
  constructor(e206) {
    this._editorViewDomNode = e206;
  }
  _create(e206) {
    return new Sb(e206, false, this._editorViewDomNode);
  }
  onContextMenu(e206, t10) {
    return L(e206, R.CONTEXT_MENU, (e207) => {
      t10(this._create(e207));
    });
  }
  onMouseUp(e206, t10) {
    return L(e206, R.MOUSE_UP, (e207) => {
      t10(this._create(e207));
    });
  }
  onMouseDown(e206, t10) {
    return L(e206, R.MOUSE_DOWN, (e207) => {
      t10(this._create(e207));
    });
  }
  onPointerDown(e206, t10) {
    return L(e206, R.POINTER_DOWN, (e207) => {
      t10(this._create(e207), e207.pointerId);
    });
  }
  onMouseLeave(e206, t10) {
    return L(e206, R.MOUSE_LEAVE, (e207) => {
      t10(this._create(e207));
    });
  }
  onMouseMove(e206, t10) {
    return L(e206, R.MOUSE_MOVE, (e207) => t10(this._create(e207)));
  }
}, yoe = class {
  constructor(e206) {
    this._editorViewDomNode = e206;
  }
  _create(e206) {
    return new Sb(e206, false, this._editorViewDomNode);
  }
  onPointerUp(e206, t10) {
    return L(e206, `pointerup`, (e207) => {
      t10(this._create(e207));
    });
  }
  onPointerDown(e206, t10) {
    return L(e206, R.POINTER_DOWN, (e207) => {
      t10(this._create(e207), e207.pointerId);
    });
  }
  onPointerLeave(e206, t10) {
    return L(e206, R.POINTER_LEAVE, (e207) => {
      t10(this._create(e207));
    });
  }
  onPointerMove(e206, t10) {
    return L(e206, `pointermove`, (e207) => t10(this._create(e207)));
  }
}, boe = class extends D {
  constructor(e206) {
    super(), this._editorViewDomNode = e206, this._globalPointerMoveMonitor = this._register(new T_()), this._keydownListener = null;
  }
  startMonitoring(e206, t10, n10, r10, i10) {
    this._keydownListener = el(e206.ownerDocument, `keydown`, (e207) => {
      e207.toKeyCodeChord().isModifierKey() || this._globalPointerMoveMonitor.stopMonitoring(true, e207.browserEvent);
    }, true), this._globalPointerMoveMonitor.startMonitoring(e206, t10, n10, (e207) => {
      r10(new Sb(e207, true, this._editorViewDomNode));
    }, (e207) => {
      this._keydownListener.dispose(), i10(e207);
    });
  }
  stopMonitoring() {
    this._globalPointerMoveMonitor.stopMonitoring(true);
  }
}, Cb = (_Z = class {
  constructor(t10) {
    this._editor = t10, this._instanceId = ++_Z._idPool, this._counter = 0, this._rules = new Xt(), this._garbageCollectionScheduler = new us(() => this.garbageCollect(), 1e3);
  }
  dispose() {
    this._rules.dispose(), this._garbageCollectionScheduler.dispose();
  }
  createClassNameRef(e206) {
    let t10 = this.getOrCreateRule(e206);
    return t10.increaseRefCount(), { className: t10.className, dispose: () => {
      t10.decreaseRefCount(), this._garbageCollectionScheduler.schedule();
    } };
  }
  getOrCreateRule(e206) {
    let t10 = this.computeUniqueKey(e206), n10 = this._rules.get(t10);
    if (!n10) {
      let r10 = this._counter++;
      n10 = new xoe(t10, `dyn-rule-${this._instanceId}-${r10}`, Dl(this._editor.getContainerDomNode()) ? this._editor.getContainerDomNode() : void 0, e206), this._rules.set(t10, n10);
    }
    return n10;
  }
  computeUniqueKey(e206) {
    return JSON.stringify(e206);
  }
  garbageCollect() {
    for (let e206 of this._rules.values()) e206.hasReferences() || this._rules.deleteAndDispose(e206.key);
  }
}, _Z._idPool = 0, _Z), xoe = class {
  constructor(e206, t10, n10, r10) {
    this.key = e206, this.className = t10, this.properties = r10, this._referenceCount = 0, this._styleElementDisposables = new E(), this._styleElement = g_(n10, void 0, this._styleElementDisposables), this._styleElement.textContent = this.getCssText(this.className, this.properties);
  }
  getCssText(e206, t10) {
    let n10 = `.${e206} {`;
    for (let e207 in t10) {
      let r10 = t10[e207], i10;
      i10 = typeof r10 == `object` ? Z(r10.id) : r10;
      let a10 = Soe(e207);
      n10 += `
	${a10}: ${i10};`;
    }
    return n10 += `
}`, n10;
  }
  dispose() {
    this._styleElementDisposables.dispose(), this._styleElement = void 0;
  }
  increaseRefCount() {
    this._referenceCount++;
  }
  decreaseRefCount() {
    this._referenceCount--;
  }
  hasReferences() {
    return this._referenceCount > 0;
  }
};
function Soe(e206) {
  return e206.replace(/(^[A-Z])/, ([e207]) => e207.toLowerCase()).replace(/([A-Z])/g, ([e207]) => `-${e207.toLowerCase()}`);
}
var wb = class extends D {
  constructor() {
    super(), this._shouldRender = true;
  }
  shouldRender() {
    return this._shouldRender;
  }
  forceShouldRender() {
    this._shouldRender = true;
  }
  setShouldRender() {
    this._shouldRender = true;
  }
  onDidRender() {
    this._shouldRender = false;
  }
  onCompositionStart(e206) {
    return false;
  }
  onCompositionEnd(e206) {
    return false;
  }
  onConfigurationChanged(e206) {
    return false;
  }
  onCursorStateChanged(e206) {
    return false;
  }
  onDecorationsChanged(e206) {
    return false;
  }
  onFlushed(e206) {
    return false;
  }
  onFocusChanged(e206) {
    return false;
  }
  onLanguageConfigurationChanged(e206) {
    return false;
  }
  onLineMappingChanged(e206) {
    return false;
  }
  onLinesChanged(e206) {
    return false;
  }
  onLinesDeleted(e206) {
    return false;
  }
  onLinesInserted(e206) {
    return false;
  }
  onRevealRangeRequest(e206) {
    return false;
  }
  onScrollChanged(e206) {
    return false;
  }
  onThemeChanged(e206) {
    return false;
  }
  onTokensChanged(e206) {
    return false;
  }
  onTokensColorsChanged(e206) {
    return false;
  }
  onZonesChanged(e206) {
    return false;
  }
  handleEvents(e206) {
    let t10 = false;
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
      let r11 = e206[n10];
      switch (r11.type) {
        case 0:
          this.onCompositionStart(r11) && (t10 = true);
          break;
        case 1:
          this.onCompositionEnd(r11) && (t10 = true);
          break;
        case 2:
          this.onConfigurationChanged(r11) && (t10 = true);
          break;
        case 3:
          this.onCursorStateChanged(r11) && (t10 = true);
          break;
        case 4:
          this.onDecorationsChanged(r11) && (t10 = true);
          break;
        case 5:
          this.onFlushed(r11) && (t10 = true);
          break;
        case 6:
          this.onFocusChanged(r11) && (t10 = true);
          break;
        case 7:
          this.onLanguageConfigurationChanged(r11) && (t10 = true);
          break;
        case 8:
          this.onLineMappingChanged(r11) && (t10 = true);
          break;
        case 9:
          this.onLinesChanged(r11) && (t10 = true);
          break;
        case 10:
          this.onLinesDeleted(r11) && (t10 = true);
          break;
        case 11:
          this.onLinesInserted(r11) && (t10 = true);
          break;
        case 12:
          this.onRevealRangeRequest(r11) && (t10 = true);
          break;
        case 13:
          this.onScrollChanged(r11) && (t10 = true);
          break;
        case 15:
          this.onTokensChanged(r11) && (t10 = true);
          break;
        case 14:
          this.onThemeChanged(r11) && (t10 = true);
          break;
        case 16:
          this.onTokensColorsChanged(r11) && (t10 = true);
          break;
        case 17:
          this.onZonesChanged(r11) && (t10 = true);
          break;
        default:
          console.info(`View received unknown event: `), console.info(r11);
      }
    }
    t10 && (this._shouldRender = true);
  }
}, Tb = class extends wb {
  constructor(e206) {
    super(), this._context = e206, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), super.dispose();
  }
}, Eb = class {
  static write(e206, t10) {
    e206.setAttribute(`data-mprt`, String(t10));
  }
  static read(e206) {
    let t10 = e206.getAttribute(`data-mprt`);
    return t10 === null ? 0 : parseInt(t10, 10);
  }
  static collect(e206, t10) {
    let n10 = [], r10 = 0;
    for (; e206 && e206 !== e206.ownerDocument.body && e206 !== t10; ) e206.nodeType === e206.ELEMENT_NODE && (n10[r10++] = this.read(e206)), e206 = e206.parentElement;
    let i10 = new Uint8Array(r10);
    for (let e207 = 0; e207 < r10; e207++) i10[e207] = n10[r10 - e207 - 1];
    return i10;
  }
}, Coe = class {
  constructor(e206, t10) {
    this._restrictedRenderingContextBrand = void 0, this._viewLayout = e206, this.viewportData = t10, this.scrollWidth = this._viewLayout.getScrollWidth(), this.scrollHeight = this._viewLayout.getScrollHeight(), this.visibleRange = this.viewportData.visibleRange, this.bigNumbersDelta = this.viewportData.bigNumbersDelta;
    let n10 = this._viewLayout.getCurrentViewport();
    this.scrollTop = n10.top, this.scrollLeft = n10.left, this.viewportWidth = n10.width, this.viewportHeight = n10.height;
  }
  getScrolledTopFromAbsoluteTop(e206) {
    return e206 - this.scrollTop;
  }
  getVerticalOffsetForLineNumber(e206, t10) {
    return this._viewLayout.getVerticalOffsetForLineNumber(e206, t10);
  }
  getVerticalOffsetAfterLineNumber(e206, t10) {
    return this._viewLayout.getVerticalOffsetAfterLineNumber(e206, t10);
  }
  getLineHeightForLineNumber(e206) {
    return this._viewLayout.getLineHeightForLineNumber(e206);
  }
  getDecorationsInViewport() {
    return this.viewportData.getDecorationsInViewport();
  }
}, woe = class extends Coe {
  constructor(e206, t10, n10, r10) {
    super(e206, t10), this._renderingContextBrand = void 0, this._viewLines = n10, this._viewLinesGpu = r10;
  }
  linesVisibleRangesForRange(e206, t10) {
    let n10 = this._viewLines.linesVisibleRangesForRange(e206, t10);
    if (!this._viewLinesGpu) return n10 ?? null;
    let r10 = this._viewLinesGpu.linesVisibleRangesForRange(e206, t10);
    return n10 ? r10 ? n10.concat(r10).sort((e207, t11) => e207.lineNumber - t11.lineNumber) : n10 : r10;
  }
  visibleRangeForPosition(e206) {
    return this._viewLines.visibleRangeForPosition(e206) ?? this._viewLinesGpu?.visibleRangeForPosition(e206) ?? null;
  }
}, Db = class {
  constructor(e206, t10, n10, r10) {
    this.outsideRenderedLine = e206, this.lineNumber = t10, this.ranges = n10, this.continuesOnNextLine = r10;
  }
}, Ob = class e75 {
  static from(t10) {
    let n10 = Array(t10.length);
    for (let r10 = 0, i10 = t10.length; r10 < i10; r10++) {
      let i11 = t10[r10];
      n10[r10] = new e75(i11.left, i11.width);
    }
    return n10;
  }
  constructor(e206, t10) {
    this._horizontalRangeBrand = void 0, this.left = Math.round(e206), this.width = Math.round(t10);
  }
  toString() {
    return `[${this.left},${this.width}]`;
  }
}, kb = class {
  constructor(e206, t10) {
    this._floatHorizontalRangeBrand = void 0, this.left = e206, this.width = t10;
  }
  toString() {
    return `[${this.left},${this.width}]`;
  }
  static compare(e206, t10) {
    return e206.left - t10.left;
  }
}, Ab = class {
  constructor(e206, t10) {
    this.outsideRenderedLine = e206, this.originalLeft = t10, this.left = Math.round(this.originalLeft);
  }
}, jb = class {
  constructor(e206, t10) {
    this.outsideRenderedLine = e206, this.ranges = t10;
  }
}, Mb = class {
  static _createRange() {
    return this._handyReadyRange || (this._handyReadyRange = document.createRange()), this._handyReadyRange;
  }
  static _detachRange(e206, t10) {
    e206.selectNodeContents(t10);
  }
  static _readClientRects(e206, t10, n10, r10, i10) {
    let a10 = this._createRange();
    try {
      return a10.setStart(e206, t10), a10.setEnd(n10, r10), a10.getClientRects();
    } catch {
      return null;
    } finally {
      this._detachRange(a10, i10);
    }
  }
  static _mergeAdjacentRanges(e206) {
    if (e206.length === 1) return e206;
    e206.sort(kb.compare);
    let t10 = [], n10 = 0, r10 = e206[0];
    for (let i10 = 1, a10 = e206.length; i10 < a10; i10++) {
      let a11 = e206[i10];
      r10.left + r10.width + 0.9 >= a11.left ? r10.width = Math.max(r10.width, a11.left + a11.width - r10.left) : (t10[n10++] = r10, r10 = a11);
    }
    return t10[n10++] = r10, t10;
  }
  static _createHorizontalRangesFromClientRects(e206, t10, n10) {
    if (!e206 || e206.length === 0) return null;
    let r10 = [];
    for (let i10 = 0, a10 = e206.length; i10 < a10; i10++) {
      let a11 = e206[i10];
      r10[i10] = new kb(Math.max(0, (a11.left - t10) / n10), a11.width / n10);
    }
    return this._mergeAdjacentRanges(r10);
  }
  static readHorizontalRanges(e206, t10, n10, r10, i10, a10) {
    let o10 = e206.children.length - 1;
    if (0 > o10) return null;
    if (t10 = Math.min(o10, Math.max(0, t10)), r10 = Math.min(o10, Math.max(0, r10)), t10 === r10 && n10 === i10 && n10 === 0 && !e206.children[t10].firstChild) {
      let n11 = e206.children[t10].getClientRects();
      return a10.markDidDomLayout(), this._createHorizontalRangesFromClientRects(n11, a10.clientRectDeltaLeft, a10.clientRectScale);
    }
    t10 !== r10 && r10 > 0 && i10 === 0 && (r10--, i10 = 1073741824);
    let s10 = e206.children[t10].firstChild, c10 = e206.children[r10].firstChild;
    if ((!s10 || !c10) && (!s10 && n10 === 0 && t10 > 0 && (s10 = e206.children[t10 - 1].firstChild, n10 = 1073741824), !c10 && i10 === 0 && r10 > 0 && (c10 = e206.children[r10 - 1].firstChild, i10 = 1073741824)), !s10 || !c10) return null;
    n10 = Math.min(s10.textContent.length, Math.max(0, n10)), i10 = Math.min(c10.textContent.length, Math.max(0, i10));
    let l10 = this._readClientRects(s10, n10, c10, i10, a10.endNode);
    return a10.markDidDomLayout(), this._createHorizontalRangesFromClientRects(l10, a10.clientRectDeltaLeft, a10.clientRectScale);
  }
}, Nb;
(function(e206) {
  e206.DARK = `dark`, e206.LIGHT = `light`, e206.HIGH_CONTRAST_DARK = `hcDark`, e206.HIGH_CONTRAST_LIGHT = `hcLight`;
})(Nb || (Nb = {}));
var Pb;
(function(e206) {
  e206.VS = `vs`, e206.VS_DARK = `vs-dark`, e206.HC_BLACK = `hc-black`, e206.HC_LIGHT = `hc-light`;
})(Pb || (Pb = {}));
function Fb(e206) {
  return e206 === Nb.HIGH_CONTRAST_DARK || e206 === Nb.HIGH_CONTRAST_LIGHT;
}
function Ib(e206) {
  return e206 === Nb.DARK || e206 === Nb.HIGH_CONTRAST_DARK;
}
var Toe = /* @__PURE__ */ (function() {
  return Dt ? true : !(Et || Mo || Fo);
})(), Lb = true, Rb = (__2 = class {
  constructor(e206, t10) {
    this._viewGpuContext = e206, this._options = t10, this._isMaybeInvalid = true, this._renderedViewLine = null;
  }
  getDomNode() {
    return this._renderedViewLine && this._renderedViewLine.domNode ? this._renderedViewLine.domNode.domNode : null;
  }
  setDomNode(e206) {
    if (this._renderedViewLine) this._renderedViewLine.domNode = _u(e206);
    else throw Error(`I have no rendered view line to set the dom node to...`);
  }
  onContentChanged() {
    this._isMaybeInvalid = true;
  }
  onTokensChanged() {
    this._isMaybeInvalid = true;
  }
  onDecorationsChanged() {
    this._isMaybeInvalid = true;
  }
  onOptionsChanged(e206) {
    this._isMaybeInvalid = true, this._options = e206;
  }
  onSelectionChanged() {
    return Fb(this._options.themeType) || this._renderedViewLine?.input.renderWhitespace === 2 ? (this._isMaybeInvalid = true, true) : false;
  }
  renderLine(t10, n10, r10, i10, a10) {
    if (this._options.useGpu && this._viewGpuContext?.canRender(this._options, i10, t10)) return this._renderedViewLine?.domNode?.domNode.remove(), this._renderedViewLine = null, false;
    if (this._isMaybeInvalid === false) return false;
    this._isMaybeInvalid = false;
    let o10 = i10.getViewLineRenderingData(t10), s10 = this._options, c10 = og.filter(o10.inlineDecorations, t10, o10.minColumn, o10.maxColumn), l10 = o10.hasVariableFonts || s10.experimentalWhitespaceRendering === `off` ? s10.renderWhitespace : `none`, u10 = !o10.hasVariableFonts, d10 = null;
    if (Fb(s10.themeType) || l10 === `selection`) {
      let e206 = i10.selections;
      for (let n11 of e206) {
        if (n11.endLineNumber < t10 || n11.startLineNumber > t10) continue;
        let e207 = n11.startLineNumber === t10 ? n11.startColumn : o10.minColumn, r11 = n11.endLineNumber === t10 ? n11.endColumn : o10.maxColumn;
        e207 < r11 && (Fb(s10.themeType) && c10.push(new og(e207, r11, `inline-selected-text`, 0)), l10 === `selection` && (d10 || (d10 = []), d10.push(new Tm(e207 - 1, r11 - 1))));
      }
    }
    let f10 = new lg(s10.useMonospaceOptimizations, s10.canUseHalfwidthRightwardsArrow, o10.content, o10.continuesWithWrappedLine, o10.isBasicASCII, o10.containsRTL, o10.minColumn - 1, o10.tokens, c10, o10.tabSize, o10.startVisibleColumn, s10.spaceWidth, s10.middotWidth, s10.wsmiddotWidth, s10.stopRenderingLineAfter, l10, s10.renderControlCharacters, s10.fontLigatures !== Gn.OFF, d10, o10.textDirection, s10.verticalScrollbarSize);
    if (this._renderedViewLine && this._renderedViewLine.input.equals(f10)) return false;
    a10.appendString(`<div `), o10.textDirection === em.RTL ? a10.appendString(`dir="rtl" `) : o10.containsRTL && a10.appendString(`dir="ltr" `), a10.appendString(`style="top:`), a10.appendString(String(n10)), a10.appendString(`px;height:`), a10.appendString(String(r10)), a10.appendString(`px;line-height:`), a10.appendString(String(r10)), o10.textDirection === em.RTL && (a10.appendString(`px;padding-right:`), a10.appendString(String(s10.verticalScrollbarSize))), a10.appendString(`px;" class="`), a10.appendString(__2.CLASS_NAME), a10.appendString(`">`);
    let p10 = pg(f10, a10);
    a10.appendString(`</div>`);
    let m10 = null;
    return u10 && Lb && Toe && o10.isBasicASCII && f10.isLTR && s10.useMonospaceOptimizations && p10.containsForeignElements === 0 && (m10 = new zb(this._renderedViewLine ? this._renderedViewLine.domNode : null, f10, p10.characterMapping)), m10 || (m10 = Vb(this._renderedViewLine ? this._renderedViewLine.domNode : null, f10, p10.characterMapping, p10.containsForeignElements)), this._renderedViewLine = m10, true;
  }
  layoutLine(e206, t10, n10) {
    this._renderedViewLine && this._renderedViewLine.domNode && (this._renderedViewLine.domNode.setTop(t10), this._renderedViewLine.domNode.setHeight(n10), this._renderedViewLine.domNode.setLineHeight(n10));
  }
  isRenderedRTL() {
    return this._renderedViewLine ? this._renderedViewLine.input.textDirection === em.RTL : false;
  }
  getWidth(e206) {
    return this._renderedViewLine ? this._renderedViewLine.getWidth(e206) : 0;
  }
  getWidthIsFast() {
    return this._renderedViewLine ? this._renderedViewLine.getWidthIsFast() : true;
  }
  needsMonospaceFontCheck() {
    return this._renderedViewLine ? this._renderedViewLine instanceof zb : false;
  }
  monospaceAssumptionsAreValid() {
    return this._renderedViewLine && this._renderedViewLine instanceof zb ? this._renderedViewLine.monospaceAssumptionsAreValid() : Lb;
  }
  onMonospaceAssumptionsInvalidated() {
    this._renderedViewLine && this._renderedViewLine instanceof zb && (this._renderedViewLine = this._renderedViewLine.toSlowRenderedLine());
  }
  getVisibleRangesForRange(e206, t10, n10, r10) {
    if (!this._renderedViewLine) return null;
    t10 = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, t10)), n10 = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, n10));
    let i10 = this._renderedViewLine.input.stopRenderingLineAfter;
    if (i10 !== -1 && t10 > i10 + 1 && n10 > i10 + 1) return new jb(true, [new kb(this.getWidth(r10), 0)]);
    i10 !== -1 && t10 > i10 + 1 && (t10 = i10 + 1), i10 !== -1 && n10 > i10 + 1 && (n10 = i10 + 1);
    let a10 = this._renderedViewLine.getVisibleRangesForRange(e206, t10, n10, r10);
    return a10 && a10.length > 0 ? new jb(false, a10) : null;
  }
  getColumnOfNodeOffset(e206, t10) {
    return this._renderedViewLine ? this._renderedViewLine.getColumnOfNodeOffset(e206, t10) : 1;
  }
}, __2.CLASS_NAME = `view-line`, __2), zb = class {
  constructor(e206, t10, n10) {
    this._cachedWidth = -1, this.domNode = e206, this.input = t10;
    let r10 = Math.floor(t10.lineContent.length / 300);
    if (r10 > 0) {
      this._keyColumnPixelOffsetCache = new Float32Array(r10);
      for (let e207 = 0; e207 < r10; e207++) this._keyColumnPixelOffsetCache[e207] = -1;
    } else this._keyColumnPixelOffsetCache = null;
    this._characterMapping = n10, this._charWidth = t10.spaceWidth;
  }
  getWidth(e206) {
    if (!this.domNode || this.input.lineContent.length < 300) {
      let e207 = this._characterMapping.getHorizontalOffset(this._characterMapping.length);
      return Math.round(this._charWidth * e207);
    }
    return this._cachedWidth === -1 && (this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth, e206?.markDidDomLayout()), this._cachedWidth;
  }
  getWidthIsFast() {
    return this.input.lineContent.length < 300 || this._cachedWidth !== -1;
  }
  monospaceAssumptionsAreValid() {
    if (!this.domNode) return Lb;
    if (this.input.lineContent.length < 300) {
      let e206 = this.getWidth(null), t10 = this.domNode.domNode.firstChild.offsetWidth;
      Math.abs(e206 - t10) >= 2 && (console.warn(`monospace assumptions have been violated, therefore disabling monospace optimizations!`), Lb = false);
    }
    return Lb;
  }
  toSlowRenderedLine() {
    return Vb(this.domNode, this.input, this._characterMapping, 0);
  }
  getVisibleRangesForRange(e206, t10, n10, r10) {
    let i10 = this._getColumnPixelOffset(e206, t10, r10);
    return [new kb(i10, this._getColumnPixelOffset(e206, n10, r10) - i10)];
  }
  _getColumnPixelOffset(e206, t10, n10) {
    if (t10 <= 300) {
      let e207 = this._characterMapping.getHorizontalOffset(t10);
      return this._charWidth * e207;
    }
    let r10 = Math.floor((t10 - 1) / 300) - 1, i10 = (r10 + 1) * 300 + 1, a10 = -1;
    if (this._keyColumnPixelOffsetCache && (a10 = this._keyColumnPixelOffsetCache[r10], a10 === -1 && (a10 = this._actualReadPixelOffset(e206, i10, n10), this._keyColumnPixelOffsetCache[r10] = a10)), a10 === -1) {
      let e207 = this._characterMapping.getHorizontalOffset(t10);
      return this._charWidth * e207;
    }
    let o10 = this._characterMapping.getHorizontalOffset(i10), s10 = this._characterMapping.getHorizontalOffset(t10);
    return a10 + this._charWidth * (s10 - o10);
  }
  _getReadingTarget(e206) {
    return e206.domNode.firstChild;
  }
  _actualReadPixelOffset(e206, t10, n10) {
    if (!this.domNode) return -1;
    let r10 = this._characterMapping.getDomPosition(t10), i10 = Mb.readHorizontalRanges(this._getReadingTarget(this.domNode), r10.partIndex, r10.charIndex, r10.partIndex, r10.charIndex, n10);
    return !i10 || i10.length === 0 ? -1 : i10[0].left;
  }
  getColumnOfNodeOffset(e206, t10) {
    return Hb(this._characterMapping, e206, t10);
  }
}, Bb = class {
  constructor(e206, t10, n10, r10) {
    if (this.domNode = e206, this.input = t10, this._characterMapping = n10, this._isWhitespaceOnly = /^\s*$/.test(t10.lineContent), this._containsForeignElements = r10, this._cachedWidth = -1, this._pixelOffsetCache = null, t10.isLTR) {
      this._pixelOffsetCache = new Float32Array(Math.max(2, this._characterMapping.length + 1));
      for (let e207 = 0, t11 = this._characterMapping.length; e207 <= t11; e207++) this._pixelOffsetCache[e207] = -1;
    }
  }
  _getReadingTarget(e206) {
    return e206.domNode.firstChild;
  }
  getWidth(e206) {
    return this.domNode ? (this._cachedWidth === -1 && (this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth, e206?.markDidDomLayout()), this._cachedWidth) : 0;
  }
  getWidthIsFast() {
    return this._cachedWidth !== -1;
  }
  getVisibleRangesForRange(e206, t10, n10, r10) {
    if (!this.domNode) return null;
    if (this._pixelOffsetCache !== null) {
      let i10 = this._readPixelOffset(this.domNode, e206, t10, r10);
      if (i10 === -1) return null;
      let a10 = this._readPixelOffset(this.domNode, e206, n10, r10);
      return a10 === -1 ? null : [new kb(i10, a10 - i10)];
    }
    return this._readVisibleRangesForRange(this.domNode, e206, t10, n10, r10);
  }
  _readVisibleRangesForRange(e206, t10, n10, r10, i10) {
    if (n10 === r10) {
      let r11 = this._readPixelOffset(e206, t10, n10, i10);
      return r11 === -1 ? null : [new kb(r11, 0)];
    } else return this._readRawVisibleRangesForRange(e206, n10, r10, i10);
  }
  _readPixelOffset(e206, t10, n10, r10) {
    if (this.input.isLTR && this._characterMapping.length === 0) {
      if (this._containsForeignElements === 0 || this._containsForeignElements === 2) return 0;
      if (this._containsForeignElements === 1) return this.getWidth(r10);
      let t11 = this._getReadingTarget(e206);
      return t11.firstChild ? (r10.markDidDomLayout(), t11.firstChild.offsetWidth) : 0;
    }
    if (this._pixelOffsetCache !== null) {
      let i10 = this._pixelOffsetCache[n10];
      if (i10 !== -1) return i10;
      let a10 = this._actualReadPixelOffset(e206, t10, n10, r10);
      return this._pixelOffsetCache[n10] = a10, a10;
    }
    return this._actualReadPixelOffset(e206, t10, n10, r10);
  }
  _actualReadPixelOffset(e206, t10, n10, r10) {
    if (this._characterMapping.length === 0) {
      let t11 = Mb.readHorizontalRanges(this._getReadingTarget(e206), 0, 0, 0, 0, r10);
      return !t11 || t11.length === 0 ? -1 : t11[0].left;
    }
    if (this.input.isLTR && n10 === this._characterMapping.length && this._isWhitespaceOnly && this._containsForeignElements === 0) return this.getWidth(r10);
    let i10 = this._characterMapping.getDomPosition(n10), a10 = Mb.readHorizontalRanges(this._getReadingTarget(e206), i10.partIndex, i10.charIndex, i10.partIndex, i10.charIndex, r10);
    if (!a10 || a10.length === 0) return -1;
    let o10 = a10[0].left;
    if (this.input.isBasicASCII) {
      let e207 = this._characterMapping.getHorizontalOffset(n10), t11 = Math.round(this.input.spaceWidth * e207);
      if (Math.abs(t11 - o10) <= 1) return t11;
    }
    return o10;
  }
  _readRawVisibleRangesForRange(e206, t10, n10, r10) {
    if (this.input.isLTR && t10 === 1 && n10 === this._characterMapping.length) return [new kb(0, this.getWidth(r10))];
    let i10 = this._characterMapping.getDomPosition(t10), a10 = this._characterMapping.getDomPosition(n10);
    return Mb.readHorizontalRanges(this._getReadingTarget(e206), i10.partIndex, i10.charIndex, a10.partIndex, a10.charIndex, r10);
  }
  getColumnOfNodeOffset(e206, t10) {
    return Hb(this._characterMapping, e206, t10);
  }
}, Eoe = class extends Bb {
  _readVisibleRangesForRange(e206, t10, n10, r10, i10) {
    let a10 = super._readVisibleRangesForRange(e206, t10, n10, r10, i10);
    if (!a10 || a10.length === 0 || n10 === r10 || n10 === 1 && r10 === this._characterMapping.length) return a10;
    if (this.input.isLTR) {
      let n11 = this._readPixelOffset(e206, t10, r10, i10);
      if (n11 !== -1) {
        let e207 = a10[a10.length - 1];
        e207.left < n11 && (e207.width = n11 - e207.left);
      }
    }
    return a10;
  }
}, Vb = /* @__PURE__ */ (function() {
  return No ? Doe : Ooe;
})();
function Doe(e206, t10, n10, r10) {
  return new Eoe(e206, t10, n10, r10);
}
function Ooe(e206, t10, n10, r10) {
  return new Bb(e206, t10, n10, r10);
}
function Hb(e206, t10, n10) {
  let r10 = t10.textContent.length, i10 = -1;
  for (; t10; ) t10 = t10.previousSibling, i10++;
  return e206.getColumn(new ug(i10, n10), r10);
}
var Ub = class e76 {
  static _nextVisibleColumn(t10, n10, r10) {
    return t10 === 9 ? e76.nextRenderTabStop(n10, r10) : yo(t10) || bo(t10) ? n10 + 2 : n10 + 1;
  }
  static visibleColumnFromColumn(e206, t10, n10) {
    let r10 = Math.min(t10 - 1, e206.length), i10 = e206.substring(0, r10), a10 = new uo(i10), o10 = 0;
    for (; !a10.eol(); ) {
      let e207 = co(i10, r10, a10.offset);
      a10.nextGraphemeLength(), o10 = this._nextVisibleColumn(e207, o10, n10);
    }
    return o10;
  }
  static columnFromVisibleColumn(e206, t10, n10) {
    if (t10 <= 0) return 1;
    let r10 = e206.length, i10 = new uo(e206), a10 = 0, o10 = 1;
    for (; !i10.eol(); ) {
      let s10 = co(e206, r10, i10.offset);
      i10.nextGraphemeLength();
      let c10 = this._nextVisibleColumn(s10, a10, n10), l10 = i10.offset + 1;
      if (c10 >= t10) {
        let e207 = t10 - a10;
        return c10 - t10 < e207 ? l10 : o10;
      }
      a10 = c10, o10 = l10;
    }
    return r10 + 1;
  }
  static nextRenderTabStop(e206, t10) {
    return e206 + t10 - e206 % t10;
  }
  static nextIndentTabStop(t10, n10) {
    return e76.nextRenderTabStop(t10, n10);
  }
  static prevRenderTabStop(e206, t10) {
    return Math.max(0, e206 - 1 - (e206 - 1) % t10);
  }
  static prevIndentTabStop(t10, n10) {
    return e76.prevRenderTabStop(t10, n10);
  }
}, Wb = class e77 {
  static whitespaceVisibleColumn(e206, t10, n10) {
    let r10 = e206.length, i10 = 0, a10 = -1, o10 = -1;
    for (let s10 = 0; s10 < r10; s10++) {
      if (s10 === t10) return [a10, o10, i10];
      switch (i10 % n10 === 0 && (a10 = s10, o10 = i10), e206.charCodeAt(s10)) {
        case 32:
          i10 += 1;
          break;
        case 9:
          i10 = Ub.nextRenderTabStop(i10, n10);
          break;
        default:
          return [-1, -1, -1];
      }
    }
    return t10 === r10 ? [a10, o10, i10] : [-1, -1, -1];
  }
  static atomicPosition(t10, n10, r10, i10) {
    let a10 = t10.length, [o10, s10, c10] = e77.whitespaceVisibleColumn(t10, n10, r10);
    if (c10 === -1) return -1;
    let l10;
    switch (i10) {
      case 0:
        l10 = true;
        break;
      case 1:
        l10 = false;
        break;
      case 2:
        if (c10 % r10 === 0) return n10;
        l10 = c10 % r10 <= r10 / 2;
        break;
    }
    if (l10) {
      if (o10 === -1) return -1;
      let e206 = s10;
      for (let n11 = o10; n11 < a10; ++n11) {
        if (e206 === s10 + r10) return o10;
        switch (t10.charCodeAt(n11)) {
          case 32:
            e206 += 1;
            break;
          case 9:
            e206 = Ub.nextRenderTabStop(e206, r10);
            break;
          default:
            return -1;
        }
      }
      return e206 === s10 + r10 ? o10 : -1;
    }
    let u10 = Ub.nextRenderTabStop(c10, r10), d10 = c10;
    for (let e206 = n10; e206 < a10; e206++) {
      if (d10 === u10) return e206;
      switch (t10.charCodeAt(e206)) {
        case 32:
          d10 += 1;
          break;
        case 9:
          d10 = Ub.nextRenderTabStop(d10, r10);
          break;
        default:
          return -1;
      }
    }
    return d10 === u10 ? a10 : -1;
  }
}, Gb = class {
  constructor(e206 = null) {
    this.hitTarget = e206, this.type = 0;
  }
}, Kb = class {
  get hitTarget() {
    return this.spanNode;
  }
  constructor(e206, t10, n10) {
    this.position = e206, this.spanNode = t10, this.injectedText = n10, this.type = 1;
  }
}, qb;
(function(e206) {
  function t10(e207, t11, n10) {
    let r10 = e207.getPositionFromDOMInfo(t11, n10);
    return r10 ? new Kb(r10, t11, null) : new Gb(t11);
  }
  e206.createFromDOMInfo = t10;
})(qb || (qb = {}));
var koe = class {
  constructor(e206, t10) {
    this.lastViewCursorsRenderData = e206, this.lastTextareaPosition = t10;
  }
}, Jb = class {
  static _deduceRage(e206, t10 = null) {
    return !t10 && e206 ? new M(e206.lineNumber, e206.column, e206.lineNumber, e206.column) : t10 ?? null;
  }
  static createUnknown(e206, t10, n10) {
    return { type: 0, element: e206, mouseColumn: t10, position: n10, range: this._deduceRage(n10) };
  }
  static createTextarea(e206, t10) {
    return { type: 1, element: e206, mouseColumn: t10, position: null, range: null };
  }
  static createMargin(e206, t10, n10, r10, i10, a10) {
    return { type: e206, element: t10, mouseColumn: n10, position: r10, range: i10, detail: a10 };
  }
  static createViewZone(e206, t10, n10, r10, i10) {
    return { type: e206, element: t10, mouseColumn: n10, position: r10, range: this._deduceRage(r10), detail: i10 };
  }
  static createContentText(e206, t10, n10, r10, i10) {
    return { type: 6, element: e206, mouseColumn: t10, position: n10, range: this._deduceRage(n10, r10), detail: i10 };
  }
  static createContentEmpty(e206, t10, n10, r10) {
    return { type: 7, element: e206, mouseColumn: t10, position: n10, range: this._deduceRage(n10), detail: r10 };
  }
  static createContentWidget(e206, t10, n10) {
    return { type: 9, element: e206, mouseColumn: t10, position: null, range: null, detail: n10 };
  }
  static createScrollbar(e206, t10, n10) {
    return { type: 11, element: e206, mouseColumn: t10, position: n10, range: this._deduceRage(n10) };
  }
  static createOverlayWidget(e206, t10, n10) {
    return { type: 12, element: e206, mouseColumn: t10, position: null, range: null, detail: n10 };
  }
  static createOutsideEditor(e206, t10, n10, r10) {
    return { type: 13, element: null, mouseColumn: e206, position: t10, range: this._deduceRage(t10), outsidePosition: n10, outsideDistance: r10 };
  }
  static _typeToString(e206) {
    return e206 === 1 ? `TEXTAREA` : e206 === 2 ? `GUTTER_GLYPH_MARGIN` : e206 === 3 ? `GUTTER_LINE_NUMBERS` : e206 === 4 ? `GUTTER_LINE_DECORATIONS` : e206 === 5 ? `GUTTER_VIEW_ZONE` : e206 === 6 ? `CONTENT_TEXT` : e206 === 7 ? `CONTENT_EMPTY` : e206 === 8 ? `CONTENT_VIEW_ZONE` : e206 === 9 ? `CONTENT_WIDGET` : e206 === 10 ? `OVERVIEW_RULER` : e206 === 11 ? `SCROLLBAR` : e206 === 12 ? `OVERLAY_WIDGET` : `UNKNOWN`;
  }
  static toString(e206) {
    return this._typeToString(e206.type) + `: ` + e206.position + ` - ` + e206.range + ` - ` + JSON.stringify(e206.detail);
  }
}, Yb = class {
  static isTextArea(e206) {
    return e206.length === 2 && e206[0] === 3 && e206[1] === 7;
  }
  static isChildOfViewLines(e206) {
    return e206.length >= 4 && e206[0] === 3 && e206[3] === 8;
  }
  static isStrictChildOfViewLines(e206) {
    return e206.length > 4 && e206[0] === 3 && e206[3] === 8;
  }
  static isChildOfScrollableElement(e206) {
    return e206.length >= 2 && e206[0] === 3 && e206[1] === 6;
  }
  static isChildOfMinimap(e206) {
    return e206.length >= 2 && e206[0] === 3 && e206[1] === 9;
  }
  static isChildOfContentWidgets(e206) {
    return e206.length >= 4 && e206[0] === 3 && e206[3] === 1;
  }
  static isChildOfOverflowGuard(e206) {
    return e206.length >= 1 && e206[0] === 3;
  }
  static isChildOfOverflowingContentWidgets(e206) {
    return e206.length >= 1 && e206[0] === 2;
  }
  static isChildOfOverlayWidgets(e206) {
    return e206.length >= 2 && e206[0] === 3 && e206[1] === 4;
  }
  static isChildOfOverflowingOverlayWidgets(e206) {
    return e206.length >= 1 && e206[0] === 5;
  }
}, Xb = class e78 {
  constructor(e206, t10, n10) {
    this.viewModel = e206.viewModel;
    let r10 = e206.configuration.options;
    this.layoutInfo = r10.get(165), this.viewDomNode = t10.viewDomNode, this.viewLinesGpu = t10.viewLinesGpu, this.lineHeight = r10.get(75), this.stickyTabStops = r10.get(132), this.typicalHalfwidthCharacterWidth = r10.get(59).typicalHalfwidthCharacterWidth, this.lastRenderData = n10, this._context = e206, this._viewHelper = t10;
  }
  getZoneAtCoord(t10) {
    return e78.getZoneAtCoord(this._context, t10);
  }
  static getZoneAtCoord(e206, t10) {
    let n10 = e206.viewLayout.getWhitespaceAtVerticalOffset(t10);
    if (n10) {
      let r10 = n10.verticalOffset + n10.height / 2, i10 = e206.viewModel.getLineCount(), a10 = null, o10, s10 = null;
      return n10.afterLineNumber !== i10 && (s10 = new j(n10.afterLineNumber + 1, 1)), n10.afterLineNumber > 0 && (a10 = new j(n10.afterLineNumber, e206.viewModel.getLineMaxColumn(n10.afterLineNumber))), o10 = s10 === null ? a10 : a10 === null ? s10 : t10 < r10 ? a10 : s10, { viewZoneId: n10.id, afterLineNumber: n10.afterLineNumber, positionBefore: a10, positionAfter: s10, position: o10 };
    }
    return null;
  }
  getFullLineRangeAtCoord(e206) {
    if (this._context.viewLayout.isAfterLines(e206)) {
      let e207 = this._context.viewModel.getLineCount(), t11 = this._context.viewModel.getLineMaxColumn(e207);
      return { range: new M(e207, t11, e207, t11), isAfterLines: true };
    }
    let t10 = this._context.viewLayout.getLineNumberAtVerticalOffset(e206);
    return { range: new M(t10, 1, t10, this._context.viewModel.getLineMaxColumn(t10)), isAfterLines: false };
  }
  getLineNumberAtVerticalOffset(e206) {
    return this._context.viewLayout.getLineNumberAtVerticalOffset(e206);
  }
  isAfterLines(e206) {
    return this._context.viewLayout.isAfterLines(e206);
  }
  isInTopPadding(e206) {
    return this._context.viewLayout.isInTopPadding(e206);
  }
  isInBottomPadding(e206) {
    return this._context.viewLayout.isInBottomPadding(e206);
  }
  getVerticalOffsetForLineNumber(e206) {
    return this._context.viewLayout.getVerticalOffsetForLineNumber(e206);
  }
  findAttribute(t10, n10) {
    return e78._findAttribute(t10, n10, this._viewHelper.viewDomNode);
  }
  static _findAttribute(e206, t10, n10) {
    for (; e206 && e206 !== e206.ownerDocument.body; ) {
      if (e206.hasAttribute && e206.hasAttribute(t10)) return e206.getAttribute(t10);
      if (e206 === n10) return null;
      e206 = e206.parentNode;
    }
    return null;
  }
  getLineWidth(e206) {
    return this._viewHelper.getLineWidth(e206);
  }
  isRtl(e206) {
    return this.viewModel.getTextDirection(e206) === em.RTL;
  }
  visibleRangeForPosition(e206, t10) {
    return this._viewHelper.visibleRangeForPosition(e206, t10);
  }
  getPositionFromDOMInfo(e206, t10) {
    return this._viewHelper.getPositionFromDOMInfo(e206, t10);
  }
  getCurrentScrollTop() {
    return this._context.viewLayout.getCurrentScrollTop();
  }
  getCurrentScrollLeft() {
    return this._context.viewLayout.getCurrentScrollLeft();
  }
}, Aoe = class {
  constructor(e206, t10, n10, r10) {
    this.editorPos = t10, this.pos = n10, this.relativePos = r10, this.mouseVerticalOffset = Math.max(0, e206.getCurrentScrollTop() + this.relativePos.y), this.mouseContentHorizontalOffset = e206.getCurrentScrollLeft() + this.relativePos.x - e206.layoutInfo.contentLeft, this.isInMarginArea = this.relativePos.x < e206.layoutInfo.contentLeft && this.relativePos.x >= e206.layoutInfo.glyphMarginLeft, this.isInContentArea = !this.isInMarginArea, this.mouseColumn = Math.max(0, $b._getMouseColumn(this.mouseContentHorizontalOffset, e206.typicalHalfwidthCharacterWidth));
  }
}, joe = class extends Aoe {
  get target() {
    return this._useHitTestTarget ? this.hitTestResult.value.hitTarget : this._eventTarget;
  }
  get targetPath() {
    return this._targetPathCacheElement !== this.target && (this._targetPathCacheElement = this.target, this._targetPathCacheValue = Eb.collect(this.target, this._ctx.viewDomNode)), this._targetPathCacheValue;
  }
  constructor(e206, t10, n10, r10, i10) {
    super(e206, t10, n10, r10), this.hitTestResult = new Fa(() => $b.doHitTest(this._ctx, this)), this._targetPathCacheElement = null, this._targetPathCacheValue = new Uint8Array(), this._ctx = e206, this._eventTarget = i10, this._useHitTestTarget = !this._eventTarget;
  }
  toString() {
    return `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
	target: ${this.target ? this.target.outerHTML : null}`;
  }
  get wouldBenefitFromHitTestTargetSwitch() {
    return !this._useHitTestTarget && this.hitTestResult.value.hitTarget !== null && this.target !== this.hitTestResult.value.hitTarget;
  }
  switchToHitTestTarget() {
    this._useHitTestTarget = true;
  }
  _getMouseColumn(e206 = null) {
    return e206 && e206.column < this._ctx.viewModel.getLineMaxColumn(e206.lineNumber) ? Ub.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e206.lineNumber), e206.column, this._ctx.viewModel.model.getOptions().tabSize) + 1 : this.mouseColumn;
  }
  fulfillUnknown(e206 = null) {
    return Jb.createUnknown(this.target, this._getMouseColumn(e206), e206);
  }
  fulfillTextarea() {
    return Jb.createTextarea(this.target, this._getMouseColumn());
  }
  fulfillMargin(e206, t10, n10, r10) {
    return Jb.createMargin(e206, this.target, this._getMouseColumn(t10), t10, n10, r10);
  }
  fulfillViewZone(e206, t10, n10) {
    return Jb.createViewZone(e206, this.target, this._getMouseColumn(), t10, n10);
  }
  fulfillContentText(e206, t10, n10) {
    return Jb.createContentText(this.target, this._getMouseColumn(e206), e206, t10, n10);
  }
  fulfillContentEmpty(e206, t10) {
    return Jb.createContentEmpty(this.target, this._getMouseColumn(e206), e206, t10);
  }
  fulfillContentWidget(e206) {
    return Jb.createContentWidget(this.target, this._getMouseColumn(), e206);
  }
  fulfillScrollbar(e206) {
    return Jb.createScrollbar(this.target, this._getMouseColumn(e206), e206);
  }
  fulfillOverlayWidget(e206) {
    return Jb.createOverlayWidget(this.target, this._getMouseColumn(), e206);
  }
}, Zb = { isAfterLines: true };
function Qb(e206) {
  return { isAfterLines: false, horizontalDistanceToText: e206 };
}
var $b = class e79 {
  constructor(e206, t10) {
    this._context = e206, this._viewHelper = t10;
  }
  mouseTargetIsWidget(e206) {
    let t10 = e206.target, n10 = Eb.collect(t10, this._viewHelper.viewDomNode);
    return !!(Yb.isChildOfContentWidgets(n10) || Yb.isChildOfOverflowingContentWidgets(n10) || Yb.isChildOfOverlayWidgets(n10) || Yb.isChildOfOverflowingOverlayWidgets(n10));
  }
  createMouseTarget(t10, n10, r10, i10, a10) {
    let o10 = new Xb(this._context, this._viewHelper, t10), s10 = new joe(o10, n10, r10, i10, a10);
    try {
      let t11 = e79._createMouseTarget(o10, s10);
      if (t11.type === 6 && o10.stickyTabStops && t11.position !== null) {
        let n11 = e79._snapToSoftTabBoundary(t11.position, o10.viewModel), r11 = M.fromPositions(n11, n11).plusRange(t11.range);
        return s10.fulfillContentText(n11, r11, t11.detail);
      }
      return t11;
    } catch {
      return s10.fulfillUnknown();
    }
  }
  static _createMouseTarget(t10, n10) {
    if (n10.target === null) return n10.fulfillUnknown();
    let r10 = n10, i10 = null;
    return !Yb.isChildOfOverflowGuard(n10.targetPath) && !Yb.isChildOfOverflowingContentWidgets(n10.targetPath) && !Yb.isChildOfOverflowingOverlayWidgets(n10.targetPath) && (i10 || (i10 = n10.fulfillUnknown())), i10 || (i10 = e79._hitTestContentWidget(t10, r10)), i10 || (i10 = e79._hitTestOverlayWidget(t10, r10)), i10 || (i10 = e79._hitTestMinimap(t10, r10)), i10 || (i10 = e79._hitTestScrollbarSlider(t10, r10)), i10 || (i10 = e79._hitTestViewZone(t10, r10)), i10 || (i10 = e79._hitTestMargin(t10, r10)), i10 || (i10 = e79._hitTestViewCursor(t10, r10)), i10 || (i10 = e79._hitTestTextArea(t10, r10)), i10 || (i10 = e79._hitTestViewLines(t10, r10)), i10 || (i10 = e79._hitTestScrollbar(t10, r10)), i10 || n10.fulfillUnknown();
  }
  static _hitTestContentWidget(e206, t10) {
    if (Yb.isChildOfContentWidgets(t10.targetPath) || Yb.isChildOfOverflowingContentWidgets(t10.targetPath)) {
      let n10 = e206.findAttribute(t10.target, `widgetId`);
      return n10 ? t10.fulfillContentWidget(n10) : t10.fulfillUnknown();
    }
    return null;
  }
  static _hitTestOverlayWidget(e206, t10) {
    if (Yb.isChildOfOverlayWidgets(t10.targetPath) || Yb.isChildOfOverflowingOverlayWidgets(t10.targetPath)) {
      let n10 = e206.findAttribute(t10.target, `widgetId`);
      return n10 ? t10.fulfillOverlayWidget(n10) : t10.fulfillUnknown();
    }
    return null;
  }
  static _hitTestViewCursor(e206, t10) {
    if (t10.target) {
      let n10 = e206.lastRenderData.lastViewCursorsRenderData;
      for (let e207 of n10) if (t10.target === e207.domNode) return t10.fulfillContentText(e207.position, null, { mightBeForeignElement: false, injectedText: null });
    }
    if (t10.isInContentArea) {
      let n10 = e206.lastRenderData.lastViewCursorsRenderData, r10 = t10.mouseContentHorizontalOffset, i10 = t10.mouseVerticalOffset;
      for (let a10 of n10) {
        if (r10 < a10.contentLeft || r10 > a10.contentLeft + a10.width) continue;
        let n11 = e206.getVerticalOffsetForLineNumber(a10.position.lineNumber);
        if (n11 <= i10 && i10 <= n11 + a10.height) return t10.fulfillContentText(a10.position, null, { mightBeForeignElement: false, injectedText: null });
      }
    }
    return null;
  }
  static _hitTestViewZone(e206, t10) {
    let n10 = e206.getZoneAtCoord(t10.mouseVerticalOffset);
    if (n10) {
      let e207 = t10.isInContentArea ? 8 : 5;
      return t10.fulfillViewZone(e207, n10.position, n10);
    }
    return null;
  }
  static _hitTestTextArea(e206, t10) {
    return Yb.isTextArea(t10.targetPath) ? e206.lastRenderData.lastTextareaPosition ? t10.fulfillContentText(e206.lastRenderData.lastTextareaPosition, null, { mightBeForeignElement: false, injectedText: null }) : t10.fulfillTextarea() : null;
  }
  static _hitTestMargin(e206, t10) {
    if (t10.isInMarginArea) {
      let n10 = e206.getFullLineRangeAtCoord(t10.mouseVerticalOffset), r10 = n10.range.getStartPosition(), i10 = Math.abs(t10.relativePos.x), a10 = { isAfterLines: n10.isAfterLines, glyphMarginLeft: e206.layoutInfo.glyphMarginLeft, glyphMarginWidth: e206.layoutInfo.glyphMarginWidth, lineNumbersWidth: e206.layoutInfo.lineNumbersWidth, offsetX: i10 };
      if (i10 -= e206.layoutInfo.glyphMarginLeft, i10 <= e206.layoutInfo.glyphMarginWidth) {
        let o10 = e206.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n10.range.getStartPosition());
        return a10.glyphMarginLane = e206.viewModel.glyphLanes.getLanesAtLine(o10.lineNumber)[Math.floor(i10 / e206.lineHeight)], t10.fulfillMargin(2, r10, n10.range, a10);
      }
      return i10 -= e206.layoutInfo.glyphMarginWidth, i10 <= e206.layoutInfo.lineNumbersWidth ? t10.fulfillMargin(3, r10, n10.range, a10) : (i10 -= e206.layoutInfo.lineNumbersWidth, t10.fulfillMargin(4, r10, n10.range, a10));
    }
    return null;
  }
  static _hitTestViewLines(t10, n10) {
    if (!Yb.isChildOfViewLines(n10.targetPath)) return null;
    if (t10.isInTopPadding(n10.mouseVerticalOffset)) return n10.fulfillContentEmpty(new j(1, 1), Zb);
    if (t10.isAfterLines(n10.mouseVerticalOffset) || t10.isInBottomPadding(n10.mouseVerticalOffset)) {
      let e206 = t10.viewModel.getLineCount(), r11 = t10.viewModel.getLineMaxColumn(e206);
      return n10.fulfillContentEmpty(new j(e206, r11), Zb);
    }
    if (Yb.isStrictChildOfViewLines(n10.targetPath)) {
      let e206 = t10.getLineNumberAtVerticalOffset(n10.mouseVerticalOffset), r11 = t10.viewModel.getLineLength(e206), i10 = t10.getLineWidth(e206);
      if (r11 === 0) {
        let t11 = Qb(n10.mouseContentHorizontalOffset - i10);
        return n10.fulfillContentEmpty(new j(e206, 1), t11);
      }
      if (t10.isRtl(e206)) {
        if (n10.mouseContentHorizontalOffset + i10 <= t10.layoutInfo.contentWidth - t10.layoutInfo.verticalScrollbarWidth) {
          let r12 = Qb(n10.mouseContentHorizontalOffset - i10), a10 = new j(e206, t10.viewModel.getLineMaxColumn(e206));
          return n10.fulfillContentEmpty(a10, r12);
        }
      } else if (n10.mouseContentHorizontalOffset >= i10) {
        let r12 = Qb(n10.mouseContentHorizontalOffset - i10), a10 = new j(e206, t10.viewModel.getLineMaxColumn(e206));
        return n10.fulfillContentEmpty(a10, r12);
      }
    } else if (t10.viewLinesGpu) {
      let e206 = t10.getLineNumberAtVerticalOffset(n10.mouseVerticalOffset);
      if (t10.viewModel.getLineLength(e206) === 0) {
        let r12 = t10.getLineWidth(e206), i11 = Qb(n10.mouseContentHorizontalOffset - r12);
        return n10.fulfillContentEmpty(new j(e206, 1), i11);
      }
      let r11 = t10.getLineWidth(e206);
      if (t10.isRtl(e206)) {
        if (n10.mouseContentHorizontalOffset + r11 <= t10.layoutInfo.contentWidth - t10.layoutInfo.verticalScrollbarWidth) {
          let i11 = Qb(n10.mouseContentHorizontalOffset - r11), a10 = new j(e206, t10.viewModel.getLineMaxColumn(e206));
          return n10.fulfillContentEmpty(a10, i11);
        }
      } else if (n10.mouseContentHorizontalOffset >= r11) {
        let i11 = Qb(n10.mouseContentHorizontalOffset - r11), a10 = new j(e206, t10.viewModel.getLineMaxColumn(e206));
        return n10.fulfillContentEmpty(a10, i11);
      }
      let i10 = t10.viewLinesGpu.getPositionAtCoordinate(e206, n10.mouseContentHorizontalOffset);
      if (i10) return n10.fulfillContentText(i10, M.fromPositions(i10, i10), { injectedText: null, mightBeForeignElement: false });
    }
    let r10 = n10.hitTestResult.value;
    return r10.type === 1 ? e79.createMouseTargetFromHitTestPosition(t10, n10, r10.spanNode, r10.position, r10.injectedText) : n10.wouldBenefitFromHitTestTargetSwitch ? (n10.switchToHitTestTarget(), this._createMouseTarget(t10, n10)) : n10.fulfillUnknown();
  }
  static _hitTestMinimap(e206, t10) {
    if (Yb.isChildOfMinimap(t10.targetPath)) {
      let n10 = e206.getLineNumberAtVerticalOffset(t10.mouseVerticalOffset), r10 = e206.viewModel.getLineMaxColumn(n10);
      return t10.fulfillScrollbar(new j(n10, r10));
    }
    return null;
  }
  static _hitTestScrollbarSlider(e206, t10) {
    if (Yb.isChildOfScrollableElement(t10.targetPath) && t10.target && t10.target.nodeType === 1) {
      let n10 = t10.target.className;
      if (n10 && /\b(slider|scrollbar)\b/.test(n10)) {
        let n11 = e206.getLineNumberAtVerticalOffset(t10.mouseVerticalOffset), r10 = e206.viewModel.getLineMaxColumn(n11);
        return t10.fulfillScrollbar(new j(n11, r10));
      }
    }
    return null;
  }
  static _hitTestScrollbar(e206, t10) {
    if (Yb.isChildOfScrollableElement(t10.targetPath)) {
      let n10 = e206.getLineNumberAtVerticalOffset(t10.mouseVerticalOffset), r10 = e206.viewModel.getLineMaxColumn(n10);
      return t10.fulfillScrollbar(new j(n10, r10));
    }
    return null;
  }
  getMouseColumn(t10) {
    let n10 = this._context.configuration.options, r10 = n10.get(165), i10 = this._context.viewLayout.getCurrentScrollLeft() + t10.x - r10.contentLeft;
    return e79._getMouseColumn(i10, n10.get(59).typicalHalfwidthCharacterWidth);
  }
  static _getMouseColumn(e206, t10) {
    return e206 < 0 ? 1 : Math.round(e206 / t10) + 1;
  }
  static createMouseTargetFromHitTestPosition(e206, t10, n10, r10, i10) {
    let a10 = r10.lineNumber, o10 = r10.column, s10 = e206.getLineWidth(a10);
    if (t10.mouseContentHorizontalOffset > s10) {
      let e207 = Qb(t10.mouseContentHorizontalOffset - s10);
      return t10.fulfillContentEmpty(r10, e207);
    }
    let c10 = e206.visibleRangeForPosition(a10, o10);
    if (!c10) return t10.fulfillUnknown(r10);
    let l10 = c10.left;
    if (Math.abs(t10.mouseContentHorizontalOffset - l10) < 1) return t10.fulfillContentText(r10, null, { mightBeForeignElement: !!i10, injectedText: i10 });
    let u10 = [];
    if (u10.push({ offset: c10.left, column: o10 }), o10 > 1) {
      let t11 = e206.visibleRangeForPosition(a10, o10 - 1);
      t11 && u10.push({ offset: t11.left, column: o10 - 1 });
    }
    if (o10 < e206.viewModel.getLineMaxColumn(a10)) {
      let t11 = e206.visibleRangeForPosition(a10, o10 + 1);
      t11 && u10.push({ offset: t11.left, column: o10 + 1 });
    }
    u10.sort((e207, t11) => e207.offset - t11.offset);
    let d10 = t10.pos.toClientCoordinates(Vc(e206.viewDomNode)), f10 = n10.getBoundingClientRect(), p10 = f10.left <= d10.clientX && d10.clientX <= f10.right, m10 = null;
    for (let e207 = 1; e207 < u10.length; e207++) {
      let n11 = u10[e207 - 1], i11 = u10[e207];
      if (n11.offset <= t10.mouseContentHorizontalOffset && t10.mouseContentHorizontalOffset <= i11.offset) {
        m10 = new M(a10, n11.column, a10, i11.column), r10 = Math.abs(n11.offset - t10.mouseContentHorizontalOffset) < Math.abs(i11.offset - t10.mouseContentHorizontalOffset) ? new j(a10, n11.column) : new j(a10, i11.column);
        break;
      }
    }
    return t10.fulfillContentText(r10, m10, { mightBeForeignElement: !p10 || !!i10, injectedText: i10 });
  }
  static _doHitTestWithCaretRangeFromPoint(e206, t10) {
    let n10 = e206.getLineNumberAtVerticalOffset(t10.mouseVerticalOffset), r10 = e206.getVerticalOffsetForLineNumber(n10), i10 = r10 + e206.lineHeight;
    if (!(n10 === e206.viewModel.getLineCount() && t10.mouseVerticalOffset > i10)) {
      let n11 = Math.floor((r10 + i10) / 2), a10 = t10.pos.y + (n11 - t10.mouseVerticalOffset);
      a10 <= t10.editorPos.y && (a10 = t10.editorPos.y + 1), a10 >= t10.editorPos.y + t10.editorPos.height && (a10 = t10.editorPos.y + t10.editorPos.height - 1);
      let o10 = new vb(t10.pos.x, a10), s10 = this._actualDoHitTestWithCaretRangeFromPoint(e206, o10.toClientCoordinates(Vc(e206.viewDomNode)));
      if (s10.type === 1) return s10;
    }
    return this._actualDoHitTestWithCaretRangeFromPoint(e206, t10.pos.toClientCoordinates(Vc(e206.viewDomNode)));
  }
  static _actualDoHitTestWithCaretRangeFromPoint(e206, t10) {
    let n10 = Ol(e206.viewDomNode), r10;
    if (r10 = n10 ? n10.caretRangeFromPoint === void 0 ? Moe(n10, t10.clientX, t10.clientY) : n10.caretRangeFromPoint(t10.clientX, t10.clientY) : e206.viewDomNode.ownerDocument.caretRangeFromPoint(t10.clientX, t10.clientY), !r10 || !r10.startContainer) return new Gb();
    let i10 = r10.startContainer;
    if (i10.nodeType === i10.TEXT_NODE) {
      let t11 = i10.parentNode, n11 = t11 ? t11.parentNode : null, a10 = n11 ? n11.parentNode : null;
      return (a10 && a10.nodeType === a10.ELEMENT_NODE ? a10.className : null) === Rb.CLASS_NAME ? qb.createFromDOMInfo(e206, t11, r10.startOffset) : new Gb(i10.parentNode);
    } else if (i10.nodeType === i10.ELEMENT_NODE) {
      let t11 = i10.parentNode, n11 = t11 ? t11.parentNode : null;
      return (n11 && n11.nodeType === n11.ELEMENT_NODE ? n11.className : null) === Rb.CLASS_NAME ? qb.createFromDOMInfo(e206, i10, i10.textContent.length) : new Gb(i10);
    }
    return new Gb();
  }
  static _doHitTestWithCaretPositionFromPoint(e206, t10) {
    let n10 = e206.viewDomNode.ownerDocument.caretPositionFromPoint(t10.clientX, t10.clientY);
    if (n10.offsetNode.nodeType === n10.offsetNode.TEXT_NODE) {
      let t11 = n10.offsetNode.parentNode, r10 = t11 ? t11.parentNode : null, i10 = r10 ? r10.parentNode : null;
      return (i10 && i10.nodeType === i10.ELEMENT_NODE ? i10.className : null) === Rb.CLASS_NAME ? qb.createFromDOMInfo(e206, n10.offsetNode.parentNode, n10.offset) : new Gb(n10.offsetNode.parentNode);
    }
    if (n10.offsetNode.nodeType === n10.offsetNode.ELEMENT_NODE) {
      let t11 = n10.offsetNode.parentNode, r10 = t11 && t11.nodeType === t11.ELEMENT_NODE ? t11.className : null, i10 = t11 ? t11.parentNode : null, a10 = i10 && i10.nodeType === i10.ELEMENT_NODE ? i10.className : null;
      if (r10 === Rb.CLASS_NAME) {
        let t12 = n10.offsetNode.childNodes[Math.min(n10.offset, n10.offsetNode.childNodes.length - 1)];
        if (t12) return qb.createFromDOMInfo(e206, t12, 0);
      } else if (a10 === Rb.CLASS_NAME) return qb.createFromDOMInfo(e206, n10.offsetNode, 0);
    }
    return new Gb(n10.offsetNode);
  }
  static _snapToSoftTabBoundary(e206, t10) {
    let n10 = t10.getLineContent(e206.lineNumber), { tabSize: r10 } = t10.model.getOptions(), i10 = Wb.atomicPosition(n10, e206.column - 1, r10, 2);
    return i10 === -1 ? e206 : new j(e206.lineNumber, i10 + 1);
  }
  static doHitTest(e206, t10) {
    let n10 = new Gb();
    if (typeof e206.viewDomNode.ownerDocument.caretRangeFromPoint == `function` ? n10 = this._doHitTestWithCaretRangeFromPoint(e206, t10) : e206.viewDomNode.ownerDocument.caretPositionFromPoint && (n10 = this._doHitTestWithCaretPositionFromPoint(e206, t10.pos.toClientCoordinates(Vc(e206.viewDomNode)))), n10.type === 1) {
      let t11 = e206.viewModel.getInjectedTextAt(n10.position), r10 = e206.viewModel.normalizePosition(n10.position, 2);
      (t11 || !r10.equals(n10.position)) && (n10 = new Kb(r10, n10.spanNode, t11));
    }
    return n10;
  }
};
function Moe(e206, t10, n10) {
  let r10 = document.createRange(), i10 = e206.elementFromPoint(t10, n10);
  if (i10?.hasChildNodes()) {
    for (; i10 && i10.firstChild && i10.firstChild.nodeType !== i10.firstChild.TEXT_NODE && i10.lastChild && i10.lastChild.firstChild; ) i10 = i10.lastChild;
    let e207 = i10.getBoundingClientRect(), n11 = Vc(i10), a10 = `${n11.getComputedStyle(i10, null).getPropertyValue(`font-style`)} ${n11.getComputedStyle(i10, null).getPropertyValue(`font-variant`)} ${n11.getComputedStyle(i10, null).getPropertyValue(`font-weight`)} ${n11.getComputedStyle(i10, null).getPropertyValue(`font-size`)}/${n11.getComputedStyle(i10, null).getPropertyValue(`line-height`)} ${n11.getComputedStyle(i10, null).getPropertyValue(`font-family`)}`, o10 = i10.innerText, s10 = e207.left, c10 = 0, l10;
    if (t10 > e207.left + e207.width) c10 = o10.length;
    else {
      let e208 = Noe.getInstance();
      for (let n12 = 0; n12 < o10.length + 1; n12++) {
        if (l10 = e208.getCharWidth(o10.charAt(n12), a10) / 2, s10 += l10, t10 < s10) {
          c10 = n12;
          break;
        }
        s10 += l10;
      }
    }
    r10.setStart(i10.firstChild, c10), r10.setEnd(i10.firstChild, c10);
  }
  return r10;
}
var Noe = (_$ = class {
  static getInstance() {
    return _$._INSTANCE || (_$._INSTANCE = new _$()), _$._INSTANCE;
  }
  constructor() {
    this._cache = {}, this._canvas = document.createElement(`canvas`);
  }
  getCharWidth(e206, t10) {
    let n10 = e206 + t10;
    if (this._cache[n10]) return this._cache[n10];
    let r10 = this._canvas.getContext(`2d`);
    r10.font = t10;
    let i10 = r10.measureText(e206).width;
    return this._cache[n10] = i10, i10;
  }
}, _$._INSTANCE = null, _$);
function ex(e206, t10, n10) {
  let r10 = null, i10 = null;
  if (typeof n10.value == `function` ? (r10 = `value`, i10 = n10.value, i10.length !== 0 && console.warn(`Memoize should only be used in functions with zero parameters`)) : typeof n10.get == `function` && (r10 = `get`, i10 = n10.get), !i10) throw Error(`not supported`);
  let a10 = `$memoize$${t10}`;
  n10[r10] = function(...e207) {
    return this.hasOwnProperty(a10) || Object.defineProperty(this, a10, { configurable: false, enumerable: false, writable: false, value: i10.apply(this, e207) }), this[a10];
  };
}
var Poe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, tx;
(function(e206) {
  e206.Tap = `-monaco-gesturetap`, e206.Change = `-monaco-gesturechange`, e206.Start = `-monaco-gesturestart`, e206.End = `-monaco-gesturesend`, e206.Contextmenu = `-monaco-gesturecontextmenu`;
})(tx || (tx = {}));
var nx = (_aa = class extends D {
  constructor() {
    super(), this.dispatched = false, this.targets = new Qt(), this.ignoreTargets = new Qt(), this.activeTouches = {}, this.handle = null, this._lastSetTapCountTime = 0, this._register(O.runAndSubscribe(qc, ({ window: e206, disposables: t10 }) => {
      t10.add(L(e206.document, `touchstart`, (e207) => this.onTouchStart(e207), { passive: false })), t10.add(L(e206.document, `touchend`, (t11) => this.onTouchEnd(e206, t11))), t10.add(L(e206.document, `touchmove`, (e207) => this.onTouchMove(e207), { passive: false }));
    }, { window: Aa, disposables: this._store }));
  }
  static addTarget(t10) {
    return _aa.isTouchDevice() ? (_aa.INSTANCE || (_aa.INSTANCE = Wt(new _aa())), T(_aa.INSTANCE.targets.push(t10))) : D.None;
  }
  static ignoreTarget(t10) {
    return _aa.isTouchDevice() ? (_aa.INSTANCE || (_aa.INSTANCE = Wt(new _aa())), T(_aa.INSTANCE.ignoreTargets.push(t10))) : D.None;
  }
  static isTouchDevice() {
    return `ontouchstart` in Aa || navigator.maxTouchPoints > 0;
  }
  dispose() {
    this.handle && (this.handle = (this.handle.dispose(), null)), super.dispose();
  }
  onTouchStart(e206) {
    let t10 = Date.now();
    this.handle && (this.handle = (this.handle.dispose(), null));
    for (let n10 = 0, r10 = e206.targetTouches.length; n10 < r10; n10++) {
      let r11 = e206.targetTouches.item(n10);
      this.activeTouches[r11.identifier] = { id: r11.identifier, initialTarget: r11.target, initialTimeStamp: t10, initialPageX: r11.pageX, initialPageY: r11.pageY, rollingTimestamps: [t10], rollingPageX: [r11.pageX], rollingPageY: [r11.pageY] };
      let i10 = this.newGestureEvent(tx.Start, r11.target);
      i10.pageX = r11.pageX, i10.pageY = r11.pageY, this.dispatchEvent(i10);
    }
    this.dispatched && (this.dispatched = (e206.preventDefault(), e206.stopPropagation(), false));
  }
  onTouchEnd(t10, n10) {
    let r10 = Date.now(), i10 = Object.keys(this.activeTouches).length;
    for (let a10 = 0, o10 = n10.changedTouches.length; a10 < o10; a10++) {
      let o11 = n10.changedTouches.item(a10);
      if (!this.activeTouches.hasOwnProperty(String(o11.identifier))) {
        console.warn(`move of an UNKNOWN touch`, o11);
        continue;
      }
      let s10 = this.activeTouches[o11.identifier], c10 = Date.now() - s10.initialTimeStamp;
      if (c10 < _aa.HOLD_DELAY && Math.abs(s10.initialPageX - s10.rollingPageX.at(-1)) < 30 && Math.abs(s10.initialPageY - s10.rollingPageY.at(-1)) < 30) {
        let e206 = this.newGestureEvent(tx.Tap, s10.initialTarget);
        e206.pageX = s10.rollingPageX.at(-1), e206.pageY = s10.rollingPageY.at(-1), this.dispatchEvent(e206);
      } else if (c10 >= _aa.HOLD_DELAY && Math.abs(s10.initialPageX - s10.rollingPageX.at(-1)) < 30 && Math.abs(s10.initialPageY - s10.rollingPageY.at(-1)) < 30) {
        let e206 = this.newGestureEvent(tx.Contextmenu, s10.initialTarget);
        e206.pageX = s10.rollingPageX.at(-1), e206.pageY = s10.rollingPageY.at(-1), this.dispatchEvent(e206);
      } else if (i10 === 1) {
        let e206 = s10.rollingPageX.at(-1), n11 = s10.rollingPageY.at(-1), i11 = s10.rollingTimestamps.at(-1) - s10.rollingTimestamps[0], a11 = e206 - s10.rollingPageX[0], o12 = n11 - s10.rollingPageY[0], c11 = [...this.targets].filter((e207) => s10.initialTarget instanceof Node && e207.contains(s10.initialTarget));
        this.inertia(t10, c11, r10, Math.abs(a11) / i11, a11 > 0 ? 1 : -1, e206, Math.abs(o12) / i11, o12 > 0 ? 1 : -1, n11);
      }
      this.dispatchEvent(this.newGestureEvent(tx.End, s10.initialTarget)), delete this.activeTouches[o11.identifier];
    }
    this.dispatched && (this.dispatched = (n10.preventDefault(), n10.stopPropagation(), false));
  }
  newGestureEvent(e206, t10) {
    let n10 = document.createEvent(`CustomEvent`);
    return n10.initEvent(e206, false, true), n10.initialTarget = t10, n10.tapCount = 0, n10;
  }
  dispatchEvent(t10) {
    if (t10.type === tx.Tap) {
      let n10 = (/* @__PURE__ */ new Date()).getTime(), r10 = 0;
      r10 = n10 - this._lastSetTapCountTime > _aa.CLEAR_TAP_COUNT_TIME ? 1 : 2, this._lastSetTapCountTime = n10, t10.tapCount = r10;
    } else (t10.type === tx.Change || t10.type === tx.Contextmenu) && (this._lastSetTapCountTime = 0);
    if (t10.initialTarget instanceof Node) {
      for (let e207 of this.ignoreTargets) if (e207.contains(t10.initialTarget)) return;
      let e206 = [];
      for (let n10 of this.targets) if (n10.contains(t10.initialTarget)) {
        let r10 = 0, i10 = t10.initialTarget;
        for (; i10 && i10 !== n10; ) r10++, i10 = i10.parentElement;
        e206.push([r10, n10]);
      }
      e206.sort((e207, t11) => e207[0] - t11[0]);
      for (let [n10, r10] of e206) r10.dispatchEvent(t10), this.dispatched = true;
    }
  }
  inertia(t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    this.handle = cl(t10, () => {
      let u10 = Date.now(), d10 = u10 - r10, f10 = 0, p10 = 0, m10 = true;
      i10 += _aa.SCROLL_FRICTION * d10, s10 += _aa.SCROLL_FRICTION * d10, i10 > 0 && (m10 = false, f10 = a10 * i10 * d10), s10 > 0 && (m10 = false, p10 = c10 * s10 * d10);
      let h10 = this.newGestureEvent(tx.Change);
      h10.translationX = f10, h10.translationY = p10, n10.forEach((e206) => e206.dispatchEvent(h10)), m10 || this.inertia(t10, n10, u10, i10, a10, o10 + f10, s10, c10, l10 + p10);
    });
  }
  onTouchMove(e206) {
    let t10 = Date.now();
    for (let n10 = 0, r10 = e206.changedTouches.length; n10 < r10; n10++) {
      let r11 = e206.changedTouches.item(n10);
      if (!this.activeTouches.hasOwnProperty(String(r11.identifier))) {
        console.warn(`end of an UNKNOWN touch`, r11);
        continue;
      }
      let i10 = this.activeTouches[r11.identifier], a10 = this.newGestureEvent(tx.Change, i10.initialTarget);
      a10.translationX = r11.pageX - i10.rollingPageX.at(-1), a10.translationY = r11.pageY - i10.rollingPageY.at(-1), a10.pageX = r11.pageX, a10.pageY = r11.pageY, this.dispatchEvent(a10), i10.rollingPageX.length > 3 && (i10.rollingPageX.shift(), i10.rollingPageY.shift(), i10.rollingTimestamps.shift()), i10.rollingPageX.push(r11.pageX), i10.rollingPageY.push(r11.pageY), i10.rollingTimestamps.push(t10);
    }
    this.dispatched && (this.dispatched = (e206.preventDefault(), e206.stopPropagation(), false));
  }
}, _aa.SCROLL_FRICTION = -5e-3, _aa.HOLD_DELAY = 700, _aa.CLEAR_TAP_COUNT_TIME = 400, _aa);
Poe([ex], nx, `isTouchDevice`, null);
var rx = class extends D {
  onclick(e206, t10) {
    this._register(L(e206, R.CLICK, (n10) => t10(new Xo(Vc(e206), n10))));
  }
  onmousedown(e206, t10) {
    this._register(L(e206, R.MOUSE_DOWN, (n10) => t10(new Xo(Vc(e206), n10))));
  }
  onmouseover(e206, t10) {
    this._register(L(e206, R.MOUSE_OVER, (n10) => t10(new Xo(Vc(e206), n10))));
  }
  onmouseleave(e206, t10) {
    this._register(L(e206, R.MOUSE_LEAVE, (n10) => t10(new Xo(Vc(e206), n10))));
  }
  onkeydown(e206, t10) {
    this._register(L(e206, R.KEY_DOWN, (e207) => t10(new Jo(e207))));
  }
  onkeyup(e206, t10) {
    this._register(L(e206, R.KEY_UP, (e207) => t10(new Jo(e207))));
  }
  oninput(e206, t10) {
    this._register(L(e206, R.INPUT, t10));
  }
  onblur(e206, t10) {
    this._register(L(e206, R.BLUR, t10));
  }
  onfocus(e206, t10) {
    this._register(L(e206, R.FOCUS, t10));
  }
  ignoreGesture(e206) {
    return nx.ignoreTarget(e206);
  }
}, Foe = class extends rx {
  constructor(e206) {
    super(), this._onActivate = e206.onActivate, this.bgDomNode = document.createElement(`div`), this.bgDomNode.className = `arrow-background`, this.bgDomNode.style.position = `absolute`, this.bgDomNode.style.width = e206.bgWidth + `px`, this.bgDomNode.style.height = e206.bgHeight + `px`, e206.top !== void 0 && (this.bgDomNode.style.top = `0px`), e206.left !== void 0 && (this.bgDomNode.style.left = `0px`), e206.bottom !== void 0 && (this.bgDomNode.style.bottom = `0px`), e206.right !== void 0 && (this.bgDomNode.style.right = `0px`), this.domNode = document.createElement(`div`), this.domNode.className = e206.className, this.domNode.classList.add(...ju.asClassNameArray(e206.icon)), this.domNode.style.position = `absolute`, this.domNode.style.width = `11px`, this.domNode.style.height = `11px`, e206.top !== void 0 && (this.domNode.style.top = e206.top + `px`), e206.left !== void 0 && (this.domNode.style.left = e206.left + `px`), e206.bottom !== void 0 && (this.domNode.style.bottom = e206.bottom + `px`), e206.right !== void 0 && (this.domNode.style.right = e206.right + `px`), this._pointerMoveMonitor = this._register(new T_()), this._register(el(this.bgDomNode, R.POINTER_DOWN, (e207) => this._arrowPointerDown(e207))), this._register(el(this.domNode, R.POINTER_DOWN, (e207) => this._arrowPointerDown(e207))), this._pointerdownRepeatTimer = this._register(new ll()), this._pointerdownScheduleRepeatTimer = this._register(new cs());
  }
  _arrowPointerDown(e206) {
    !e206.target || !(e206.target instanceof Element) || (this._onActivate(), this._pointerdownRepeatTimer.cancel(), this._pointerdownScheduleRepeatTimer.cancelAndSet(() => {
      this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1e3 / 24, Vc(e206));
    }, 200), this._pointerMoveMonitor.startMonitoring(e206.target, e206.pointerId, e206.buttons, (e207) => {
    }, () => {
      this._pointerdownRepeatTimer.cancel(), this._pointerdownScheduleRepeatTimer.cancel();
    }), e206.preventDefault());
  }
}, Ioe = class extends D {
  constructor(e206, t10, n10) {
    super(), this._visibility = e206, this._visibleClassName = t10, this._invisibleClassName = n10, this._domNode = null, this._isVisible = false, this._isNeeded = false, this._rawShouldBeVisible = false, this._shouldBeVisible = false, this._revealTimer = this._register(new cs());
  }
  setVisibility(e206) {
    this._visibility !== e206 && (this._visibility = e206, this._updateShouldBeVisible());
  }
  setShouldBeVisible(e206) {
    this._rawShouldBeVisible = e206, this._updateShouldBeVisible();
  }
  _applyVisibilitySetting() {
    return this._visibility === 2 ? false : this._visibility === 3 ? true : this._rawShouldBeVisible;
  }
  _updateShouldBeVisible() {
    let e206 = this._applyVisibilitySetting();
    this._shouldBeVisible !== e206 && (this._shouldBeVisible = e206, this.ensureVisibility());
  }
  setIsNeeded(e206) {
    this._isNeeded !== e206 && (this._isNeeded = e206, this.ensureVisibility());
  }
  setDomNode(e206) {
    this._domNode = e206, this._domNode.setClassName(this._invisibleClassName), this.setShouldBeVisible(false);
  }
  ensureVisibility() {
    if (!this._isNeeded) {
      this._hide(false);
      return;
    }
    this._shouldBeVisible ? this._reveal() : this._hide(true);
  }
  _reveal() {
    this._isVisible || (this._isVisible = true, this._revealTimer.setIfNotSet(() => {
      this._domNode?.setClassName(this._visibleClassName);
    }, 0));
  }
  _hide(e206) {
    this._revealTimer.cancel(), this._isVisible && (this._isVisible = false, this._domNode?.setClassName(this._invisibleClassName + (e206 ? ` fade` : ``)));
  }
}, Loe = 140, ix = class extends rx {
  constructor(e206) {
    super(), this._lazyRender = e206.lazyRender, this._host = e206.host, this._scrollable = e206.scrollable, this._scrollByPage = e206.scrollByPage, this._scrollbarState = e206.scrollbarState, this._visibilityController = this._register(new Ioe(e206.visibility, `visible scrollbar ` + e206.extraScrollbarClassName, `invisible scrollbar ` + e206.extraScrollbarClassName)), this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._pointerMoveMonitor = this._register(new T_()), this._shouldRender = true, this.domNode = _u(document.createElement(`div`)), this.domNode.setAttribute(`role`, `presentation`), this.domNode.setAttribute(`aria-hidden`, `true`), this._visibilityController.setDomNode(this.domNode), this.domNode.setPosition(`absolute`), this._register(L(this.domNode.domNode, R.POINTER_DOWN, (e207) => this._domNodePointerDown(e207)));
  }
  _createArrow(e206) {
    let t10 = this._register(new Foe(e206));
    this.domNode.domNode.appendChild(t10.bgDomNode), this.domNode.domNode.appendChild(t10.domNode);
  }
  _createSlider(e206, t10, n10, r10) {
    this.slider = _u(document.createElement(`div`)), this.slider.setClassName(`slider`), this.slider.setPosition(`absolute`), this.slider.setTop(e206), this.slider.setLeft(t10), typeof n10 == `number` && this.slider.setWidth(n10), typeof r10 == `number` && this.slider.setHeight(r10), this.slider.setLayerHinting(true), this.slider.setContain(`strict`), this.domNode.domNode.appendChild(this.slider.domNode), this._register(L(this.slider.domNode, R.POINTER_DOWN, (e207) => {
      e207.button === 0 && (e207.preventDefault(), this._sliderPointerDown(e207));
    })), this.onclick(this.slider.domNode, (e207) => {
      e207.leftButton && e207.stopPropagation();
    });
  }
  _onElementSize(e206) {
    return this._scrollbarState.setVisibleSize(e206) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = true, this._lazyRender || this.render()), this._shouldRender;
  }
  _onElementScrollSize(e206) {
    return this._scrollbarState.setScrollSize(e206) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = true, this._lazyRender || this.render()), this._shouldRender;
  }
  _onElementScrollPosition(e206) {
    return this._scrollbarState.setScrollPosition(e206) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = true, this._lazyRender || this.render()), this._shouldRender;
  }
  beginReveal() {
    this._visibilityController.setShouldBeVisible(true);
  }
  beginHide() {
    this._visibilityController.setShouldBeVisible(false);
  }
  render() {
    this._shouldRender && (this._shouldRender = false, this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize()), this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition()));
  }
  _domNodePointerDown(e206) {
    e206.target === this.domNode.domNode && this._onPointerDown(e206);
  }
  delegatePointerDown(e206) {
    let t10 = this.domNode.domNode.getClientRects()[0].top, n10 = t10 + this._scrollbarState.getSliderPosition(), r10 = t10 + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize(), i10 = this._sliderPointerPosition(e206);
    n10 <= i10 && i10 <= r10 ? e206.button === 0 && (e206.preventDefault(), this._sliderPointerDown(e206)) : this._onPointerDown(e206);
  }
  _onPointerDown(e206) {
    let t10, n10;
    if (e206.target === this.domNode.domNode && typeof e206.offsetX == `number` && typeof e206.offsetY == `number`) t10 = e206.offsetX, n10 = e206.offsetY;
    else {
      let r11 = _l2(this.domNode.domNode);
      t10 = e206.pageX - r11.left, n10 = e206.pageY - r11.top;
    }
    let r10 = e206.pointerType === `mouse`, i10 = e206.button === 0;
    if (i10 || !r10) {
      let e207 = this._pointerDownRelativePosition(t10, n10);
      this._setDesiredScrollPositionNow(this._scrollByPage ? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(e207) : this._scrollbarState.getDesiredScrollPositionFromOffset(e207));
    }
    i10 && (e206.preventDefault(), this._sliderPointerDown(e206));
  }
  _sliderPointerDown(e206) {
    if (!e206.target || !(e206.target instanceof Element)) return;
    let t10 = this._sliderPointerPosition(e206), n10 = this._sliderOrthogonalPointerPosition(e206), r10 = this._scrollbarState.clone();
    this.slider.toggleClassName(`active`, true), this._pointerMoveMonitor.startMonitoring(e206.target, e206.pointerId, e206.buttons, (e207) => {
      let i10 = this._sliderOrthogonalPointerPosition(e207), a10 = Math.abs(i10 - n10);
      if (wt && a10 > Loe) {
        this._setDesiredScrollPositionNow(r10.getScrollPosition());
        return;
      }
      let o10 = this._sliderPointerPosition(e207) - t10;
      this._setDesiredScrollPositionNow(r10.getDesiredScrollPositionFromDelta(o10));
    }, () => {
      this.slider.toggleClassName(`active`, false), this._host.onDragEnd();
    }), this._host.onDragStart();
  }
  _setDesiredScrollPositionNow(e206) {
    let t10 = {};
    this.writeScrollPosition(t10, e206), this._scrollable.setScrollPositionNow(t10);
  }
  updateScrollbarSize(e206) {
    this._updateScrollbarSize(e206), this._scrollbarState.setScrollbarSize(e206), this._shouldRender = true, this._lazyRender || this.render();
  }
  isNeeded() {
    return this._scrollbarState.isNeeded();
  }
}, Roe = 20, ax = class e80 {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._scrollbarSize = Math.round(t10), this._oppositeScrollbarSize = Math.round(n10), this._arrowSize = Math.round(e206), this._visibleSize = r10, this._scrollSize = i10, this._scrollPosition = a10, this._computedAvailableSize = 0, this._computedIsNeeded = false, this._computedSliderSize = 0, this._computedSliderRatio = 0, this._computedSliderPosition = 0, this._refreshComputedValues();
  }
  clone() {
    return new e80(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition);
  }
  setVisibleSize(e206) {
    let t10 = Math.round(e206);
    return this._visibleSize === t10 ? false : (this._visibleSize = t10, this._refreshComputedValues(), true);
  }
  setScrollSize(e206) {
    let t10 = Math.round(e206);
    return this._scrollSize === t10 ? false : (this._scrollSize = t10, this._refreshComputedValues(), true);
  }
  setScrollPosition(e206) {
    let t10 = Math.round(e206);
    return this._scrollPosition === t10 ? false : (this._scrollPosition = t10, this._refreshComputedValues(), true);
  }
  setScrollbarSize(e206) {
    this._scrollbarSize = Math.round(e206);
  }
  setOppositeScrollbarSize(e206) {
    this._oppositeScrollbarSize = Math.round(e206);
  }
  static _computeValues(e206, t10, n10, r10, i10) {
    let a10 = Math.max(0, n10 - e206), o10 = Math.max(0, a10 - 2 * t10), s10 = r10 > 0 && r10 > n10;
    if (!s10) return { computedAvailableSize: Math.round(a10), computedIsNeeded: s10, computedSliderSize: Math.round(o10), computedSliderRatio: 0, computedSliderPosition: 0 };
    let c10 = Math.round(Math.max(Roe, Math.floor(n10 * o10 / r10))), l10 = (o10 - c10) / (r10 - n10), u10 = i10 * l10;
    return { computedAvailableSize: Math.round(a10), computedIsNeeded: s10, computedSliderSize: Math.round(c10), computedSliderRatio: l10, computedSliderPosition: Math.round(u10) };
  }
  _refreshComputedValues() {
    let t10 = e80._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition);
    this._computedAvailableSize = t10.computedAvailableSize, this._computedIsNeeded = t10.computedIsNeeded, this._computedSliderSize = t10.computedSliderSize, this._computedSliderRatio = t10.computedSliderRatio, this._computedSliderPosition = t10.computedSliderPosition;
  }
  getArrowSize() {
    return this._arrowSize;
  }
  getScrollPosition() {
    return this._scrollPosition;
  }
  getRectangleLargeSize() {
    return this._computedAvailableSize;
  }
  getRectangleSmallSize() {
    return this._scrollbarSize;
  }
  isNeeded() {
    return this._computedIsNeeded;
  }
  getSliderSize() {
    return this._computedSliderSize;
  }
  getSliderPosition() {
    return this._computedSliderPosition;
  }
  getDesiredScrollPositionFromOffset(e206) {
    if (!this._computedIsNeeded) return 0;
    let t10 = e206 - this._arrowSize - this._computedSliderSize / 2;
    return Math.round(t10 / this._computedSliderRatio);
  }
  getDesiredScrollPositionFromOffsetPaged(e206) {
    if (!this._computedIsNeeded) return 0;
    let t10 = e206 - this._arrowSize, n10 = this._scrollPosition;
    return t10 < this._computedSliderPosition ? n10 -= this._visibleSize : n10 += this._visibleSize, n10;
  }
  getDesiredScrollPositionFromDelta(e206) {
    if (!this._computedIsNeeded) return 0;
    let t10 = this._computedSliderPosition + e206;
    return Math.round(t10 / this._computedSliderRatio);
  }
}, zoe = class extends ix {
  constructor(e206, t10, n10) {
    let r10 = e206.getScrollDimensions(), i10 = e206.getCurrentScrollPosition();
    if (super({ lazyRender: t10.lazyRender, host: n10, scrollbarState: new ax(t10.horizontalHasArrows ? t10.arrowSize : 0, t10.horizontal === 2 ? 0 : t10.horizontalScrollbarSize, t10.vertical === 2 ? 0 : t10.verticalScrollbarSize, r10.width, r10.scrollWidth, i10.scrollLeft), visibility: t10.horizontal, extraScrollbarClassName: `horizontal`, scrollable: e206, scrollByPage: t10.scrollByPage }), t10.horizontalHasArrows) {
      let e207 = (t10.arrowSize - 11) / 2, n11 = (t10.horizontalScrollbarSize - 11) / 2;
      this._createArrow({ className: `scra`, icon: F.scrollbarButtonLeft, top: n11, left: e207, bottom: void 0, right: void 0, bgWidth: t10.arrowSize, bgHeight: t10.horizontalScrollbarSize, onActivate: () => this._host.onMouseWheel(new Zo(null, 1, 0)) }), this._createArrow({ className: `scra`, icon: F.scrollbarButtonRight, top: n11, left: void 0, bottom: void 0, right: e207, bgWidth: t10.arrowSize, bgHeight: t10.horizontalScrollbarSize, onActivate: () => this._host.onMouseWheel(new Zo(null, -1, 0)) });
    }
    this._createSlider(Math.floor((t10.horizontalScrollbarSize - t10.horizontalSliderSize) / 2), 0, void 0, t10.horizontalSliderSize);
  }
  _updateSlider(e206, t10) {
    this.slider.setWidth(e206), this.slider.setLeft(t10);
  }
  _renderDomNode(e206, t10) {
    this.domNode.setWidth(e206), this.domNode.setHeight(t10), this.domNode.setLeft(0), this.domNode.setBottom(0);
  }
  onDidScroll(e206) {
    return this._shouldRender = this._onElementScrollSize(e206.scrollWidth) || this._shouldRender, this._shouldRender = this._onElementScrollPosition(e206.scrollLeft) || this._shouldRender, this._shouldRender = this._onElementSize(e206.width) || this._shouldRender, this._shouldRender;
  }
  _pointerDownRelativePosition(e206, t10) {
    return e206;
  }
  _sliderPointerPosition(e206) {
    return e206.pageX;
  }
  _sliderOrthogonalPointerPosition(e206) {
    return e206.pageY;
  }
  _updateScrollbarSize(e206) {
    this.slider.setHeight(e206);
  }
  writeScrollPosition(e206, t10) {
    e206.scrollLeft = t10;
  }
  updateOptions(e206) {
    this.updateScrollbarSize(e206.horizontal === 2 ? 0 : e206.horizontalScrollbarSize), this._scrollbarState.setOppositeScrollbarSize(e206.vertical === 2 ? 0 : e206.verticalScrollbarSize), this._visibilityController.setVisibility(e206.horizontal), this._scrollByPage = e206.scrollByPage;
  }
}, Boe = class extends ix {
  constructor(e206, t10, n10) {
    let r10 = e206.getScrollDimensions(), i10 = e206.getCurrentScrollPosition();
    if (super({ lazyRender: t10.lazyRender, host: n10, scrollbarState: new ax(t10.verticalHasArrows ? t10.arrowSize : 0, t10.vertical === 2 ? 0 : t10.verticalScrollbarSize, 0, r10.height, r10.scrollHeight, i10.scrollTop), visibility: t10.vertical, extraScrollbarClassName: `vertical`, scrollable: e206, scrollByPage: t10.scrollByPage }), t10.verticalHasArrows) {
      let e207 = (t10.arrowSize - 11) / 2, n11 = (t10.verticalScrollbarSize - 11) / 2;
      this._createArrow({ className: `scra`, icon: F.scrollbarButtonUp, top: e207, left: n11, bottom: void 0, right: void 0, bgWidth: t10.verticalScrollbarSize, bgHeight: t10.arrowSize, onActivate: () => this._host.onMouseWheel(new Zo(null, 0, 1)) }), this._createArrow({ className: `scra`, icon: F.scrollbarButtonDown, top: void 0, left: n11, bottom: e207, right: void 0, bgWidth: t10.verticalScrollbarSize, bgHeight: t10.arrowSize, onActivate: () => this._host.onMouseWheel(new Zo(null, 0, -1)) });
    }
    this._createSlider(0, Math.floor((t10.verticalScrollbarSize - t10.verticalSliderSize) / 2), t10.verticalSliderSize, void 0);
  }
  _updateSlider(e206, t10) {
    this.slider.setHeight(e206), this.slider.setTop(t10);
  }
  _renderDomNode(e206, t10) {
    this.domNode.setWidth(t10), this.domNode.setHeight(e206), this.domNode.setRight(0), this.domNode.setTop(0);
  }
  onDidScroll(e206) {
    return this._shouldRender = this._onElementScrollSize(e206.scrollHeight) || this._shouldRender, this._shouldRender = this._onElementScrollPosition(e206.scrollTop) || this._shouldRender, this._shouldRender = this._onElementSize(e206.height) || this._shouldRender, this._shouldRender;
  }
  _pointerDownRelativePosition(e206, t10) {
    return t10;
  }
  _sliderPointerPosition(e206) {
    return e206.pageY;
  }
  _sliderOrthogonalPointerPosition(e206) {
    return e206.pageX;
  }
  _updateScrollbarSize(e206) {
    this.slider.setWidth(e206);
  }
  writeScrollPosition(e206, t10) {
    e206.scrollTop = t10;
  }
  updateOptions(e206) {
    this.updateScrollbarSize(e206.vertical === 2 ? 0 : e206.verticalScrollbarSize), this._scrollbarState.setOppositeScrollbarSize(0), this._visibilityController.setVisibility(e206.vertical), this._scrollByPage = e206.scrollByPage;
  }
}, Voe = class e81 {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this._forceIntegerValues = e206, this._scrollStateBrand = void 0, this._forceIntegerValues && (t10 |= 0, n10 |= 0, r10 |= 0, i10 |= 0, a10 |= 0, o10 |= 0), this.rawScrollLeft = r10, this.rawScrollTop = o10, t10 < 0 && (t10 = 0), r10 + t10 > n10 && (r10 = n10 - t10), r10 < 0 && (r10 = 0), i10 < 0 && (i10 = 0), o10 + i10 > a10 && (o10 = a10 - i10), o10 < 0 && (o10 = 0), this.width = t10, this.scrollWidth = n10, this.scrollLeft = r10, this.height = i10, this.scrollHeight = a10, this.scrollTop = o10;
  }
  equals(e206) {
    return this.rawScrollLeft === e206.rawScrollLeft && this.rawScrollTop === e206.rawScrollTop && this.width === e206.width && this.scrollWidth === e206.scrollWidth && this.scrollLeft === e206.scrollLeft && this.height === e206.height && this.scrollHeight === e206.scrollHeight && this.scrollTop === e206.scrollTop;
  }
  withScrollDimensions(t10, n10) {
    return new e81(this._forceIntegerValues, t10.width === void 0 ? this.width : t10.width, t10.scrollWidth === void 0 ? this.scrollWidth : t10.scrollWidth, n10 ? this.rawScrollLeft : this.scrollLeft, t10.height === void 0 ? this.height : t10.height, t10.scrollHeight === void 0 ? this.scrollHeight : t10.scrollHeight, n10 ? this.rawScrollTop : this.scrollTop);
  }
  withScrollPosition(t10) {
    return new e81(this._forceIntegerValues, this.width, this.scrollWidth, t10.scrollLeft === void 0 ? this.rawScrollLeft : t10.scrollLeft, this.height, this.scrollHeight, t10.scrollTop === void 0 ? this.rawScrollTop : t10.scrollTop);
  }
  createScrollEvent(e206, t10) {
    let n10 = this.width !== e206.width, r10 = this.scrollWidth !== e206.scrollWidth, i10 = this.scrollLeft !== e206.scrollLeft, a10 = this.height !== e206.height, o10 = this.scrollHeight !== e206.scrollHeight, s10 = this.scrollTop !== e206.scrollTop;
    return { inSmoothScrolling: t10, oldWidth: e206.width, oldScrollWidth: e206.scrollWidth, oldScrollLeft: e206.scrollLeft, width: this.width, scrollWidth: this.scrollWidth, scrollLeft: this.scrollLeft, oldHeight: e206.height, oldScrollHeight: e206.scrollHeight, oldScrollTop: e206.scrollTop, height: this.height, scrollHeight: this.scrollHeight, scrollTop: this.scrollTop, widthChanged: n10, scrollWidthChanged: r10, scrollLeftChanged: i10, heightChanged: a10, scrollHeightChanged: o10, scrollTopChanged: s10 };
  }
}, ox = class extends D {
  constructor(e206) {
    super(), this._scrollableBrand = void 0, this._onScroll = this._register(new k()), this.onScroll = this._onScroll.event, this._smoothScrollDuration = e206.smoothScrollDuration, this._scheduleAtNextAnimationFrame = e206.scheduleAtNextAnimationFrame, this._state = new Voe(e206.forceIntegerValues, 0, 0, 0, 0, 0, 0), this._smoothScrolling = null;
  }
  dispose() {
    this._smoothScrolling && (this._smoothScrolling = (this._smoothScrolling.dispose(), null)), super.dispose();
  }
  setSmoothScrollDuration(e206) {
    this._smoothScrollDuration = e206;
  }
  validateScrollPosition(e206) {
    return this._state.withScrollPosition(e206);
  }
  getScrollDimensions() {
    return this._state;
  }
  setScrollDimensions(e206, t10) {
    let n10 = this._state.withScrollDimensions(e206, t10);
    this._setState(n10, !!this._smoothScrolling), this._smoothScrolling?.acceptScrollDimensions(this._state);
  }
  getFutureScrollPosition() {
    return this._smoothScrolling ? this._smoothScrolling.to : this._state;
  }
  getCurrentScrollPosition() {
    return this._state;
  }
  setScrollPositionNow(e206) {
    let t10 = this._state.withScrollPosition(e206);
    this._smoothScrolling && (this._smoothScrolling = (this._smoothScrolling.dispose(), null)), this._setState(t10, false);
  }
  setScrollPositionSmooth(e206, t10) {
    if (this._smoothScrollDuration === 0) return this.setScrollPositionNow(e206);
    if (this._smoothScrolling) {
      e206 = { scrollLeft: e206.scrollLeft === void 0 ? this._smoothScrolling.to.scrollLeft : e206.scrollLeft, scrollTop: e206.scrollTop === void 0 ? this._smoothScrolling.to.scrollTop : e206.scrollTop };
      let n10 = this._state.withScrollPosition(e206);
      if (this._smoothScrolling.to.scrollLeft === n10.scrollLeft && this._smoothScrolling.to.scrollTop === n10.scrollTop) return;
      let r10;
      r10 = t10 ? new lx(this._smoothScrolling.from, n10, this._smoothScrolling.startTime, this._smoothScrolling.duration) : this._smoothScrolling.combine(this._state, n10, this._smoothScrollDuration), this._smoothScrolling.dispose(), this._smoothScrolling = r10;
    } else {
      let t11 = this._state.withScrollPosition(e206);
      this._smoothScrolling = lx.start(this._state, t11, this._smoothScrollDuration);
    }
    this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
      this._smoothScrolling && (this._smoothScrolling.animationFrameDisposable = null, this._performSmoothScrolling());
    });
  }
  hasPendingScrollAnimation() {
    return !!this._smoothScrolling;
  }
  _performSmoothScrolling() {
    if (!this._smoothScrolling) return;
    let e206 = this._smoothScrolling.tick(), t10 = this._state.withScrollPosition(e206);
    if (this._setState(t10, true), this._smoothScrolling) {
      if (e206.isDone) {
        this._smoothScrolling.dispose(), this._smoothScrolling = null;
        return;
      }
      this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
        this._smoothScrolling && (this._smoothScrolling.animationFrameDisposable = null, this._performSmoothScrolling());
      });
    }
  }
  _setState(e206, t10) {
    let n10 = this._state;
    n10.equals(e206) || (this._state = e206, this._onScroll.fire(this._state.createScrollEvent(n10, t10)));
  }
}, sx = class {
  constructor(e206, t10, n10) {
    this.scrollLeft = e206, this.scrollTop = t10, this.isDone = n10;
  }
};
function cx(e206, t10) {
  let n10 = t10 - e206;
  return function(t11) {
    return e206 + n10 * Woe(t11);
  };
}
function Hoe(e206, t10, n10) {
  return function(r10) {
    return r10 < n10 ? e206(r10 / n10) : t10((r10 - n10) / (1 - n10));
  };
}
var lx = class e82 {
  constructor(e206, t10, n10, r10) {
    this.from = e206, this.to = t10, this.duration = r10, this.startTime = n10, this.animationFrameDisposable = null, this._initAnimations();
  }
  _initAnimations() {
    this.scrollLeft = this._initAnimation(this.from.scrollLeft, this.to.scrollLeft, this.to.width), this.scrollTop = this._initAnimation(this.from.scrollTop, this.to.scrollTop, this.to.height);
  }
  _initAnimation(e206, t10, n10) {
    if (Math.abs(e206 - t10) > 2.5 * n10) {
      let r10, i10;
      return e206 < t10 ? (r10 = e206 + 0.75 * n10, i10 = t10 - 0.75 * n10) : (r10 = e206 - 0.75 * n10, i10 = t10 + 0.75 * n10), Hoe(cx(e206, r10), cx(i10, t10), 0.33);
    }
    return cx(e206, t10);
  }
  dispose() {
    this.animationFrameDisposable !== null && (this.animationFrameDisposable.dispose(), this.animationFrameDisposable = null);
  }
  acceptScrollDimensions(e206) {
    this.to = e206.withScrollPosition(this.to), this._initAnimations();
  }
  tick() {
    return this._tick(Date.now());
  }
  _tick(e206) {
    let t10 = (e206 - this.startTime) / this.duration;
    return t10 < 1 ? new sx(this.scrollLeft(t10), this.scrollTop(t10), false) : new sx(this.to.scrollLeft, this.to.scrollTop, true);
  }
  combine(t10, n10, r10) {
    return e82.start(t10, n10, r10);
  }
  static start(t10, n10, r10) {
    return r10 += 10, new e82(t10, n10, Date.now() - 10, r10);
  }
};
function Uoe(e206) {
  return e206 ** 3;
}
function Woe(e206) {
  return 1 - Uoe(1 - e206);
}
var Goe = 500, ux = 50, Koe = class {
  constructor(e206, t10, n10) {
    this.timestamp = e206, this.deltaX = t10, this.deltaY = n10, this.score = 0;
  }
}, dx = (_ba = class {
  constructor() {
    this._capacity = 5, this._memory = [], this._front = -1, this._rear = -1;
  }
  isPhysicalMouseWheel() {
    if (this._front === -1 && this._rear === -1) return false;
    let e206 = 1, t10 = 0, n10 = 1, r10 = this._rear;
    do {
      let i10 = r10 === this._front ? e206 : 2 ** -n10;
      if (e206 -= i10, t10 += this._memory[r10].score * i10, r10 === this._front) break;
      r10 = (this._capacity + r10 - 1) % this._capacity, n10++;
    } while (true);
    return t10 <= 0.5;
  }
  acceptStandardWheelEvent(e206) {
    if (Po) {
      let t10 = Ao(Vc(e206.browserEvent));
      this.accept(Date.now(), e206.deltaX * t10, e206.deltaY * t10);
    } else this.accept(Date.now(), e206.deltaX, e206.deltaY);
  }
  accept(e206, t10, n10) {
    let r10 = null, i10 = new Koe(e206, t10, n10);
    this._front === -1 && this._rear === -1 ? (this._memory[0] = i10, this._front = 0, this._rear = 0) : (r10 = this._memory[this._rear], this._rear = (this._rear + 1) % this._capacity, this._rear === this._front && (this._front = (this._front + 1) % this._capacity), this._memory[this._rear] = i10), i10.score = this._computeScore(i10, r10);
  }
  _computeScore(e206, t10) {
    if (Math.abs(e206.deltaX) > 0 && Math.abs(e206.deltaY) > 0) return 1;
    let n10 = 0.5;
    if ((!this._isAlmostInt(e206.deltaX) || !this._isAlmostInt(e206.deltaY)) && (n10 += 0.25), t10) {
      let r10 = Math.abs(e206.deltaX), i10 = Math.abs(e206.deltaY), a10 = Math.abs(t10.deltaX), o10 = Math.abs(t10.deltaY), s10 = Math.max(Math.min(r10, a10), 1), c10 = Math.max(Math.min(i10, o10), 1), l10 = Math.max(r10, a10), u10 = Math.max(i10, o10);
      l10 % s10 === 0 && u10 % c10 === 0 && (n10 -= 0.5);
    }
    return Math.min(Math.max(n10, 0), 1);
  }
  _isAlmostInt(e206) {
    return Math.abs(Math.round(e206) - e206) < 0.01 + 2 ** -52 * 100;
  }
}, _ba.INSTANCE = new _ba(), _ba), fx = class extends rx {
  get onScroll() {
    return this._onScroll.event;
  }
  get options() {
    return this._options;
  }
  constructor(e206, t10, n10) {
    super(), this._inertialTimeout = null, this._inertialSpeed = { X: 0, Y: 0 }, this._onScroll = this._register(new k()), this._onWillScroll = this._register(new k()), e206.style.overflow = `hidden`, this._options = qoe(t10), this._scrollable = n10, this._register(this._scrollable.onScroll((e207) => {
      this._onWillScroll.fire(e207), this._onDidScroll(e207), this._onScroll.fire(e207);
    }));
    let r10 = { onMouseWheel: (e207) => this._onMouseWheel(e207), onDragStart: () => this._onDragStart(), onDragEnd: () => this._onDragEnd() };
    this._verticalScrollbar = this._register(new Boe(this._scrollable, this._options, r10)), this._horizontalScrollbar = this._register(new zoe(this._scrollable, this._options, r10)), this._domNode = document.createElement(`div`), this._domNode.className = `monaco-scrollable-element ` + this._options.className, this._domNode.setAttribute(`role`, `presentation`), this._domNode.style.position = `relative`, this._domNode.style.overflow = `hidden`, this._domNode.appendChild(e206), this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode), this._domNode.appendChild(this._verticalScrollbar.domNode.domNode), this._options.useShadows ? (this._leftShadowDomNode = _u(document.createElement(`div`)), this._leftShadowDomNode.setClassName(`shadow`), this._domNode.appendChild(this._leftShadowDomNode.domNode), this._topShadowDomNode = _u(document.createElement(`div`)), this._topShadowDomNode.setClassName(`shadow`), this._domNode.appendChild(this._topShadowDomNode.domNode), this._topLeftShadowDomNode = _u(document.createElement(`div`)), this._topLeftShadowDomNode.setClassName(`shadow`), this._domNode.appendChild(this._topLeftShadowDomNode.domNode)) : (this._leftShadowDomNode = null, this._topShadowDomNode = null, this._topLeftShadowDomNode = null), this._listenOnDomNode = this._options.listenOnDomNode || this._domNode, this._mouseWheelToDispose = [], this._setListeningToMouseWheel(this._options.handleMouseWheel), this.onmouseover(this._listenOnDomNode, (e207) => this._onMouseOver(e207)), this.onmouseleave(this._listenOnDomNode, (e207) => this._onMouseLeave(e207)), this._hideTimeout = this._register(new cs()), this._isDragging = false, this._mouseIsOver = false, this._shouldRender = true, this._revealOnScroll = true;
  }
  dispose() {
    this._mouseWheelToDispose = Kt(this._mouseWheelToDispose), this._inertialTimeout && (this._inertialTimeout = (this._inertialTimeout.dispose(), null)), super.dispose();
  }
  getDomNode() {
    return this._domNode;
  }
  getOverviewRulerLayoutInfo() {
    return { parent: this._domNode, insertBefore: this._verticalScrollbar.domNode.domNode };
  }
  delegateVerticalScrollbarPointerDown(e206) {
    this._verticalScrollbar.delegatePointerDown(e206);
  }
  getScrollDimensions() {
    return this._scrollable.getScrollDimensions();
  }
  setScrollDimensions(e206) {
    this._scrollable.setScrollDimensions(e206, false);
  }
  updateClassName(e206) {
    this._options.className = e206, Tt && (this._options.className += ` mac`), this._domNode.className = `monaco-scrollable-element ` + this._options.className;
  }
  updateOptions(e206) {
    e206.handleMouseWheel !== void 0 && (this._options.handleMouseWheel = e206.handleMouseWheel, this._setListeningToMouseWheel(this._options.handleMouseWheel)), e206.mouseWheelScrollSensitivity !== void 0 && (this._options.mouseWheelScrollSensitivity = e206.mouseWheelScrollSensitivity), e206.fastScrollSensitivity !== void 0 && (this._options.fastScrollSensitivity = e206.fastScrollSensitivity), e206.scrollPredominantAxis !== void 0 && (this._options.scrollPredominantAxis = e206.scrollPredominantAxis), e206.horizontal !== void 0 && (this._options.horizontal = e206.horizontal), e206.vertical !== void 0 && (this._options.vertical = e206.vertical), e206.horizontalScrollbarSize !== void 0 && (this._options.horizontalScrollbarSize = e206.horizontalScrollbarSize), e206.verticalScrollbarSize !== void 0 && (this._options.verticalScrollbarSize = e206.verticalScrollbarSize), e206.scrollByPage !== void 0 && (this._options.scrollByPage = e206.scrollByPage), this._horizontalScrollbar.updateOptions(this._options), this._verticalScrollbar.updateOptions(this._options), this._options.lazyRender || this._render();
  }
  delegateScrollFromMouseWheelEvent(e206) {
    this._onMouseWheel(new Zo(e206));
  }
  async _periodicSync() {
    let e206 = false;
    (this._inertialSpeed.X !== 0 || this._inertialSpeed.Y !== 0) && (this._scrollable.setScrollPositionNow({ scrollTop: this._scrollable.getCurrentScrollPosition().scrollTop - this._inertialSpeed.Y * 100, scrollLeft: this._scrollable.getCurrentScrollPosition().scrollLeft - this._inertialSpeed.X * 100 }), this._inertialSpeed.X *= 0.9, this._inertialSpeed.Y *= 0.9, Math.abs(this._inertialSpeed.X) < 0.01 && (this._inertialSpeed.X = 0), Math.abs(this._inertialSpeed.Y) < 0.01 && (this._inertialSpeed.Y = 0), e206 = this._inertialSpeed.X !== 0 || this._inertialSpeed.Y !== 0), e206 ? (this._inertialTimeout || (this._inertialTimeout = new cs()), this._inertialTimeout.cancelAndSet(() => this._periodicSync(), 1e3 / 60)) : (this._inertialTimeout?.dispose(), this._inertialTimeout = null);
  }
  _setListeningToMouseWheel(e206) {
    this._mouseWheelToDispose.length > 0 !== e206 && (this._mouseWheelToDispose = Kt(this._mouseWheelToDispose), e206 && this._mouseWheelToDispose.push(L(this._listenOnDomNode, R.MOUSE_WHEEL, (e207) => {
      this._onMouseWheel(new Zo(e207));
    }, { passive: false })));
  }
  _onMouseWheel(e206) {
    if (e206.browserEvent?.defaultPrevented) return;
    let t10 = dx.INSTANCE;
    t10.acceptStandardWheelEvent(e206);
    let n10 = false;
    if (e206.deltaY || e206.deltaX) {
      let r11 = e206.deltaY * this._options.mouseWheelScrollSensitivity, i10 = e206.deltaX * this._options.mouseWheelScrollSensitivity;
      this._options.scrollPredominantAxis && (this._options.scrollYToX && i10 + r11 === 0 ? i10 = r11 = 0 : Math.abs(r11) >= Math.abs(i10) ? i10 = 0 : r11 = 0), this._options.flipAxes && ([r11, i10] = [i10, r11]);
      let a10 = !Tt && e206.browserEvent && e206.browserEvent.shiftKey;
      (this._options.scrollYToX || a10) && !i10 && (i10 = r11, r11 = 0), e206.browserEvent && e206.browserEvent.altKey && (i10 *= this._options.fastScrollSensitivity, r11 *= this._options.fastScrollSensitivity);
      let o10 = this._scrollable.getFutureScrollPosition(), s10 = {};
      if (r11) {
        let e207 = ux * r11, t11 = o10.scrollTop - (e207 < 0 ? Math.floor(e207) : Math.ceil(e207));
        this._verticalScrollbar.writeScrollPosition(s10, t11);
      }
      if (i10) {
        let e207 = ux * i10, t11 = o10.scrollLeft - (e207 < 0 ? Math.floor(e207) : Math.ceil(e207));
        this._horizontalScrollbar.writeScrollPosition(s10, t11);
      }
      if (s10 = this._scrollable.validateScrollPosition(s10), this._options.inertialScroll && (i10 || r11) && !t10.isPhysicalMouseWheel()) {
        let e207 = false;
        this._inertialSpeed.X === 0 && this._inertialSpeed.Y === 0 && (e207 = true), this._inertialSpeed.Y = (r11 < 0 ? -1 : 1) * Math.abs(r11) ** 1.02, this._inertialSpeed.X = (i10 < 0 ? -1 : 1) * Math.abs(i10) ** 1.02, e207 && this._periodicSync();
      }
      (o10.scrollLeft !== s10.scrollLeft || o10.scrollTop !== s10.scrollTop) && (this._options.mouseWheelSmoothScroll && t10.isPhysicalMouseWheel() ? this._scrollable.setScrollPositionSmooth(s10) : this._scrollable.setScrollPositionNow(s10), n10 = true);
    }
    let r10 = n10;
    !r10 && this._options.alwaysConsumeMouseWheel && (r10 = true), !r10 && this._options.consumeMouseWheelIfScrollbarIsNeeded && (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded()) && (r10 = true), r10 && (e206.preventDefault(), e206.stopPropagation());
  }
  _onDidScroll(e206) {
    this._shouldRender = this._horizontalScrollbar.onDidScroll(e206) || this._shouldRender, this._shouldRender = this._verticalScrollbar.onDidScroll(e206) || this._shouldRender, this._options.useShadows && (this._shouldRender = true), this._revealOnScroll && this._reveal(), this._options.lazyRender || this._render();
  }
  renderNow() {
    if (!this._options.lazyRender) throw Error("Please use `lazyRender` together with `renderNow`!");
    this._render();
  }
  _render() {
    if (this._shouldRender && (this._shouldRender = false, this._horizontalScrollbar.render(), this._verticalScrollbar.render(), this._options.useShadows)) {
      let e206 = this._scrollable.getCurrentScrollPosition(), t10 = e206.scrollTop > 0, n10 = e206.scrollLeft > 0, r10 = n10 ? ` left` : ``, i10 = t10 ? ` top` : ``, a10 = n10 || t10 ? ` top-left-corner` : ``;
      this._leftShadowDomNode.setClassName(`shadow${r10}`), this._topShadowDomNode.setClassName(`shadow${i10}`), this._topLeftShadowDomNode.setClassName(`shadow${a10}${i10}${r10}`);
    }
  }
  _onDragStart() {
    this._isDragging = true, this._reveal();
  }
  _onDragEnd() {
    this._isDragging = false, this._hide();
  }
  _onMouseLeave(e206) {
    this._mouseIsOver = false, this._hide();
  }
  _onMouseOver(e206) {
    this._mouseIsOver = true, this._reveal();
  }
  _reveal() {
    this._verticalScrollbar.beginReveal(), this._horizontalScrollbar.beginReveal(), this._scheduleHide();
  }
  _hide() {
    !this._mouseIsOver && !this._isDragging && (this._verticalScrollbar.beginHide(), this._horizontalScrollbar.beginHide());
  }
  _scheduleHide() {
    !this._mouseIsOver && !this._isDragging && this._hideTimeout.cancelAndSet(() => this._hide(), Goe);
  }
}, px = class extends fx {
  constructor(e206, t10) {
    t10 || (t10 = {}), t10.mouseWheelSmoothScroll = false;
    let n10 = new ox({ forceIntegerValues: true, smoothScrollDuration: 0, scheduleAtNextAnimationFrame: (t11) => cl(Vc(e206), t11) });
    super(e206, t10, n10), this._register(n10);
  }
  setScrollPosition(e206) {
    this._scrollable.setScrollPositionNow(e206);
  }
}, mx = class extends fx {
  constructor(e206, t10, n10) {
    super(e206, t10, n10);
  }
  setScrollPosition(e206) {
    e206.reuseAnimation ? this._scrollable.setScrollPositionSmooth(e206, e206.reuseAnimation) : this._scrollable.setScrollPositionNow(e206);
  }
  getScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
}, hx = class extends fx {
  constructor(e206, t10) {
    t10 || (t10 = {}), t10.mouseWheelSmoothScroll = false;
    let n10 = new ox({ forceIntegerValues: false, smoothScrollDuration: 0, scheduleAtNextAnimationFrame: (t11) => cl(Vc(e206), t11) });
    super(e206, t10, n10), this._register(n10), this._element = e206, this._register(this.onScroll((e207) => {
      e207.scrollTopChanged && (this._element.scrollTop = e207.scrollTop), e207.scrollLeftChanged && (this._element.scrollLeft = e207.scrollLeft);
    })), this.scanDomNode();
  }
  setScrollPosition(e206) {
    this._scrollable.setScrollPositionNow(e206);
  }
  getScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
  scanDomNode() {
    this.setScrollDimensions({ width: this._element.clientWidth, scrollWidth: this._element.scrollWidth, height: this._element.clientHeight, scrollHeight: this._element.scrollHeight }), this.setScrollPosition({ scrollLeft: this._element.scrollLeft, scrollTop: this._element.scrollTop });
  }
};
function qoe(e206) {
  let t10 = { lazyRender: e206.lazyRender === void 0 ? false : e206.lazyRender, className: e206.className === void 0 ? `` : e206.className, useShadows: e206.useShadows === void 0 ? true : e206.useShadows, handleMouseWheel: e206.handleMouseWheel === void 0 ? true : e206.handleMouseWheel, flipAxes: e206.flipAxes === void 0 ? false : e206.flipAxes, consumeMouseWheelIfScrollbarIsNeeded: e206.consumeMouseWheelIfScrollbarIsNeeded === void 0 ? false : e206.consumeMouseWheelIfScrollbarIsNeeded, alwaysConsumeMouseWheel: e206.alwaysConsumeMouseWheel === void 0 ? false : e206.alwaysConsumeMouseWheel, scrollYToX: e206.scrollYToX === void 0 ? false : e206.scrollYToX, mouseWheelScrollSensitivity: e206.mouseWheelScrollSensitivity === void 0 ? 1 : e206.mouseWheelScrollSensitivity, fastScrollSensitivity: e206.fastScrollSensitivity === void 0 ? 5 : e206.fastScrollSensitivity, scrollPredominantAxis: e206.scrollPredominantAxis === void 0 ? true : e206.scrollPredominantAxis, mouseWheelSmoothScroll: e206.mouseWheelSmoothScroll === void 0 ? true : e206.mouseWheelSmoothScroll, inertialScroll: e206.inertialScroll === void 0 ? false : e206.inertialScroll, arrowSize: e206.arrowSize === void 0 ? 11 : e206.arrowSize, listenOnDomNode: e206.listenOnDomNode === void 0 ? null : e206.listenOnDomNode, horizontal: e206.horizontal === void 0 ? 1 : e206.horizontal, horizontalScrollbarSize: e206.horizontalScrollbarSize === void 0 ? 10 : e206.horizontalScrollbarSize, horizontalSliderSize: e206.horizontalSliderSize === void 0 ? 0 : e206.horizontalSliderSize, horizontalHasArrows: e206.horizontalHasArrows === void 0 ? false : e206.horizontalHasArrows, vertical: e206.vertical === void 0 ? 1 : e206.vertical, verticalScrollbarSize: e206.verticalScrollbarSize === void 0 ? 10 : e206.verticalScrollbarSize, verticalHasArrows: e206.verticalHasArrows === void 0 ? false : e206.verticalHasArrows, verticalSliderSize: e206.verticalSliderSize === void 0 ? 0 : e206.verticalSliderSize, scrollByPage: e206.scrollByPage === void 0 ? false : e206.scrollByPage };
  return t10.horizontalSliderSize = e206.horizontalSliderSize === void 0 ? t10.horizontalScrollbarSize : e206.horizontalSliderSize, t10.verticalSliderSize = e206.verticalSliderSize === void 0 ? t10.verticalScrollbarSize : e206.verticalSliderSize, Tt && (t10.className += ` mac`), t10;
}
var gx = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._context = e206, this._viewHelper = t10, this._mouseTargetFactory = n10, this._dispatchMouse = r10, this._operation = null;
  }
  dispose() {
    super.dispose(), this.stop();
  }
  start(e206, t10) {
    this._operation ? this._operation.setPosition(e206, t10) : this._operation = this._createDragScrollingOperation(e206, t10);
  }
  stop() {
    this._operation && (this._operation = (this._operation.dispose(), null));
  }
}, _x2 = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._context = e206, this._viewHelper = t10, this._mouseTargetFactory = n10, this._dispatchMouse = r10, this._position = i10, this._mouseEvent = a10, this._lastTime = Date.now(), this._animationFrameDisposable = cl(Vc(a10.browserEvent), () => this._execute());
  }
  dispose() {
    this._animationFrameDisposable.dispose(), super.dispose();
  }
  setPosition(e206, t10) {
    this._position = e206, this._mouseEvent = t10;
  }
  _tick() {
    let e206 = Date.now(), t10 = e206 - this._lastTime;
    return this._lastTime = e206, t10;
  }
}, Joe = class extends gx {
  _createDragScrollingOperation(e206, t10) {
    return new Yoe(this._context, this._viewHelper, this._mouseTargetFactory, this._dispatchMouse, e206, t10);
  }
}, Yoe = class extends _x2 {
  _getScrollSpeed() {
    let e206 = this._context.configuration.options.get(75), t10 = this._context.configuration.options.get(165).height / e206, n10 = this._position.outsideDistance / e206;
    return n10 <= 1.5 ? Math.max(30, t10 * (1 + n10)) : n10 <= 3 ? Math.max(60, t10 * (2 + n10)) : Math.max(200, t10 * (7 + n10));
  }
  _execute() {
    let e206 = this._context.configuration.options.get(75), t10 = this._getScrollSpeed() * (this._tick() / 1e3) * e206, n10 = this._position.outsidePosition === `above` ? -t10 : t10;
    this._context.viewModel.viewLayout.deltaScrollNow(0, n10), this._viewHelper.renderNow();
    let r10 = this._context.viewLayout.getLinesViewportData(), i10 = this._position.outsidePosition === `above` ? r10.startLineNumber : r10.endLineNumber, a10;
    {
      let e207 = bb(this._viewHelper.viewDomNode), t11 = this._context.configuration.options.get(165).horizontalScrollbarHeight, n11 = new vb(this._mouseEvent.pos.x, e207.y + e207.height - t11 - 0.1), r11 = xb(this._viewHelper.viewDomNode, e207, n11);
      a10 = this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(), e207, n11, r11, null);
    }
    (!a10.position || a10.position.lineNumber !== i10) && (a10 = this._position.outsidePosition === `above` ? Jb.createOutsideEditor(this._position.mouseColumn, new j(i10, 1), `above`, this._position.outsideDistance) : Jb.createOutsideEditor(this._position.mouseColumn, new j(i10, this._context.viewModel.getLineMaxColumn(i10)), `below`, this._position.outsideDistance)), this._dispatchMouse(a10, true, 2), this._animationFrameDisposable = cl(Vc(a10.element), () => this._execute());
  }
}, Xoe = class extends gx {
  _createDragScrollingOperation(e206, t10) {
    return new Zoe(this._context, this._viewHelper, this._mouseTargetFactory, this._dispatchMouse, e206, t10);
  }
}, Zoe = class extends _x2 {
  _getScrollSpeed() {
    let e206 = this._context.configuration.options.get(59).typicalFullwidthCharacterWidth, t10 = this._context.configuration.options.get(165).contentWidth / e206, n10 = this._position.outsideDistance / e206;
    return n10 <= 1.5 ? Math.max(30, t10 * (1 + n10)) : n10 <= 3 ? Math.max(60, t10 * (2 + n10)) : Math.max(200, t10 * (7 + n10));
  }
  _execute() {
    let e206 = this._context.configuration.options.get(59).typicalFullwidthCharacterWidth, t10 = this._getScrollSpeed() * (this._tick() / 1e3) * e206 * 0.5, n10 = this._position.outsidePosition === `left` ? -t10 : t10;
    if (this._context.viewModel.viewLayout.deltaScrollNow(n10, 0), this._viewHelper.renderNow(), !this._position.position) return;
    let r10 = this._position.position.lineNumber, i10;
    {
      let e207 = bb(this._viewHelper.viewDomNode), t11 = this._context.configuration.options.get(165).horizontalScrollbarHeight, n11 = new vb(this._mouseEvent.pos.x, e207.y + e207.height - t11 - 0.1), r11 = xb(this._viewHelper.viewDomNode, e207, n11);
      i10 = this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(), e207, n11, r11, null);
    }
    i10 = this._position.outsidePosition === `left` ? Jb.createOutsideEditor(i10.mouseColumn, new j(r10, i10.mouseColumn), `left`, this._position.outsideDistance) : Jb.createOutsideEditor(i10.mouseColumn, new j(r10, i10.mouseColumn), `right`, this._position.outsideDistance), this._dispatchMouse(i10, true, 2), this._animationFrameDisposable = cl(Vc(i10.element), () => this._execute());
  }
}, vx = class extends wb {
  constructor(e206, t10, n10) {
    super(), this._mouseLeaveMonitor = null, this._context = e206, this.viewController = t10, this.viewHelper = n10, this.mouseTargetFactory = new $b(this._context, n10), this._mouseDownOperation = this._register(new Qoe(this._context, this.viewController, this.viewHelper, this.mouseTargetFactory, (e207, t11) => this._createMouseTarget(e207, t11), (e207) => this._getMouseColumn(e207))), this.lastMouseLeaveTime = -1, this._height = this._context.configuration.options.get(165).height;
    let r10 = new voe(this.viewHelper.viewDomNode);
    this._register(r10.onContextMenu(this.viewHelper.viewDomNode, (e207) => this._onContextMenu(e207, true))), this._register(r10.onMouseMove(this.viewHelper.viewDomNode, (e207) => {
      this._onMouseMove(e207), this._mouseLeaveMonitor || (this._mouseLeaveMonitor = L(this.viewHelper.viewDomNode.ownerDocument, `mousemove`, (e208) => {
        this.viewHelper.viewDomNode.contains(e208.target) || this._onMouseLeave(new Sb(e208, false, this.viewHelper.viewDomNode));
      }));
    })), this._register(r10.onMouseUp(this.viewHelper.viewDomNode, (e207) => this._onMouseUp(e207))), this._register(r10.onMouseLeave(this.viewHelper.viewDomNode, (e207) => this._onMouseLeave(e207)));
    let i10 = 0;
    this._register(r10.onPointerDown(this.viewHelper.viewDomNode, (e207, t11) => {
      i10 = t11;
    })), this._register(L(this.viewHelper.viewDomNode, R.POINTER_UP, (e207) => {
      this._mouseDownOperation.onPointerUp();
    })), this._register(r10.onMouseDown(this.viewHelper.viewDomNode, (e207) => this._onMouseDown(e207, i10))), this._setupMouseWheelZoomListener(), this._context.addEventHandler(this);
  }
  _setupMouseWheelZoomListener() {
    let e206 = dx.INSTANCE, t10 = 0, n10 = pn.getZoomLevel(), r10 = false, i10 = 0;
    this._register(L(this.viewHelper.viewDomNode, R.MOUSE_WHEEL, (o10) => {
      if (this.viewController.emitMouseWheel(o10), !this._context.configuration.options.get(84)) return;
      let s10 = new Zo(o10);
      if (e206.acceptStandardWheelEvent(s10), e206.isPhysicalMouseWheel()) {
        if (a10(o10)) {
          let e207 = pn.getZoomLevel(), t11 = s10.deltaY > 0 ? 1 : -1;
          pn.setZoomLevel(e207 + t11), s10.preventDefault(), s10.stopPropagation();
        }
      } else Date.now() - t10 > 50 && (n10 = pn.getZoomLevel(), r10 = a10(o10), i10 = 0), t10 = Date.now(), i10 += s10.deltaY, r10 && (pn.setZoomLevel(n10 + i10 / 5), s10.preventDefault(), s10.stopPropagation());
    }, { capture: true, passive: false }));
    function a10(e207) {
      return Tt ? (e207.metaKey || e207.ctrlKey) && !e207.shiftKey && !e207.altKey : e207.ctrlKey && !e207.metaKey && !e207.shiftKey && !e207.altKey;
    }
  }
  dispose() {
    this._context.removeEventHandler(this), this._mouseLeaveMonitor && (this._mouseLeaveMonitor = (this._mouseLeaveMonitor.dispose(), null)), super.dispose();
  }
  onConfigurationChanged(e206) {
    if (e206.hasChanged(165)) {
      let e207 = this._context.configuration.options.get(165).height;
      this._height !== e207 && (this._height = e207, this._mouseDownOperation.onHeightChanged());
    }
    return false;
  }
  onCursorStateChanged(e206) {
    return this._mouseDownOperation.onCursorStateChanged(e206), false;
  }
  onFocusChanged(e206) {
    return false;
  }
  getTargetAtClientPoint(e206, t10) {
    let n10 = new yb(e206, t10).toPageCoordinates(Vc(this.viewHelper.viewDomNode)), r10 = bb(this.viewHelper.viewDomNode);
    if (n10.y < r10.y || n10.y > r10.y + r10.height || n10.x < r10.x || n10.x > r10.x + r10.width) return null;
    let i10 = xb(this.viewHelper.viewDomNode, r10, n10);
    return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), r10, n10, i10, null);
  }
  _createMouseTarget(e206, t10) {
    let n10 = e206.target;
    if (!this.viewHelper.viewDomNode.contains(n10)) {
      let t11 = Ol(this.viewHelper.viewDomNode);
      t11 && (n10 = t11.elementsFromPoint(e206.posx, e206.posy).find((e207) => this.viewHelper.viewDomNode.contains(e207)) ?? null);
    }
    return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e206.editorPos, e206.pos, e206.relativePos, t10 ? n10 : null);
  }
  _getMouseColumn(e206) {
    return this.mouseTargetFactory.getMouseColumn(e206.relativePos);
  }
  _onContextMenu(e206, t10) {
    this.viewController.emitContextMenu({ event: e206, target: this._createMouseTarget(e206, t10) });
  }
  _onMouseMove(e206) {
    this.mouseTargetFactory.mouseTargetIsWidget(e206) || e206.preventDefault(), !this._mouseDownOperation.isActive() && (e206.timestamp < this.lastMouseLeaveTime || this.viewController.emitMouseMove({ event: e206, target: this._createMouseTarget(e206, true) }));
  }
  _onMouseLeave(e206) {
    this._mouseLeaveMonitor && (this._mouseLeaveMonitor = (this._mouseLeaveMonitor.dispose(), null)), this.lastMouseLeaveTime = (/* @__PURE__ */ new Date()).getTime(), this.viewController.emitMouseLeave({ event: e206, target: null });
  }
  _onMouseUp(e206) {
    this.viewController.emitMouseUp({ event: e206, target: this._createMouseTarget(e206, true) });
  }
  _onMouseDown(e206, t10) {
    let n10 = this._createMouseTarget(e206, true), r10 = n10.type === 6 || n10.type === 7, i10 = n10.type === 2 || n10.type === 3 || n10.type === 4, a10 = n10.type === 3, o10 = this._context.configuration.options.get(125), s10 = n10.type === 8 || n10.type === 5, c10 = n10.type === 9, l10 = e206.leftButton || e206.middleButton;
    Tt && e206.leftButton && e206.ctrlKey && (l10 = false);
    let u10 = () => {
      e206.preventDefault(), this.viewHelper.focusTextArea();
    };
    if (l10 && (r10 || a10 && o10)) u10(), this._mouseDownOperation.start(n10.type, e206, t10);
    else if (i10) e206.preventDefault();
    else if (s10) {
      let r11 = n10.detail;
      l10 && this.viewHelper.shouldSuppressMouseDownOnViewZone(r11.viewZoneId) && (u10(), this._mouseDownOperation.start(n10.type, e206, t10), e206.preventDefault());
    } else c10 && this.viewHelper.shouldSuppressMouseDownOnWidget(n10.detail) && (u10(), e206.preventDefault());
    this.viewController.emitMouseDown({ event: e206, target: n10 });
  }
}, Qoe = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._context = e206, this._viewController = t10, this._viewHelper = n10, this._mouseTargetFactory = r10, this._createMouseTarget = i10, this._getMouseColumn = a10, this._mouseMoveMonitor = this._register(new boe(this._viewHelper.viewDomNode)), this._topBottomDragScrolling = this._register(new Joe(this._context, this._viewHelper, this._mouseTargetFactory, (e207, t11, n11) => this._dispatchMouse(e207, t11, n11))), this._leftRightDragScrolling = this._register(new Xoe(this._context, this._viewHelper, this._mouseTargetFactory, (e207, t11, n11) => this._dispatchMouse(e207, t11, n11))), this._mouseState = new $oe(), this._currentSelection = new N(1, 1, 1, 1), this._isActive = false, this._lastMouseEvent = null;
  }
  dispose() {
    super.dispose();
  }
  isActive() {
    return this._isActive;
  }
  _onMouseDownThenMove(e206) {
    this._lastMouseEvent = e206, this._mouseState.setModifiers(e206);
    let t10 = this._findMousePosition(e206, false);
    t10 && (this._mouseState.isDragAndDrop ? this._viewController.emitMouseDrag({ event: e206, target: t10 }) : t10.type === 13 ? t10.outsidePosition === `above` || t10.outsidePosition === `below` ? (this._topBottomDragScrolling.start(t10, e206), this._leftRightDragScrolling.stop()) : (this._leftRightDragScrolling.start(t10, e206), this._topBottomDragScrolling.stop()) : (this._topBottomDragScrolling.stop(), this._leftRightDragScrolling.stop(), this._dispatchMouse(t10, true, 1)));
  }
  start(e206, t10, n10) {
    this._lastMouseEvent = t10, this._mouseState.setStartedOnLineNumbers(e206 === 3), this._mouseState.setStartButtons(t10), this._mouseState.setModifiers(t10);
    let r10 = this._findMousePosition(t10, true);
    if (!r10 || !r10.position) return;
    this._mouseState.trySetCount(t10.detail, r10.position), t10.detail = this._mouseState.count;
    let i10 = this._context.configuration.options;
    if (!i10.get(104) && i10.get(42) && !i10.get(28) && !this._mouseState.altKey && t10.detail < 2 && !this._isActive && !this._currentSelection.isEmpty() && r10.type === 6 && r10.position && this._currentSelection.containsPosition(r10.position)) {
      this._mouseState.isDragAndDrop = true, this._isActive = true, this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, n10, t10.buttons, (e207) => this._onMouseDownThenMove(e207), (e207) => {
        let t11 = this._findMousePosition(this._lastMouseEvent, false);
        zl(e207) ? this._viewController.emitMouseDropCanceled() : this._viewController.emitMouseDrop({ event: this._lastMouseEvent, target: t11 ? this._createMouseTarget(this._lastMouseEvent, true) : null }), this._stop();
      });
      return;
    }
    this._mouseState.isDragAndDrop = false, this._dispatchMouse(r10, t10.shiftKey, 1), this._isActive || (this._isActive = true, this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, n10, t10.buttons, (e207) => this._onMouseDownThenMove(e207), () => this._stop()));
  }
  _stop() {
    this._isActive = false, this._topBottomDragScrolling.stop(), this._leftRightDragScrolling.stop();
  }
  onHeightChanged() {
    this._mouseMoveMonitor.stopMonitoring();
  }
  onPointerUp() {
    this._mouseMoveMonitor.stopMonitoring();
  }
  onCursorStateChanged(e206) {
    this._currentSelection = e206.selections[0];
  }
  _getPositionOutsideEditor(e206) {
    let t10 = e206.editorPos, n10 = this._context.viewModel, r10 = this._context.viewLayout, i10 = this._getMouseColumn(e206);
    if (e206.posy < t10.y) {
      let n11 = t10.y - e206.posy, a11 = Math.max(r10.getCurrentScrollTop() - n11, 0), o11 = Xb.getZoneAtCoord(this._context, a11);
      if (o11) {
        let e207 = this._helpPositionJumpOverViewZone(o11);
        if (e207) return Jb.createOutsideEditor(i10, e207, `above`, n11);
      }
      let s11 = r10.getLineNumberAtVerticalOffset(a11);
      return Jb.createOutsideEditor(i10, new j(s11, 1), `above`, n11);
    }
    if (e206.posy > t10.y + t10.height) {
      let a11 = e206.posy - t10.y - t10.height, o11 = r10.getCurrentScrollTop() + e206.relativePos.y, s11 = Xb.getZoneAtCoord(this._context, o11);
      if (s11) {
        let e207 = this._helpPositionJumpOverViewZone(s11);
        if (e207) return Jb.createOutsideEditor(i10, e207, `below`, a11);
      }
      let c11 = r10.getLineNumberAtVerticalOffset(o11);
      return Jb.createOutsideEditor(i10, new j(c11, n10.getLineMaxColumn(c11)), `below`, a11);
    }
    let a10 = r10.getLineNumberAtVerticalOffset(r10.getCurrentScrollTop() + e206.relativePos.y), o10 = this._context.configuration.options.get(165), s10 = o10.contentLeft;
    if (e206.relativePos.x <= s10) {
      let t11 = s10 - e206.relativePos.x;
      return Jb.createOutsideEditor(i10, new j(a10, 1), `left`, t11);
    }
    let c10 = o10.minimap.minimapLeft === 0 ? o10.width - o10.verticalScrollbarWidth : o10.minimap.minimapLeft;
    if (e206.relativePos.x >= c10) {
      let t11 = e206.relativePos.x - c10;
      return Jb.createOutsideEditor(i10, new j(a10, n10.getLineMaxColumn(a10)), `right`, t11);
    }
    return null;
  }
  _findMousePosition(e206, t10) {
    let n10 = this._getPositionOutsideEditor(e206);
    if (n10) return n10;
    let r10 = this._createMouseTarget(e206, t10);
    if (!r10.position) return null;
    if (r10.type === 8 || r10.type === 5) {
      let e207 = this._helpPositionJumpOverViewZone(r10.detail);
      if (e207) return Jb.createViewZone(r10.type, r10.element, r10.mouseColumn, e207, r10.detail);
    }
    return r10;
  }
  _helpPositionJumpOverViewZone(e206) {
    let t10 = new j(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn), n10 = e206.positionBefore, r10 = e206.positionAfter;
    return n10 && r10 ? n10.isBefore(t10) ? n10 : r10 : null;
  }
  _dispatchMouse(e206, t10, n10) {
    e206.position && this._viewController.dispatchMouse({ position: e206.position, mouseColumn: e206.mouseColumn, startedOnLineNumbers: this._mouseState.startedOnLineNumbers, revealType: n10, inSelectionMode: t10, mouseDownCount: this._mouseState.count, altKey: this._mouseState.altKey, ctrlKey: this._mouseState.ctrlKey, metaKey: this._mouseState.metaKey, shiftKey: this._mouseState.shiftKey, leftButton: this._mouseState.leftButton, middleButton: this._mouseState.middleButton, onInjectedText: e206.type === 6 && e206.detail.injectedText !== null });
  }
}, $oe = (_ca = class {
  get altKey() {
    return this._altKey;
  }
  get ctrlKey() {
    return this._ctrlKey;
  }
  get metaKey() {
    return this._metaKey;
  }
  get shiftKey() {
    return this._shiftKey;
  }
  get leftButton() {
    return this._leftButton;
  }
  get middleButton() {
    return this._middleButton;
  }
  get startedOnLineNumbers() {
    return this._startedOnLineNumbers;
  }
  constructor() {
    this._altKey = false, this._ctrlKey = false, this._metaKey = false, this._shiftKey = false, this._leftButton = false, this._middleButton = false, this._startedOnLineNumbers = false, this._lastMouseDownPosition = null, this._lastMouseDownPositionEqualCount = 0, this._lastMouseDownCount = 0, this._lastSetMouseDownCountTime = 0, this.isDragAndDrop = false;
  }
  get count() {
    return this._lastMouseDownCount;
  }
  setModifiers(e206) {
    this._altKey = e206.altKey, this._ctrlKey = e206.ctrlKey, this._metaKey = e206.metaKey, this._shiftKey = e206.shiftKey;
  }
  setStartButtons(e206) {
    this._leftButton = e206.leftButton, this._middleButton = e206.middleButton;
  }
  setStartedOnLineNumbers(e206) {
    this._startedOnLineNumbers = e206;
  }
  trySetCount(t10, n10) {
    let r10 = (/* @__PURE__ */ new Date()).getTime();
    r10 - this._lastSetMouseDownCountTime > _ca.CLEAR_MOUSE_DOWN_COUNT_TIME && (t10 = 1), this._lastSetMouseDownCountTime = r10, t10 > this._lastMouseDownCount + 1 && (t10 = this._lastMouseDownCount + 1), this._lastMouseDownPosition && this._lastMouseDownPosition.equals(n10) ? this._lastMouseDownPositionEqualCount++ : this._lastMouseDownPositionEqualCount = 1, this._lastMouseDownPosition = n10, this._lastMouseDownCount = Math.min(t10, this._lastMouseDownPositionEqualCount);
  }
}, _ca.CLEAR_MOUSE_DOWN_COUNT_TIME = 400, _ca), yx = class {
  get event() {
    return this.emitter.event;
  }
  constructor(e206, t10, n10) {
    let r10 = (e207) => this.emitter.fire(e207);
    this.emitter = new k({ onWillAddFirstListener: () => e206.addEventListener(t10, r10, n10), onDidRemoveLastListener: () => e206.removeEventListener(t10, r10, n10) });
  }
  dispose() {
    this.emitter.dispose();
  }
};
function bx(e206, t10, n10, r10) {
  let i10 = e206.getPlainTextToCopy(t10, n10, wt), a10 = e206.model.getEOL(), o10 = n10 && t10.length === 1 && t10[0].isEmpty(), s10 = Array.isArray(i10) ? i10 : null, c10 = Array.isArray(i10) ? i10.join(a10) : i10, l10, u10 = null;
  if (Sx.forceCopyWithSyntaxHighlighting || r10 && c10.length < 65536) {
    let r11 = e206.getRichTextToCopy(t10, n10);
    r11 && (l10 = r11.html, u10 = r11.mode);
  }
  return { isFromEmptySelection: o10, multicursorText: s10, text: c10, html: l10, mode: u10 };
}
var xx = (_da = class {
  constructor() {
    this._lastState = null;
  }
  set(e206, t10) {
    this._lastState = { lastCopiedValue: e206, data: t10 };
  }
  get(e206) {
    return this._lastState && this._lastState.lastCopiedValue === e206 ? this._lastState.data : (this._lastState = null, null);
  }
}, _da.INSTANCE = new _da(), _da), Sx = { forceCopyWithSyntaxHighlighting: false }, Cx = { getTextData(e206) {
  let t10 = e206.getData($f.text), n10 = null, r10 = e206.getData(`vscode-editor-data`);
  if (typeof r10 == `string`) try {
    n10 = JSON.parse(r10), n10.version !== 1 && (n10 = null);
  } catch {
  }
  return t10.length === 0 && n10 === null && e206.files.length > 0 ? [Array.prototype.slice.call(e206.files, 0).map((e207) => e207.name).join(`
`), null] : [t10, n10];
}, setTextData(e206, t10, n10, r10) {
  e206.setData($f.text, t10), typeof n10 == `string` && e206.setData(`text/html`, n10), e206.setData(`vscode-editor-data`, JSON.stringify(r10));
} }, wx = (_ea = class {
  constructor(e206, t10, n10, r10, i10) {
    this.value = e206, this.selectionStart = t10, this.selectionEnd = n10, this.selection = r10, this.newlineCountBeforeSelection = i10;
  }
  toString() {
    return `[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`;
  }
  static readFromTextArea(t10, n10) {
    let r10 = t10.getValue(), i10 = t10.getSelectionStart(), a10 = t10.getSelectionEnd(), o10;
    return n10 && r10.substring(0, i10) === n10.value.substring(0, n10.selectionStart) && (o10 = n10.newlineCountBeforeSelection), new _ea(r10, i10, a10, null, o10);
  }
  collapseSelection() {
    return this.selectionStart === this.value.length ? this : new _ea(this.value, this.value.length, this.value.length, null, void 0);
  }
  isWrittenToTextArea(e206, t10) {
    let n10 = this.value === e206.getValue();
    return t10 ? this.selectionStart === e206.getSelectionStart() && this.selectionEnd === e206.getSelectionEnd() && n10 : n10;
  }
  writeToTextArea(e206, t10, n10) {
    t10.setValue(e206, this.value), n10 && t10.setSelectionRange(e206, this.selectionStart, this.selectionEnd);
  }
  deduceEditorPosition(e206) {
    if (e206 <= this.selectionStart) {
      let t11 = this.value.substring(e206, this.selectionStart);
      return this._finishDeduceEditorPosition(this.selection?.getStartPosition() ?? null, t11, -1);
    }
    if (e206 >= this.selectionEnd) {
      let t11 = this.value.substring(this.selectionEnd, e206);
      return this._finishDeduceEditorPosition(this.selection?.getEndPosition() ?? null, t11, 1);
    }
    let t10 = this.value.substring(this.selectionStart, e206);
    if (t10.indexOf(`\u2026`) === -1) return this._finishDeduceEditorPosition(this.selection?.getStartPosition() ?? null, t10, 1);
    let n10 = this.value.substring(e206, this.selectionEnd);
    return this._finishDeduceEditorPosition(this.selection?.getEndPosition() ?? null, n10, -1);
  }
  _finishDeduceEditorPosition(e206, t10, n10) {
    let r10 = 0, i10 = -1;
    for (; (i10 = t10.indexOf(`
`, i10 + 1)) !== -1; ) r10++;
    return [e206, n10 * t10.length, r10];
  }
  static deduceInput(e206, t10, n10) {
    if (!e206) return { text: ``, replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 };
    let r10 = Math.min(ro(e206.value, t10.value), e206.selectionStart, t10.selectionStart), i10 = Math.min(io(e206.value, t10.value), e206.value.length - e206.selectionEnd, t10.value.length - t10.selectionEnd);
    e206.value.substring(r10, e206.value.length - i10);
    let a10 = t10.value.substring(r10, t10.value.length - i10), o10 = e206.selectionStart - r10, s10 = e206.selectionEnd - r10;
    return t10.selectionStart - r10 === t10.selectionEnd - r10 ? { text: a10, replacePrevCharCnt: e206.selectionStart - r10, replaceNextCharCnt: 0, positionDelta: 0 } : { text: a10, replacePrevCharCnt: s10 - o10, replaceNextCharCnt: 0, positionDelta: 0 };
  }
  static deduceAndroidCompositionInput(e206, t10) {
    if (!e206) return { text: ``, replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 };
    if (e206.value === t10.value) return { text: ``, replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: t10.selectionEnd - e206.selectionEnd };
    let n10 = Math.min(ro(e206.value, t10.value), e206.selectionEnd), r10 = Math.min(io(e206.value, t10.value), e206.value.length - e206.selectionEnd), i10 = e206.value.substring(n10, e206.value.length - r10), a10 = t10.value.substring(n10, t10.value.length - r10);
    e206.selectionStart - n10;
    let o10 = e206.selectionEnd - n10;
    t10.selectionStart - n10;
    let s10 = t10.selectionEnd - n10;
    return { text: a10, replacePrevCharCnt: o10, replaceNextCharCnt: i10.length - o10, positionDelta: s10 - a10.length };
  }
  static fromScreenReaderContentState(t10) {
    return new _ea(t10.value, t10.selectionStart, t10.selectionEnd, t10.selection, t10.newlineCountBeforeSelection);
  }
}, _ea.EMPTY = new _ea(``, 0, 0, null, void 0), _ea), Tx = (function() {
  if (typeof crypto.randomUUID == `function`) return crypto.randomUUID.bind(crypto);
  let e206 = new Uint8Array(16), t10 = [];
  for (let e207 = 0; e207 < 256; e207++) t10.push(e207.toString(16).padStart(2, `0`));
  return function() {
    crypto.getRandomValues(e206), e206[6] = e206[6] & 15 | 64, e206[8] = e206[8] & 63 | 128;
    let n10 = 0, r10 = ``;
    return r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += `-`, r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += `-`, r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += `-`, r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += `-`, r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10 += t10[e206[n10++]], r10;
  };
})();
function Ex(e206) {
  return `${e206}-${Tx()}`;
}
var ese = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Dx = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Ox;
(function(e206) {
  e206.Tap = `-monaco-textarea-synthetic-tap`;
})(Ox || (Ox = {}));
var tse = class {
  constructor() {
    this._lastTypeTextLength = 0;
  }
  handleCompositionUpdate(e206) {
    e206 || (e206 = ``);
    let t10 = { text: e206, replacePrevCharCnt: this._lastTypeTextLength, replaceNextCharCnt: 0, positionDelta: 0 };
    return this._lastTypeTextLength = e206.length, t10;
  }
}, kx = class extends D {
  get textAreaState() {
    return this._textAreaState;
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._host = e206, this._textArea = t10, this._OS = n10, this._browser = r10, this._accessibilityService = i10, this._logService = a10, this._onFocus = this._register(new k()), this.onFocus = this._onFocus.event, this._onBlur = this._register(new k()), this.onBlur = this._onBlur.event, this._onKeyDown = this._register(new k()), this.onKeyDown = this._onKeyDown.event, this._onKeyUp = this._register(new k()), this.onKeyUp = this._onKeyUp.event, this._onCut = this._register(new k()), this.onCut = this._onCut.event, this._onPaste = this._register(new k()), this.onPaste = this._onPaste.event, this._onType = this._register(new k()), this.onType = this._onType.event, this._onCompositionStart = this._register(new k()), this.onCompositionStart = this._onCompositionStart.event, this._onCompositionUpdate = this._register(new k()), this.onCompositionUpdate = this._onCompositionUpdate.event, this._onCompositionEnd = this._register(new k()), this.onCompositionEnd = this._onCompositionEnd.event, this._onSelectionChangeRequest = this._register(new k()), this.onSelectionChangeRequest = this._onSelectionChangeRequest.event, this._asyncFocusGainWriteScreenReaderContent = this._register(new Jt()), this._asyncTriggerCut = this._register(new us(() => this._onCut.fire(), 0)), this._textAreaState = wx.EMPTY, this._selectionChangeListener = null, this._accessibilityService.isScreenReaderOptimized() && this.writeNativeTextAreaContent(`ctor`), this._register(O.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized, () => {
      this._accessibilityService.isScreenReaderOptimized() && !this._asyncFocusGainWriteScreenReaderContent.value ? this._asyncFocusGainWriteScreenReaderContent.value = this._register(new us(() => this.writeNativeTextAreaContent(`asyncFocusGain`), 0)) : this._asyncFocusGainWriteScreenReaderContent.clear();
    })), this._hasFocus = false, this._currentComposition = null;
    let o10 = null;
    this._register(this._textArea.onKeyDown((e207) => {
      let t11 = new Jo(e207);
      (t11.keyCode === 114 || this._currentComposition && t11.keyCode === 1) && t11.stopPropagation(), t11.equals(9) && t11.preventDefault(), o10 = t11, this._onKeyDown.fire(t11);
    })), this._register(this._textArea.onKeyUp((e207) => {
      let t11 = new Jo(e207);
      this._onKeyUp.fire(t11);
    })), this._register(this._textArea.onCompositionStart((e207) => {
      let t11 = new tse();
      if (this._currentComposition) {
        this._currentComposition = t11;
        return;
      }
      if (this._currentComposition = t11, this._OS === 2 && o10 && o10.equals(114) && this._textAreaState.selectionStart === this._textAreaState.selectionEnd && this._textAreaState.selectionStart > 0 && this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) === e207.data && (o10.code === `ArrowRight` || o10.code === `ArrowLeft`)) {
        t11.handleCompositionUpdate(`x`), this._onCompositionStart.fire({ data: e207.data });
        return;
      }
      if (this._browser.isAndroid) {
        this._onCompositionStart.fire({ data: e207.data });
        return;
      }
      this._onCompositionStart.fire({ data: e207.data });
    })), this._register(this._textArea.onCompositionUpdate((e207) => {
      let t11 = this._currentComposition;
      if (!t11) return;
      if (this._browser.isAndroid) {
        let t12 = wx.readFromTextArea(this._textArea, this._textAreaState), n12 = wx.deduceAndroidCompositionInput(this._textAreaState, t12);
        this._textAreaState = t12, this._onType.fire(n12), this._onCompositionUpdate.fire(e207);
        return;
      }
      let n11 = t11.handleCompositionUpdate(e207.data);
      this._textAreaState = wx.readFromTextArea(this._textArea, this._textAreaState), this._onType.fire(n11), this._onCompositionUpdate.fire(e207);
    })), this._register(this._textArea.onCompositionEnd((e207) => {
      let t11 = this._currentComposition;
      if (!t11) return;
      if (this._currentComposition = null, this._browser.isAndroid) {
        let e208 = wx.readFromTextArea(this._textArea, this._textAreaState), t12 = wx.deduceAndroidCompositionInput(this._textAreaState, e208);
        this._textAreaState = e208, this._onType.fire(t12), this._onCompositionEnd.fire();
        return;
      }
      let n11 = t11.handleCompositionUpdate(e207.data);
      this._textAreaState = wx.readFromTextArea(this._textArea, this._textAreaState), this._onType.fire(n11), this._onCompositionEnd.fire();
    })), this._register(this._textArea.onInput((e207) => {
      if (this._textArea.setIgnoreSelectionChangeTime(`received input event`), this._currentComposition) return;
      let t11 = wx.readFromTextArea(this._textArea, this._textAreaState), n11 = wx.deduceInput(this._textAreaState, t11, this._OS === 2);
      n11.replacePrevCharCnt === 0 && n11.text.length === 1 && (ao(n11.text.charCodeAt(0)) || n11.text.charCodeAt(0) === 127) || (this._textAreaState = t11, (n11.text !== `` || n11.replacePrevCharCnt !== 0 || n11.replaceNextCharCnt !== 0 || n11.positionDelta !== 0) && (e207.inputType === `insertFromPaste` ? this._onPaste.fire({ text: n11.text, metadata: xx.INSTANCE.get(n11.text) }) : this._onType.fire(n11)));
    })), this._register(this._textArea.onCut((e207) => {
      this._logService.trace(`TextAreaInput#onCut`, e207), this._textArea.setIgnoreSelectionChangeTime(`received cut event`), this._ensureClipboardGetsEditorSelection(e207), this._asyncTriggerCut.schedule();
    })), this._register(this._textArea.onCopy((e207) => {
      this._logService.trace(`TextAreaInput#onCopy`, e207), this._ensureClipboardGetsEditorSelection(e207);
    })), this._register(this._textArea.onPaste((e207) => {
      if (this._logService.trace(`TextAreaInput#onPaste`, e207), this._textArea.setIgnoreSelectionChangeTime(`received paste event`), e207.preventDefault(), !e207.clipboardData) return;
      let [t11, n11] = Cx.getTextData(e207.clipboardData);
      this._logService.trace(`TextAreaInput#onPaste with id : `, n11?.id, ` with text.length: `, t11.length), t11 && (n11 || (n11 = xx.INSTANCE.get(t11)), this._logService.trace(`TextAreaInput#onPaste (before onPaste)`), this._onPaste.fire({ text: t11, metadata: n11 }));
    })), this._register(this._textArea.onFocus(() => {
      let e207 = this._hasFocus;
      this._setHasFocus(true), this._accessibilityService.isScreenReaderOptimized() && this._browser.isSafari && !e207 && this._hasFocus && (this._asyncFocusGainWriteScreenReaderContent.value || (this._asyncFocusGainWriteScreenReaderContent.value = new us(() => this.writeNativeTextAreaContent(`asyncFocusGain`), 0)), this._asyncFocusGainWriteScreenReaderContent.value.schedule());
    })), this._register(this._textArea.onBlur(() => {
      this._currentComposition && (this._currentComposition = null, this.writeNativeTextAreaContent(`blurWithoutCompositionEnd`), this._onCompositionEnd.fire()), this._setHasFocus(false);
    })), this._register(this._textArea.onSyntheticTap(() => {
      this._browser.isAndroid && this._currentComposition && (this._currentComposition = null, this.writeNativeTextAreaContent(`tapWithoutCompositionEnd`), this._onCompositionEnd.fire());
    }));
  }
  _installSelectionChangeListener() {
    let e206 = 0;
    return L(this._textArea.ownerDocument, `selectionchange`, (t10) => {
      if (f_.onSelectionChange(), !this._hasFocus || this._currentComposition || !this._browser.isChrome) return;
      let n10 = Date.now(), r10 = n10 - e206;
      if (e206 = n10, r10 < 5) return;
      let i10 = n10 - this._textArea.getIgnoreSelectionChangeTime();
      if (this._textArea.resetSelectionChangeTime(), i10 < 100 || !this._textAreaState.selection) return;
      let a10 = this._textArea.getValue();
      if (this._textAreaState.value !== a10) return;
      let o10 = this._textArea.getSelectionStart(), s10 = this._textArea.getSelectionEnd();
      if (this._textAreaState.selectionStart === o10 && this._textAreaState.selectionEnd === s10) return;
      let c10 = this._textAreaState.deduceEditorPosition(o10), l10 = this._host.deduceModelPosition(c10[0], c10[1], c10[2]), u10 = this._textAreaState.deduceEditorPosition(s10), d10 = this._host.deduceModelPosition(u10[0], u10[1], u10[2]), f10 = new N(l10.lineNumber, l10.column, d10.lineNumber, d10.column);
      this._onSelectionChangeRequest.fire(f10);
    });
  }
  dispose() {
    super.dispose(), this._selectionChangeListener && (this._selectionChangeListener = (this._selectionChangeListener.dispose(), null));
  }
  focusTextArea() {
    this._setHasFocus(true), this.refreshFocusState();
  }
  isFocused() {
    return this._hasFocus;
  }
  refreshFocusState() {
    this._setHasFocus(this._textArea.hasFocus());
  }
  _setHasFocus(e206) {
    this._hasFocus !== e206 && (this._hasFocus = e206, this._selectionChangeListener && (this._selectionChangeListener = (this._selectionChangeListener.dispose(), null)), this._hasFocus && (this._selectionChangeListener = this._installSelectionChangeListener()), this._hasFocus && this.writeNativeTextAreaContent(`focusgain`), this._hasFocus ? this._onFocus.fire() : this._onBlur.fire());
  }
  _setAndWriteTextAreaState(e206, t10) {
    this._hasFocus || (t10 = t10.collapseSelection()), t10.isWrittenToTextArea(this._textArea, this._hasFocus) || this._logService.trace(`writeTextAreaState(reason: ${e206})`), t10.writeToTextArea(e206, this._textArea, this._hasFocus), this._textAreaState = t10;
  }
  writeNativeTextAreaContent(e206) {
    !this._accessibilityService.isScreenReaderOptimized() && e206 === `render` || this._currentComposition || this._setAndWriteTextAreaState(e206, this._host.getScreenReaderContent());
  }
  _ensureClipboardGetsEditorSelection(e206) {
    let t10 = this._host.getDataToCopy(), n10;
    this._logService.getLevel() === Gd.Trace && (n10 = Tx());
    let r10 = { version: 1, id: n10, isFromEmptySelection: t10.isFromEmptySelection, multicursorText: t10.multicursorText, mode: t10.mode };
    xx.INSTANCE.set(this._browser.isFirefox ? t10.text.replace(/\r\n/g, `
`) : t10.text, r10), e206.preventDefault(), e206.clipboardData && Cx.setTextData(e206.clipboardData, t10.text, t10.html, r10), this._logService.trace(`TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : `, n10, ` with text.length: `, t10.text.length);
  }
};
kx = ese([Dx(4, e_), Dx(5, Ud)], kx);
var nse = class extends D {
  get ownerDocument() {
    return this._actual.ownerDocument;
  }
  constructor(e206) {
    super(), this._actual = e206, this._onSyntheticTap = this._register(new k()), this.onSyntheticTap = this._onSyntheticTap.event, this._ignoreSelectionChangeTime = 0, this.onKeyDown = this._register(new yx(this._actual, `keydown`)).event, this.onKeyPress = this._register(new yx(this._actual, `keypress`)).event, this.onKeyUp = this._register(new yx(this._actual, `keyup`)).event, this.onCompositionStart = this._register(new yx(this._actual, `compositionstart`)).event, this.onCompositionUpdate = this._register(new yx(this._actual, `compositionupdate`)).event, this.onCompositionEnd = this._register(new yx(this._actual, `compositionend`)).event, this.onBeforeInput = this._register(new yx(this._actual, `beforeinput`)).event, this.onInput = this._register(new yx(this._actual, `input`)).event, this.onCut = this._register(new yx(this._actual, `cut`)).event, this.onCopy = this._register(new yx(this._actual, `copy`)).event, this.onPaste = this._register(new yx(this._actual, `paste`)).event, this.onFocus = this._register(new yx(this._actual, `focus`)).event, this.onBlur = this._register(new yx(this._actual, `blur`)).event, this._register(this.onKeyDown(() => f_.onKeyDown())), this._register(this.onBeforeInput(() => f_.onBeforeInput())), this._register(this.onInput(() => f_.onInput())), this._register(this.onKeyUp(() => f_.onKeyUp())), this._register(L(this._actual, Ox.Tap, () => this._onSyntheticTap.fire()));
  }
  hasFocus() {
    let e206 = Ol(this._actual);
    return e206 ? e206.activeElement === this._actual : this._actual.isConnected ? kl() === this._actual : false;
  }
  setIgnoreSelectionChangeTime(e206) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  getIgnoreSelectionChangeTime() {
    return this._ignoreSelectionChangeTime;
  }
  resetSelectionChangeTime() {
    this._ignoreSelectionChangeTime = 0;
  }
  getValue() {
    return this._actual.value;
  }
  setValue(e206, t10) {
    let n10 = this._actual;
    n10.value !== t10 && (this.setIgnoreSelectionChangeTime(`setValue`), n10.value = t10);
  }
  getSelectionStart() {
    return this._actual.selectionDirection === `backward` ? this._actual.selectionEnd : this._actual.selectionStart;
  }
  getSelectionEnd() {
    return this._actual.selectionDirection === `backward` ? this._actual.selectionStart : this._actual.selectionEnd;
  }
  setSelectionRange(e206, t10, n10) {
    let r10 = this._actual, i10 = null, a10 = Ol(r10);
    i10 = a10 ? a10.activeElement : kl();
    let o10 = Vc(i10), s10 = i10 === r10, c10 = r10.selectionStart, l10 = r10.selectionEnd;
    if (s10 && c10 === t10 && l10 === n10) {
      Mo && o10.parent !== o10 && r10.focus();
      return;
    }
    if (s10) {
      this.setIgnoreSelectionChangeTime(`setSelectionRange`), r10.setSelectionRange(t10, n10), Mo && o10.parent !== o10 && r10.focus();
      return;
    }
    try {
      let e207 = Hl(r10);
      this.setIgnoreSelectionChangeTime(`setSelectionRange`), r10.focus(), r10.setSelectionRange(t10, n10), Ul(r10, e207);
    } catch {
    }
  }
}, rse = class extends vx {
  constructor(e206, t10, n10) {
    super(e206, t10, n10), this._register(nx.addTarget(this.viewHelper.linesContentDomNode)), this._register(L(this.viewHelper.linesContentDomNode, tx.Tap, (e207) => this.onTap(e207))), this._register(L(this.viewHelper.linesContentDomNode, tx.Change, (e207) => this.onChange(e207))), this._register(L(this.viewHelper.linesContentDomNode, tx.Contextmenu, (e207) => this._onContextMenu(new Sb(e207, false, this.viewHelper.viewDomNode), false))), this._lastPointerType = `mouse`, this._register(L(this.viewHelper.linesContentDomNode, `pointerdown`, (e207) => {
      let t11 = e207.pointerType;
      if (t11 === `mouse`) {
        this._lastPointerType = `mouse`;
        return;
      } else t11 === `touch` ? this._lastPointerType = `touch` : this._lastPointerType = `pen`;
    }));
    let r10 = new yoe(this.viewHelper.viewDomNode);
    this._register(r10.onPointerMove(this.viewHelper.viewDomNode, (e207) => this._onMouseMove(e207))), this._register(r10.onPointerUp(this.viewHelper.viewDomNode, (e207) => this._onMouseUp(e207))), this._register(r10.onPointerLeave(this.viewHelper.viewDomNode, (e207) => this._onMouseLeave(e207))), this._register(r10.onPointerDown(this.viewHelper.viewDomNode, (e207, t11) => this._onMouseDown(e207, t11)));
  }
  onTap(e206) {
    !e206.initialTarget || !this.viewHelper.linesContentDomNode.contains(e206.initialTarget) || (e206.preventDefault(), this.viewHelper.focusTextArea(), this._dispatchGesture(e206, false));
  }
  onChange(e206) {
    this._lastPointerType === `touch` && this._context.viewModel.viewLayout.deltaScrollNow(-e206.translationX, -e206.translationY), this._lastPointerType === `pen` && this._dispatchGesture(e206, true);
  }
  _dispatchGesture(e206, t10) {
    let n10 = this._createMouseTarget(new Sb(e206, false, this.viewHelper.viewDomNode), false);
    n10.position && this.viewController.dispatchMouse({ position: n10.position, mouseColumn: n10.position.column, startedOnLineNumbers: false, revealType: 1, mouseDownCount: e206.tapCount, inSelectionMode: t10, altKey: false, ctrlKey: false, metaKey: false, shiftKey: false, leftButton: false, middleButton: false, onInjectedText: n10.type === 6 && n10.detail.injectedText !== null });
  }
  _onMouseDown(e206, t10) {
    e206.browserEvent.pointerType !== `touch` && super._onMouseDown(e206, t10);
  }
}, ise = class extends vx {
  constructor(e206, t10, n10) {
    super(e206, t10, n10), this._register(nx.addTarget(this.viewHelper.linesContentDomNode)), this._register(L(this.viewHelper.linesContentDomNode, tx.Tap, (e207) => this.onTap(e207))), this._register(L(this.viewHelper.linesContentDomNode, tx.Change, (e207) => this.onChange(e207))), this._register(L(this.viewHelper.linesContentDomNode, tx.Contextmenu, (e207) => this._onContextMenu(new Sb(e207, false, this.viewHelper.viewDomNode), false)));
  }
  onTap(e206) {
    e206.preventDefault(), this.viewHelper.focusTextArea();
    let t10 = this._createMouseTarget(new Sb(e206, false, this.viewHelper.viewDomNode), false);
    if (t10.position) {
      let e207 = document.createEvent(`CustomEvent`);
      e207.initEvent(Ox.Tap, false, true), this.viewHelper.dispatchTextAreaEvent(e207), this.viewController.moveTo(t10.position, 1);
    }
  }
  onChange(e206) {
    this._context.viewModel.viewLayout.deltaScrollNow(-e206.translationX, -e206.translationY);
  }
}, ase = class extends D {
  constructor(e206, t10, n10) {
    super(), (kt || Vt && At) && Bo.pointerEvents ? this.handler = this._register(new rse(e206, t10, n10)) : Aa.TouchEvent ? this.handler = this._register(new ise(e206, t10, n10)) : this.handler = this._register(new vx(e206, t10, n10));
  }
  getTargetAtClientPoint(e206, t10) {
    return this.handler.getTargetAtClientPoint(e206, t10);
  }
};
function ose(e206, t10, n10) {
  let r10 = 0;
  for (let n11 = 0; n11 < e206.length; n11++) e206.charAt(n11) === `	` ? r10 = Ub.nextIndentTabStop(r10, t10) : r10++;
  let i10 = ``;
  if (!n10) {
    let e207 = Math.floor(r10 / t10);
    r10 %= t10;
    for (let t11 = 0; t11 < e207; t11++) i10 += `	`;
  }
  for (let e207 = 0; e207 < r10; e207++) i10 += ` `;
  return i10;
}
function Ax(e206, t10, n10) {
  let r10 = Ga(e206);
  return r10 === -1 && (r10 = e206.length), ose(e206.substring(0, r10), t10, n10) + e206.substring(r10);
}
var sse = () => true, cse = () => false, lse = (e206) => e206 === ` ` || e206 === `	`, jx = class {
  static shouldRecreate(e206) {
    return e206.hasChanged(165) || e206.hasChanged(148) || e206.hasChanged(45) || e206.hasChanged(85) || e206.hasChanged(88) || e206.hasChanged(89) || e206.hasChanged(10) || e206.hasChanged(11) || e206.hasChanged(15) || e206.hasChanged(13) || e206.hasChanged(14) || e206.hasChanged(20) || e206.hasChanged(145) || e206.hasChanged(141) || e206.hasChanged(59) || e206.hasChanged(104) || e206.hasChanged(147) || e206.hasChanged(93);
  }
  constructor(e206, t10, n10, r10) {
    this.languageConfigurationService = r10, this._cursorMoveConfigurationBrand = void 0, this._languageId = e206;
    let i10 = n10.options, a10 = i10.get(165), o10 = i10.get(59);
    this.readOnly = i10.get(104), this.tabSize = t10.tabSize, this.indentSize = t10.indentSize, this.insertSpaces = t10.insertSpaces, this.stickyTabStops = i10.get(132), this.lineHeight = o10.lineHeight, this.typicalHalfwidthCharacterWidth = o10.typicalHalfwidthCharacterWidth, this.pageSize = Math.max(1, Math.floor(a10.height / this.lineHeight) - 2), this.useTabStops = i10.get(145), this.trimWhitespaceOnDelete = i10.get(141), this.wordSeparators = i10.get(148), this.emptySelectionClipboard = i10.get(45), this.copyWithSyntaxHighlighting = i10.get(31), this.multiCursorMergeOverlapping = i10.get(85), this.multiCursorPaste = i10.get(88), this.multiCursorLimit = i10.get(89), this.autoClosingBrackets = i10.get(10), this.autoClosingComments = i10.get(11), this.autoClosingQuotes = i10.get(15), this.autoClosingDelete = i10.get(13), this.autoClosingOvertype = i10.get(14), this.autoSurround = i10.get(20), this.autoIndent = i10.get(16), this.wordSegmenterLocales = i10.get(147), this.overtypeOnPaste = i10.get(93), this.surroundingPairs = {}, this._electricChars = null, this.shouldAutoCloseBefore = { quote: this._getShouldAutoClose(e206, this.autoClosingQuotes, true), comment: this._getShouldAutoClose(e206, this.autoClosingComments, false), bracket: this._getShouldAutoClose(e206, this.autoClosingBrackets, false) }, this.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(e206).getAutoClosingPairs();
    let s10 = this.languageConfigurationService.getLanguageConfiguration(e206).getSurroundingPairs();
    if (s10) for (let e207 of s10) this.surroundingPairs[e207.open] = e207.close;
    this.blockCommentStartToken = this.languageConfigurationService.getLanguageConfiguration(e206).comments?.blockCommentStartToken ?? null;
  }
  get electricChars() {
    if (!this._electricChars) {
      this._electricChars = {};
      let e206 = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();
      if (e206) for (let t10 of e206) this._electricChars[t10] = true;
    }
    return this._electricChars;
  }
  get inputMode() {
    return n_.getInputMode();
  }
  onElectricCharacter(e206, t10, n10) {
    let r10 = Ef(t10, n10 - 1), i10 = this.languageConfigurationService.getLanguageConfiguration(r10.languageId).electricCharacter;
    return i10 ? i10.onElectricCharacter(e206, r10, n10 - r10.firstCharOffset) : null;
  }
  normalizeIndentation(e206) {
    return Ax(e206, this.indentSize, this.insertSpaces);
  }
  _getShouldAutoClose(e206, t10, n10) {
    switch (t10) {
      case `beforeWhitespace`:
        return lse;
      case `languageDefined`:
        return this._getLanguageDefinedShouldAutoClose(e206, n10);
      case `always`:
        return sse;
      case `never`:
        return cse;
    }
  }
  _getLanguageDefinedShouldAutoClose(e206, t10) {
    let n10 = this.languageConfigurationService.getLanguageConfiguration(e206).getAutoCloseBeforeSet(t10);
    return (e207) => n10.indexOf(e207) !== -1;
  }
  visibleColumnFromColumn(e206, t10) {
    return Ub.visibleColumnFromColumn(e206.getLineContent(t10.lineNumber), t10.column, this.tabSize);
  }
  columnFromVisibleColumn(e206, t10, n10) {
    let r10 = Ub.columnFromVisibleColumn(e206.getLineContent(t10), n10, this.tabSize), i10 = e206.getLineMinColumn(t10);
    if (r10 < i10) return i10;
    let a10 = e206.getLineMaxColumn(t10);
    return r10 > a10 ? a10 : r10;
  }
}, Mx = class e83 {
  static fromModelState(e206) {
    return new use(e206);
  }
  static fromViewState(e206) {
    return new dse(e206);
  }
  static fromModelSelection(t10) {
    let n10 = N.liftSelection(t10), r10 = new Nx(M.fromPositions(n10.getSelectionStart()), 0, 0, n10.getPosition(), 0);
    return e83.fromModelState(r10);
  }
  static fromModelSelections(e206) {
    let t10 = [];
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) t10[n10] = this.fromModelSelection(e206[n10]);
    return t10;
  }
  constructor(e206, t10) {
    this._cursorStateBrand = void 0, this.modelState = e206, this.viewState = t10;
  }
  equals(e206) {
    return this.viewState.equals(e206.viewState) && this.modelState.equals(e206.modelState);
  }
}, use = class {
  constructor(e206) {
    this.modelState = e206, this.viewState = null;
  }
}, dse = class {
  constructor(e206) {
    this.modelState = null, this.viewState = e206;
  }
}, Nx = class e84 {
  constructor(t10, n10, r10, i10, a10) {
    this.selectionStart = t10, this.selectionStartKind = n10, this.selectionStartLeftoverVisibleColumns = r10, this.position = i10, this.leftoverVisibleColumns = a10, this._singleCursorStateBrand = void 0, this.selection = e84._computeSelection(this.selectionStart, this.position);
  }
  equals(e206) {
    return this.selectionStartLeftoverVisibleColumns === e206.selectionStartLeftoverVisibleColumns && this.leftoverVisibleColumns === e206.leftoverVisibleColumns && this.selectionStartKind === e206.selectionStartKind && this.position.equals(e206.position) && this.selectionStart.equalsRange(e206.selectionStart);
  }
  hasSelection() {
    return !this.selection.isEmpty() || !this.selectionStart.isEmpty();
  }
  move(t10, n10, r10, i10) {
    return t10 ? new e84(this.selectionStart, this.selectionStartKind, this.selectionStartLeftoverVisibleColumns, new j(n10, r10), i10) : new e84(new M(n10, r10, n10, r10), 0, i10, new j(n10, r10), i10);
  }
  static _computeSelection(e206, t10) {
    return e206.isEmpty() || !t10.isBeforeOrEqual(e206.getStartPosition()) ? N.fromPositions(e206.getStartPosition(), t10) : N.fromPositions(e206.getEndPosition(), t10);
  }
}, Px = class {
  constructor(e206, t10, n10) {
    this._editOperationResultBrand = void 0, this.type = e206, this.commands = t10, this.shouldPushStackElementBefore = n10.shouldPushStackElementBefore, this.shouldPushStackElementAfter = n10.shouldPushStackElementAfter;
  }
};
function Fx(e206) {
  return e206 === `'` || e206 === `"` || e206 === "`";
}
var Ix = class e85 {
  static columnSelect(e206, t10, n10, r10, i10, a10) {
    let o10 = Math.abs(i10 - n10) + 1, s10 = n10 > i10, c10 = r10 > a10, l10 = r10 < a10, u10 = [];
    for (let i11 = 0; i11 < o10; i11++) {
      let o11 = n10 + (s10 ? -i11 : i11), d10 = e206.columnFromVisibleColumn(t10, o11, r10), f10 = e206.columnFromVisibleColumn(t10, o11, a10), p10 = e206.visibleColumnFromColumn(t10, new j(o11, d10)), m10 = e206.visibleColumnFromColumn(t10, new j(o11, f10));
      l10 && (p10 > a10 || m10 < r10) || c10 && (m10 > r10 || p10 < a10) || u10.push(new Nx(new M(o11, d10, o11, d10), 0, 0, new j(o11, f10), 0));
    }
    if (u10.length === 0) for (let e207 = 0; e207 < o10; e207++) {
      let r11 = n10 + (s10 ? -e207 : e207), i11 = t10.getLineMaxColumn(r11);
      u10.push(new Nx(new M(r11, i11, r11, i11), 0, 0, new j(r11, i11), 0));
    }
    return { viewStates: u10, reversed: s10, fromLineNumber: n10, fromVisualColumn: r10, toLineNumber: i10, toVisualColumn: a10 };
  }
  static columnSelectLeft(t10, n10, r10) {
    let i10 = r10.toViewVisualColumn;
    return i10 > 0 && i10--, e85.columnSelect(t10, n10, r10.fromViewLineNumber, r10.fromViewVisualColumn, r10.toViewLineNumber, i10);
  }
  static columnSelectRight(e206, t10, n10) {
    let r10 = 0, i10 = Math.min(n10.fromViewLineNumber, n10.toViewLineNumber), a10 = Math.max(n10.fromViewLineNumber, n10.toViewLineNumber);
    for (let n11 = i10; n11 <= a10; n11++) {
      let i11 = t10.getLineMaxColumn(n11), a11 = e206.visibleColumnFromColumn(t10, new j(n11, i11));
      r10 = Math.max(r10, a11);
    }
    let o10 = n10.toViewVisualColumn;
    return o10 < r10 && o10++, this.columnSelect(e206, t10, n10.fromViewLineNumber, n10.fromViewVisualColumn, n10.toViewLineNumber, o10);
  }
  static columnSelectUp(e206, t10, n10, r10) {
    let i10 = r10 ? e206.pageSize : 1, a10 = Math.max(1, n10.toViewLineNumber - i10);
    return this.columnSelect(e206, t10, n10.fromViewLineNumber, n10.fromViewVisualColumn, a10, n10.toViewVisualColumn);
  }
  static columnSelectDown(e206, t10, n10, r10) {
    let i10 = r10 ? e206.pageSize : 1, a10 = Math.min(t10.getLineCount(), n10.toViewLineNumber + i10);
    return this.columnSelect(e206, t10, n10.fromViewLineNumber, n10.fromViewVisualColumn, a10, n10.toViewVisualColumn);
  }
}, Lx = class {
  constructor(e206, t10, n10 = false) {
    this._range = e206, this._text = t10, this.insertsAutoWhitespace = n10;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return N.fromPositions(n10.getEndPosition());
  }
}, Rx = class {
  constructor(e206, t10, n10 = false) {
    this._range = e206, this._text = t10, this.insertsAutoWhitespace = n10;
  }
  getEditOperations(e206, t10) {
    let n10 = this._range.getStartPosition(), r10 = this._range.getEndPosition(), i10 = r10.lineNumber, a10 = Hx(e206, r10, this._text.length + (this._range.isEmpty() ? 0 : -1));
    a10.lineNumber > i10 && (a10 = new j(i10, e206.getLineMaxColumn(i10)));
    let o10 = M.fromPositions(n10, a10);
    t10.addTrackedEditOperation(o10, this._text);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return N.fromPositions(n10.getEndPosition());
  }
}, fse = class {
  constructor(e206, t10) {
    this._range = e206, this._text = t10;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return N.fromRange(n10, 0);
  }
}, zx = class {
  constructor(e206, t10, n10 = false) {
    this._range = e206, this._text = t10, this.insertsAutoWhitespace = n10;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return N.fromPositions(n10.getStartPosition());
  }
}, Bx = class {
  constructor(e206, t10, n10, r10, i10 = false) {
    this._range = e206, this._text = t10, this._columnDeltaOffset = r10, this._lineNumberDeltaOffset = n10, this.insertsAutoWhitespace = i10;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return N.fromPositions(n10.getEndPosition().delta(this._lineNumberDeltaOffset, this._columnDeltaOffset));
  }
}, pse = class {
  constructor(e206) {
    this._range = e206;
  }
  getEditOperations(e206, t10) {
    let n10 = e206.getValueInRange(this._range), r10 = this._range.getEndPosition(), i10 = r10.lineNumber, a10 = Hx(e206, r10, n10.length);
    a10.lineNumber > i10 && (a10 = new j(i10, e206.getLineMaxColumn(i10)));
    let o10 = M.fromPositions(r10, a10);
    t10.addTrackedEditOperation(o10, ``);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return N.fromPositions(n10.getEndPosition());
  }
}, Vx = class {
  constructor(e206, t10, n10, r10 = false) {
    this._range = e206, this._text = t10, this._initialSelection = n10, this._forceMoveMarkers = r10, this._selectionId = null;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(this._range, this._text, this._forceMoveMarkers), this._selectionId = t10.trackSelection(this._initialSelection);
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this._selectionId);
  }
};
function Hx(e206, t10, n10) {
  if (n10 < 0) throw Error(`Unexpected negative delta`);
  let r10 = e206.getLineCount(), i10 = new j(r10, e206.getLineMaxColumn(r10));
  for (let a10 = t10.lineNumber; a10 <= r10; a10++) if (a10 === t10.lineNumber) {
    let r11 = n10 - e206.getLineMaxColumn(t10.lineNumber) + t10.column;
    if (r11 <= 0) {
      i10 = new j(t10.lineNumber, t10.column + n10);
      break;
    }
    n10 = r11;
  } else {
    let t11 = n10 - e206.getLineMaxColumn(a10);
    if (t11 <= 0) {
      i10 = new j(a10, n10);
      break;
    }
    n10 = t11;
  }
  return i10;
}
var Ux = class {
  constructor(e206, t10, n10) {
    this._cursorPositionBrand = void 0, this.lineNumber = e206, this.column = t10, this.leftoverVisibleColumns = n10;
  }
}, Wx = class e86 {
  static leftPosition(e206, t10) {
    if (t10.column > e206.getLineMinColumn(t10.lineNumber)) return t10.delta(void 0, -po(e206.getLineContent(t10.lineNumber), t10.column - 1));
    if (t10.lineNumber > 1) {
      let n10 = t10.lineNumber - 1;
      return new j(n10, e206.getLineMaxColumn(n10));
    } else return t10;
  }
  static leftPositionAtomicSoftTabs(e206, t10, n10) {
    if (t10.column <= e206.getLineIndentColumn(t10.lineNumber)) {
      let r10 = e206.getLineMinColumn(t10.lineNumber), i10 = e206.getLineContent(t10.lineNumber), a10 = Wb.atomicPosition(i10, t10.column - 1, n10, 0);
      if (a10 !== -1 && a10 + 1 >= r10) return new j(t10.lineNumber, a10 + 1);
    }
    return this.leftPosition(e206, t10);
  }
  static left(t10, n10, r10) {
    let i10 = t10.stickyTabStops ? e86.leftPositionAtomicSoftTabs(n10, r10, t10.tabSize) : e86.leftPosition(n10, r10);
    return new Ux(i10.lineNumber, i10.column, 0);
  }
  static moveLeft(t10, n10, r10, i10, a10) {
    let o10, s10;
    if (r10.hasSelection() && !i10) o10 = r10.selection.startLineNumber, s10 = r10.selection.startColumn;
    else {
      let i11 = r10.position.delta(void 0, -(a10 - 1)), c10 = n10.normalizePosition(e86.clipPositionColumn(i11, n10), 0), l10 = e86.left(t10, n10, c10);
      o10 = l10.lineNumber, s10 = l10.column;
    }
    return r10.move(i10, o10, s10, 0);
  }
  static clipPositionColumn(t10, n10) {
    return new j(t10.lineNumber, e86.clipRange(t10.column, n10.getLineMinColumn(t10.lineNumber), n10.getLineMaxColumn(t10.lineNumber)));
  }
  static clipRange(e206, t10, n10) {
    return e206 < t10 ? t10 : e206 > n10 ? n10 : e206;
  }
  static rightPosition(e206, t10, n10) {
    return n10 < e206.getLineMaxColumn(t10) ? n10 += fo(e206.getLineContent(t10), n10 - 1) : t10 < e206.getLineCount() && (t10 += 1, n10 = e206.getLineMinColumn(t10)), new j(t10, n10);
  }
  static rightPositionAtomicSoftTabs(e206, t10, n10, r10, i10) {
    if (n10 < e206.getLineIndentColumn(t10)) {
      let i11 = e206.getLineContent(t10), a10 = Wb.atomicPosition(i11, n10 - 1, r10, 1);
      if (a10 !== -1) return new j(t10, a10 + 1);
    }
    return this.rightPosition(e206, t10, n10);
  }
  static right(t10, n10, r10) {
    let i10 = t10.stickyTabStops ? e86.rightPositionAtomicSoftTabs(n10, r10.lineNumber, r10.column, t10.tabSize, t10.indentSize) : e86.rightPosition(n10, r10.lineNumber, r10.column);
    return new Ux(i10.lineNumber, i10.column, 0);
  }
  static moveRight(t10, n10, r10, i10, a10) {
    let o10, s10;
    if (r10.hasSelection() && !i10) o10 = r10.selection.endLineNumber, s10 = r10.selection.endColumn;
    else {
      let i11 = r10.position.delta(void 0, a10 - 1), c10 = n10.normalizePosition(e86.clipPositionColumn(i11, n10), 1), l10 = e86.right(t10, n10, c10);
      o10 = l10.lineNumber, s10 = l10.column;
    }
    return r10.move(i10, o10, s10, 0);
  }
  static vertical(e206, t10, n10, r10, i10, a10, o10, s10) {
    let c10 = Ub.visibleColumnFromColumn(t10.getLineContent(n10), r10, e206.tabSize) + i10, l10 = t10.getLineCount(), u10 = n10 === 1 && r10 === 1, d10 = n10 === l10 && r10 === t10.getLineMaxColumn(n10), f10 = a10 < n10 ? u10 : d10;
    if (n10 = a10, n10 < 1 ? (n10 = 1, r10 = o10 ? t10.getLineMinColumn(n10) : Math.min(t10.getLineMaxColumn(n10), r10)) : n10 > l10 ? (n10 = l10, r10 = o10 ? t10.getLineMaxColumn(n10) : Math.min(t10.getLineMaxColumn(n10), r10)) : r10 = e206.columnFromVisibleColumn(t10, n10, c10), i10 = f10 ? 0 : c10 - Ub.visibleColumnFromColumn(t10.getLineContent(n10), r10, e206.tabSize), s10 !== void 0) {
      let e207 = new j(n10, r10), a11 = t10.normalizePosition(e207, s10);
      i10 += r10 - a11.column, n10 = a11.lineNumber, r10 = a11.column;
    }
    return new Ux(n10, r10, i10);
  }
  static down(e206, t10, n10, r10, i10, a10, o10) {
    return this.vertical(e206, t10, n10, r10, i10, n10 + a10, o10, 4);
  }
  static moveDown(t10, n10, r10, i10, a10) {
    let o10, s10;
    r10.hasSelection() && !i10 ? (o10 = r10.selection.endLineNumber, s10 = r10.selection.endColumn) : (o10 = r10.position.lineNumber, s10 = r10.position.column);
    let c10 = 0, l10;
    do
      if (l10 = e86.down(t10, n10, o10 + c10, s10, r10.leftoverVisibleColumns, a10, true), n10.normalizePosition(new j(l10.lineNumber, l10.column), 2).lineNumber > o10) break;
    while (c10++ < 10 && o10 + c10 < n10.getLineCount());
    return r10.move(i10, l10.lineNumber, l10.column, l10.leftoverVisibleColumns);
  }
  static translateDown(t10, n10, r10) {
    let i10 = r10.selection, a10 = e86.down(t10, n10, i10.selectionStartLineNumber, i10.selectionStartColumn, r10.selectionStartLeftoverVisibleColumns, 1, false), o10 = e86.down(t10, n10, i10.positionLineNumber, i10.positionColumn, r10.leftoverVisibleColumns, 1, false);
    return new Nx(new M(a10.lineNumber, a10.column, a10.lineNumber, a10.column), 0, a10.leftoverVisibleColumns, new j(o10.lineNumber, o10.column), o10.leftoverVisibleColumns);
  }
  static up(e206, t10, n10, r10, i10, a10, o10) {
    return this.vertical(e206, t10, n10, r10, i10, n10 - a10, o10, 3);
  }
  static moveUp(t10, n10, r10, i10, a10) {
    let o10, s10;
    r10.hasSelection() && !i10 ? (o10 = r10.selection.startLineNumber, s10 = r10.selection.startColumn) : (o10 = r10.position.lineNumber, s10 = r10.position.column);
    let c10 = e86.up(t10, n10, o10, s10, r10.leftoverVisibleColumns, a10, true);
    return r10.move(i10, c10.lineNumber, c10.column, c10.leftoverVisibleColumns);
  }
  static translateUp(t10, n10, r10) {
    let i10 = r10.selection, a10 = e86.up(t10, n10, i10.selectionStartLineNumber, i10.selectionStartColumn, r10.selectionStartLeftoverVisibleColumns, 1, false), o10 = e86.up(t10, n10, i10.positionLineNumber, i10.positionColumn, r10.leftoverVisibleColumns, 1, false);
    return new Nx(new M(a10.lineNumber, a10.column, a10.lineNumber, a10.column), 0, a10.leftoverVisibleColumns, new j(o10.lineNumber, o10.column), o10.leftoverVisibleColumns);
  }
  static _isBlankLine(e206, t10) {
    return e206.getLineFirstNonWhitespaceColumn(t10) === 0;
  }
  static moveToPrevBlankLine(e206, t10, n10, r10) {
    let i10 = n10.position.lineNumber;
    for (; i10 > 1 && this._isBlankLine(t10, i10); ) i10--;
    for (; i10 > 1 && !this._isBlankLine(t10, i10); ) i10--;
    return n10.move(r10, i10, t10.getLineMinColumn(i10), 0);
  }
  static moveToNextBlankLine(e206, t10, n10, r10) {
    let i10 = t10.getLineCount(), a10 = n10.position.lineNumber;
    for (; a10 < i10 && this._isBlankLine(t10, a10); ) a10++;
    for (; a10 < i10 && !this._isBlankLine(t10, a10); ) a10++;
    return n10.move(r10, a10, t10.getLineMinColumn(a10), 0);
  }
  static moveToBeginningOfLine(e206, t10, n10, r10) {
    let i10 = n10.position.lineNumber, a10 = t10.getLineMinColumn(i10), o10 = t10.getLineFirstNonWhitespaceColumn(i10) || a10, s10;
    return s10 = n10.position.column === o10 ? a10 : o10, n10.move(r10, i10, s10, 0);
  }
  static moveToEndOfLine(e206, t10, n10, r10, i10) {
    let a10 = n10.position.lineNumber, o10 = t10.getLineMaxColumn(a10);
    return n10.move(r10, a10, o10, i10 ? 1073741824 - o10 : 0);
  }
  static moveToBeginningOfBuffer(e206, t10, n10, r10) {
    return n10.move(r10, 1, 1, 0);
  }
  static moveToEndOfBuffer(e206, t10, n10, r10) {
    let i10 = t10.getLineCount(), a10 = t10.getLineMaxColumn(i10);
    return n10.move(r10, i10, a10, 0);
  }
}, Gx = class e87 {
  static deleteRight(e206, t10, n10, r10) {
    let i10 = [], a10 = e206 !== 3;
    for (let e207 = 0, o10 = r10.length; e207 < o10; e207++) {
      let o11 = r10[e207], s10 = this.getDeleteRightRange(o11, n10, t10);
      if (s10.isEmpty()) {
        i10[e207] = null;
        continue;
      }
      s10.startLineNumber !== s10.endLineNumber && (a10 = true), i10[e207] = new Lx(s10, ``);
    }
    return [a10, i10];
  }
  static getDeleteRightRange(e206, t10, n10) {
    if (!e206.isEmpty()) return e206;
    let r10 = e206.getPosition(), i10 = Wx.right(n10, t10, r10);
    if (n10.trimWhitespaceOnDelete && i10.lineNumber !== r10.lineNumber) {
      let e207 = t10.getLineFirstNonWhitespaceColumn(r10.lineNumber) > 0, n11 = t10.getLineFirstNonWhitespaceColumn(i10.lineNumber);
      if (e207 && n11 > 0) return new M(i10.lineNumber, n11, r10.lineNumber, r10.column);
    }
    return new M(i10.lineNumber, i10.column, r10.lineNumber, r10.column);
  }
  static isAutoClosingPairDelete(e206, t10, n10, r10, i10, a10, o10) {
    if (t10 === `never` && n10 === `never` || e206 === `never`) return false;
    for (let s10 = 0, c10 = a10.length; s10 < c10; s10++) {
      let c11 = a10[s10], l10 = c11.getPosition();
      if (!c11.isEmpty()) return false;
      let u10 = i10.getLineContent(l10.lineNumber);
      if (l10.column < 2 || l10.column >= u10.length + 1) return false;
      let d10 = u10.charAt(l10.column - 2), f10 = r10.get(d10);
      if (!f10) return false;
      if (Fx(d10)) {
        if (n10 === `never`) return false;
      } else if (t10 === `never`) return false;
      let p10 = u10.charAt(l10.column - 1), m10 = false;
      for (let e207 of f10) e207.open === d10 && e207.close === p10 && (m10 = true);
      if (!m10) return false;
      if (e206 === `auto`) {
        let e207 = false;
        for (let t11 = 0, n11 = o10.length; t11 < n11; t11++) {
          let n12 = o10[t11];
          if (l10.lineNumber === n12.startLineNumber && l10.column === n12.startColumn) {
            e207 = true;
            break;
          }
        }
        if (!e207) return false;
      }
    }
    return true;
  }
  static _runAutoClosingPairDelete(e206, t10, n10) {
    let r10 = [];
    for (let e207 = 0, t11 = n10.length; e207 < t11; e207++) {
      let t12 = n10[e207].getPosition();
      r10[e207] = new Lx(new M(t12.lineNumber, t12.column - 1, t12.lineNumber, t12.column + 1), ``);
    }
    return [true, r10];
  }
  static deleteLeft(t10, n10, r10, i10, a10) {
    if (this.isAutoClosingPairDelete(n10.autoClosingDelete, n10.autoClosingBrackets, n10.autoClosingQuotes, n10.autoClosingPairs.autoClosingPairsOpenByEnd, r10, i10, a10)) return this._runAutoClosingPairDelete(n10, r10, i10);
    let o10 = [], s10 = t10 !== 2;
    for (let t11 = 0, a11 = i10.length; t11 < a11; t11++) {
      let a12 = e87.getDeleteLeftRange(i10[t11], r10, n10);
      if (a12.isEmpty()) {
        o10[t11] = null;
        continue;
      }
      a12.startLineNumber !== a12.endLineNumber && (s10 = true), o10[t11] = new Lx(a12, ``);
    }
    return [s10, o10];
  }
  static getDeleteLeftRange(t10, n10, r10) {
    if (!t10.isEmpty()) return t10;
    let i10 = t10.getPosition();
    if (r10.useTabStops && i10.column > 1) {
      let e206 = n10.getLineContent(i10.lineNumber), t11 = Ga(e206), a10 = t11 === -1 ? e206.length + 1 : t11 + 1;
      if (i10.column <= a10) {
        let e207 = r10.visibleColumnFromColumn(n10, i10), t12 = Ub.prevIndentTabStop(e207, r10.indentSize), a11 = r10.columnFromVisibleColumn(n10, i10.lineNumber, t12);
        return new M(i10.lineNumber, a11, i10.lineNumber, i10.column);
      }
    }
    return M.fromPositions(e87.getPositionAfterDeleteLeft(i10, n10), i10);
  }
  static getPositionAfterDeleteLeft(e206, t10) {
    if (e206.column > 1) {
      let n10 = kte(e206.column - 1, t10.getLineContent(e206.lineNumber));
      return e206.with(void 0, n10 + 1);
    } else if (e206.lineNumber > 1) {
      let n10 = e206.lineNumber - 1;
      return new j(n10, t10.getLineMaxColumn(n10));
    } else return e206;
  }
  static cut(e206, t10, n10) {
    let r10 = [], i10 = null;
    n10.sort((e207, t11) => j.compare(e207.getStartPosition(), t11.getEndPosition()));
    for (let a10 = 0, o10 = n10.length; a10 < o10; a10++) {
      let o11 = n10[a10];
      if (o11.isEmpty()) if (e206.emptySelectionClipboard) {
        let e207 = o11.getPosition(), n11, s10, c10, l10;
        e207.lineNumber < t10.getLineCount() ? (n11 = e207.lineNumber, s10 = 1, c10 = e207.lineNumber + 1, l10 = 1) : e207.lineNumber > 1 && i10?.endLineNumber !== e207.lineNumber ? (n11 = e207.lineNumber - 1, s10 = t10.getLineMaxColumn(e207.lineNumber - 1), c10 = e207.lineNumber, l10 = t10.getLineMaxColumn(e207.lineNumber)) : (n11 = e207.lineNumber, s10 = 1, c10 = e207.lineNumber, l10 = t10.getLineMaxColumn(e207.lineNumber));
        let u10 = new M(n11, s10, c10, l10);
        i10 = u10, u10.isEmpty() ? r10[a10] = null : r10[a10] = new Lx(u10, ``);
      } else r10[a10] = null;
      else r10[a10] = new Lx(o11, ``);
    }
    return new Px(0, r10, { shouldPushStackElementBefore: true, shouldPushStackElementAfter: true });
  }
}, Kx = class e88 {
  static _createWord(e206, t10, n10, r10, i10) {
    return { start: r10, end: i10, wordType: t10, nextCharClass: n10 };
  }
  static _createIntlWord(e206, t10) {
    return { start: e206.index, end: e206.index + e206.segment.length, wordType: 1, nextCharClass: t10 };
  }
  static _findPreviousWordOnLine(e206, t10, n10) {
    let r10 = t10.getLineContent(n10.lineNumber);
    return this._doFindPreviousWordOnLine(r10, e206, n10);
  }
  static _doFindPreviousWordOnLine(e206, t10, n10) {
    let r10 = 0, i10 = t10.findPrevIntlWordBeforeOrAtOffset(e206, n10.column - 2);
    for (let a10 = n10.column - 2; a10 >= 0; a10--) {
      let n11 = e206.charCodeAt(a10), o10 = t10.get(n11);
      if (i10 && a10 === i10.index) return this._createIntlWord(i10, o10);
      if (o10 === 0) {
        if (r10 === 2) return this._createWord(e206, r10, o10, a10 + 1, this._findEndOfWord(e206, t10, r10, a10 + 1));
        r10 = 1;
      } else if (o10 === 2) {
        if (r10 === 1) return this._createWord(e206, r10, o10, a10 + 1, this._findEndOfWord(e206, t10, r10, a10 + 1));
        r10 = 2;
      } else if (o10 === 1 && r10 !== 0) return this._createWord(e206, r10, o10, a10 + 1, this._findEndOfWord(e206, t10, r10, a10 + 1));
    }
    return r10 === 0 ? null : this._createWord(e206, r10, 1, 0, this._findEndOfWord(e206, t10, r10, 0));
  }
  static _findEndOfWord(e206, t10, n10, r10) {
    let i10 = t10.findNextIntlWordAtOrAfterOffset(e206, r10), a10 = e206.length;
    for (let o10 = r10; o10 < a10; o10++) {
      let r11 = e206.charCodeAt(o10), a11 = t10.get(r11);
      if (i10 && o10 === i10.index + i10.segment.length || a11 === 1 || n10 === 1 && a11 === 2 || n10 === 2 && a11 === 0) return o10;
    }
    return a10;
  }
  static _findNextWordOnLine(e206, t10, n10) {
    let r10 = t10.getLineContent(n10.lineNumber);
    return this._doFindNextWordOnLine(r10, e206, n10);
  }
  static _doFindNextWordOnLine(e206, t10, n10) {
    let r10 = 0, i10 = e206.length, a10 = t10.findNextIntlWordAtOrAfterOffset(e206, n10.column - 1);
    for (let o10 = n10.column - 1; o10 < i10; o10++) {
      let n11 = e206.charCodeAt(o10), i11 = t10.get(n11);
      if (a10 && o10 === a10.index) return this._createIntlWord(a10, i11);
      if (i11 === 0) {
        if (r10 === 2) return this._createWord(e206, r10, i11, this._findStartOfWord(e206, t10, r10, o10 - 1), o10);
        r10 = 1;
      } else if (i11 === 2) {
        if (r10 === 1) return this._createWord(e206, r10, i11, this._findStartOfWord(e206, t10, r10, o10 - 1), o10);
        r10 = 2;
      } else if (i11 === 1 && r10 !== 0) return this._createWord(e206, r10, i11, this._findStartOfWord(e206, t10, r10, o10 - 1), o10);
    }
    return r10 === 0 ? null : this._createWord(e206, r10, 1, this._findStartOfWord(e206, t10, r10, i10 - 1), i10);
  }
  static _findStartOfWord(e206, t10, n10, r10) {
    let i10 = t10.findPrevIntlWordBeforeOrAtOffset(e206, r10);
    for (let a10 = r10; a10 >= 0; a10--) {
      let r11 = e206.charCodeAt(a10), o10 = t10.get(r11);
      if (i10 && a10 === i10.index) return a10;
      if (o10 === 1 || n10 === 1 && o10 === 2 || n10 === 2 && o10 === 0) return a10 + 1;
    }
    return 0;
  }
  static moveWordLeft(t10, n10, r10, i10, a10) {
    let o10 = r10.lineNumber, s10 = r10.column;
    s10 === 1 && o10 > 1 && (--o10, s10 = n10.getLineMaxColumn(o10));
    let c10 = e88._findPreviousWordOnLine(t10, n10, new j(o10, s10));
    if (i10 === 0) return new j(o10, c10 ? c10.start + 1 : 1);
    if (i10 === 1) return !a10 && c10 && c10.wordType === 2 && c10.end - c10.start === 1 && c10.nextCharClass === 0 && (c10 = e88._findPreviousWordOnLine(t10, n10, new j(o10, c10.start + 1))), new j(o10, c10 ? c10.start + 1 : 1);
    if (i10 === 3) {
      for (; c10 && c10.wordType === 2; ) c10 = e88._findPreviousWordOnLine(t10, n10, new j(o10, c10.start + 1));
      return new j(o10, c10 ? c10.start + 1 : 1);
    }
    return c10 && s10 <= c10.end + 1 && (c10 = e88._findPreviousWordOnLine(t10, n10, new j(o10, c10.start + 1))), new j(o10, c10 ? c10.end + 1 : 1);
  }
  static _moveWordPartLeft(e206, t10) {
    let n10 = t10.lineNumber, r10 = e206.getLineMaxColumn(n10);
    if (t10.column === 1) return n10 > 1 ? new j(n10 - 1, e206.getLineMaxColumn(n10 - 1)) : t10;
    let i10 = e206.getLineContent(n10);
    for (let e207 = t10.column - 1; e207 > 1; e207--) {
      let t11 = i10.charCodeAt(e207 - 2), a10 = i10.charCodeAt(e207 - 1);
      if (t11 === 95 && a10 !== 95 || t11 === 45 && a10 !== 45 || ($a(t11) || Qa(t11)) && eo(a10)) return new j(n10, e207);
      if (eo(t11) && eo(a10) && e207 + 1 < r10) {
        let t12 = i10.charCodeAt(e207);
        if ($a(t12) || Qa(t12)) return new j(n10, e207);
      }
    }
    return new j(n10, 1);
  }
  static moveWordRight(t10, n10, r10, i10) {
    let a10 = r10.lineNumber, o10 = r10.column, s10 = false;
    o10 === n10.getLineMaxColumn(a10) && a10 < n10.getLineCount() && (s10 = true, a10 += 1, o10 = 1);
    let c10 = e88._findNextWordOnLine(t10, n10, new j(a10, o10));
    if (i10 === 2) c10 && c10.wordType === 2 && c10.end - c10.start === 1 && c10.nextCharClass === 0 && (c10 = e88._findNextWordOnLine(t10, n10, new j(a10, c10.end + 1))), o10 = c10 ? c10.end + 1 : n10.getLineMaxColumn(a10);
    else if (i10 === 3) {
      for (s10 && (o10 = 0); c10 && (c10.wordType === 2 || c10.start + 1 <= o10); ) c10 = e88._findNextWordOnLine(t10, n10, new j(a10, c10.end + 1));
      o10 = c10 ? c10.start + 1 : n10.getLineMaxColumn(a10);
    } else c10 && !s10 && o10 >= c10.start + 1 && (c10 = e88._findNextWordOnLine(t10, n10, new j(a10, c10.end + 1))), o10 = c10 ? c10.start + 1 : n10.getLineMaxColumn(a10);
    return new j(a10, o10);
  }
  static _moveWordPartRight(e206, t10) {
    let n10 = t10.lineNumber, r10 = e206.getLineMaxColumn(n10);
    if (t10.column === r10) return n10 < e206.getLineCount() ? new j(n10 + 1, 1) : t10;
    let i10 = e206.getLineContent(n10);
    for (let e207 = t10.column + 1; e207 < r10; e207++) {
      let t11 = i10.charCodeAt(e207 - 2), a10 = i10.charCodeAt(e207 - 1);
      if (t11 !== 95 && a10 === 95 || t11 !== 45 && a10 === 45 || ($a(t11) || Qa(t11)) && eo(a10)) return new j(n10, e207);
      if (eo(t11) && eo(a10) && e207 + 1 < r10) {
        let t12 = i10.charCodeAt(e207);
        if ($a(t12) || Qa(t12)) return new j(n10, e207);
      }
    }
    return new j(n10, r10);
  }
  static _deleteWordLeftWhitespace(e206, t10) {
    let n10 = e206.getLineContent(t10.lineNumber), r10 = t10.column - 2, i10 = qa(n10, r10);
    return i10 + 1 < r10 ? new M(t10.lineNumber, i10 + 2, t10.lineNumber, t10.column) : null;
  }
  static deleteWordLeft(t10, n10) {
    let r10 = t10.wordSeparators, i10 = t10.model, a10 = t10.selection, o10 = t10.whitespaceHeuristics;
    if (!a10.isEmpty()) return a10;
    if (Gx.isAutoClosingPairDelete(t10.autoClosingDelete, t10.autoClosingBrackets, t10.autoClosingQuotes, t10.autoClosingPairs.autoClosingPairsOpenByEnd, t10.model, [t10.selection], t10.autoClosedCharacters)) {
      let e206 = t10.selection.getPosition();
      return new M(e206.lineNumber, e206.column - 1, e206.lineNumber, e206.column + 1);
    }
    let s10 = new j(a10.positionLineNumber, a10.positionColumn), c10 = s10.lineNumber, l10 = s10.column;
    if (c10 === 1 && l10 === 1) return null;
    if (o10) {
      let e206 = this._deleteWordLeftWhitespace(i10, s10);
      if (e206) return e206;
    }
    let u10 = e88._findPreviousWordOnLine(r10, i10, s10);
    return n10 === 0 ? u10 ? l10 = u10.start + 1 : l10 > 1 ? l10 = 1 : (c10--, l10 = i10.getLineMaxColumn(c10)) : (u10 && l10 <= u10.end + 1 && (u10 = e88._findPreviousWordOnLine(r10, i10, new j(c10, u10.start + 1))), u10 ? l10 = u10.end + 1 : l10 > 1 ? l10 = 1 : (c10--, l10 = i10.getLineMaxColumn(c10))), new M(c10, l10, s10.lineNumber, s10.column);
  }
  static deleteInsideWord(e206, t10, n10) {
    if (!n10.isEmpty()) return n10;
    let r10 = new j(n10.positionLineNumber, n10.positionColumn);
    return this._deleteInsideWordWhitespace(t10, r10) || this._deleteInsideWordDetermineDeleteRange(e206, t10, r10);
  }
  static _charAtIsWhitespace(e206, t10) {
    let n10 = e206.charCodeAt(t10);
    return n10 === 32 || n10 === 9;
  }
  static _deleteInsideWordWhitespace(e206, t10) {
    let n10 = e206.getLineContent(t10.lineNumber), r10 = n10.length;
    if (r10 === 0) return null;
    let i10 = Math.max(t10.column - 2, 0);
    if (!this._charAtIsWhitespace(n10, i10)) return null;
    let a10 = Math.min(t10.column - 1, r10 - 1);
    if (!this._charAtIsWhitespace(n10, a10)) return null;
    for (; i10 > 0 && this._charAtIsWhitespace(n10, i10 - 1); ) i10--;
    for (; a10 + 1 < r10 && this._charAtIsWhitespace(n10, a10 + 1); ) a10++;
    return new M(t10.lineNumber, i10 + 1, t10.lineNumber, a10 + 2);
  }
  static _deleteInsideWordDetermineDeleteRange(t10, n10, r10) {
    let i10 = n10.getLineContent(r10.lineNumber), a10 = i10.length;
    if (a10 === 0) return r10.lineNumber > 1 ? new M(r10.lineNumber - 1, n10.getLineMaxColumn(r10.lineNumber - 1), r10.lineNumber, 1) : r10.lineNumber < n10.getLineCount() ? new M(r10.lineNumber, 1, r10.lineNumber + 1, 1) : new M(r10.lineNumber, 1, r10.lineNumber, 1);
    let o10 = (e206) => e206.start + 1 <= r10.column && r10.column <= e206.end + 1, s10 = (e206, t11) => (e206 = Math.min(e206, r10.column), t11 = Math.max(t11, r10.column), new M(r10.lineNumber, e206, r10.lineNumber, t11)), c10 = (e206) => {
      let t11 = e206.start + 1, n11 = e206.end + 1, r11 = false;
      for (; n11 - 1 < a10 && this._charAtIsWhitespace(i10, n11 - 1); ) r11 = true, n11++;
      if (!r11) for (; t11 > 1 && this._charAtIsWhitespace(i10, t11 - 2); ) t11--;
      return s10(t11, n11);
    }, l10 = e88._findPreviousWordOnLine(t10, n10, r10);
    if (l10 && o10(l10)) return c10(l10);
    let u10 = e88._findNextWordOnLine(t10, n10, r10);
    return u10 && o10(u10) ? c10(u10) : l10 && u10 ? s10(l10.end + 1, u10.start + 1) : l10 ? s10(l10.start + 1, l10.end + 1) : u10 ? s10(u10.start + 1, u10.end + 1) : s10(1, a10 + 1);
  }
  static _deleteWordPartLeft(t10, n10) {
    if (!n10.isEmpty()) return n10;
    let r10 = n10.getPosition(), i10 = e88._moveWordPartLeft(t10, r10);
    return new M(r10.lineNumber, r10.column, i10.lineNumber, i10.column);
  }
  static _findFirstNonWhitespaceChar(e206, t10) {
    let n10 = e206.length;
    for (let r10 = t10; r10 < n10; r10++) {
      let t11 = e206.charAt(r10);
      if (t11 !== ` ` && t11 !== `	`) return r10;
    }
    return n10;
  }
  static _deleteWordRightWhitespace(e206, t10) {
    let n10 = e206.getLineContent(t10.lineNumber), r10 = t10.column - 1, i10 = this._findFirstNonWhitespaceChar(n10, r10);
    return r10 + 1 < i10 ? new M(t10.lineNumber, t10.column, t10.lineNumber, i10 + 1) : null;
  }
  static deleteWordRight(t10, n10) {
    let r10 = t10.wordSeparators, i10 = t10.model, a10 = t10.selection, o10 = t10.whitespaceHeuristics;
    if (!a10.isEmpty()) return a10;
    let s10 = new j(a10.positionLineNumber, a10.positionColumn), c10 = s10.lineNumber, l10 = s10.column, u10 = i10.getLineCount(), d10 = i10.getLineMaxColumn(c10);
    if (c10 === u10 && l10 === d10) return null;
    if (o10) {
      let e206 = this._deleteWordRightWhitespace(i10, s10);
      if (e206) return e206;
    }
    let f10 = e88._findNextWordOnLine(r10, i10, s10);
    return n10 === 2 ? f10 ? l10 = f10.end + 1 : l10 < d10 || c10 === u10 ? l10 = d10 : (c10++, f10 = e88._findNextWordOnLine(r10, i10, new j(c10, 1)), l10 = f10 ? f10.start + 1 : i10.getLineMaxColumn(c10)) : (f10 && l10 >= f10.start + 1 && (f10 = e88._findNextWordOnLine(r10, i10, new j(c10, f10.end + 1))), f10 ? l10 = f10.start + 1 : l10 < d10 || c10 === u10 ? l10 = d10 : (c10++, f10 = e88._findNextWordOnLine(r10, i10, new j(c10, 1)), l10 = f10 ? f10.start + 1 : i10.getLineMaxColumn(c10))), new M(c10, l10, s10.lineNumber, s10.column);
  }
  static _deleteWordPartRight(t10, n10) {
    if (!n10.isEmpty()) return n10;
    let r10 = n10.getPosition(), i10 = e88._moveWordPartRight(t10, r10);
    return new M(r10.lineNumber, r10.column, i10.lineNumber, i10.column);
  }
  static _createWordAtPosition(e206, t10, n10) {
    let r10 = new M(t10, n10.start + 1, t10, n10.end + 1);
    return { word: e206.getValueInRange(r10), startColumn: r10.startColumn, endColumn: r10.endColumn };
  }
  static getWordAtPosition(t10, n10, r10, i10) {
    let a10 = Zp(n10, r10), o10 = e88._findPreviousWordOnLine(a10, t10, i10);
    if (o10 && o10.wordType === 1 && o10.start <= i10.column - 1 && i10.column - 1 <= o10.end) return e88._createWordAtPosition(t10, i10.lineNumber, o10);
    let s10 = e88._findNextWordOnLine(a10, t10, i10);
    return s10 && s10.wordType === 1 && s10.start <= i10.column - 1 && i10.column - 1 <= s10.end ? e88._createWordAtPosition(t10, i10.lineNumber, s10) : null;
  }
  static word(t10, n10, r10, i10, a10) {
    let o10 = Zp(t10.wordSeparators, t10.wordSegmenterLocales), s10 = e88._findPreviousWordOnLine(o10, n10, a10), c10 = e88._findNextWordOnLine(o10, n10, a10);
    if (!i10) {
      let e206, t11;
      return s10 && s10.wordType === 1 && s10.start <= a10.column - 1 && a10.column - 1 <= s10.end || s10 && s10.wordType === 2 && s10.start <= a10.column - 1 && a10.column - 1 < s10.end ? (e206 = s10.start + 1, t11 = s10.end + 1) : c10 && c10.wordType === 1 && c10.start <= a10.column - 1 && a10.column - 1 <= c10.end || c10 && c10.wordType === 2 && c10.start <= a10.column - 1 && a10.column - 1 < c10.end ? (e206 = c10.start + 1, t11 = c10.end + 1) : (e206 = s10 ? s10.end + 1 : 1, t11 = c10 ? c10.start + 1 : n10.getLineMaxColumn(a10.lineNumber)), new Nx(new M(a10.lineNumber, e206, a10.lineNumber, t11), 1, 0, new j(a10.lineNumber, t11), 0);
    }
    let l10, u10;
    s10 && s10.wordType === 1 && s10.start < a10.column - 1 && a10.column - 1 < s10.end ? (l10 = s10.start + 1, u10 = s10.end + 1) : c10 && c10.wordType === 1 && c10.start < a10.column - 1 && a10.column - 1 < c10.end ? (l10 = c10.start + 1, u10 = c10.end + 1) : (l10 = a10.column, u10 = a10.column);
    let d10 = a10.lineNumber, f10;
    if (r10.selectionStart.containsPosition(a10)) f10 = r10.selectionStart.endColumn;
    else if (a10.isBeforeOrEqual(r10.selectionStart.getStartPosition())) {
      f10 = l10;
      let e206 = new j(d10, f10);
      r10.selectionStart.containsPosition(e206) && (f10 = r10.selectionStart.endColumn);
    } else {
      f10 = u10;
      let e206 = new j(d10, f10);
      r10.selectionStart.containsPosition(e206) && (f10 = r10.selectionStart.startColumn);
    }
    return r10.move(true, d10, f10, 0);
  }
}, qx = class extends Kx {
  static deleteWordPartLeft(e206) {
    let t10 = Jx([Kx.deleteWordLeft(e206, 0), Kx.deleteWordLeft(e206, 2), Kx._deleteWordPartLeft(e206.model, e206.selection)]);
    return t10.sort(M.compareRangesUsingEnds), t10[2];
  }
  static deleteWordPartRight(e206) {
    let t10 = Jx([Kx.deleteWordRight(e206, 0), Kx.deleteWordRight(e206, 2), Kx._deleteWordPartRight(e206.model, e206.selection)]);
    return t10.sort(M.compareRangesUsingStarts), t10[0];
  }
  static moveWordPartLeft(e206, t10, n10, r10) {
    let i10 = Jx([Kx.moveWordLeft(e206, t10, n10, 0, r10), Kx.moveWordLeft(e206, t10, n10, 2, r10), Kx._moveWordPartLeft(t10, n10)]);
    return i10.sort(j.compare), i10[2];
  }
  static moveWordPartRight(e206, t10, n10) {
    let r10 = Jx([Kx.moveWordRight(e206, t10, n10, 0), Kx.moveWordRight(e206, t10, n10, 2), Kx._moveWordPartRight(t10, n10)]);
    return r10.sort(j.compare), r10[0];
  }
};
function Jx(e206) {
  return e206.filter((e207) => !!e207);
}
var Yx = class {
  static addCursorDown(e206, t10, n10) {
    let r10 = [], i10 = 0;
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10];
      r10[i10++] = new Mx(o11.modelState, o11.viewState), n10 ? r10[i10++] = Mx.fromModelState(Wx.translateDown(e206.cursorConfig, e206.model, o11.modelState)) : r10[i10++] = Mx.fromViewState(Wx.translateDown(e206.cursorConfig, e206, o11.viewState));
    }
    return r10;
  }
  static addCursorUp(e206, t10, n10) {
    let r10 = [], i10 = 0;
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10];
      r10[i10++] = new Mx(o11.modelState, o11.viewState), n10 ? r10[i10++] = Mx.fromModelState(Wx.translateUp(e206.cursorConfig, e206.model, o11.modelState)) : r10[i10++] = Mx.fromViewState(Wx.translateUp(e206.cursorConfig, e206, o11.viewState));
    }
    return r10;
  }
  static moveToBeginningOfLine(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10];
      r10[i10] = this._moveToLineStart(e206, a11, n10);
    }
    return r10;
  }
  static _moveToLineStart(e206, t10, n10) {
    let r10 = t10.viewState.position.column, i10 = r10 === t10.modelState.position.column, a10 = t10.viewState.position.lineNumber, o10 = r10 === e206.getLineFirstNonWhitespaceColumn(a10);
    return !i10 && !o10 ? this._moveToLineStartByView(e206, t10, n10) : this._moveToLineStartByModel(e206, t10, n10);
  }
  static _moveToLineStartByView(e206, t10, n10) {
    return Mx.fromViewState(Wx.moveToBeginningOfLine(e206.cursorConfig, e206, t10.viewState, n10));
  }
  static _moveToLineStartByModel(e206, t10, n10) {
    return Mx.fromModelState(Wx.moveToBeginningOfLine(e206.cursorConfig, e206.model, t10.modelState, n10));
  }
  static moveToEndOfLine(e206, t10, n10, r10) {
    let i10 = [];
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10];
      i10[a10] = this._moveToLineEnd(e206, o11, n10, r10);
    }
    return i10;
  }
  static _moveToLineEnd(e206, t10, n10, r10) {
    let i10 = t10.viewState.position, a10 = e206.getLineMaxColumn(i10.lineNumber), o10 = i10.column === a10, s10 = t10.modelState.position, c10 = e206.model.getLineMaxColumn(s10.lineNumber), l10 = a10 - i10.column === c10 - s10.column;
    return o10 || l10 ? this._moveToLineEndByModel(e206, t10, n10, r10) : this._moveToLineEndByView(e206, t10, n10, r10);
  }
  static _moveToLineEndByView(e206, t10, n10, r10) {
    return Mx.fromViewState(Wx.moveToEndOfLine(e206.cursorConfig, e206, t10.viewState, n10, r10));
  }
  static _moveToLineEndByModel(e206, t10, n10, r10) {
    return Mx.fromModelState(Wx.moveToEndOfLine(e206.cursorConfig, e206.model, t10.modelState, n10, r10));
  }
  static expandLineSelection(e206, t10) {
    let n10 = [];
    for (let r10 = 0, i10 = t10.length; r10 < i10; r10++) {
      let i11 = t10[r10], a10 = i11.modelState.selection.startLineNumber, o10 = e206.model.getLineCount(), s10 = i11.modelState.selection.endLineNumber, c10;
      s10 === o10 ? c10 = e206.model.getLineMaxColumn(o10) : (s10++, c10 = 1), n10[r10] = Mx.fromModelState(new Nx(new M(a10, 1, a10, 1), 0, 0, new j(s10, c10), 0));
    }
    return n10;
  }
  static moveToBeginningOfBuffer(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10];
      r10[i10] = Mx.fromModelState(Wx.moveToBeginningOfBuffer(e206.cursorConfig, e206.model, a11.modelState, n10));
    }
    return r10;
  }
  static moveToEndOfBuffer(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10];
      r10[i10] = Mx.fromModelState(Wx.moveToEndOfBuffer(e206.cursorConfig, e206.model, a11.modelState, n10));
    }
    return r10;
  }
  static selectAll(e206, t10) {
    let n10 = e206.model.getLineCount(), r10 = e206.model.getLineMaxColumn(n10);
    return Mx.fromModelState(new Nx(new M(1, 1, 1, 1), 0, 0, new j(n10, r10), 0));
  }
  static line(e206, t10, n10, r10, i10) {
    let a10 = e206.model.validatePosition(r10), o10 = i10 ? e206.coordinatesConverter.validateViewPosition(new j(i10.lineNumber, i10.column), a10) : e206.coordinatesConverter.convertModelPositionToViewPosition(a10);
    if (!n10) {
      let t11 = e206.model.getLineCount(), n11 = a10.lineNumber + 1, r11 = 1;
      return n11 > t11 && (n11 = t11, r11 = e206.model.getLineMaxColumn(n11)), Mx.fromModelState(new Nx(new M(a10.lineNumber, 1, n11, r11), 2, 0, new j(n11, r11), 0));
    }
    let s10 = t10.modelState.selectionStart.getStartPosition().lineNumber;
    if (a10.lineNumber < s10) return Mx.fromViewState(t10.viewState.move(true, o10.lineNumber, 1, 0));
    if (a10.lineNumber > s10) {
      let n11 = e206.getLineCount(), r11 = o10.lineNumber + 1, i11 = 1;
      return r11 > n11 && (r11 = n11, i11 = e206.getLineMaxColumn(r11)), Mx.fromViewState(t10.viewState.move(true, r11, i11, 0));
    } else {
      let e207 = t10.modelState.selectionStart.getEndPosition();
      return Mx.fromModelState(t10.modelState.move(true, e207.lineNumber, e207.column, 0));
    }
  }
  static word(e206, t10, n10, r10) {
    let i10 = e206.model.validatePosition(r10);
    return Mx.fromModelState(Kx.word(e206.cursorConfig, e206.model, t10.modelState, n10, i10));
  }
  static cancelSelection(e206, t10) {
    if (!t10.modelState.hasSelection()) return new Mx(t10.modelState, t10.viewState);
    let n10 = t10.viewState.position.lineNumber, r10 = t10.viewState.position.column;
    return Mx.fromViewState(new Nx(new M(n10, r10, n10, r10), 0, 0, new j(n10, r10), 0));
  }
  static moveTo(e206, t10, n10, r10, i10) {
    if (n10) {
      if (t10.modelState.selectionStartKind === 1) return this.word(e206, t10, n10, r10);
      if (t10.modelState.selectionStartKind === 2) return this.line(e206, t10, n10, r10, i10);
    }
    let a10 = e206.model.validatePosition(r10), o10 = i10 ? e206.coordinatesConverter.validateViewPosition(new j(i10.lineNumber, i10.column), a10) : e206.coordinatesConverter.convertModelPositionToViewPosition(a10);
    return Mx.fromViewState(t10.viewState.move(n10, o10.lineNumber, o10.column, 0));
  }
  static simpleMove(e206, t10, n10, r10, i10, a10) {
    switch (n10) {
      case 0:
        return a10 === 4 ? this._moveHalfLineLeft(e206, t10, r10) : this._moveLeft(e206, t10, r10, i10);
      case 1:
        return a10 === 4 ? this._moveHalfLineRight(e206, t10, r10) : this._moveRight(e206, t10, r10, i10);
      case 2:
        return a10 === 2 ? this._moveUpByViewLines(e206, t10, r10, i10) : this._moveUpByModelLines(e206, t10, r10, i10);
      case 3:
        return a10 === 2 ? this._moveDownByViewLines(e206, t10, r10, i10) : this._moveDownByModelLines(e206, t10, r10, i10);
      case 4:
        return a10 === 2 ? t10.map((t11) => Mx.fromViewState(Wx.moveToPrevBlankLine(e206.cursorConfig, e206, t11.viewState, r10))) : t10.map((t11) => Mx.fromModelState(Wx.moveToPrevBlankLine(e206.cursorConfig, e206.model, t11.modelState, r10)));
      case 5:
        return a10 === 2 ? t10.map((t11) => Mx.fromViewState(Wx.moveToNextBlankLine(e206.cursorConfig, e206, t11.viewState, r10))) : t10.map((t11) => Mx.fromModelState(Wx.moveToNextBlankLine(e206.cursorConfig, e206.model, t11.modelState, r10)));
      case 6:
        return this._moveToViewMinColumn(e206, t10, r10);
      case 7:
        return this._moveToViewFirstNonWhitespaceColumn(e206, t10, r10);
      case 8:
        return this._moveToViewCenterColumn(e206, t10, r10);
      case 9:
        return this._moveToViewMaxColumn(e206, t10, r10);
      case 10:
        return this._moveToViewLastNonWhitespaceColumn(e206, t10, r10);
      default:
        return null;
    }
  }
  static viewportMove(e206, t10, n10, r10, i10) {
    let a10 = e206.getCompletelyVisibleViewRange(), o10 = e206.coordinatesConverter.convertViewRangeToModelRange(a10);
    switch (n10) {
      case 11: {
        let n11 = this._firstLineNumberInRange(e206.model, o10, i10), a11 = e206.model.getLineFirstNonWhitespaceColumn(n11);
        return [this._moveToModelPosition(e206, t10[0], r10, n11, a11)];
      }
      case 13: {
        let n11 = this._lastLineNumberInRange(e206.model, o10, i10), a11 = e206.model.getLineFirstNonWhitespaceColumn(n11);
        return [this._moveToModelPosition(e206, t10[0], r10, n11, a11)];
      }
      case 12: {
        let n11 = Math.round((o10.startLineNumber + o10.endLineNumber) / 2), i11 = e206.model.getLineFirstNonWhitespaceColumn(n11);
        return [this._moveToModelPosition(e206, t10[0], r10, n11, i11)];
      }
      case 14: {
        let n11 = [];
        for (let i11 = 0, o11 = t10.length; i11 < o11; i11++) {
          let o12 = t10[i11];
          n11[i11] = this.findPositionInViewportIfOutside(e206, o12, a10, r10);
        }
        return n11;
      }
      default:
        return null;
    }
  }
  static findPositionInViewportIfOutside(e206, t10, n10, r10) {
    let i10 = t10.viewState.position.lineNumber;
    if (n10.startLineNumber <= i10 && i10 <= n10.endLineNumber - 1) return new Mx(t10.modelState, t10.viewState);
    {
      let a10;
      a10 = i10 > n10.endLineNumber - 1 ? n10.endLineNumber - 1 : i10 < n10.startLineNumber ? n10.startLineNumber : i10;
      let o10 = Wx.vertical(e206.cursorConfig, e206, i10, t10.viewState.position.column, t10.viewState.leftoverVisibleColumns, a10, false);
      return Mx.fromViewState(t10.viewState.move(r10, o10.lineNumber, o10.column, o10.leftoverVisibleColumns));
    }
  }
  static _firstLineNumberInRange(e206, t10, n10) {
    let r10 = t10.startLineNumber;
    return t10.startColumn !== e206.getLineMinColumn(r10) && r10++, Math.min(t10.endLineNumber, r10 + n10 - 1);
  }
  static _lastLineNumberInRange(e206, t10, n10) {
    let r10 = t10.startLineNumber;
    return t10.startColumn !== e206.getLineMinColumn(r10) && r10++, Math.max(r10, t10.endLineNumber - n10 + 1);
  }
  static _moveLeft(e206, t10, n10, r10) {
    return t10.map((t11) => {
      let i10 = e206.getTextDirection(t11.viewState.position.lineNumber) === em.RTL;
      return Mx.fromViewState(i10 ? Wx.moveRight(e206.cursorConfig, e206, t11.viewState, n10, r10) : Wx.moveLeft(e206.cursorConfig, e206, t11.viewState, n10, r10));
    });
  }
  static _moveHalfLineLeft(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = a11.viewState.position.lineNumber, s10 = Math.round(e206.getLineLength(o10) / 2);
      r10[i10] = Mx.fromViewState(Wx.moveLeft(e206.cursorConfig, e206, a11.viewState, n10, s10));
    }
    return r10;
  }
  static _moveRight(e206, t10, n10, r10) {
    return t10.map((t11) => {
      let i10 = e206.getTextDirection(t11.viewState.position.lineNumber) === em.RTL;
      return Mx.fromViewState(i10 ? Wx.moveLeft(e206.cursorConfig, e206, t11.viewState, n10, r10) : Wx.moveRight(e206.cursorConfig, e206, t11.viewState, n10, r10));
    });
  }
  static _moveHalfLineRight(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = a11.viewState.position.lineNumber, s10 = Math.round(e206.getLineLength(o10) / 2);
      r10[i10] = Mx.fromViewState(Wx.moveRight(e206.cursorConfig, e206, a11.viewState, n10, s10));
    }
    return r10;
  }
  static _moveDownByViewLines(e206, t10, n10, r10) {
    let i10 = [];
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10];
      i10[a10] = Mx.fromViewState(Wx.moveDown(e206.cursorConfig, e206, o11.viewState, n10, r10));
    }
    return i10;
  }
  static _moveDownByModelLines(e206, t10, n10, r10) {
    let i10 = [];
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10];
      i10[a10] = Mx.fromModelState(Wx.moveDown(e206.cursorConfig, e206.model, o11.modelState, n10, r10));
    }
    return i10;
  }
  static _moveUpByViewLines(e206, t10, n10, r10) {
    let i10 = [];
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10];
      i10[a10] = Mx.fromViewState(Wx.moveUp(e206.cursorConfig, e206, o11.viewState, n10, r10));
    }
    return i10;
  }
  static _moveUpByModelLines(e206, t10, n10, r10) {
    let i10 = [];
    for (let a10 = 0, o10 = t10.length; a10 < o10; a10++) {
      let o11 = t10[a10];
      i10[a10] = Mx.fromModelState(Wx.moveUp(e206.cursorConfig, e206.model, o11.modelState, n10, r10));
    }
    return i10;
  }
  static _moveToViewPosition(e206, t10, n10, r10, i10) {
    return Mx.fromViewState(t10.viewState.move(n10, r10, i10, 0));
  }
  static _moveToModelPosition(e206, t10, n10, r10, i10) {
    return Mx.fromModelState(t10.modelState.move(n10, r10, i10, 0));
  }
  static _moveToViewMinColumn(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = a11.viewState.position.lineNumber, s10 = e206.getLineMinColumn(o10);
      r10[i10] = this._moveToViewPosition(e206, a11, n10, o10, s10);
    }
    return r10;
  }
  static _moveToViewFirstNonWhitespaceColumn(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = a11.viewState.position.lineNumber, s10 = e206.getLineFirstNonWhitespaceColumn(o10);
      r10[i10] = this._moveToViewPosition(e206, a11, n10, o10, s10);
    }
    return r10;
  }
  static _moveToViewCenterColumn(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = a11.viewState.position.lineNumber, s10 = Math.round((e206.getLineMaxColumn(o10) + e206.getLineMinColumn(o10)) / 2);
      r10[i10] = this._moveToViewPosition(e206, a11, n10, o10, s10);
    }
    return r10;
  }
  static _moveToViewMaxColumn(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = a11.viewState.position.lineNumber, s10 = e206.getLineMaxColumn(o10);
      r10[i10] = this._moveToViewPosition(e206, a11, n10, o10, s10);
    }
    return r10;
  }
  static _moveToViewLastNonWhitespaceColumn(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = a11.viewState.position.lineNumber, s10 = e206.getLineLastNonWhitespaceColumn(o10);
      r10[i10] = this._moveToViewPosition(e206, a11, n10, o10, s10);
    }
    return r10;
  }
}, Xx;
(function(e206) {
  e206.metadata = { description: `Move cursor to a logical position in the view`, args: [{ name: `Cursor move argument object`, description: `Property-value pairs that can be passed through this argument:
					* 'to': A mandatory logical position value providing where to move the cursor.
						\`\`\`
						'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
						'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
						'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
						'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
						\`\`\`
					* 'by': Unit to move. Default is computed based on 'to' value.
						\`\`\`
						'line', 'wrappedLine', 'character', 'halfLine'
						\`\`\`
					* 'value': Number of units to move. Default is '1'.
					* 'select': If 'true' makes the selection. Default is 'false'.
					* 'noHistory': If 'true' does not add the movement to navigation history. Default is 'false'.
				`, constraint: function(e207) {
    if (!Be(e207)) return false;
    let t11 = e207;
    return !(!Re(t11.to) || !Ge(t11.select) && !We(t11.select) || !Ge(t11.by) && !Re(t11.by) || !Ge(t11.value) && !He(t11.value) || !Ge(t11.noHistory) && !We(t11.noHistory));
  }, schema: { type: `object`, required: [`to`], properties: { to: { type: `string`, enum: [`left`, `right`, `up`, `down`, `prevBlankLine`, `nextBlankLine`, `wrappedLineStart`, `wrappedLineEnd`, `wrappedLineColumnCenter`, `wrappedLineFirstNonWhitespaceCharacter`, `wrappedLineLastNonWhitespaceCharacter`, `viewPortTop`, `viewPortCenter`, `viewPortBottom`, `viewPortIfOutside`] }, by: { type: `string`, enum: [`line`, `wrappedLine`, `character`, `halfLine`] }, value: { type: `number`, default: 1 }, select: { type: `boolean`, default: false }, noHistory: { type: `boolean`, default: false } } } }] }, e206.RawDirection = { Left: `left`, Right: `right`, Up: `up`, Down: `down`, PrevBlankLine: `prevBlankLine`, NextBlankLine: `nextBlankLine`, WrappedLineStart: `wrappedLineStart`, WrappedLineFirstNonWhitespaceCharacter: `wrappedLineFirstNonWhitespaceCharacter`, WrappedLineColumnCenter: `wrappedLineColumnCenter`, WrappedLineEnd: `wrappedLineEnd`, WrappedLineLastNonWhitespaceCharacter: `wrappedLineLastNonWhitespaceCharacter`, ViewPortTop: `viewPortTop`, ViewPortCenter: `viewPortCenter`, ViewPortBottom: `viewPortBottom`, ViewPortIfOutside: `viewPortIfOutside` }, e206.RawUnit = { Line: `line`, WrappedLine: `wrappedLine`, Character: `character`, HalfLine: `halfLine` };
  function t10(t11) {
    if (!t11.to) return null;
    let n10;
    switch (t11.to) {
      case e206.RawDirection.Left:
        n10 = 0;
        break;
      case e206.RawDirection.Right:
        n10 = 1;
        break;
      case e206.RawDirection.Up:
        n10 = 2;
        break;
      case e206.RawDirection.Down:
        n10 = 3;
        break;
      case e206.RawDirection.PrevBlankLine:
        n10 = 4;
        break;
      case e206.RawDirection.NextBlankLine:
        n10 = 5;
        break;
      case e206.RawDirection.WrappedLineStart:
        n10 = 6;
        break;
      case e206.RawDirection.WrappedLineFirstNonWhitespaceCharacter:
        n10 = 7;
        break;
      case e206.RawDirection.WrappedLineColumnCenter:
        n10 = 8;
        break;
      case e206.RawDirection.WrappedLineEnd:
        n10 = 9;
        break;
      case e206.RawDirection.WrappedLineLastNonWhitespaceCharacter:
        n10 = 10;
        break;
      case e206.RawDirection.ViewPortTop:
        n10 = 11;
        break;
      case e206.RawDirection.ViewPortBottom:
        n10 = 13;
        break;
      case e206.RawDirection.ViewPortCenter:
        n10 = 12;
        break;
      case e206.RawDirection.ViewPortIfOutside:
        n10 = 14;
        break;
      default:
        return null;
    }
    let r10 = 0;
    switch (t11.by) {
      case e206.RawUnit.Line:
        r10 = 1;
        break;
      case e206.RawUnit.WrappedLine:
        r10 = 2;
        break;
      case e206.RawUnit.Character:
        r10 = 3;
        break;
      case e206.RawUnit.HalfLine:
        r10 = 4;
        break;
    }
    return { direction: n10, unit: r10, select: !!t11.select, value: t11.value || 1, noHistory: !!t11.noHistory };
  }
  e206.parse = t10;
})(Xx || (Xx = {}));
var Zx = class {
  constructor(e206, t10, n10) {
    this._indentRulesSupport = t10, this._indentationLineProcessor = new $x(e206, n10);
  }
  shouldIncrease(e206, t10) {
    let n10 = this._indentationLineProcessor.getProcessedLine(e206, t10);
    return this._indentRulesSupport.shouldIncrease(n10);
  }
  shouldDecrease(e206, t10) {
    let n10 = this._indentationLineProcessor.getProcessedLine(e206, t10);
    return this._indentRulesSupport.shouldDecrease(n10);
  }
  shouldIgnore(e206, t10) {
    let n10 = this._indentationLineProcessor.getProcessedLine(e206, t10);
    return this._indentRulesSupport.shouldIgnore(n10);
  }
  shouldIndentNextLine(e206, t10) {
    let n10 = this._indentationLineProcessor.getProcessedLine(e206, t10);
    return this._indentRulesSupport.shouldIndentNextLine(n10);
  }
}, Qx = class {
  constructor(e206, t10) {
    this.model = e206, this.indentationLineProcessor = new $x(e206, t10);
  }
  getProcessedTokenContextAroundRange(e206) {
    return { beforeRangeProcessedTokens: this._getProcessedTokensBeforeRange(e206), afterRangeProcessedTokens: this._getProcessedTokensAfterRange(e206), previousLineProcessedTokens: this._getProcessedPreviousLineTokens(e206) };
  }
  _getProcessedTokensBeforeRange(e206) {
    this.model.tokenization.forceTokenization(e206.startLineNumber);
    let t10 = this.model.tokenization.getLineTokens(e206.startLineNumber), n10 = Ef(t10, e206.startColumn - 1), r10;
    if (eS(this.model, e206.getStartPosition())) {
      let i10 = e206.startColumn - 1 - n10.firstCharOffset, a10 = n10.firstCharOffset, o10 = a10 + i10;
      r10 = t10.sliceAndInflate(a10, o10, 0);
    } else {
      let n11 = e206.startColumn - 1;
      r10 = t10.sliceAndInflate(0, n11, 0);
    }
    return this.indentationLineProcessor.getProcessedTokens(r10);
  }
  _getProcessedTokensAfterRange(e206) {
    let t10 = e206.isEmpty() ? e206.getStartPosition() : e206.getEndPosition();
    this.model.tokenization.forceTokenization(t10.lineNumber);
    let n10 = this.model.tokenization.getLineTokens(t10.lineNumber), r10 = Ef(n10, t10.column - 1), i10 = t10.column - 1 - r10.firstCharOffset, a10 = r10.firstCharOffset + i10, o10 = r10.firstCharOffset + r10.getLineLength(), s10 = n10.sliceAndInflate(a10, o10, 0);
    return this.indentationLineProcessor.getProcessedTokens(s10);
  }
  _getProcessedPreviousLineTokens(e206) {
    let t10 = (e207) => (this.model.tokenization.forceTokenization(e207), Ef(this.model.tokenization.getLineTokens(e207), this.model.getLineMaxColumn(e207) - 1));
    this.model.tokenization.forceTokenization(e206.startLineNumber);
    let n10 = Ef(this.model.tokenization.getLineTokens(e206.startLineNumber), e206.startColumn - 1), r10 = rg.createEmpty(``, n10.languageIdCodec), i10 = e206.startLineNumber - 1;
    if (i10 === 0 || n10.firstCharOffset !== 0) return r10;
    let a10 = t10(i10);
    if (n10.languageId !== a10.languageId) return r10;
    let o10 = a10.toIViewLineTokens();
    return this.indentationLineProcessor.getProcessedTokens(o10);
  }
}, $x = class {
  constructor(e206, t10) {
    this.model = e206, this.languageConfigurationService = t10;
  }
  getProcessedLine(e206, t10) {
    let n10 = (e207, t11) => {
      let n11 = Ka(e207);
      return t11 + e207.substring(n11.length);
    };
    this.model.tokenization.forceTokenization?.(e206);
    let r10 = this.model.tokenization.getLineTokens(e206), i10 = this.getProcessedTokens(r10).getLineContent();
    return t10 !== void 0 && (i10 = n10(i10, t10)), i10;
  }
  getProcessedTokens(e206) {
    let t10 = (e207) => e207 === 2 || e207 === 3 || e207 === 1, n10 = e206.getLanguageId(0), r10 = this.languageConfigurationService.getLanguageConfiguration(n10).bracketsNew.getBracketRegExp({ global: true }), i10 = [];
    return e206.forEach((n11) => {
      let a10 = e206.getStandardTokenType(n11), o10 = e206.getTokenText(n11);
      t10(a10) && (o10 = o10.replace(r10, ``));
      let s10 = e206.getMetadata(n11);
      i10.push({ text: o10, metadata: s10 });
    }), rg.createFromTextAndMetadata(i10, e206.languageIdCodec);
  }
};
function eS(e206, t10) {
  e206.tokenization.forceTokenization(t10.lineNumber);
  let n10 = e206.tokenization.getLineTokens(t10.lineNumber), r10 = Ef(n10, t10.column - 1), i10 = r10.firstCharOffset === 0, a10 = n10.getLanguageId(0) === r10.languageId;
  return !i10 && !a10;
}
function tS(e206, t10, n10, r10) {
  t10.tokenization.forceTokenization(n10.startLineNumber);
  let i10 = t10.getLanguageIdAtPosition(n10.startLineNumber, n10.startColumn), a10 = r10.getLanguageConfiguration(i10);
  if (!a10) return null;
  let o10 = new Qx(t10, r10).getProcessedTokenContextAroundRange(n10), s10 = o10.previousLineProcessedTokens.getLineContent(), c10 = o10.beforeRangeProcessedTokens.getLineContent(), l10 = o10.afterRangeProcessedTokens.getLineContent(), u10 = a10.onEnter(e206, s10, c10, l10);
  if (!u10) return null;
  let d10 = u10.indentAction, f10 = u10.appendText, p10 = u10.removeText || 0;
  f10 ? d10 === xf.Indent && (f10 = `	` + f10) : f10 = d10 === xf.Indent || d10 === xf.IndentOutdent ? `	` : ``;
  let m10 = wp(t10, n10.startLineNumber, n10.startColumn);
  return p10 && (m10 = m10.substring(0, m10.length - p10)), { indentAction: d10, appendText: f10, removeText: p10, indentation: m10 };
}
var mse = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, hse = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, nS, rS = /* @__PURE__ */ Object.create(null);
function iS(e206, t10) {
  if (t10 <= 0) return ``;
  rS[e206] || (rS[e206] = [``, e206]);
  let n10 = rS[e206];
  for (let r10 = n10.length; r10 <= t10; r10++) n10[r10] = n10[r10 - 1] + e206;
  return n10[t10];
}
var aS = nS = class {
  static unshiftIndent(e206, t10, n10, r10, i10) {
    let a10 = Ub.visibleColumnFromColumn(e206, t10, n10);
    return i10 ? iS(iS(` `, r10), Ub.prevIndentTabStop(a10, r10) / r10) : iS(`	`, Ub.prevRenderTabStop(a10, n10) / n10);
  }
  static shiftIndent(e206, t10, n10, r10, i10) {
    let a10 = Ub.visibleColumnFromColumn(e206, t10, n10);
    return i10 ? iS(iS(` `, r10), Ub.nextIndentTabStop(a10, r10) / r10) : iS(`	`, Ub.nextRenderTabStop(a10, n10) / n10);
  }
  constructor(e206, t10, n10) {
    this._languageConfigurationService = n10, this._opts = t10, this._selection = e206, this._selectionId = null, this._useLastEditRangeForCursorEndPosition = false, this._selectionStartColumnStaysPut = false;
  }
  _addEditOperation(e206, t10, n10) {
    this._useLastEditRangeForCursorEndPosition ? e206.addTrackedEditOperation(t10, n10) : e206.addEditOperation(t10, n10);
  }
  getEditOperations(e206, t10) {
    let n10 = this._selection.startLineNumber, r10 = this._selection.endLineNumber;
    this._selection.endColumn === 1 && n10 !== r10 && --r10;
    let { tabSize: i10, indentSize: a10, insertSpaces: o10 } = this._opts, s10 = n10 === r10;
    if (this._opts.useTabStops) {
      this._selection.isEmpty() && /^\s*$/.test(e206.getLineContent(n10)) && (this._useLastEditRangeForCursorEndPosition = true);
      let c10 = 0, l10 = 0;
      for (let u10 = n10; u10 <= r10; u10++, c10 = l10) {
        l10 = 0;
        let r11 = e206.getLineContent(u10), d10 = Ga(r11);
        if (this._opts.isUnshift && (r11.length === 0 || d10 === 0) || !s10 && !this._opts.isUnshift && r11.length === 0) continue;
        if (d10 === -1 && (d10 = r11.length), u10 > 1 && Ub.visibleColumnFromColumn(r11, d10 + 1, i10) % a10 !== 0 && e206.tokenization.isCheapToTokenize(u10 - 1)) {
          let t11 = tS(this._opts.autoIndent, e206, new M(u10 - 1, e206.getLineMaxColumn(u10 - 1), u10 - 1, e206.getLineMaxColumn(u10 - 1)), this._languageConfigurationService);
          if (t11) {
            if (l10 = c10, t11.appendText) for (let e207 = 0, n11 = t11.appendText.length; e207 < n11 && l10 < a10 && t11.appendText.charCodeAt(e207) === 32; e207++) l10++;
            t11.removeText && (l10 = Math.max(0, l10 - t11.removeText));
            for (let e207 = 0; e207 < l10 && !(d10 === 0 || r11.charCodeAt(d10 - 1) !== 32); e207++) d10--;
          }
        }
        if (this._opts.isUnshift && d10 === 0) continue;
        let f10;
        f10 = this._opts.isUnshift ? nS.unshiftIndent(r11, d10 + 1, i10, a10, o10) : nS.shiftIndent(r11, d10 + 1, i10, a10, o10), this._addEditOperation(t10, new M(u10, 1, u10, d10 + 1), f10), u10 === n10 && !this._selection.isEmpty() && (this._selectionStartColumnStaysPut = this._selection.startColumn <= d10 + 1);
      }
    } else {
      !this._opts.isUnshift && this._selection.isEmpty() && e206.getLineLength(n10) === 0 && (this._useLastEditRangeForCursorEndPosition = true);
      let i11 = o10 ? iS(` `, a10) : `	`;
      for (let o11 = n10; o11 <= r10; o11++) {
        let r11 = e206.getLineContent(o11), c10 = Ga(r11);
        if (!(this._opts.isUnshift && (r11.length === 0 || c10 === 0)) && !(!s10 && !this._opts.isUnshift && r11.length === 0) && (c10 === -1 && (c10 = r11.length), !(this._opts.isUnshift && c10 === 0))) if (this._opts.isUnshift) {
          c10 = Math.min(c10, a10);
          for (let e207 = 0; e207 < c10; e207++) if (r11.charCodeAt(e207) === 9) {
            c10 = e207 + 1;
            break;
          }
          this._addEditOperation(t10, new M(o11, 1, o11, c10 + 1), ``);
        } else this._addEditOperation(t10, new M(o11, 1, o11, 1), i11), o11 === n10 && !this._selection.isEmpty() && (this._selectionStartColumnStaysPut = this._selection.startColumn === 1);
      }
    }
    this._selectionId = t10.trackSelection(this._selection);
  }
  computeCursorState(e206, t10) {
    if (this._useLastEditRangeForCursorEndPosition) {
      let e207 = t10.getInverseEditOperations()[0];
      return new N(e207.range.endLineNumber, e207.range.endColumn, e207.range.endLineNumber, e207.range.endColumn);
    }
    let n10 = t10.getTrackedSelection(this._selectionId);
    if (this._selectionStartColumnStaysPut) {
      let e207 = this._selection.startColumn;
      return n10.startColumn <= e207 ? n10 : n10.getDirection() === 0 ? new N(n10.startLineNumber, e207, n10.endLineNumber, n10.endColumn) : new N(n10.endLineNumber, n10.endColumn, n10.startLineNumber, e207);
    }
    return n10;
  }
};
aS = nS = mse([hse(2, bp)], aS);
var gse = class {
  constructor(e206, t10, n10) {
    this._range = e206, this._charBeforeSelection = t10, this._charAfterSelection = n10;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(new M(this._range.startLineNumber, this._range.startColumn, this._range.startLineNumber, this._range.startColumn), this._charBeforeSelection), t10.addTrackedEditOperation(new M(this._range.endLineNumber, this._range.endColumn, this._range.endLineNumber, this._range.endColumn), this._charAfterSelection || null);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations(), r10 = n10[0].range, i10 = n10[1].range;
    return new N(r10.endLineNumber, r10.endColumn, i10.endLineNumber, i10.endColumn - this._charAfterSelection.length);
  }
}, _se = class {
  constructor(e206, t10, n10) {
    this._position = e206, this._text = t10, this._charAfter = n10;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(new M(this._position.lineNumber, this._position.column, this._position.lineNumber, this._position.column), this._text + this._charAfter);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return new N(n10.endLineNumber, n10.startColumn, n10.endLineNumber, n10.endColumn - this._charAfter.length);
  }
};
function vse(e206, t10, n10) {
  let r10 = e206.tokenization.getLanguageIdAtPosition(t10, 0);
  if (t10 > 1) {
    let i10, a10 = -1;
    for (i10 = t10 - 1; i10 >= 1; i10--) {
      if (e206.tokenization.getLanguageIdAtPosition(i10, 0) !== r10) return a10;
      let t11 = e206.getLineContent(i10);
      if (n10.shouldIgnore(i10) || /^\s+$/.test(t11) || t11 === ``) {
        a10 = i10;
        continue;
      }
      return i10;
    }
  }
  return -1;
}
function oS(e206, t10, n10, r10 = true, i10) {
  if (e206 < 4) return null;
  let a10 = i10.getLanguageConfiguration(t10.tokenization.getLanguageId()).indentRulesSupport;
  if (!a10) return null;
  let o10 = new Zx(t10, a10, i10);
  if (n10 <= 1) return { indentation: ``, action: null };
  for (let e207 = n10 - 1; e207 > 0 && t10.getLineContent(e207) === ``; e207--) if (e207 === 1) return { indentation: ``, action: null };
  let s10 = vse(t10, n10, o10);
  if (s10 < 0) return null;
  if (s10 < 1) return { indentation: ``, action: null };
  if (o10.shouldIncrease(s10) || o10.shouldIndentNextLine(s10)) return { indentation: Ka(t10.getLineContent(s10)), action: xf.Indent, line: s10 };
  if (o10.shouldDecrease(s10)) return { indentation: Ka(t10.getLineContent(s10)), action: null, line: s10 };
  {
    if (s10 === 1) return { indentation: Ka(t10.getLineContent(s10)), action: null, line: s10 };
    let e207 = s10 - 1, n11 = a10.getIndentMetadata(t10.getLineContent(e207));
    if (!(n11 & 3) && n11 & 4) {
      let n12 = 0;
      for (let t11 = e207 - 1; t11 > 0; t11--) if (!o10.shouldIndentNextLine(t11)) {
        n12 = t11;
        break;
      }
      return { indentation: Ka(t10.getLineContent(n12 + 1)), action: null, line: n12 + 1 };
    }
    if (r10) return { indentation: Ka(t10.getLineContent(s10)), action: null, line: s10 };
    for (let e208 = s10; e208 > 0; e208--) if (o10.shouldIncrease(e208)) return { indentation: Ka(t10.getLineContent(e208)), action: xf.Indent, line: e208 };
    else if (o10.shouldIndentNextLine(e208)) {
      let n12 = 0;
      for (let t11 = e208 - 1; t11 > 0; t11--) if (!o10.shouldIndentNextLine(e208)) {
        n12 = t11;
        break;
      }
      return { indentation: Ka(t10.getLineContent(n12 + 1)), action: null, line: n12 + 1 };
    } else if (o10.shouldDecrease(e208)) return { indentation: Ka(t10.getLineContent(e208)), action: null, line: e208 };
    return { indentation: Ka(t10.getLineContent(1)), action: null, line: 1 };
  }
}
function sS(e206, t10, n10, r10, i10, a10) {
  if (e206 < 4) return null;
  let o10 = a10.getLanguageConfiguration(n10);
  if (!o10) return null;
  let s10 = a10.getLanguageConfiguration(n10).indentRulesSupport;
  if (!s10) return null;
  let c10 = new Zx(t10, s10, a10), l10 = oS(e206, t10, r10, void 0, a10);
  if (l10) {
    let n11 = l10.line;
    if (n11 !== void 0) {
      let a11 = true;
      for (let e207 = n11; e207 < r10 - 1; e207++) if (!/^\s*$/.test(t10.getLineContent(e207))) {
        a11 = false;
        break;
      }
      if (a11) {
        let a12 = o10.onEnter(e206, ``, t10.getLineContent(n11), ``);
        if (a12) {
          let e207 = Ka(t10.getLineContent(n11));
          return a12.removeText && (e207 = e207.substring(0, e207.length - a12.removeText)), a12.indentAction === xf.Indent || a12.indentAction === xf.IndentOutdent ? e207 = i10.shiftIndent(e207) : a12.indentAction === xf.Outdent && (e207 = i10.unshiftIndent(e207)), c10.shouldDecrease(r10) && (e207 = i10.unshiftIndent(e207)), a12.appendText && (e207 += a12.appendText), Ka(e207);
        }
      }
    }
    return c10.shouldDecrease(r10) ? l10.action === xf.Indent ? l10.indentation : i10.unshiftIndent(l10.indentation) : l10.action === xf.Indent ? i10.shiftIndent(l10.indentation) : l10.indentation;
  }
  return null;
}
function yse(e206, t10, n10, r10, i10) {
  if (e206 < 4) return null;
  let a10 = t10.getLanguageIdAtPosition(n10.startLineNumber, n10.startColumn), o10 = i10.getLanguageConfiguration(a10).indentRulesSupport;
  if (!o10) return null;
  t10.tokenization.forceTokenization(n10.startLineNumber);
  let s10 = new Qx(t10, i10).getProcessedTokenContextAroundRange(n10), c10 = s10.afterRangeProcessedTokens, l10 = s10.beforeRangeProcessedTokens, u10 = Ka(l10.getLineContent()), d10 = xse(t10, n10.startLineNumber, l10), f10 = eS(t10, n10.getStartPosition()), p10 = Ka(t10.getLineContent(n10.startLineNumber)), m10 = oS(e206, d10, n10.startLineNumber + 1, void 0, i10);
  if (!m10) {
    let e207 = f10 ? p10 : u10;
    return { beforeEnter: e207, afterEnter: e207 };
  }
  let h10 = f10 ? p10 : m10.indentation;
  return m10.action === xf.Indent && (h10 = r10.shiftIndent(h10)), o10.shouldDecrease(c10.getLineContent()) && (h10 = r10.unshiftIndent(h10)), { beforeEnter: f10 ? p10 : u10, afterEnter: h10 };
}
function bse(e206, t10, n10, r10, i10, a10) {
  let o10 = e206.autoIndent;
  if (o10 < 4 || eS(t10, n10.getStartPosition())) return null;
  let s10 = t10.getLanguageIdAtPosition(n10.startLineNumber, n10.startColumn), c10 = a10.getLanguageConfiguration(s10).indentRulesSupport;
  if (!c10) return null;
  let l10 = new Qx(t10, a10).getProcessedTokenContextAroundRange(n10), u10 = l10.beforeRangeProcessedTokens.getLineContent(), d10 = l10.afterRangeProcessedTokens.getLineContent(), f10 = u10 + d10, p10 = u10 + r10 + d10;
  if (!c10.shouldDecrease(f10) && c10.shouldDecrease(p10)) {
    let e207 = oS(o10, t10, n10.startLineNumber, false, a10);
    if (!e207) return null;
    let r11 = e207.indentation;
    return e207.action !== xf.Indent && (r11 = i10.unshiftIndent(r11)), r11;
  }
  let m10 = n10.startLineNumber - 1;
  if (m10 > 0) {
    let s11 = t10.getLineContent(m10);
    if (c10.shouldIndentNextLine(s11) && c10.shouldIncrease(p10)) {
      let s12 = oS(o10, t10, n10.startLineNumber, false, a10)?.indentation;
      if (s12 !== void 0) {
        let a11 = Ka(t10.getLineContent(n10.startLineNumber)), o11 = i10.shiftIndent(s12) === a11, c11 = /^\s*$/.test(f10), l11 = e206.autoClosingPairs.autoClosingPairsOpenByEnd.get(r10), u11 = l11 && l11.length > 0 && c11;
        if (o11 && u11) return s12;
      }
    }
  }
  return null;
}
function cS(e206, t10, n10) {
  let r10 = n10.getLanguageConfiguration(e206.getLanguageId()).indentRulesSupport;
  return !r10 || t10 < 1 || t10 > e206.getLineCount() ? null : r10.getIndentMetadata(e206.getLineContent(t10));
}
function xse(e206, t10, n10) {
  return { tokenization: { getLineTokens: (r10) => r10 === t10 ? n10 : e206.tokenization.getLineTokens(r10), getLanguageId: () => e206.getLanguageId(), getLanguageIdAtPosition: (t11, n11) => e206.getLanguageIdAtPosition(t11, n11) }, getLineContent: (r10) => r10 === t10 ? n10.getLineContent() : e206.getLineContent(r10) };
}
var Sse = class {
  static getEdits(e206, t10, n10, r10, i10) {
    if (!i10 && this._isAutoIndentType(e206, t10, n10)) {
      let i11 = [];
      for (let a11 of n10) {
        let n11 = this._findActualIndentationForSelection(e206, t10, a11, r10);
        if (n11 === null) return;
        i11.push({ selection: a11, indentation: n11 });
      }
      let a10 = lS.getAutoClosingPairClose(e206, t10, n10, r10, false);
      return this._getIndentationAndAutoClosingPairEdits(e206, t10, i11, r10, a10);
    }
  }
  static _isAutoIndentType(e206, t10, n10) {
    if (e206.autoIndent < 4) return false;
    for (let e207 = 0, r10 = n10.length; e207 < r10; e207++) if (!t10.tokenization.isCheapToTokenize(n10[e207].getEndPosition().lineNumber)) return false;
    return true;
  }
  static _findActualIndentationForSelection(e206, t10, n10, r10) {
    let i10 = bse(e206, t10, n10, r10, { shiftIndent: (t11) => yS(e206, t11), unshiftIndent: (t11) => bS(e206, t11) }, e206.languageConfigurationService);
    if (i10 === null) return null;
    let a10 = wp(t10, n10.startLineNumber, n10.startColumn);
    return i10 === e206.normalizeIndentation(a10) ? null : i10;
  }
  static _getIndentationAndAutoClosingPairEdits(e206, t10, n10, r10, i10) {
    return new Px(4, n10.map(({ selection: n11, indentation: a10 }) => {
      if (i10 !== null) return new Nse(this._getEditFromIndentationAndSelection(e206, t10, a10, n11, r10, false), n11, r10, i10);
      {
        let i11 = this._getEditFromIndentationAndSelection(e206, t10, a10, n11, r10, true);
        return vS(i11.range, i11.text, false);
      }
    }), { shouldPushStackElementBefore: true, shouldPushStackElementAfter: false });
  }
  static _getEditFromIndentationAndSelection(e206, t10, n10, r10, i10, a10 = true) {
    let o10 = r10.startLineNumber, s10 = t10.getLineFirstNonWhitespaceColumn(o10), c10 = e206.normalizeIndentation(n10);
    if (s10 !== 0) {
      let e207 = t10.getLineContent(o10);
      c10 += e207.substring(s10 - 1, r10.startColumn - 1);
    }
    return c10 += a10 ? i10 : ``, { range: new M(o10, 1, r10.endLineNumber, r10.endColumn), text: c10 };
  }
}, Cse = class {
  static getEdits(e206, t10, n10, r10, i10, a10) {
    if (_S2(t10, n10, r10, i10, a10)) return this._runAutoClosingOvertype(e206, r10, a10);
  }
  static _runAutoClosingOvertype(e206, t10, n10) {
    let r10 = [];
    for (let e207 = 0, i10 = t10.length; e207 < i10; e207++) {
      let i11 = t10[e207].getPosition();
      r10[e207] = new Lx(new M(i11.lineNumber, i11.column, i11.lineNumber, i11.column + 1), n10);
    }
    return new Px(4, r10, { shouldPushStackElementBefore: mS(e206, 4), shouldPushStackElementAfter: false });
  }
}, wse = class {
  static getEdits(e206, t10, n10, r10, i10) {
    if (_S2(e206, t10, n10, r10, i10)) return new Px(4, n10.map((e207) => new Lx(new M(e207.positionLineNumber, e207.positionColumn, e207.positionLineNumber, e207.positionColumn + 1), ``, false)), { shouldPushStackElementBefore: true, shouldPushStackElementAfter: false });
  }
}, lS = class {
  static getEdits(e206, t10, n10, r10, i10, a10) {
    if (!a10) {
      let a11 = this.getAutoClosingPairClose(e206, t10, n10, r10, i10);
      if (a11 !== null) return this._runAutoClosingOpenCharType(n10, r10, i10, a11);
    }
  }
  static _runAutoClosingOpenCharType(e206, t10, n10, r10) {
    let i10 = [];
    for (let a10 = 0, o10 = e206.length; a10 < o10; a10++) {
      let o11 = e206[a10];
      i10[a10] = new Mse(o11, t10, !n10, r10);
    }
    return new Px(4, i10, { shouldPushStackElementBefore: true, shouldPushStackElementAfter: false });
  }
  static getAutoClosingPairClose(e206, t10, n10, r10, i10) {
    for (let e207 of n10) if (!e207.isEmpty()) return null;
    let a10 = n10.map((e207) => {
      let t11 = e207.getPosition();
      return i10 ? { lineNumber: t11.lineNumber, beforeColumn: t11.column - r10.length, afterColumn: t11.column } : { lineNumber: t11.lineNumber, beforeColumn: t11.column, afterColumn: t11.column };
    }), o10 = this._findAutoClosingPairOpen(e206, t10, a10.map((e207) => new j(e207.lineNumber, e207.beforeColumn)), r10);
    if (!o10) return null;
    let s10, c10;
    if (Fx(r10) ? (s10 = e206.autoClosingQuotes, c10 = e206.shouldAutoCloseBefore.quote) : e206.blockCommentStartToken && o10.open.includes(e206.blockCommentStartToken) ? (s10 = e206.autoClosingComments, c10 = e206.shouldAutoCloseBefore.comment) : (s10 = e206.autoClosingBrackets, c10 = e206.shouldAutoCloseBefore.bracket), s10 === `never`) return null;
    let l10 = this._findContainedAutoClosingPair(e206, o10), u10 = l10 ? l10.close : ``, d10 = true;
    for (let n11 of a10) {
      let { lineNumber: i11, beforeColumn: a11, afterColumn: l11 } = n11, f10 = t10.getLineContent(i11), p10 = f10.substring(0, a11 - 1), m10 = f10.substring(l11 - 1);
      if (m10.startsWith(u10) || (d10 = false), m10.length > 0) {
        let t11 = m10.charAt(0);
        if (!this._isBeforeClosingBrace(e206, m10) && !c10(t11)) return null;
      }
      if (o10.open.length === 1 && (r10 === `'` || r10 === `"`) && s10 !== `always`) {
        let t11 = Zp(e206.wordSeparators, []);
        if (p10.length > 0) {
          let e207 = p10.charCodeAt(p10.length - 1);
          if (t11.get(e207) === 0) return null;
        }
      }
      if (!t10.tokenization.isCheapToTokenize(i11)) return null;
      t10.tokenization.forceTokenization(i11);
      let h10 = Ef(t10.tokenization.getLineTokens(i11), a11 - 1);
      if (!o10.shouldAutoClose(h10, a11 - h10.firstCharOffset)) return null;
      let g10 = o10.findNeutralCharacter();
      if (g10) {
        let e207 = t10.tokenization.getTokenTypeIfInsertingCharacter(i11, a11, g10);
        if (!o10.isOK(e207)) return null;
      }
    }
    return d10 ? o10.close.substring(0, o10.close.length - u10.length) : o10.close;
  }
  static _findContainedAutoClosingPair(e206, t10) {
    if (t10.open.length <= 1) return null;
    let n10 = t10.close.charAt(t10.close.length - 1), r10 = e206.autoClosingPairs.autoClosingPairsCloseByEnd.get(n10) || [], i10 = null;
    for (let e207 of r10) e207.open !== t10.open && t10.open.includes(e207.open) && t10.close.endsWith(e207.close) && (!i10 || e207.open.length > i10.open.length) && (i10 = e207);
    return i10;
  }
  static _findAutoClosingPairOpen(e206, t10, n10, r10) {
    let i10 = e206.autoClosingPairs.autoClosingPairsOpenByEnd.get(r10);
    if (!i10) return null;
    let a10 = null;
    for (let e207 of i10) if (a10 === null || e207.open.length > a10.open.length) {
      let i11 = true;
      for (let a11 of n10) if (t10.getValueInRange(new M(a11.lineNumber, a11.column - e207.open.length + 1, a11.lineNumber, a11.column)) + r10 !== e207.open) {
        i11 = false;
        break;
      }
      i11 && (a10 = e207);
    }
    return a10;
  }
  static _isBeforeClosingBrace(e206, t10) {
    let n10 = t10.charAt(0), r10 = e206.autoClosingPairs.autoClosingPairsOpenByStart.get(n10) || [], i10 = e206.autoClosingPairs.autoClosingPairsCloseByStart.get(n10) || [], a10 = r10.some((e207) => t10.startsWith(e207.open)), o10 = i10.some((e207) => t10.startsWith(e207.close));
    return !a10 && o10;
  }
}, uS = class {
  static getEdits(e206, t10) {
    return e206.inputMode === `overtype` ? new Px(4, t10.map((e207) => new pse(e207.insertedTextRange)), { shouldPushStackElementBefore: true, shouldPushStackElementAfter: false }) : null;
  }
}, Tse = class {
  static getEdits(e206, t10, n10, r10, i10) {
    if (!i10 && this._isSurroundSelectionType(e206, t10, n10, r10)) return this._runSurroundSelectionType(e206, n10, r10);
  }
  static _runSurroundSelectionType(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = e206.surroundingPairs[n10];
      r10[i10] = new gse(a11, n10, o10);
    }
    return new Px(0, r10, { shouldPushStackElementBefore: true, shouldPushStackElementAfter: true });
  }
  static _isSurroundSelectionType(e206, t10, n10, r10) {
    if (!xS(e206, r10) || !e206.surroundingPairs.hasOwnProperty(r10)) return false;
    let i10 = Fx(r10);
    for (let e207 of n10) {
      if (e207.isEmpty()) return false;
      let n11 = true;
      for (let r11 = e207.startLineNumber; r11 <= e207.endLineNumber; r11++) {
        let i11 = t10.getLineContent(r11), a10 = r11 === e207.startLineNumber ? e207.startColumn - 1 : 0, o10 = r11 === e207.endLineNumber ? e207.endColumn - 1 : i11.length, s10 = i11.substring(a10, o10);
        if (/[^ \t]/.test(s10)) {
          n11 = false;
          break;
        }
      }
      if (n11 || i10 && e207.startLineNumber === e207.endLineNumber && e207.startColumn + 1 === e207.endColumn && Fx(t10.getValueInRange(e207))) return false;
    }
    return true;
  }
}, Ese = class {
  static getEdits(e206, t10, n10, r10, i10, a10) {
    if (!a10 && this._isTypeInterceptorElectricChar(t10, n10, r10)) {
      let a11 = this._typeInterceptorElectricChar(e206, t10, n10, r10[0], i10);
      if (a11) return a11;
    }
  }
  static _isTypeInterceptorElectricChar(e206, t10, n10) {
    return !!(n10.length === 1 && t10.tokenization.isCheapToTokenize(n10[0].getEndPosition().lineNumber));
  }
  static _typeInterceptorElectricChar(e206, t10, n10, r10, i10) {
    if (!t10.electricChars.hasOwnProperty(i10) || !r10.isEmpty()) return null;
    let a10 = r10.getPosition();
    n10.tokenization.forceTokenization(a10.lineNumber);
    let o10 = n10.tokenization.getLineTokens(a10.lineNumber), s10;
    try {
      s10 = t10.onElectricCharacter(i10, o10, a10.column);
    } catch (e207) {
      return be(e207), null;
    }
    if (!s10) return null;
    if (s10.matchOpenBracket) {
      let r11 = (o10.getLineContent() + i10).lastIndexOf(s10.matchOpenBracket) + 1, c10 = n10.bracketPairs.findMatchingBracketUp(s10.matchOpenBracket, { lineNumber: a10.lineNumber, column: r11 }, 500);
      if (c10) {
        if (c10.startLineNumber === a10.lineNumber) return null;
        let r12 = Ka(n10.getLineContent(c10.startLineNumber)), o11 = t10.normalizeIndentation(r12), s11 = n10.getLineContent(a10.lineNumber), l10 = n10.getLineFirstNonWhitespaceColumn(a10.lineNumber) || a10.column, u10 = o11 + s11.substring(l10 - 1, a10.column - 1) + i10, d10 = new Lx(new M(a10.lineNumber, 1, a10.lineNumber, a10.column), u10);
        return new Px(pS(u10, e206), [d10], { shouldPushStackElementBefore: false, shouldPushStackElementAfter: true });
      }
    }
    return null;
  }
}, Dse = class {
  static getEdits(e206, t10, n10, r10, i10) {
    let a10 = [];
    for (let t11 = 0, o11 = n10.length; t11 < o11; t11++) a10[t11] = new (e206.inputMode === `overtype` && !i10 ? Rx : Lx)(n10[t11], r10);
    let o10 = pS(r10, t10);
    return new Px(o10, a10, { shouldPushStackElementBefore: mS(t10, o10), shouldPushStackElementAfter: false });
  }
}, dS = class {
  static getEdits(e206, t10, n10, r10, i10) {
    if (!i10 && r10 === `
`) {
      let r11 = [];
      for (let i11 = 0, a10 = n10.length; i11 < a10; i11++) r11[i11] = this._enter(e206, t10, false, n10[i11]);
      return new Px(4, r11, { shouldPushStackElementBefore: true, shouldPushStackElementAfter: false });
    }
  }
  static _enter(e206, t10, n10, r10) {
    if (e206.autoIndent === 0) return vS(r10, `
`, n10);
    if (!t10.tokenization.isCheapToTokenize(r10.getStartPosition().lineNumber) || e206.autoIndent === 1) {
      let i11 = Ka(t10.getLineContent(r10.startLineNumber)).substring(0, r10.startColumn - 1);
      return vS(r10, `
` + e206.normalizeIndentation(i11), n10);
    }
    let i10 = tS(e206.autoIndent, t10, r10, e206.languageConfigurationService);
    if (i10) {
      if (i10.indentAction === xf.None || i10.indentAction === xf.Indent) return vS(r10, `
` + e206.normalizeIndentation(i10.indentation + i10.appendText), n10);
      if (i10.indentAction === xf.IndentOutdent) {
        let t11 = e206.normalizeIndentation(i10.indentation), a11 = e206.normalizeIndentation(i10.indentation + i10.appendText), o10 = `
` + a11 + `
` + t11;
        return n10 ? new zx(r10, o10, true) : new Bx(r10, o10, -1, a11.length - t11.length, true);
      } else if (i10.indentAction === xf.Outdent) {
        let t11 = bS(e206, i10.indentation);
        return vS(r10, `
` + e206.normalizeIndentation(t11 + i10.appendText), n10);
      }
    }
    let a10 = Ka(t10.getLineContent(r10.startLineNumber)).substring(0, r10.startColumn - 1);
    if (e206.autoIndent >= 4) {
      let i11 = yse(e206.autoIndent, t10, r10, { unshiftIndent: (t11) => bS(e206, t11), shiftIndent: (t11) => yS(e206, t11), normalizeIndentation: (t11) => e206.normalizeIndentation(t11) }, e206.languageConfigurationService);
      if (i11) {
        let a11 = e206.visibleColumnFromColumn(t10, r10.getEndPosition()), o10 = r10.endColumn, s10 = Ga(t10.getLineContent(r10.endLineNumber));
        if (r10 = s10 >= 0 ? r10.setEndPosition(r10.endLineNumber, Math.max(r10.endColumn, s10 + 1)) : r10.setEndPosition(r10.endLineNumber, t10.getLineMaxColumn(r10.endLineNumber)), n10) return new zx(r10, `
` + e206.normalizeIndentation(i11.afterEnter), true);
        {
          let t11 = 0;
          return o10 <= s10 + 1 && (e206.insertSpaces || (a11 = Math.ceil(a11 / e206.indentSize)), t11 = Math.min(a11 + 1 - e206.normalizeIndentation(i11.afterEnter).length - 1, 0)), new Bx(r10, `
` + e206.normalizeIndentation(i11.afterEnter), 0, t11, true);
        }
      }
    }
    return vS(r10, `
` + e206.normalizeIndentation(a10), n10);
  }
  static lineInsertBefore(e206, t10, n10) {
    if (t10 === null || n10 === null) return [];
    let r10 = [];
    for (let i10 = 0, a10 = n10.length; i10 < a10; i10++) {
      let a11 = n10[i10].positionLineNumber;
      if (a11 === 1) r10[i10] = new zx(new M(1, 1, 1, 1), `
`);
      else {
        a11--;
        let n11 = t10.getLineMaxColumn(a11);
        r10[i10] = this._enter(e206, t10, false, new M(a11, n11, a11, n11));
      }
    }
    return r10;
  }
  static lineInsertAfter(e206, t10, n10) {
    if (t10 === null || n10 === null) return [];
    let r10 = [];
    for (let i10 = 0, a10 = n10.length; i10 < a10; i10++) {
      let a11 = n10[i10].positionLineNumber, o10 = t10.getLineMaxColumn(a11);
      r10[i10] = this._enter(e206, t10, false, new M(a11, o10, a11, o10));
    }
    return r10;
  }
  static lineBreakInsert(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = n10.length; i10 < a10; i10++) r10[i10] = this._enter(e206, t10, true, n10[i10]);
    return r10;
  }
}, Ose = class {
  static getEdits(e206, t10, n10, r10, i10, a10) {
    let o10 = this._distributePasteToCursors(e206, n10, r10, i10, a10);
    return o10 ? (n10 = n10.sort(M.compareRangesUsingStarts), this._distributedPaste(e206, t10, n10, o10)) : this._simplePaste(e206, t10, n10, r10, i10);
  }
  static _distributePasteToCursors(e206, t10, n10, r10, i10) {
    if (r10 || t10.length === 1) return null;
    if (i10 && i10.length === t10.length) return i10;
    if (e206.multiCursorPaste === `spread`) {
      n10.charCodeAt(n10.length - 1) === 10 && (n10 = n10.substring(0, n10.length - 1)), n10.charCodeAt(n10.length - 1) === 13 && (n10 = n10.substring(0, n10.length - 1));
      let e207 = Wa(n10);
      if (e207.length === t10.length) return e207;
    }
    return null;
  }
  static _distributedPaste(e206, t10, n10, r10) {
    let i10 = [];
    for (let t11 = 0, a10 = n10.length; t11 < a10; t11++) i10[t11] = new (e206.overtypeOnPaste && e206.inputMode === `overtype` ? Rx : Lx)(n10[t11], r10[t11]);
    return new Px(0, i10, { shouldPushStackElementBefore: true, shouldPushStackElementAfter: true });
  }
  static _simplePaste(e206, t10, n10, r10, i10) {
    let a10 = [];
    for (let t11 = 0, o10 = n10.length; t11 < o10; t11++) {
      let o11 = n10[t11], s10 = o11.getPosition();
      i10 && !o11.isEmpty() && (i10 = false), i10 && r10.indexOf(`
`) !== r10.length - 1 && (i10 = false), i10 ? a10[t11] = new Vx(new M(s10.lineNumber, 1, s10.lineNumber, 1), r10, o11, true) : a10[t11] = new (e206.overtypeOnPaste && e206.inputMode === `overtype` ? Rx : Lx)(o11, r10);
    }
    return new Px(0, a10, { shouldPushStackElementBefore: true, shouldPushStackElementAfter: true });
  }
}, kse = class {
  static getEdits(e206, t10, n10, r10, i10, a10, o10, s10) {
    return new Px(4, r10.map((e207) => this._compositionType(n10, e207, i10, a10, o10, s10)), { shouldPushStackElementBefore: mS(e206, 4), shouldPushStackElementAfter: false });
  }
  static _compositionType(e206, t10, n10, r10, i10, a10) {
    if (!t10.isEmpty()) return null;
    let o10 = t10.getPosition(), s10 = Math.max(1, o10.column - r10), c10 = Math.min(e206.getLineMaxColumn(o10.lineNumber), o10.column + i10);
    return new Bx(new M(o10.lineNumber, s10, o10.lineNumber, c10), n10, 0, a10);
  }
}, Ase = class {
  static getEdits(e206, t10, n10) {
    let r10 = [];
    for (let e207 = 0, i11 = t10.length; e207 < i11; e207++) r10[e207] = new Lx(t10[e207], n10);
    let i10 = pS(n10, e206);
    return new Px(i10, r10, { shouldPushStackElementBefore: mS(e206, i10), shouldPushStackElementAfter: false });
  }
}, jse = class {
  static getCommands(e206, t10, n10) {
    let r10 = [];
    for (let i10 = 0, a10 = n10.length; i10 < a10; i10++) {
      let a11 = n10[i10];
      if (a11.isEmpty()) {
        let n11 = t10.getLineContent(a11.startLineNumber);
        if (/^\s*$/.test(n11) && t10.tokenization.isCheapToTokenize(a11.startLineNumber)) {
          let o10 = this._goodIndentForLine(e206, t10, a11.startLineNumber);
          o10 || (o10 = `	`);
          let s10 = e206.normalizeIndentation(o10);
          if (!n11.startsWith(s10)) {
            r10[i10] = new Lx(new M(a11.startLineNumber, 1, a11.startLineNumber, n11.length + 1), s10, true);
            continue;
          }
        }
        r10[i10] = this._replaceJumpToNextIndent(e206, t10, a11, true);
      } else {
        if (a11.startLineNumber === a11.endLineNumber) {
          let n11 = t10.getLineMaxColumn(a11.startLineNumber);
          if (a11.startColumn !== 1 || a11.endColumn !== n11) {
            r10[i10] = this._replaceJumpToNextIndent(e206, t10, a11, false);
            continue;
          }
        }
        r10[i10] = new aS(a11, { isUnshift: false, tabSize: e206.tabSize, indentSize: e206.indentSize, insertSpaces: e206.insertSpaces, useTabStops: e206.useTabStops, autoIndent: e206.autoIndent }, e206.languageConfigurationService);
      }
    }
    return r10;
  }
  static _goodIndentForLine(e206, t10, n10) {
    let r10 = null, i10 = ``, a10 = oS(e206.autoIndent, t10, n10, false, e206.languageConfigurationService);
    if (a10) r10 = a10.action, i10 = a10.indentation;
    else if (n10 > 1) {
      let r11;
      for (r11 = n10 - 1; r11 >= 1 && !(qa(t10.getLineContent(r11)) >= 0); r11--) ;
      if (r11 < 1) return null;
      let a11 = t10.getLineMaxColumn(r11), o10 = tS(e206.autoIndent, t10, new M(r11, a11, r11, a11), e206.languageConfigurationService);
      o10 && (i10 = o10.indentation + o10.appendText);
    }
    return r10 && (r10 === xf.Indent && (i10 = yS(e206, i10)), r10 === xf.Outdent && (i10 = bS(e206, i10)), i10 = e206.normalizeIndentation(i10)), i10 || null;
  }
  static _replaceJumpToNextIndent(e206, t10, n10, r10) {
    let i10 = ``, a10 = n10.getStartPosition();
    if (e206.insertSpaces) {
      let n11 = e206.visibleColumnFromColumn(t10, a10), r11 = e206.indentSize, o10 = r11 - n11 % r11;
      for (let e207 = 0; e207 < o10; e207++) i10 += ` `;
    } else i10 = `	`;
    return new Lx(n10, i10, r10);
  }
}, fS = class extends Bx {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(e206, t10, n10, r10), this._openCharacter = i10, this._closeCharacter = a10, this.closeCharacterRange = null, this.enclosingRange = null;
  }
  _computeCursorStateWithRange(e206, t10, n10) {
    return this.closeCharacterRange = new M(t10.startLineNumber, t10.endColumn - this._closeCharacter.length, t10.endLineNumber, t10.endColumn), this.enclosingRange = new M(t10.startLineNumber, t10.endColumn - this._openCharacter.length - this._closeCharacter.length, t10.endLineNumber, t10.endColumn), super.computeCursorState(e206, n10);
  }
}, Mse = class extends fS {
  constructor(e206, t10, n10, r10) {
    let i10 = (n10 ? t10 : ``) + r10, a10 = -r10.length;
    super(e206, i10, 0, a10, t10, r10);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return this._computeCursorStateWithRange(e206, n10, t10);
  }
}, Nse = class extends fS {
  constructor(e206, t10, n10, r10) {
    let i10 = n10 + r10, a10 = n10.length;
    super(t10, i10, 0, a10, n10, r10), this._autoIndentationEdit = e206, this._autoClosingEdit = { range: t10, text: i10 };
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(this._autoIndentationEdit.range, this._autoIndentationEdit.text), t10.addTrackedEditOperation(this._autoClosingEdit.range, this._autoClosingEdit.text);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations();
    if (n10.length !== 2) throw Error(`There should be two inverse edit operations!`);
    let r10 = n10[0].range, i10 = n10[1].range, a10 = r10.plusRange(i10);
    return this._computeCursorStateWithRange(e206, a10, t10);
  }
};
function pS(e206, t10) {
  return e206 === ` ` ? t10 === 5 || t10 === 6 ? 6 : 5 : 4;
}
function mS(e206, t10) {
  return gS(e206) && !gS(t10) ? true : e206 === 5 ? false : hS(e206) !== hS(t10);
}
function hS(e206) {
  return e206 === 6 || e206 === 5 ? `space` : e206;
}
function gS(e206) {
  return e206 === 4 || e206 === 5 || e206 === 6;
}
function _S2(e206, t10, n10, r10, i10) {
  if (e206.autoClosingOvertype === `never` || !e206.autoClosingPairs.autoClosingPairsCloseSingleChar.has(i10)) return false;
  for (let a10 = 0, o10 = n10.length; a10 < o10; a10++) {
    let o11 = n10[a10];
    if (!o11.isEmpty()) return false;
    let s10 = o11.getPosition(), c10 = t10.getLineContent(s10.lineNumber);
    if (c10.charAt(s10.column - 1) !== i10) return false;
    let l10 = Fx(i10);
    if ((s10.column > 2 ? c10.charCodeAt(s10.column - 2) : 0) === 92 && l10) return false;
    if (e206.autoClosingOvertype === `auto`) {
      let e207 = false;
      for (let t11 = 0, n11 = r10.length; t11 < n11; t11++) {
        let n12 = r10[t11];
        if (s10.lineNumber === n12.startLineNumber && s10.column === n12.startColumn) {
          e207 = true;
          break;
        }
      }
      if (!e207) return false;
    }
  }
  return true;
}
function vS(e206, t10, n10) {
  return n10 ? new zx(e206, t10, true) : new Lx(e206, t10, true);
}
function yS(e206, t10, n10) {
  return n10 || (n10 = 1), aS.shiftIndent(t10, t10.length + n10, e206.tabSize, e206.indentSize, e206.insertSpaces);
}
function bS(e206, t10, n10) {
  return n10 || (n10 = 1), aS.unshiftIndent(t10, t10.length + n10, e206.tabSize, e206.indentSize, e206.insertSpaces);
}
function xS(e206, t10) {
  return Fx(t10) ? e206.autoSurround === `quotes` || e206.autoSurround === `languageDefined` : e206.autoSurround === `brackets` || e206.autoSurround === `languageDefined`;
}
var SS = class {
  static indent(e206, t10, n10) {
    if (t10 === null || n10 === null) return [];
    let r10 = [];
    for (let t11 = 0, i10 = n10.length; t11 < i10; t11++) r10[t11] = new aS(n10[t11], { isUnshift: false, tabSize: e206.tabSize, indentSize: e206.indentSize, insertSpaces: e206.insertSpaces, useTabStops: e206.useTabStops, autoIndent: e206.autoIndent }, e206.languageConfigurationService);
    return r10;
  }
  static outdent(e206, t10, n10) {
    let r10 = [];
    for (let t11 = 0, i10 = n10.length; t11 < i10; t11++) r10[t11] = new aS(n10[t11], { isUnshift: true, tabSize: e206.tabSize, indentSize: e206.indentSize, insertSpaces: e206.insertSpaces, useTabStops: e206.useTabStops, autoIndent: e206.autoIndent }, e206.languageConfigurationService);
    return r10;
  }
  static paste(e206, t10, n10, r10, i10, a10) {
    return Ose.getEdits(e206, t10, n10, r10, i10, a10);
  }
  static tab(e206, t10, n10) {
    return jse.getCommands(e206, t10, n10);
  }
  static compositionType(e206, t10, n10, r10, i10, a10, o10, s10) {
    return kse.getEdits(e206, t10, n10, r10, i10, a10, o10, s10);
  }
  static compositionEndWithInterceptors(e206, t10, n10, r10, i10, a10) {
    if (!r10) return null;
    let o10 = null;
    for (let e207 of r10) if (o10 === null) o10 = e207.insertedText;
    else if (o10 !== e207.insertedText) return null;
    if (!o10 || o10.length !== 1) return uS.getEdits(t10, r10);
    let s10 = o10, c10 = false;
    for (let e207 of r10) if (e207.deletedText.length !== 0) {
      c10 = true;
      break;
    }
    if (c10) {
      if (!xS(t10, s10) || !t10.surroundingPairs.hasOwnProperty(s10)) return null;
      let e207 = Fx(s10);
      for (let t11 of r10) if (t11.deletedSelectionStart !== 0 || t11.deletedSelectionEnd !== t11.deletedText.length || /^[ \t]+$/.test(t11.deletedText) || e207 && Fx(t11.deletedText)) return null;
      let n11 = [];
      for (let e208 of i10) {
        if (!e208.isEmpty()) return null;
        n11.push(e208.getPosition());
      }
      if (n11.length !== r10.length) return null;
      let a11 = [];
      for (let e208 = 0, i11 = n11.length; e208 < i11; e208++) a11.push(new _se(n11[e208], r10[e208].deletedText, t10.surroundingPairs[s10]));
      return new Px(4, a11, { shouldPushStackElementBefore: true, shouldPushStackElementAfter: false });
    }
    let l10 = wse.getEdits(t10, n10, i10, a10, s10);
    if (l10 !== void 0) return l10;
    let u10 = lS.getEdits(t10, n10, i10, s10, true, false);
    return u10 === void 0 ? uS.getEdits(t10, r10) : u10;
  }
  static typeWithInterceptors(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = dS.getEdits(n10, r10, i10, o10, e206);
    if (s10 !== void 0) return s10;
    let c10 = Sse.getEdits(n10, r10, i10, o10, e206);
    if (c10 !== void 0) return c10;
    let l10 = Cse.getEdits(t10, n10, r10, i10, a10, o10);
    if (l10 !== void 0) return l10;
    let u10 = lS.getEdits(n10, r10, i10, o10, false, e206);
    if (u10 !== void 0) return u10;
    let d10 = Tse.getEdits(n10, r10, i10, o10, e206);
    if (d10 !== void 0) return d10;
    let f10 = Ese.getEdits(t10, n10, r10, i10, o10, e206);
    return f10 === void 0 ? Dse.getEdits(n10, t10, i10, o10, e206) : f10;
  }
  static typeWithoutInterceptors(e206, t10, n10, r10, i10) {
    return Ase.getEdits(e206, r10, i10);
  }
}, Pse = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.deletedText = e206, this.deletedSelectionStart = t10, this.deletedSelectionEnd = n10, this.insertedText = r10, this.insertedSelectionStart = i10, this.insertedSelectionEnd = a10, this.insertedTextRange = o10;
  }
}, $;
(function(e206) {
  e206.editorSimpleInput = new U(`editorSimpleInput`, false, true), e206.editorTextFocus = new U(`editorTextFocus`, false, C(681, `Whether the editor text has focus (cursor is blinking)`)), e206.focus = new U(`editorFocus`, false, C(682, `Whether the editor or an editor widget has focus (e.g. focus is in the find widget)`)), e206.textInputFocus = new U(`textInputFocus`, false, C(683, `Whether an editor or a rich text input has focus (cursor is blinking)`)), e206.readOnly = new U(`editorReadonly`, false, C(684, `Whether the editor is read-only`)), e206.inDiffEditor = new U(`inDiffEditor`, false, C(685, `Whether the context is a diff editor`)), e206.isEmbeddedDiffEditor = new U(`isEmbeddedDiffEditor`, false, C(686, `Whether the context is an embedded diff editor`)), e206.inMultiDiffEditor = new U(`inMultiDiffEditor`, false, C(687, `Whether the context is a multi diff editor`)), e206.multiDiffEditorAllCollapsed = new U(`multiDiffEditorAllCollapsed`, void 0, C(688, `Whether all files in multi diff editor are collapsed`)), e206.hasChanges = new U(`diffEditorHasChanges`, false, C(689, `Whether the diff editor has changes`)), e206.comparingMovedCode = new U(`comparingMovedCode`, false, C(690, `Whether a moved code block is selected for comparison`)), e206.accessibleDiffViewerVisible = new U(`accessibleDiffViewerVisible`, false, C(691, `Whether the accessible diff viewer is visible`)), e206.diffEditorRenderSideBySideInlineBreakpointReached = new U(`diffEditorRenderSideBySideInlineBreakpointReached`, false, C(692, `Whether the diff editor render side by side inline breakpoint is reached`)), e206.diffEditorInlineMode = new U(`diffEditorInlineMode`, false, C(693, `Whether inline mode is active`)), e206.diffEditorOriginalWritable = new U(`diffEditorOriginalWritable`, false, C(694, `Whether modified is writable in the diff editor`)), e206.diffEditorModifiedWritable = new U(`diffEditorModifiedWritable`, false, C(695, `Whether modified is writable in the diff editor`)), e206.diffEditorOriginalUri = new U(`diffEditorOriginalUri`, ``, C(696, `The uri of the original document`)), e206.diffEditorModifiedUri = new U(`diffEditorModifiedUri`, ``, C(697, `The uri of the modified document`)), e206.columnSelection = new U(`editorColumnSelection`, false, C(698, "Whether `editor.columnSelection` is enabled")), e206.writable = e206.readOnly.toNegated(), e206.hasNonEmptySelection = new U(`editorHasSelection`, false, C(699, `Whether the editor has text selected`)), e206.hasOnlyEmptySelection = e206.hasNonEmptySelection.toNegated(), e206.hasMultipleSelections = new U(`editorHasMultipleSelections`, false, C(700, `Whether the editor has multiple selections`)), e206.hasSingleSelection = e206.hasMultipleSelections.toNegated(), e206.tabMovesFocus = new U(`editorTabMovesFocus`, false, C(701, "Whether `Tab` will move focus out of the editor")), e206.tabDoesNotMoveFocus = e206.tabMovesFocus.toNegated(), e206.isInEmbeddedEditor = new U(`isInEmbeddedEditor`, false, true), e206.canUndo = new U(`canUndo`, false, true), e206.canRedo = new U(`canRedo`, false, true), e206.hoverVisible = new U(`editorHoverVisible`, false, C(702, `Whether the editor hover is visible`)), e206.hoverFocused = new U(`editorHoverFocused`, false, C(703, `Whether the editor hover is focused`)), e206.stickyScrollFocused = new U(`stickyScrollFocused`, false, C(704, `Whether the sticky scroll is focused`)), e206.stickyScrollVisible = new U(`stickyScrollVisible`, false, C(705, `Whether the sticky scroll is visible`)), e206.standaloneColorPickerVisible = new U(`standaloneColorPickerVisible`, false, C(706, `Whether the standalone color picker is visible`)), e206.standaloneColorPickerFocused = new U(`standaloneColorPickerFocused`, false, C(707, `Whether the standalone color picker is focused`)), e206.inCompositeEditor = new U(`inCompositeEditor`, void 0, C(708, `Whether the editor is part of a larger editor (e.g. notebooks)`)), e206.notInCompositeEditor = e206.inCompositeEditor.toNegated(), e206.languageId = new U(`editorLangId`, ``, C(709, `The language identifier of the editor`)), e206.hasCompletionItemProvider = new U(`editorHasCompletionItemProvider`, false, C(710, `Whether the editor has a completion item provider`)), e206.hasCodeActionsProvider = new U(`editorHasCodeActionsProvider`, false, C(711, `Whether the editor has a code actions provider`)), e206.hasCodeLensProvider = new U(`editorHasCodeLensProvider`, false, C(712, `Whether the editor has a code lens provider`)), e206.hasDefinitionProvider = new U(`editorHasDefinitionProvider`, false, C(713, `Whether the editor has a definition provider`)), e206.hasDeclarationProvider = new U(`editorHasDeclarationProvider`, false, C(714, `Whether the editor has a declaration provider`)), e206.hasImplementationProvider = new U(`editorHasImplementationProvider`, false, C(715, `Whether the editor has an implementation provider`)), e206.hasTypeDefinitionProvider = new U(`editorHasTypeDefinitionProvider`, false, C(716, `Whether the editor has a type definition provider`)), e206.hasHoverProvider = new U(`editorHasHoverProvider`, false, C(717, `Whether the editor has a hover provider`)), e206.hasDocumentHighlightProvider = new U(`editorHasDocumentHighlightProvider`, false, C(718, `Whether the editor has a document highlight provider`)), e206.hasDocumentSymbolProvider = new U(`editorHasDocumentSymbolProvider`, false, C(719, `Whether the editor has a document symbol provider`)), e206.hasReferenceProvider = new U(`editorHasReferenceProvider`, false, C(720, `Whether the editor has a reference provider`)), e206.hasRenameProvider = new U(`editorHasRenameProvider`, false, C(721, `Whether the editor has a rename provider`)), e206.hasSignatureHelpProvider = new U(`editorHasSignatureHelpProvider`, false, C(722, `Whether the editor has a signature help provider`)), e206.hasInlayHintsProvider = new U(`editorHasInlayHintsProvider`, false, C(723, `Whether the editor has an inline hints provider`)), e206.hasDocumentFormattingProvider = new U(`editorHasDocumentFormattingProvider`, false, C(724, `Whether the editor has a document formatting provider`)), e206.hasDocumentSelectionFormattingProvider = new U(`editorHasDocumentSelectionFormattingProvider`, false, C(725, `Whether the editor has a document selection formatting provider`)), e206.hasMultipleDocumentFormattingProvider = new U(`editorHasMultipleDocumentFormattingProvider`, false, C(726, `Whether the editor has multiple document formatting providers`)), e206.hasMultipleDocumentSelectionFormattingProvider = new U(`editorHasMultipleDocumentSelectionFormattingProvider`, false, C(727, `Whether the editor has multiple document selection formatting providers`));
})($ || ($ = {}));
var CS = 0, wS = class extends $d {
  runEditorCommand(e206, t10, n10) {
    let r10 = t10._getViewModel();
    r10 && this.runCoreEditorCommand(r10, n10 || {});
  }
}, TS;
(function(e206) {
  e206.metadata = { description: `Scroll editor in the given direction`, args: [{ name: `Editor scroll argument object`, description: "Property-value pairs that can be passed through this argument:\n					* 'to': A mandatory direction value.\n						```\n						'up', 'down'\n						```\n					* 'by': Unit to move. Default is computed based on 'to' value.\n						```\n						'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n						```\n					* 'value': Number of units to move. Default is '1'.\n					* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n				", constraint: function(e207) {
    if (!Be(e207)) return false;
    let t11 = e207;
    return !(!Re(t11.to) || !Ge(t11.by) && !Re(t11.by) || !Ge(t11.value) && !He(t11.value) || !Ge(t11.revealCursor) && !We(t11.revealCursor));
  }, schema: { type: `object`, required: [`to`], properties: { to: { type: `string`, enum: [`up`, `down`] }, by: { type: `string`, enum: [`line`, `wrappedLine`, `page`, `halfPage`, `editor`] }, value: { type: `number`, default: 1 }, revealCursor: { type: `boolean` } } } }] }, e206.RawDirection = { Up: `up`, Right: `right`, Down: `down`, Left: `left` }, e206.RawUnit = { Line: `line`, WrappedLine: `wrappedLine`, Page: `page`, HalfPage: `halfPage`, Editor: `editor`, Column: `column` };
  function t10(t11) {
    let n10;
    switch (t11.to) {
      case e206.RawDirection.Up:
        n10 = 1;
        break;
      case e206.RawDirection.Right:
        n10 = 2;
        break;
      case e206.RawDirection.Down:
        n10 = 3;
        break;
      case e206.RawDirection.Left:
        n10 = 4;
        break;
      default:
        return null;
    }
    let r10;
    switch (t11.by) {
      case e206.RawUnit.Line:
        r10 = 1;
        break;
      case e206.RawUnit.WrappedLine:
        r10 = 2;
        break;
      case e206.RawUnit.Page:
        r10 = 3;
        break;
      case e206.RawUnit.HalfPage:
        r10 = 4;
        break;
      case e206.RawUnit.Editor:
        r10 = 5;
        break;
      case e206.RawUnit.Column:
        r10 = 6;
        break;
      default:
        r10 = 2;
    }
    let i10 = Math.floor(t11.value || 1), a10 = !!t11.revealCursor;
    return { direction: n10, unit: r10, value: i10, revealCursor: a10, select: !!t11.select };
  }
  e206.parse = t10;
})(TS || (TS = {}));
var ES;
(function(e206) {
  e206.metadata = { description: `Reveal the given line at the given logical position`, args: [{ name: `Reveal line argument object`, description: `Property-value pairs that can be passed through this argument:
					* 'lineNumber': A mandatory line number value.
					* 'at': Logical position at which line has to be revealed.
						\`\`\`
						'top', 'center', 'bottom'
						\`\`\`
				`, constraint: function(e207) {
    if (!Be(e207)) return false;
    let t10 = e207;
    return !(!He(t10.lineNumber) && !Re(t10.lineNumber) || !Ge(t10.at) && !Re(t10.at));
  }, schema: { type: `object`, required: [`lineNumber`], properties: { lineNumber: { type: [`number`, `string`] }, at: { type: `string`, enum: [`top`, `center`, `bottom`] } } } }] }, e206.RawAtArgument = { Top: `top`, Center: `center`, Bottom: `bottom` };
})(ES || (ES = {}));
var DS = class {
  constructor(e206) {
    e206.addImplementation(1e4, `code-editor`, (e207, t10) => {
      let n10 = e207.get(Su).getFocusedCodeEditor();
      return n10 && n10.hasTextFocus() ? this._runEditorCommand(e207, n10, t10) : false;
    }), e206.addImplementation(1e3, `generic-dom-input-textarea`, (e207, t10) => {
      let n10 = kl();
      return n10 && iu(n10) ? (this.runDOMCommand(n10), true) : false;
    }), e206.addImplementation(0, `generic-dom`, (e207, t10) => {
      let n10 = e207.get(Su).getActiveCodeEditor();
      return n10 ? (n10.focus(), this._runEditorCommand(e207, n10, t10)) : false;
    });
  }
  _runEditorCommand(e206, t10, n10) {
    return this.runEditorCommand(e206, t10, n10) || true;
  }
}, OS;
(function(e206) {
  class t10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      t11.position && (e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, [Yx.moveTo(e207, e207.getPrimaryCursorState(), this._inSelectionMode, t11.position, t11.viewPosition)]) && t11.revealType !== 2 && e207.revealAllCursors(t11.source, true, true));
    }
  }
  e206.MoveTo = K(new t10({ id: `_moveTo`, inSelectionMode: false, precondition: void 0 })), e206.MoveToSelect = K(new t10({ id: `_moveToSelect`, inSelectionMode: true, precondition: void 0 }));
  class n10 extends wS {
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement();
      let n11 = this._getColumnSelectResult(e207, e207.getPrimaryCursorState(), e207.getCursorColumnSelectData(), t11);
      n11 !== null && (e207.setCursorStates(t11.source, 3, n11.viewStates.map((e208) => Mx.fromViewState(e208))), e207.setCursorColumnSelectData({ isReal: true, fromViewLineNumber: n11.fromLineNumber, fromViewVisualColumn: n11.fromVisualColumn, toViewLineNumber: n11.toLineNumber, toViewVisualColumn: n11.toVisualColumn }), n11.reversed ? e207.revealTopMostCursor(t11.source) : e207.revealBottomMostCursor(t11.source));
    }
  }
  e206.ColumnSelect = K(new class extends n10 {
    constructor() {
      super({ id: `columnSelect`, precondition: void 0 });
    }
    _getColumnSelectResult(e207, t11, n11, r11) {
      if (r11.position === void 0 || r11.viewPosition === void 0 || r11.mouseColumn === void 0) return null;
      let i11 = e207.model.validatePosition(r11.position), a11 = e207.coordinatesConverter.validateViewPosition(new j(r11.viewPosition.lineNumber, r11.viewPosition.column), i11), o11 = r11.doColumnSelect ? n11.fromViewLineNumber : a11.lineNumber, s11 = r11.doColumnSelect ? n11.fromViewVisualColumn : r11.mouseColumn - 1;
      return Ix.columnSelect(e207.cursorConfig, e207, o11, s11, a11.lineNumber, r11.mouseColumn - 1);
    }
  }()), e206.CursorColumnSelectLeft = K(new class extends n10 {
    constructor() {
      super({ id: `cursorColumnSelectLeft`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3599, linux: { primary: 0 } } });
    }
    _getColumnSelectResult(e207, t11, n11, r11) {
      return Ix.columnSelectLeft(e207.cursorConfig, e207, n11);
    }
  }()), e206.CursorColumnSelectRight = K(new class extends n10 {
    constructor() {
      super({ id: `cursorColumnSelectRight`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3601, linux: { primary: 0 } } });
    }
    _getColumnSelectResult(e207, t11, n11, r11) {
      return Ix.columnSelectRight(e207.cursorConfig, e207, n11);
    }
  }());
  class r10 extends n10 {
    constructor(e207) {
      super(e207), this._isPaged = e207.isPaged;
    }
    _getColumnSelectResult(e207, t11, n11, r11) {
      return Ix.columnSelectUp(e207.cursorConfig, e207, n11, this._isPaged);
    }
  }
  e206.CursorColumnSelectUp = K(new r10({ isPaged: false, id: `cursorColumnSelectUp`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3600, linux: { primary: 0 } } })), e206.CursorColumnSelectPageUp = K(new r10({ isPaged: true, id: `cursorColumnSelectPageUp`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3595, linux: { primary: 0 } } }));
  class i10 extends n10 {
    constructor(e207) {
      super(e207), this._isPaged = e207.isPaged;
    }
    _getColumnSelectResult(e207, t11, n11, r11) {
      return Ix.columnSelectDown(e207.cursorConfig, e207, n11, this._isPaged);
    }
  }
  e206.CursorColumnSelectDown = K(new i10({ isPaged: false, id: `cursorColumnSelectDown`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3602, linux: { primary: 0 } } })), e206.CursorColumnSelectPageDown = K(new i10({ isPaged: true, id: `cursorColumnSelectPageDown`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3596, linux: { primary: 0 } } }));
  class a10 extends wS {
    constructor() {
      super({ id: `cursorMove`, precondition: void 0, metadata: Xx.metadata });
    }
    runCoreEditorCommand(e207, t11) {
      let n11 = Xx.parse(t11);
      n11 && this._runCursorMove(e207, t11.source, n11);
    }
    _runCursorMove(e207, t11, n11) {
      let r11 = n11.noHistory ? `api` : t11;
      e207.model.pushStackElement(), e207.setCursorStates(r11, 3, a10._move(e207, e207.getCursorStates(), n11)), e207.revealAllCursors(r11, true);
    }
    static _move(e207, t11, n11) {
      let r11 = n11.select, i11 = n11.value;
      switch (n11.direction) {
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 10:
          return Yx.simpleMove(e207, t11, n11.direction, r11, i11, n11.unit);
        case 11:
        case 13:
        case 12:
        case 14:
          return Yx.viewportMove(e207, t11, n11.direction, r11, i11);
        default:
          return null;
      }
    }
  }
  e206.CursorMoveImpl = a10, e206.CursorMove = K(new a10());
  class o10 extends wS {
    constructor(e207) {
      super(e207), this._staticArgs = e207.args;
    }
    runCoreEditorCommand(e207, t11) {
      let n11 = this._staticArgs;
      this._staticArgs.value === -1 && (n11 = { direction: this._staticArgs.direction, unit: this._staticArgs.unit, select: this._staticArgs.select, value: t11.pageSize || e207.cursorConfig.pageSize }), e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, Yx.simpleMove(e207, e207.getCursorStates(), n11.direction, n11.select, n11.value, n11.unit)), e207.revealAllCursors(t11.source, true);
    }
  }
  e206.CursorLeft = K(new o10({ args: { direction: 0, unit: 0, select: false, value: 1 }, id: `cursorLeft`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 15, mac: { primary: 15, secondary: [288] } } })), e206.CursorLeftSelect = K(new o10({ args: { direction: 0, unit: 0, select: true, value: 1 }, id: `cursorLeftSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1039 } })), e206.CursorRight = K(new o10({ args: { direction: 1, unit: 0, select: false, value: 1 }, id: `cursorRight`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 17, mac: { primary: 17, secondary: [292] } } })), e206.CursorRightSelect = K(new o10({ args: { direction: 1, unit: 0, select: true, value: 1 }, id: `cursorRightSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1041 } })), e206.CursorUp = K(new o10({ args: { direction: 2, unit: 2, select: false, value: 1 }, id: `cursorUp`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 16, mac: { primary: 16, secondary: [302] } } })), e206.CursorUpSelect = K(new o10({ args: { direction: 2, unit: 2, select: true, value: 1 }, id: `cursorUpSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1040, secondary: [3088], mac: { primary: 1040 }, linux: { primary: 1040 } } })), e206.CursorPageUp = K(new o10({ args: { direction: 2, unit: 2, select: false, value: -1 }, id: `cursorPageUp`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 11 } })), e206.CursorPageUpSelect = K(new o10({ args: { direction: 2, unit: 2, select: true, value: -1 }, id: `cursorPageUpSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1035 } })), e206.CursorDown = K(new o10({ args: { direction: 3, unit: 2, select: false, value: 1 }, id: `cursorDown`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 18, mac: { primary: 18, secondary: [300] } } })), e206.CursorDownSelect = K(new o10({ args: { direction: 3, unit: 2, select: true, value: 1 }, id: `cursorDownSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1042, secondary: [3090], mac: { primary: 1042 }, linux: { primary: 1042 } } })), e206.CursorPageDown = K(new o10({ args: { direction: 3, unit: 2, select: false, value: -1 }, id: `cursorPageDown`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 12 } })), e206.CursorPageDownSelect = K(new o10({ args: { direction: 3, unit: 2, select: true, value: -1 }, id: `cursorPageDownSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1036 } })), e206.CreateCursor = K(new class extends wS {
    constructor() {
      super({ id: `createCursor`, precondition: void 0 });
    }
    runCoreEditorCommand(e207, t11) {
      if (!t11.position) return;
      let n11;
      n11 = t11.wholeLine ? Yx.line(e207, e207.getPrimaryCursorState(), false, t11.position, t11.viewPosition) : Yx.moveTo(e207, e207.getPrimaryCursorState(), false, t11.position, t11.viewPosition);
      let r11 = e207.getCursorStates();
      if (r11.length > 1) {
        let i11 = n11.modelState ? n11.modelState.position : null, a11 = n11.viewState ? n11.viewState.position : null;
        for (let n12 = 0, o11 = r11.length; n12 < o11; n12++) {
          let o12 = r11[n12];
          if (!(i11 && !o12.modelState.selection.containsPosition(i11)) && !(a11 && !o12.viewState.selection.containsPosition(a11))) {
            r11.splice(n12, 1), e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, r11);
            return;
          }
        }
      }
      r11.push(n11), e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, r11);
    }
  }()), e206.LastCursorMoveToSelect = K(new class extends wS {
    constructor() {
      super({ id: `_lastCursorMoveToSelect`, precondition: void 0 });
    }
    runCoreEditorCommand(e207, t11) {
      if (!t11.position) return;
      let n11 = e207.getLastAddedCursorIndex(), r11 = e207.getCursorStates(), i11 = r11.slice(0);
      i11[n11] = Yx.moveTo(e207, r11[n11], true, t11.position, t11.viewPosition), e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, i11);
    }
  }());
  class s10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, Yx.moveToBeginningOfLine(e207, e207.getCursorStates(), this._inSelectionMode)), e207.revealAllCursors(t11.source, true);
    }
  }
  e206.CursorHome = K(new s10({ inSelectionMode: false, id: `cursorHome`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 14, mac: { primary: 14, secondary: [2063] } } })), e206.CursorHomeSelect = K(new s10({ inSelectionMode: true, id: `cursorHomeSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1038, mac: { primary: 1038, secondary: [3087] } } }));
  class c10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, this._exec(e207.getCursorStates())), e207.revealAllCursors(t11.source, true);
    }
    _exec(e207) {
      let t11 = [];
      for (let n11 = 0, r11 = e207.length; n11 < r11; n11++) {
        let r12 = e207[n11], i11 = r12.modelState.position.lineNumber;
        t11[n11] = Mx.fromModelState(r12.modelState.move(this._inSelectionMode, i11, 1, 0));
      }
      return t11;
    }
  }
  e206.CursorLineStart = K(new c10({ inSelectionMode: false, id: `cursorLineStart`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 0, mac: { primary: 287 } } })), e206.CursorLineStartSelect = K(new c10({ inSelectionMode: true, id: `cursorLineStartSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 0, mac: { primary: 1311 } } }));
  class l10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, Yx.moveToEndOfLine(e207, e207.getCursorStates(), this._inSelectionMode, t11.sticky || false)), e207.revealAllCursors(t11.source, true);
    }
  }
  e206.CursorEnd = K(new l10({ inSelectionMode: false, id: `cursorEnd`, precondition: void 0, kbOpts: { args: { sticky: false }, weight: CS, kbExpr: $.textInputFocus, primary: 13, mac: { primary: 13, secondary: [2065] } }, metadata: { description: `Go to End`, args: [{ name: `args`, schema: { type: `object`, properties: { sticky: { description: C(66, `Stick to the end even when going to longer lines`), type: `boolean`, default: false } } } }] } })), e206.CursorEndSelect = K(new l10({ inSelectionMode: true, id: `cursorEndSelect`, precondition: void 0, kbOpts: { args: { sticky: false }, weight: CS, kbExpr: $.textInputFocus, primary: 1037, mac: { primary: 1037, secondary: [3089] } }, metadata: { description: `Select to End`, args: [{ name: `args`, schema: { type: `object`, properties: { sticky: { description: C(67, `Stick to the end even when going to longer lines`), type: `boolean`, default: false } } } }] } }));
  class u10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, this._exec(e207, e207.getCursorStates())), e207.revealAllCursors(t11.source, true);
    }
    _exec(e207, t11) {
      let n11 = [];
      for (let r11 = 0, i11 = t11.length; r11 < i11; r11++) {
        let i12 = t11[r11], a11 = i12.modelState.position.lineNumber, o11 = e207.model.getLineMaxColumn(a11);
        n11[r11] = Mx.fromModelState(i12.modelState.move(this._inSelectionMode, a11, o11, 0));
      }
      return n11;
    }
  }
  e206.CursorLineEnd = K(new u10({ inSelectionMode: false, id: `cursorLineEnd`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 0, mac: { primary: 291 } } })), e206.CursorLineEndSelect = K(new u10({ inSelectionMode: true, id: `cursorLineEndSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 0, mac: { primary: 1315 } } }));
  class d10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, Yx.moveToBeginningOfBuffer(e207, e207.getCursorStates(), this._inSelectionMode)), e207.revealAllCursors(t11.source, true);
    }
  }
  e206.CursorTop = K(new d10({ inSelectionMode: false, id: `cursorTop`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 2062, mac: { primary: 2064 } } })), e206.CursorTopSelect = K(new d10({ inSelectionMode: true, id: `cursorTopSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3086, mac: { primary: 3088 } } }));
  class f10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, Yx.moveToEndOfBuffer(e207, e207.getCursorStates(), this._inSelectionMode)), e207.revealAllCursors(t11.source, true);
    }
  }
  e206.CursorBottom = K(new f10({ inSelectionMode: false, id: `cursorBottom`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 2061, mac: { primary: 2066 } } })), e206.CursorBottomSelect = K(new f10({ inSelectionMode: true, id: `cursorBottomSelect`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 3085, mac: { primary: 3090 } } }));
  class p10 extends wS {
    constructor() {
      super({ id: `editorScroll`, precondition: void 0, metadata: TS.metadata });
    }
    determineScrollMethod(e207) {
      return [6].includes(e207.unit) && [4, 2].includes(e207.direction) ? this._runHorizontalEditorScroll.bind(this) : [1, 2, 3, 4, 5, 6].includes(e207.unit) && [1, 3].includes(e207.direction) ? this._runVerticalEditorScroll.bind(this) : null;
    }
    runCoreEditorCommand(e207, t11) {
      let n11 = TS.parse(t11);
      if (!n11) return;
      let r11 = this.determineScrollMethod(n11);
      r11 && r11(e207, t11.source, n11);
    }
    _runVerticalEditorScroll(e207, t11, n11) {
      let r11 = this._computeDesiredScrollTop(e207, n11);
      if (n11.revealCursor) {
        let i11 = e207.getCompletelyVisibleViewRangeAtScrollTop(r11);
        e207.setCursorStates(t11, 3, [Yx.findPositionInViewportIfOutside(e207, e207.getPrimaryCursorState(), i11, n11.select)]);
      }
      e207.viewLayout.setScrollPosition({ scrollTop: r11 }, 0);
    }
    _computeDesiredScrollTop(e207, t11) {
      if (t11.unit === 1) {
        let n12 = e207.viewLayout.getFutureViewport(), r12 = e207.getCompletelyVisibleViewRangeAtScrollTop(n12.top), i11 = e207.coordinatesConverter.convertViewRangeToModelRange(r12), a11;
        a11 = t11.direction === 1 ? Math.max(1, i11.startLineNumber - t11.value) : Math.min(e207.model.getLineCount(), i11.startLineNumber + t11.value);
        let o11 = e207.coordinatesConverter.convertModelPositionToViewPosition(new j(a11, 1));
        return e207.viewLayout.getVerticalOffsetForLineNumber(o11.lineNumber);
      }
      if (t11.unit === 5) {
        let n12 = 0;
        return t11.direction === 3 && (n12 = e207.model.getLineCount() - e207.cursorConfig.pageSize), e207.viewLayout.getVerticalOffsetForLineNumber(n12);
      }
      let n11;
      n11 = t11.unit === 3 ? e207.cursorConfig.pageSize * t11.value : t11.unit === 4 ? Math.round(e207.cursorConfig.pageSize / 2) * t11.value : t11.value;
      let r11 = (t11.direction === 1 ? -1 : 1) * n11;
      return e207.viewLayout.getCurrentScrollTop() + r11 * e207.cursorConfig.lineHeight;
    }
    _runHorizontalEditorScroll(e207, t11, n11) {
      let r11 = this._computeDesiredScrollLeft(e207, n11);
      e207.viewLayout.setScrollPosition({ scrollLeft: r11 }, 0);
    }
    _computeDesiredScrollLeft(e207, t11) {
      let n11 = (t11.direction === 4 ? -1 : 1) * t11.value;
      return e207.viewLayout.getCurrentScrollLeft() + n11 * e207.cursorConfig.typicalHalfwidthCharacterWidth;
    }
  }
  e206.EditorScrollImpl = p10, e206.EditorScroll = K(new p10()), e206.ScrollLineUp = K(new class extends wS {
    constructor() {
      super({ id: `scrollLineUp`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 2064, mac: { primary: 267 } } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Up, by: TS.RawUnit.WrappedLine, value: 1, revealCursor: false, select: false, source: n11.source });
    }
  }()), e206.ScrollPageUp = K(new class extends wS {
    constructor() {
      super({ id: `scrollPageUp`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 2059, win: { primary: 523 }, linux: { primary: 523 } } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Up, by: TS.RawUnit.Page, value: 1, revealCursor: false, select: false, source: n11.source });
    }
  }()), e206.ScrollEditorTop = K(new class extends wS {
    constructor() {
      super({ id: `scrollEditorTop`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Up, by: TS.RawUnit.Editor, value: 1, revealCursor: false, select: false, source: n11.source });
    }
  }()), e206.ScrollLineDown = K(new class extends wS {
    constructor() {
      super({ id: `scrollLineDown`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 2066, mac: { primary: 268 } } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Down, by: TS.RawUnit.WrappedLine, value: 1, revealCursor: false, select: false, source: n11.source });
    }
  }()), e206.ScrollPageDown = K(new class extends wS {
    constructor() {
      super({ id: `scrollPageDown`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 2060, win: { primary: 524 }, linux: { primary: 524 } } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Down, by: TS.RawUnit.Page, value: 1, revealCursor: false, select: false, source: n11.source });
    }
  }()), e206.ScrollEditorBottom = K(new class extends wS {
    constructor() {
      super({ id: `scrollEditorBottom`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Down, by: TS.RawUnit.Editor, value: 1, revealCursor: false, select: false, source: n11.source });
    }
  }()), e206.ScrollLeft = K(new class extends wS {
    constructor() {
      super({ id: `scrollLeft`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Left, by: TS.RawUnit.Column, value: 2, revealCursor: false, select: false, source: n11.source });
    }
  }()), e206.ScrollRight = K(new class extends wS {
    constructor() {
      super({ id: `scrollRight`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus } });
    }
    runCoreEditorCommand(t11, n11) {
      e206.EditorScroll.runCoreEditorCommand(t11, { to: TS.RawDirection.Right, by: TS.RawUnit.Column, value: 2, revealCursor: false, select: false, source: n11.source });
    }
  }());
  class m10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      t11.position && (e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, [Yx.word(e207, e207.getPrimaryCursorState(), this._inSelectionMode, t11.position)]), t11.revealType !== 2 && e207.revealAllCursors(t11.source, true, true));
    }
  }
  e206.WordSelect = K(new m10({ inSelectionMode: false, id: `_wordSelect`, precondition: void 0 })), e206.WordSelectDrag = K(new m10({ inSelectionMode: true, id: `_wordSelectDrag`, precondition: void 0 })), e206.LastCursorWordSelect = K(new class extends wS {
    constructor() {
      super({ id: `lastCursorWordSelect`, precondition: void 0 });
    }
    runCoreEditorCommand(e207, t11) {
      if (!t11.position) return;
      let n11 = e207.getLastAddedCursorIndex(), r11 = e207.getCursorStates(), i11 = r11.slice(0), a11 = r11[n11];
      i11[n11] = Yx.word(e207, a11, a11.modelState.hasSelection(), t11.position), e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, i11);
    }
  }());
  class h10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      t11.position && (e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, [Yx.line(e207, e207.getPrimaryCursorState(), this._inSelectionMode, t11.position, t11.viewPosition)]), t11.revealType !== 2 && e207.revealAllCursors(t11.source, false, true));
    }
  }
  e206.LineSelect = K(new h10({ inSelectionMode: false, id: `_lineSelect`, precondition: void 0 })), e206.LineSelectDrag = K(new h10({ inSelectionMode: true, id: `_lineSelectDrag`, precondition: void 0 }));
  class g10 extends wS {
    constructor(e207) {
      super(e207), this._inSelectionMode = e207.inSelectionMode;
    }
    runCoreEditorCommand(e207, t11) {
      if (!t11.position) return;
      let n11 = e207.getLastAddedCursorIndex(), r11 = e207.getCursorStates(), i11 = r11.slice(0);
      i11[n11] = Yx.line(e207, r11[n11], this._inSelectionMode, t11.position, t11.viewPosition), e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, i11);
    }
  }
  e206.LastCursorLineSelect = K(new g10({ inSelectionMode: false, id: `lastCursorLineSelect`, precondition: void 0 })), e206.LastCursorLineSelectDrag = K(new g10({ inSelectionMode: true, id: `lastCursorLineSelectDrag`, precondition: void 0 })), e206.CancelSelection = K(new class extends wS {
    constructor() {
      super({ id: `cancelSelection`, precondition: $.hasNonEmptySelection, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 9, secondary: [1033] } });
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, [Yx.cancelSelection(e207, e207.getPrimaryCursorState())]), e207.revealAllCursors(t11.source, true);
    }
  }()), e206.RemoveSecondaryCursors = K(new class extends wS {
    constructor() {
      super({ id: `removeSecondaryCursors`, precondition: $.hasMultipleSelections, kbOpts: { weight: CS + 1, kbExpr: $.textInputFocus, primary: 9, secondary: [1033] } });
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, [e207.getPrimaryCursorState()]), e207.revealAllCursors(t11.source, true), Gg(C(68, `Removed secondary cursors`));
    }
  }()), e206.RevealLine = K(new class extends wS {
    constructor() {
      super({ id: `revealLine`, precondition: void 0, metadata: ES.metadata });
    }
    runCoreEditorCommand(e207, t11) {
      let n11 = t11, r11 = n11.lineNumber || 0, i11 = typeof r11 == `number` ? r11 + 1 : parseInt(r11) + 1;
      i11 < 1 && (i11 = 1);
      let a11 = e207.model.getLineCount();
      i11 > a11 && (i11 = a11);
      let o11 = new M(i11, 1, i11, e207.model.getLineMaxColumn(i11)), s11 = 0;
      if (n11.at) switch (n11.at) {
        case ES.RawAtArgument.Top:
          s11 = 3;
          break;
        case ES.RawAtArgument.Center:
          s11 = 1;
          break;
        case ES.RawAtArgument.Bottom:
          s11 = 4;
          break;
      }
      let c11 = e207.coordinatesConverter.convertModelRangeToViewRange(o11);
      e207.revealRange(t11.source, false, c11, s11, 0);
    }
  }()), e206.SelectAll = new class extends DS {
    constructor() {
      super(hre);
    }
    runDOMCommand(e207) {
      Mo && (e207.focus(), e207.select()), e207.ownerDocument.execCommand(`selectAll`);
    }
    runEditorCommand(e207, t11, n11) {
      let r11 = t11._getViewModel();
      r11 && this.runCoreEditorCommand(r11, n11);
    }
    runCoreEditorCommand(e207, t11) {
      e207.model.pushStackElement(), e207.setCursorStates(`keyboard`, 3, [Yx.selectAll(e207, e207.getPrimaryCursorState())]);
    }
  }(), e206.SetSelection = K(new class extends wS {
    constructor() {
      super({ id: `setSelection`, precondition: void 0 });
    }
    runCoreEditorCommand(e207, t11) {
      t11.selection && (e207.model.pushStackElement(), e207.setCursorStates(t11.source, 3, [Mx.fromModelSelection(t11.selection)]));
    }
  }());
})(OS || (OS = {}));
var Fse = H.and($.textInputFocus, $.columnSelection);
function kS(e206, t10) {
  ld.registerKeybindingRule({ id: e206, primary: t10, when: Fse, weight: CS + 1 });
}
kS(OS.CursorColumnSelectLeft.id, 1039), kS(OS.CursorColumnSelectRight.id, 1041), kS(OS.CursorColumnSelectUp.id, 1040), kS(OS.CursorColumnSelectPageUp.id, 1035), kS(OS.CursorColumnSelectDown.id, 1042), kS(OS.CursorColumnSelectPageDown.id, 1036);
function AS(e206) {
  return e206.register(), e206;
}
var jS;
(function(e206) {
  class t10 extends $d {
    runEditorCommand(e207, t11, n10) {
      let r10 = t11._getViewModel();
      r10 && this.runCoreEditingCommand(t11, r10, n10 || {});
    }
  }
  e206.CoreEditingCommand = t10, e206.LineBreakInsert = K(new class extends t10 {
    constructor() {
      super({ id: `lineBreakInsert`, precondition: $.writable, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 0, mac: { primary: 301 } } });
    }
    runCoreEditingCommand(e207, t11, n10) {
      e207.pushUndoStop(), e207.executeCommands(this.id, dS.lineBreakInsert(t11.cursorConfig, t11.model, t11.getCursorStates().map((e208) => e208.modelState.selection)));
    }
  }()), e206.Outdent = K(new class extends t10 {
    constructor() {
      super({ id: `outdent`, precondition: $.writable, kbOpts: { weight: CS, kbExpr: H.and($.editorTextFocus, $.tabDoesNotMoveFocus), primary: 1026 } });
    }
    runCoreEditingCommand(e207, t11, n10) {
      e207.pushUndoStop(), e207.executeCommands(this.id, SS.outdent(t11.cursorConfig, t11.model, t11.getCursorStates().map((e208) => e208.modelState.selection))), e207.pushUndoStop();
    }
  }()), e206.Tab = K(new class extends t10 {
    constructor() {
      super({ id: `tab`, precondition: $.writable, kbOpts: { weight: CS, kbExpr: H.and($.editorTextFocus, $.tabDoesNotMoveFocus), primary: 2 } });
    }
    runCoreEditingCommand(e207, t11, n10) {
      e207.pushUndoStop(), e207.executeCommands(this.id, SS.tab(t11.cursorConfig, t11.model, t11.getCursorStates().map((e208) => e208.modelState.selection))), e207.pushUndoStop();
    }
  }()), e206.DeleteLeft = K(new class extends t10 {
    constructor() {
      super({ id: `deleteLeft`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 1, secondary: [1025], mac: { primary: 1, secondary: [1025, 294, 257] } } });
    }
    runCoreEditingCommand(e207, t11, n10) {
      let [r10, i10] = Gx.deleteLeft(t11.getPrevEditOperationType(), t11.cursorConfig, t11.model, t11.getCursorStates().map((e208) => e208.modelState.selection), t11.getCursorAutoClosedCharacters());
      r10 && e207.pushUndoStop(), e207.executeCommands(this.id, i10), t11.setPrevEditOperationType(2);
    }
  }()), e206.DeleteRight = K(new class extends t10 {
    constructor() {
      super({ id: `deleteRight`, precondition: void 0, kbOpts: { weight: CS, kbExpr: $.textInputFocus, primary: 20, mac: { primary: 20, secondary: [290, 276] } } });
    }
    runCoreEditingCommand(e207, t11, n10) {
      let [r10, i10] = Gx.deleteRight(t11.getPrevEditOperationType(), t11.cursorConfig, t11.model, t11.getCursorStates().map((e208) => e208.modelState.selection));
      r10 && e207.pushUndoStop(), e207.executeCommands(this.id, i10), t11.setPrevEditOperationType(3);
    }
  }()), e206.Undo = new class extends DS {
    constructor() {
      super(lf);
    }
    runDOMCommand(e207) {
      e207.ownerDocument.execCommand(`undo`);
    }
    runEditorCommand(e207, t11, n10) {
      if (!(!t11.hasModel() || t11.getOption(104) === true)) return t11.getModel().undo();
    }
  }(), e206.Redo = new class extends DS {
    constructor() {
      super(uf);
    }
    runDOMCommand(e207) {
      e207.ownerDocument.execCommand(`redo`);
    }
    runEditorCommand(e207, t11, n10) {
      if (!(!t11.hasModel() || t11.getOption(104) === true)) return t11.getModel().redo();
    }
  }();
})(jS || (jS = {}));
var MS = class extends Xd {
  constructor(e206, t10, n10) {
    super({ id: e206, precondition: void 0, metadata: n10 }), this._handlerId = t10;
  }
  runCommand(e206, t10) {
    let n10 = e206.get(Su).getFocusedCodeEditor();
    n10 && n10.trigger(`keyboard`, this._handlerId, t10);
  }
};
function NS(e206, t10) {
  AS(new MS(`default:` + e206, e206)), AS(new MS(e206, e206, t10));
}
NS(`type`, { description: `Type`, args: [{ name: `args`, schema: { type: `object`, required: [`text`], properties: { text: { type: `string` } } } }] }), NS(`replacePreviousChar`), NS(`compositionType`), NS(`compositionStart`), NS(`compositionEnd`), NS(`paste`), NS(`cut`);
var Ise = class {
  constructor(e206, t10, n10, r10) {
    this.configuration = e206, this.viewModel = t10, this.userInputEvents = n10, this.commandDelegate = r10;
  }
  paste(e206, t10, n10, r10) {
    this.commandDelegate.paste(e206, t10, n10, r10);
  }
  type(e206) {
    this.commandDelegate.type(e206);
  }
  compositionType(e206, t10, n10, r10) {
    this.commandDelegate.compositionType(e206, t10, n10, r10);
  }
  compositionStart() {
    this.commandDelegate.startComposition();
  }
  compositionEnd() {
    this.commandDelegate.endComposition();
  }
  cut() {
    this.commandDelegate.cut();
  }
  setSelection(e206) {
    OS.SetSelection.runCoreEditorCommand(this.viewModel, { source: `keyboard`, selection: e206 });
  }
  _validateViewColumn(e206) {
    let t10 = this.viewModel.getLineMinColumn(e206.lineNumber);
    return e206.column < t10 ? new j(e206.lineNumber, t10) : e206;
  }
  _hasMulticursorModifier(e206) {
    switch (this.configuration.options.get(86)) {
      case `altKey`:
        return e206.altKey;
      case `ctrlKey`:
        return e206.ctrlKey;
      case `metaKey`:
        return e206.metaKey;
      default:
        return false;
    }
  }
  _hasNonMulticursorModifier(e206) {
    switch (this.configuration.options.get(86)) {
      case `altKey`:
        return e206.ctrlKey || e206.metaKey;
      case `ctrlKey`:
        return e206.altKey || e206.metaKey;
      case `metaKey`:
        return e206.ctrlKey || e206.altKey;
      default:
        return false;
    }
  }
  dispatchMouse(e206) {
    let t10 = this.configuration.options, n10 = Et && t10.get(121), r10 = t10.get(28), i10 = t10.get(171);
    e206.middleButton && !n10 ? i10 || this._columnSelect(e206.position, e206.mouseColumn, e206.inSelectionMode) : e206.startedOnLineNumbers ? this._hasMulticursorModifier(e206) ? e206.inSelectionMode ? this._lastCursorLineSelect(e206.position, e206.revealType) : this._createCursor(e206.position, true) : e206.inSelectionMode ? this._lineSelectDrag(e206.position, e206.revealType) : this._lineSelect(e206.position, e206.revealType) : e206.mouseDownCount >= 4 ? this._selectAll() : e206.mouseDownCount === 3 ? this._hasMulticursorModifier(e206) ? e206.inSelectionMode ? this._lastCursorLineSelectDrag(e206.position, e206.revealType) : this._lastCursorLineSelect(e206.position, e206.revealType) : e206.inSelectionMode ? this._lineSelectDrag(e206.position, e206.revealType) : this._lineSelect(e206.position, e206.revealType) : e206.mouseDownCount === 2 ? e206.onInjectedText || (this._hasMulticursorModifier(e206) ? this._lastCursorWordSelect(e206.position, e206.revealType) : e206.inSelectionMode ? this._wordSelectDrag(e206.position, e206.revealType) : this._wordSelect(e206.position, e206.revealType)) : this._hasMulticursorModifier(e206) ? this._hasNonMulticursorModifier(e206) || (e206.shiftKey ? this._columnSelect(e206.position, e206.mouseColumn, true) : e206.inSelectionMode ? this._lastCursorMoveToSelect(e206.position, e206.revealType) : this._createCursor(e206.position, false)) : e206.inSelectionMode ? e206.altKey || r10 ? this._columnSelect(e206.position, e206.mouseColumn, true) : this._moveToSelect(e206.position, e206.revealType) : this.moveTo(e206.position, e206.revealType);
  }
  _usualArgs(e206, t10) {
    return e206 = this._validateViewColumn(e206), { source: `mouse`, position: this._convertViewToModelPosition(e206), viewPosition: e206, revealType: t10 };
  }
  moveTo(e206, t10) {
    OS.MoveTo.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _moveToSelect(e206, t10) {
    OS.MoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _columnSelect(e206, t10, n10) {
    e206 = this._validateViewColumn(e206), OS.ColumnSelect.runCoreEditorCommand(this.viewModel, { source: `mouse`, position: this._convertViewToModelPosition(e206), viewPosition: e206, mouseColumn: t10, doColumnSelect: n10 });
  }
  _createCursor(e206, t10) {
    e206 = this._validateViewColumn(e206), OS.CreateCursor.runCoreEditorCommand(this.viewModel, { source: `mouse`, position: this._convertViewToModelPosition(e206), viewPosition: e206, wholeLine: t10 });
  }
  _lastCursorMoveToSelect(e206, t10) {
    OS.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _wordSelect(e206, t10) {
    OS.WordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _wordSelectDrag(e206, t10) {
    OS.WordSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _lastCursorWordSelect(e206, t10) {
    OS.LastCursorWordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _lineSelect(e206, t10) {
    OS.LineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _lineSelectDrag(e206, t10) {
    OS.LineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _lastCursorLineSelect(e206, t10) {
    OS.LastCursorLineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _lastCursorLineSelectDrag(e206, t10) {
    OS.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e206, t10));
  }
  _selectAll() {
    OS.SelectAll.runCoreEditorCommand(this.viewModel, { source: `mouse` });
  }
  _convertViewToModelPosition(e206) {
    return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e206);
  }
  emitKeyDown(e206) {
    this.userInputEvents.emitKeyDown(e206);
  }
  emitKeyUp(e206) {
    this.userInputEvents.emitKeyUp(e206);
  }
  emitContextMenu(e206) {
    this.userInputEvents.emitContextMenu(e206);
  }
  emitMouseMove(e206) {
    this.userInputEvents.emitMouseMove(e206);
  }
  emitMouseLeave(e206) {
    this.userInputEvents.emitMouseLeave(e206);
  }
  emitMouseUp(e206) {
    this.userInputEvents.emitMouseUp(e206);
  }
  emitMouseDown(e206) {
    this.userInputEvents.emitMouseDown(e206);
  }
  emitMouseDrag(e206) {
    this.userInputEvents.emitMouseDrag(e206);
  }
  emitMouseDrop(e206) {
    this.userInputEvents.emitMouseDrop(e206);
  }
  emitMouseDropCanceled() {
    this.userInputEvents.emitMouseDropCanceled();
  }
  emitMouseWheel(e206) {
    this.userInputEvents.emitMouseWheel(e206);
  }
}, PS = class {
  constructor(e206) {
    this._lineFactory = e206, this._set(1, []);
  }
  flush() {
    this._set(1, []);
  }
  _set(e206, t10) {
    this._lines = t10, this._rendLineNumberStart = e206;
  }
  _get() {
    return { rendLineNumberStart: this._rendLineNumberStart, lines: this._lines };
  }
  getStartLineNumber() {
    return this._rendLineNumberStart;
  }
  getEndLineNumber() {
    return this._rendLineNumberStart + this._lines.length - 1;
  }
  getCount() {
    return this._lines.length;
  }
  getLine(e206) {
    let t10 = e206 - this._rendLineNumberStart;
    if (t10 < 0 || t10 >= this._lines.length) throw new je(`Illegal value for lineNumber`);
    return this._lines[t10];
  }
  onLinesDeleted(e206, t10) {
    if (this.getCount() === 0) return null;
    let n10 = this.getStartLineNumber(), r10 = this.getEndLineNumber();
    if (t10 < n10) {
      let n11 = t10 - e206 + 1;
      return this._rendLineNumberStart -= n11, null;
    }
    if (e206 > r10) return null;
    let i10 = 0, a10 = 0;
    for (let o10 = n10; o10 <= r10; o10++) {
      let n11 = o10 - this._rendLineNumberStart;
      e206 <= o10 && o10 <= t10 && (a10 === 0 ? (i10 = n11, a10 = 1) : a10++);
    }
    if (e206 < n10) {
      let r11 = 0;
      r11 = t10 < n10 ? t10 - e206 + 1 : n10 - e206, this._rendLineNumberStart -= r11;
    }
    return this._lines.splice(i10, a10);
  }
  onLinesChanged(e206, t10) {
    let n10 = e206 + t10 - 1;
    if (this.getCount() === 0) return false;
    let r10 = this.getStartLineNumber(), i10 = this.getEndLineNumber(), a10 = false;
    for (let t11 = e206; t11 <= n10; t11++) t11 >= r10 && t11 <= i10 && (this._lines[t11 - this._rendLineNumberStart].onContentChanged(), a10 = true);
    return a10;
  }
  onLinesInserted(e206, t10) {
    if (this.getCount() === 0) return null;
    let n10 = t10 - e206 + 1, r10 = this.getStartLineNumber(), i10 = this.getEndLineNumber();
    if (e206 <= r10) return this._rendLineNumberStart += n10, null;
    if (e206 > i10) return null;
    if (n10 + e206 > i10) return this._lines.splice(e206 - this._rendLineNumberStart, i10 - e206 + 1);
    let a10 = [];
    for (let e207 = 0; e207 < n10; e207++) a10[e207] = this._lineFactory.createLine();
    let o10 = e206 - this._rendLineNumberStart, s10 = this._lines.slice(0, o10), c10 = this._lines.slice(o10, this._lines.length - n10), l10 = this._lines.slice(this._lines.length - n10, this._lines.length);
    return this._lines = s10.concat(a10).concat(c10), l10;
  }
  onTokensChanged(e206) {
    if (this.getCount() === 0) return false;
    let t10 = this.getStartLineNumber(), n10 = this.getEndLineNumber(), r10 = false;
    for (let i10 = 0, a10 = e206.length; i10 < a10; i10++) {
      let a11 = e206[i10];
      if (a11.toLineNumber < t10 || a11.fromLineNumber > n10) continue;
      let o10 = Math.max(t10, a11.fromLineNumber), s10 = Math.min(n10, a11.toLineNumber);
      for (let e207 = o10; e207 <= s10; e207++) {
        let t11 = e207 - this._rendLineNumberStart;
        this._lines[t11].onTokensChanged(), r10 = true;
      }
    }
    return r10;
  }
}, FS = class {
  constructor(e206, t10) {
    this._viewContext = e206, this._lineFactory = t10, this.domNode = this._createDomNode(), this._linesCollection = new PS(this._lineFactory);
  }
  _createDomNode() {
    let e206 = _u(document.createElement(`div`));
    return e206.setClassName(`view-layer`), e206.setPosition(`absolute`), e206.domNode.setAttribute(`role`, `presentation`), e206.domNode.setAttribute(`aria-hidden`, `true`), e206;
  }
  onConfigurationChanged(e206) {
    return !!e206.hasChanged(165);
  }
  onFlushed(e206, t10) {
    if (t10) {
      let e207 = this._linesCollection.getStartLineNumber(), t11 = this._linesCollection.getEndLineNumber();
      for (let n10 = e207; n10 <= t11; n10++) this._linesCollection.getLine(n10).getDomNode()?.remove();
    }
    return this._linesCollection.flush(), true;
  }
  onLinesChanged(e206) {
    return this._linesCollection.onLinesChanged(e206.fromLineNumber, e206.count);
  }
  onLinesDeleted(e206) {
    let t10 = this._linesCollection.onLinesDeleted(e206.fromLineNumber, e206.toLineNumber);
    if (t10) for (let e207 = 0, n10 = t10.length; e207 < n10; e207++) t10[e207].getDomNode()?.remove();
    return true;
  }
  onLinesInserted(e206) {
    let t10 = this._linesCollection.onLinesInserted(e206.fromLineNumber, e206.toLineNumber);
    if (t10) for (let e207 = 0, n10 = t10.length; e207 < n10; e207++) t10[e207].getDomNode()?.remove();
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onTokensChanged(e206) {
    return this._linesCollection.onTokensChanged(e206.ranges);
  }
  onZonesChanged(e206) {
    return true;
  }
  getStartLineNumber() {
    return this._linesCollection.getStartLineNumber();
  }
  getEndLineNumber() {
    return this._linesCollection.getEndLineNumber();
  }
  getVisibleLine(e206) {
    return this._linesCollection.getLine(e206);
  }
  renderLines(e206) {
    let t10 = this._linesCollection._get(), n10 = new Lse(this.domNode.domNode, this._lineFactory, e206, this._viewContext), r10 = { rendLineNumberStart: t10.rendLineNumberStart, lines: t10.lines, linesLength: t10.lines.length }, i10 = n10.render(r10, e206.startLineNumber, e206.endLineNumber, e206.relativeVerticalOffset);
    this._linesCollection._set(i10.rendLineNumberStart, i10.lines);
  }
}, Lse = (_fa = class {
  constructor(e206, t10, n10, r10) {
    this._domNode = e206, this._lineFactory = t10, this._viewportData = n10, this._viewContext = r10;
  }
  render(e206, t10, n10, r10) {
    let i10 = { rendLineNumberStart: e206.rendLineNumberStart, lines: e206.lines.slice(0), linesLength: e206.linesLength };
    if (i10.rendLineNumberStart + i10.linesLength - 1 < t10 || n10 < i10.rendLineNumberStart) {
      i10.rendLineNumberStart = t10, i10.linesLength = n10 - t10 + 1, i10.lines = [];
      for (let e207 = t10; e207 <= n10; e207++) i10.lines[e207 - t10] = this._lineFactory.createLine();
      return this._finishRendering(i10, true, r10), i10;
    }
    if (this._renderUntouchedLines(i10, Math.max(t10 - i10.rendLineNumberStart, 0), Math.min(n10 - i10.rendLineNumberStart, i10.linesLength - 1), r10, t10), i10.rendLineNumberStart > t10) {
      let e207 = t10, a10 = Math.min(n10, i10.rendLineNumberStart - 1);
      e207 <= a10 && (this._insertLinesBefore(i10, e207, a10, r10, t10), i10.linesLength += a10 - e207 + 1);
    } else if (i10.rendLineNumberStart < t10) {
      let e207 = Math.min(i10.linesLength, t10 - i10.rendLineNumberStart);
      e207 > 0 && (this._removeLinesBefore(i10, e207), i10.linesLength -= e207);
    }
    if (i10.rendLineNumberStart = t10, i10.rendLineNumberStart + i10.linesLength - 1 < n10) {
      let e207 = i10.rendLineNumberStart + i10.linesLength, a10 = n10;
      e207 <= a10 && (this._insertLinesAfter(i10, e207, a10, r10, t10), i10.linesLength += a10 - e207 + 1);
    } else if (i10.rendLineNumberStart + i10.linesLength - 1 > n10) {
      let e207 = Math.max(0, n10 - i10.rendLineNumberStart + 1), t11 = i10.linesLength - 1 - e207 + 1;
      t11 > 0 && (this._removeLinesAfter(i10, t11), i10.linesLength -= t11);
    }
    return this._finishRendering(i10, false, r10), i10;
  }
  _renderUntouchedLines(e206, t10, n10, r10, i10) {
    let a10 = e206.rendLineNumberStart, o10 = e206.lines;
    for (let e207 = t10; e207 <= n10; e207++) {
      let t11 = a10 + e207;
      o10[e207].layoutLine(t11, r10[t11 - i10], this._lineHeightForLineNumber(t11));
    }
  }
  _insertLinesBefore(e206, t10, n10, r10, i10) {
    let a10 = [], o10 = 0;
    for (let e207 = t10; e207 <= n10; e207++) a10[o10++] = this._lineFactory.createLine();
    e206.lines = a10.concat(e206.lines);
  }
  _removeLinesBefore(e206, t10) {
    for (let n10 = 0; n10 < t10; n10++) e206.lines[n10].getDomNode()?.remove();
    e206.lines.splice(0, t10);
  }
  _insertLinesAfter(e206, t10, n10, r10, i10) {
    let a10 = [], o10 = 0;
    for (let e207 = t10; e207 <= n10; e207++) a10[o10++] = this._lineFactory.createLine();
    e206.lines = e206.lines.concat(a10);
  }
  _removeLinesAfter(e206, t10) {
    let n10 = e206.linesLength - t10;
    for (let r10 = 0; r10 < t10; r10++) e206.lines[n10 + r10].getDomNode()?.remove();
    e206.lines.splice(n10, t10);
  }
  _finishRenderingNewLines(t10, n10, r10, i10) {
    _fa._ttPolicy && (r10 = _fa._ttPolicy.createHTML(r10));
    let a10 = this._domNode.lastChild;
    n10 || !a10 ? this._domNode.innerHTML = r10 : a10.insertAdjacentHTML(`afterend`, r10);
    let o10 = this._domNode.lastChild;
    for (let e206 = t10.linesLength - 1; e206 >= 0; e206--) {
      let n11 = t10.lines[e206];
      i10[e206] && (n11.setDomNode(o10), o10 = o10.previousSibling);
    }
  }
  _finishRenderingInvalidLines(t10, n10, r10) {
    let i10 = document.createElement(`div`);
    _fa._ttPolicy && (n10 = _fa._ttPolicy.createHTML(n10)), i10.innerHTML = n10;
    for (let e206 = 0; e206 < t10.linesLength; e206++) {
      let n11 = t10.lines[e206];
      if (r10[e206]) {
        let e207 = i10.firstChild;
        n11.getDomNode().replaceWith(e207), n11.setDomNode(e207);
      }
    }
  }
  _finishRendering(t10, n10, r10) {
    let i10 = _fa._sb, a10 = t10.linesLength, o10 = t10.lines, s10 = t10.rendLineNumberStart, c10 = [];
    {
      i10.reset();
      let e206 = false;
      for (let t11 = 0; t11 < a10; t11++) {
        let n11 = o10[t11];
        if (c10[t11] = false, n11.getDomNode()) continue;
        let a11 = t11 + s10;
        n11.renderLine(a11, r10[t11], this._lineHeightForLineNumber(a11), this._viewportData, i10) && (c10[t11] = true, e206 = true);
      }
      e206 && this._finishRenderingNewLines(t10, n10, i10.build(), c10);
    }
    {
      i10.reset();
      let e206 = false, n11 = [];
      for (let t11 = 0; t11 < a10; t11++) {
        let a11 = o10[t11];
        if (n11[t11] = false, c10[t11]) continue;
        let l10 = t11 + s10;
        a11.renderLine(l10, r10[t11], this._lineHeightForLineNumber(l10), this._viewportData, i10) && (n11[t11] = true, e206 = true);
      }
      e206 && this._finishRenderingInvalidLines(t10, i10.build(), n11);
    }
  }
  _lineHeightForLineNumber(e206) {
    return this._viewContext.viewLayout.getLineHeightForLineNumber(e206);
  }
}, _fa._ttPolicy = _f2(`editorViewLayer`, { createHTML: (e206) => e206 }), _fa._sb = new Ff(1e5), _fa), IS = class extends Tb {
  constructor(e206) {
    super(e206), this._dynamicOverlays = [], this._isFocused = false, this._visibleLines = new FS(this._context, { createLine: () => new Rse(this._dynamicOverlays) }), this.domNode = this._visibleLines.domNode;
    let t10 = this._context.configuration.options.get(59);
    vu(this.domNode, t10), this.domNode.setClassName(`view-overlays`);
  }
  shouldRender() {
    if (super.shouldRender()) return true;
    for (let e206 = 0, t10 = this._dynamicOverlays.length; e206 < t10; e206++) if (this._dynamicOverlays[e206].shouldRender()) return true;
    return false;
  }
  dispose() {
    super.dispose();
    for (let e206 = 0, t10 = this._dynamicOverlays.length; e206 < t10; e206++) this._dynamicOverlays[e206].dispose();
    this._dynamicOverlays = [];
  }
  getDomNode() {
    return this.domNode;
  }
  addDynamicOverlay(e206) {
    this._dynamicOverlays.push(e206);
  }
  onConfigurationChanged(e206) {
    this._visibleLines.onConfigurationChanged(e206);
    let t10 = this._context.configuration.options.get(59);
    return vu(this.domNode, t10), true;
  }
  onFlushed(e206) {
    return this._visibleLines.onFlushed(e206);
  }
  onFocusChanged(e206) {
    return this._isFocused = e206.isFocused, true;
  }
  onLinesChanged(e206) {
    return this._visibleLines.onLinesChanged(e206);
  }
  onLinesDeleted(e206) {
    return this._visibleLines.onLinesDeleted(e206);
  }
  onLinesInserted(e206) {
    return this._visibleLines.onLinesInserted(e206);
  }
  onScrollChanged(e206) {
    return this._visibleLines.onScrollChanged(e206) || true;
  }
  onTokensChanged(e206) {
    return this._visibleLines.onTokensChanged(e206);
  }
  onZonesChanged(e206) {
    return this._visibleLines.onZonesChanged(e206);
  }
  prepareRender(e206) {
    let t10 = this._dynamicOverlays.filter((e207) => e207.shouldRender());
    for (let n10 = 0, r10 = t10.length; n10 < r10; n10++) {
      let r11 = t10[n10];
      r11.prepareRender(e206), r11.onDidRender();
    }
  }
  render(e206) {
    this._viewOverlaysRender(e206), this.domNode.toggleClassName(`focused`, this._isFocused);
  }
  _viewOverlaysRender(e206) {
    this._visibleLines.renderLines(e206.viewportData);
  }
}, Rse = class {
  constructor(e206) {
    this._dynamicOverlays = e206, this._domNode = null, this._renderedContent = null;
  }
  getDomNode() {
    return this._domNode ? this._domNode.domNode : null;
  }
  setDomNode(e206) {
    this._domNode = _u(e206);
  }
  onContentChanged() {
  }
  onTokensChanged() {
  }
  renderLine(e206, t10, n10, r10, i10) {
    let a10 = ``;
    for (let t11 = 0, n11 = this._dynamicOverlays.length; t11 < n11; t11++) {
      let n12 = this._dynamicOverlays[t11];
      a10 += n12.render(r10.startLineNumber, e206);
    }
    return this._renderedContent === a10 ? false : (this._renderedContent = a10, i10.appendString(`<div style="top:`), i10.appendString(String(t10)), i10.appendString(`px;height:`), i10.appendString(String(n10)), i10.appendString(`px;line-height:`), i10.appendString(String(n10)), i10.appendString(`px;">`), i10.appendString(a10), i10.appendString(`</div>`), true);
  }
  layoutLine(e206, t10, n10) {
    this._domNode && (this._domNode.setTop(t10), this._domNode.setHeight(n10), this._domNode.setLineHeight(n10));
  }
}, zse = class extends IS {
  constructor(e206) {
    super(e206), this._contentWidth = this._context.configuration.options.get(165).contentWidth, this.domNode.setHeight(0);
  }
  onConfigurationChanged(e206) {
    return this._contentWidth = this._context.configuration.options.get(165).contentWidth, super.onConfigurationChanged(e206) || true;
  }
  onScrollChanged(e206) {
    return super.onScrollChanged(e206) || e206.scrollWidthChanged;
  }
  _viewOverlaysRender(e206) {
    super._viewOverlaysRender(e206), this.domNode.setWidth(Math.max(e206.scrollWidth, this._contentWidth));
  }
}, Bse = class extends IS {
  constructor(e206) {
    super(e206);
    let t10 = this._context.configuration.options;
    this._contentLeft = t10.get(165).contentLeft, this.domNode.setClassName(`margin-view-overlays`), this.domNode.setWidth(1), vu(this.domNode, t10.get(59));
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options;
    return vu(this.domNode, t10.get(59)), this._contentLeft = t10.get(165).contentLeft, super.onConfigurationChanged(e206) || true;
  }
  onScrollChanged(e206) {
    return super.onScrollChanged(e206) || e206.scrollHeightChanged;
  }
  _viewOverlaysRender(e206) {
    super._viewOverlaysRender(e206);
    let t10 = Math.min(e206.scrollHeight, 1e6);
    this.domNode.setHeight(t10), this.domNode.setWidth(this._contentLeft);
  }
}, LS = class e89 {
  constructor(e206) {
    this.onKeyDown = null, this.onKeyUp = null, this.onContextMenu = null, this.onMouseMove = null, this.onMouseLeave = null, this.onMouseDown = null, this.onMouseUp = null, this.onMouseDrag = null, this.onMouseDrop = null, this.onMouseDropCanceled = null, this.onMouseWheel = null, this._coordinatesConverter = e206;
  }
  emitKeyDown(e206) {
    this.onKeyDown?.(e206);
  }
  emitKeyUp(e206) {
    this.onKeyUp?.(e206);
  }
  emitContextMenu(e206) {
    this.onContextMenu?.(this._convertViewToModelMouseEvent(e206));
  }
  emitMouseMove(e206) {
    this.onMouseMove?.(this._convertViewToModelMouseEvent(e206));
  }
  emitMouseLeave(e206) {
    this.onMouseLeave?.(this._convertViewToModelMouseEvent(e206));
  }
  emitMouseDown(e206) {
    this.onMouseDown?.(this._convertViewToModelMouseEvent(e206));
  }
  emitMouseUp(e206) {
    this.onMouseUp?.(this._convertViewToModelMouseEvent(e206));
  }
  emitMouseDrag(e206) {
    this.onMouseDrag?.(this._convertViewToModelMouseEvent(e206));
  }
  emitMouseDrop(e206) {
    this.onMouseDrop?.(this._convertViewToModelMouseEvent(e206));
  }
  emitMouseDropCanceled() {
    this.onMouseDropCanceled?.();
  }
  emitMouseWheel(e206) {
    this.onMouseWheel?.(e206);
  }
  _convertViewToModelMouseEvent(e206) {
    return e206.target ? { event: e206.event, target: this._convertViewToModelMouseTarget(e206.target) } : e206;
  }
  _convertViewToModelMouseTarget(t10) {
    return e89.convertViewToModelMouseTarget(t10, this._coordinatesConverter);
  }
  static convertViewToModelMouseTarget(e206, t10) {
    let n10 = { ...e206 };
    return n10.position && (n10.position = t10.convertViewPositionToModelPosition(n10.position)), n10.range && (n10.range = t10.convertViewRangeToModelRange(n10.range)), (n10.type === 5 || n10.type === 8) && (n10.detail = this.convertViewToModelViewZoneData(n10.detail, t10)), n10;
  }
  static convertViewToModelViewZoneData(e206, t10) {
    return { viewZoneId: e206.viewZoneId, positionBefore: e206.positionBefore ? t10.convertViewPositionToModelPosition(e206.positionBefore) : e206.positionBefore, positionAfter: e206.positionAfter ? t10.convertViewPositionToModelPosition(e206.positionAfter) : e206.positionAfter, position: t10.convertViewPositionToModelPosition(e206.position), afterLineNumber: t10.convertViewPositionToModelPosition(new j(e206.afterLineNumber, 1)).lineNumber };
  }
}, Vse = class extends Tb {
  constructor(e206) {
    super(e206), this.blocks = [], this.contentWidth = -1, this.contentLeft = 0, this.domNode = _u(document.createElement(`div`)), this.domNode.setAttribute(`role`, `presentation`), this.domNode.setAttribute(`aria-hidden`, `true`), this.domNode.setClassName(`blockDecorations-container`), this.update();
  }
  update() {
    let e206 = false, t10 = this._context.configuration.options.get(165), n10 = t10.contentWidth - t10.verticalScrollbarWidth;
    this.contentWidth !== n10 && (this.contentWidth = n10, e206 = true);
    let r10 = t10.contentLeft;
    return this.contentLeft !== r10 && (this.contentLeft = r10, e206 = true), e206;
  }
  dispose() {
    super.dispose();
  }
  onConfigurationChanged(e206) {
    return this.update();
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged || e206.scrollLeftChanged;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onZonesChanged(e206) {
    return true;
  }
  prepareRender(e206) {
  }
  render(e206) {
    let t10 = 0, n10 = e206.getDecorationsInViewport();
    for (let r10 of n10) {
      if (!r10.options.blockClassName) continue;
      let n11 = this.blocks[t10];
      n11 || (n11 = this.blocks[t10] = _u(document.createElement(`div`)), this.domNode.appendChild(n11));
      let i10, a10;
      r10.options.blockIsAfterEnd ? (i10 = e206.getVerticalOffsetAfterLineNumber(r10.range.endLineNumber, false), a10 = e206.getVerticalOffsetAfterLineNumber(r10.range.endLineNumber, true)) : (i10 = e206.getVerticalOffsetForLineNumber(r10.range.startLineNumber, true), a10 = r10.range.isEmpty() && !r10.options.blockDoesNotCollapse ? e206.getVerticalOffsetForLineNumber(r10.range.startLineNumber, false) : e206.getVerticalOffsetAfterLineNumber(r10.range.endLineNumber, true));
      let [o10, s10, c10, l10] = r10.options.blockPadding ?? [0, 0, 0, 0];
      n11.setClassName(`blockDecorations-block ` + r10.options.blockClassName), n11.setLeft(this.contentLeft - l10), n11.setWidth(this.contentWidth + l10 + s10), n11.setTop(i10 - e206.scrollTop - o10), n11.setHeight(a10 - i10 + o10 + c10), t10++;
    }
    for (let e207 = t10; e207 < this.blocks.length; e207++) this.blocks[e207].domNode.remove();
    this.blocks.length = t10;
  }
}, Hse = class extends Tb {
  constructor(e206, t10) {
    super(e206), this._viewDomNode = t10, this._widgets = {}, this.domNode = _u(document.createElement(`div`)), Eb.write(this.domNode, 1), this.domNode.setClassName(`contentWidgets`), this.domNode.setPosition(`absolute`), this.domNode.setTop(0), this.overflowingContentWidgetsDomNode = _u(document.createElement(`div`)), Eb.write(this.overflowingContentWidgetsDomNode, 2), this.overflowingContentWidgetsDomNode.setClassName(`overflowingContentWidgets`);
  }
  dispose() {
    super.dispose(), this._widgets = {};
  }
  onConfigurationChanged(e206) {
    let t10 = Object.keys(this._widgets);
    for (let n10 of t10) this._widgets[n10].onConfigurationChanged(e206);
    return true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLineMappingChanged(e206) {
    return this._updateAnchorsViewPositions(), true;
  }
  onLinesChanged(e206) {
    return this._updateAnchorsViewPositions(), true;
  }
  onLinesDeleted(e206) {
    return this._updateAnchorsViewPositions(), true;
  }
  onLinesInserted(e206) {
    return this._updateAnchorsViewPositions(), true;
  }
  onScrollChanged(e206) {
    return true;
  }
  onZonesChanged(e206) {
    return true;
  }
  _updateAnchorsViewPositions() {
    let e206 = Object.keys(this._widgets);
    for (let t10 of e206) this._widgets[t10].updateAnchorViewPosition();
  }
  addWidget(e206) {
    let t10 = new Use(this._context, this._viewDomNode, e206);
    this._widgets[t10.id] = t10, t10.allowEditorOverflow ? this.overflowingContentWidgetsDomNode.appendChild(t10.domNode) : this.domNode.appendChild(t10.domNode), this.setShouldRender();
  }
  setWidgetPosition(e206, t10, n10, r10, i10) {
    this._widgets[e206.getId()].setPosition(t10, n10, r10, i10), this.setShouldRender();
  }
  removeWidget(e206) {
    let t10 = e206.getId();
    if (this._widgets.hasOwnProperty(t10)) {
      let e207 = this._widgets[t10];
      delete this._widgets[t10];
      let n10 = e207.domNode.domNode;
      n10.remove(), n10.removeAttribute(`monaco-visible-content-widget`), this.setShouldRender();
    }
  }
  shouldSuppressMouseDownOnWidget(e206) {
    return this._widgets.hasOwnProperty(e206) ? this._widgets[e206].suppressMouseDown : false;
  }
  onBeforeRender(e206) {
    let t10 = Object.keys(this._widgets);
    for (let n10 of t10) this._widgets[n10].onBeforeRender(e206);
  }
  prepareRender(e206) {
    let t10 = Object.keys(this._widgets);
    for (let n10 of t10) this._widgets[n10].prepareRender(e206);
  }
  render(e206) {
    let t10 = Object.keys(this._widgets);
    for (let n10 of t10) this._widgets[n10].render(e206);
  }
}, Use = class {
  constructor(e206, t10, n10) {
    this._primaryAnchor = new RS(null, null), this._secondaryAnchor = new RS(null, null), this._context = e206, this._viewDomNode = t10, this._actual = n10;
    let r10 = this._context.configuration.options, i10 = r10.get(165), a10 = r10.get(4);
    this.domNode = _u(this._actual.getDomNode()), this.id = this._actual.getId(), this.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && a10, this.suppressMouseDown = this._actual.suppressMouseDown || false, this._fixedOverflowWidgets = r10.get(51), this._contentWidth = i10.contentWidth, this._contentLeft = i10.contentLeft, this._affinity = null, this._preference = [], this._cachedDomNodeOffsetWidth = -1, this._cachedDomNodeOffsetHeight = -1, this._maxWidth = this._getMaxWidth(), this._isVisible = false, this._renderData = null, this.domNode.setPosition(this._fixedOverflowWidgets && this.allowEditorOverflow ? `fixed` : `absolute`), this.domNode.setDisplay(`none`), this.domNode.setVisibility(`hidden`), this.domNode.setAttribute(`widgetId`, this.id), this.domNode.setMaxWidth(this._maxWidth);
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options;
    if (e206.hasChanged(165)) {
      let e207 = t10.get(165);
      this._contentLeft = e207.contentLeft, this._contentWidth = e207.contentWidth, this._maxWidth = this._getMaxWidth();
    }
  }
  updateAnchorViewPosition() {
    this._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);
  }
  _setPosition(e206, t10, n10) {
    this._affinity = e206, this._primaryAnchor = r10(t10, this._context.viewModel, this._affinity), this._secondaryAnchor = r10(n10, this._context.viewModel, this._affinity);
    function r10(e207, t11, n11) {
      if (!e207) return new RS(null, null);
      let r11 = t11.model.validatePosition(e207);
      return t11.coordinatesConverter.modelPositionIsVisible(r11) ? new RS(e207, t11.coordinatesConverter.convertModelPositionToViewPosition(r11, n11 ?? void 0)) : new RS(e207, null);
    }
  }
  _getMaxWidth() {
    let e206 = this.domNode.domNode.ownerDocument, t10 = e206.defaultView;
    return this.allowEditorOverflow ? t10?.innerWidth || e206.documentElement.offsetWidth || e206.body.offsetWidth : this._contentWidth;
  }
  setPosition(e206, t10, n10, r10) {
    this._setPosition(r10, e206, t10), this._preference = n10, this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0 ? this.domNode.setDisplay(`block`) : this.domNode.setDisplay(`none`), this._cachedDomNodeOffsetWidth = -1, this._cachedDomNodeOffsetHeight = -1;
  }
  _layoutBoxInViewport(e206, t10, n10, r10) {
    let i10 = e206.top, a10 = i10, o10 = e206.top + e206.height, s10 = r10.viewportHeight - o10, c10 = i10 - n10, l10 = a10 >= n10, u10 = o10, d10 = s10 >= n10, f10 = e206.left;
    return f10 + t10 > r10.scrollLeft + r10.viewportWidth && (f10 = r10.scrollLeft + r10.viewportWidth - t10), f10 < r10.scrollLeft && (f10 = r10.scrollLeft), { fitsAbove: l10, aboveTop: c10, fitsBelow: d10, belowTop: u10, left: f10 };
  }
  _layoutHorizontalSegmentInPage(e206, t10, n10, r10) {
    let i10 = Math.max(15, t10.left - r10), a10 = Math.min(t10.left + t10.width + r10, e206.width - 15), o10 = this._viewDomNode.domNode.ownerDocument.defaultView, s10 = t10.left + n10 - (o10?.scrollX ?? 0);
    if (s10 + r10 > a10) {
      let e207 = s10 - (a10 - r10);
      s10 -= e207, n10 -= e207;
    }
    if (s10 < i10) {
      let e207 = s10 - i10;
      s10 -= e207, n10 -= e207;
    }
    return [n10, s10];
  }
  _layoutBoxInPage(e206, t10, n10, r10) {
    let i10 = e206.top - n10, a10 = e206.top + e206.height, o10 = _l2(this._viewDomNode.domNode), s10 = this._viewDomNode.domNode.ownerDocument, c10 = s10.defaultView, l10 = o10.top + i10 - (c10?.scrollY ?? 0), u10 = o10.top + a10 - (c10?.scrollY ?? 0), d10 = fl(s10.body), [f10, p10] = this._layoutHorizontalSegmentInPage(d10, o10, e206.left - r10.scrollLeft + this._contentLeft, t10), m10 = l10 >= 22, h10 = u10 + n10 <= d10.height - 22;
    return this._fixedOverflowWidgets ? { fitsAbove: m10, aboveTop: Math.max(l10, 22), fitsBelow: h10, belowTop: u10, left: p10 } : { fitsAbove: m10, aboveTop: i10, fitsBelow: h10, belowTop: a10, left: f10 };
  }
  _prepareRenderWidgetAtExactPositionOverflowing(e206) {
    return new zS(e206.top, e206.left + this._contentLeft);
  }
  _getAnchorsCoordinates(e206) {
    return { primary: t10(this._primaryAnchor.viewPosition, this._affinity), secondary: t10(this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null, this._affinity) };
    function t10(t11, n10) {
      if (!t11) return null;
      let r10 = e206.visibleRangeForPosition(t11);
      if (!r10) return null;
      let i10 = t11.column === 1 && n10 === 3 ? 0 : r10.left;
      return new BS(e206.getVerticalOffsetForLineNumber(t11.lineNumber) - e206.scrollTop, i10, e206.getLineHeightForLineNumber(t11.lineNumber));
    }
  }
  _reduceAnchorCoordinates(e206, t10, n10) {
    if (!t10) return e206;
    let r10 = this._context.configuration.options.get(59), i10 = t10.left;
    return i10 = i10 < e206.left ? Math.max(i10, e206.left - n10 + r10.typicalFullwidthCharacterWidth) : Math.min(i10, e206.left + n10 - r10.typicalFullwidthCharacterWidth), new BS(e206.top, i10, e206.height);
  }
  _prepareRenderWidget(e206) {
    if (!this._preference || this._preference.length === 0) return null;
    let { primary: t10, secondary: n10 } = this._getAnchorsCoordinates(e206);
    if (!t10) return { kind: `offViewport`, preserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement) };
    if (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {
      let e207 = null;
      if (typeof this._actual.beforeRender == `function` && (e207 = VS(this._actual.beforeRender, this._actual)), e207) this._cachedDomNodeOffsetWidth = e207.width, this._cachedDomNodeOffsetHeight = e207.height;
      else {
        let e208 = this.domNode.domNode.getBoundingClientRect();
        this._cachedDomNodeOffsetWidth = Math.round(e208.width), this._cachedDomNodeOffsetHeight = Math.round(e208.height);
      }
    }
    let r10 = this._reduceAnchorCoordinates(t10, n10, this._cachedDomNodeOffsetWidth), i10;
    i10 = this.allowEditorOverflow ? this._layoutBoxInPage(r10, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, e206) : this._layoutBoxInViewport(r10, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, e206);
    for (let e207 = 1; e207 <= 2; e207++) for (let t11 of this._preference) if (t11 === 1) {
      if (!i10) return null;
      if (e207 === 2 || i10.fitsAbove) return { kind: `inViewport`, coordinate: new zS(i10.aboveTop, i10.left), position: 1 };
    } else if (t11 === 2) {
      if (!i10) return null;
      if (e207 === 2 || i10.fitsBelow) return { kind: `inViewport`, coordinate: new zS(i10.belowTop, i10.left), position: 2 };
    } else if (this.allowEditorOverflow) return { kind: `inViewport`, coordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new zS(r10.top, r10.left)), position: 0 };
    else return { kind: `inViewport`, coordinate: new zS(r10.top, r10.left), position: 0 };
    return null;
  }
  onBeforeRender(e206) {
    !this._primaryAnchor.viewPosition || !this._preference || this._primaryAnchor.viewPosition.lineNumber < e206.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > e206.endLineNumber || this.domNode.setMaxWidth(this._maxWidth);
  }
  prepareRender(e206) {
    this._renderData = this._prepareRenderWidget(e206);
  }
  render(e206) {
    if (!this._renderData || this._renderData.kind === `offViewport`) {
      this._isVisible && (this.domNode.removeAttribute(`monaco-visible-content-widget`), this._isVisible = false, this._renderData?.kind === `offViewport` && this._renderData.preserveFocus ? this.domNode.setTop(-1e3) : this.domNode.setVisibility(`hidden`)), typeof this._actual.afterRender == `function` && VS(this._actual.afterRender, this._actual, null, null);
      return;
    }
    this.allowEditorOverflow ? (this.domNode.setTop(this._renderData.coordinate.top), this.domNode.setLeft(this._renderData.coordinate.left)) : (this.domNode.setTop(this._renderData.coordinate.top + e206.scrollTop - e206.bigNumbersDelta), this.domNode.setLeft(this._renderData.coordinate.left)), this._isVisible || (this._isVisible = (this.domNode.setVisibility(`inherit`), this.domNode.setAttribute(`monaco-visible-content-widget`, `true`), true)), typeof this._actual.afterRender == `function` && VS(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);
  }
}, RS = class {
  constructor(e206, t10) {
    this.modelPosition = e206, this.viewPosition = t10;
  }
}, zS = class {
  constructor(e206, t10) {
    this.top = e206, this.left = t10, this._coordinateBrand = void 0;
  }
}, BS = class {
  constructor(e206, t10, n10) {
    this.top = e206, this.left = t10, this.height = n10, this._anchorCoordinateBrand = void 0;
  }
};
function VS(e206, t10, ...n10) {
  try {
    return e206.call(t10, ...n10);
  } catch {
    return null;
  }
}
var HS = class extends wb {
}, US = xu(`themeService`);
function WS(e206) {
  return { id: e206 };
}
function GS(e206) {
  switch (e206) {
    case Nb.DARK:
      return Pb.VS_DARK;
    case Nb.HIGH_CONTRAST_DARK:
      return Pb.HC_BLACK;
    case Nb.HIGH_CONTRAST_LIGHT:
      return Pb.HC_LIGHT;
    default:
      return Pb.VS;
  }
}
var KS = { ThemingContribution: `base.contributions.theming` }, qS = new class extends D {
  constructor() {
    super(), this.themingParticipants = [], this.themingParticipants = [], this.onThemingParticipantAddedEmitter = this._register(new k());
  }
  onColorThemeChange(e206) {
    return this.themingParticipants.push(e206), this.onThemingParticipantAddedEmitter.fire(e206), T(() => {
      let t10 = this.themingParticipants.indexOf(e206);
      this.themingParticipants.splice(t10, 1);
    });
  }
  getThemingParticipants() {
    return this.themingParticipants;
  }
}();
cd.add(KS.ThemingContribution, qS);
function JS(e206) {
  return qS.onColorThemeChange(e206);
}
var Wse = class extends D {
  constructor(e206) {
    super(), this.themeService = e206, this.theme = e206.getColorTheme(), this._register(this.themeService.onDidColorThemeChange((e207) => this.onThemeChange(e207)));
  }
  onThemeChange(e206) {
    this.theme = e206, this.updateStyles();
  }
  updateStyles() {
  }
}, YS = Q(`editor.lineHighlightBackground`, null, C(610, `Background color for the highlight of line at the cursor position.`)), XS = Q(`editor.lineHighlightBorder`, { dark: `#282828`, light: `#eeeeee`, hcDark: `#f38518`, hcLight: q_ }, C(611, `Background color for the border around the line at the cursor position.`));
Q(`editor.rangeHighlightBackground`, { dark: `#ffffff0b`, light: `#fdff0033`, hcDark: null, hcLight: null }, C(612, `Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.`), true), Q(`editor.rangeHighlightBorder`, { dark: null, light: null, hcDark: J_, hcLight: J_ }, C(613, `Background color of the border around highlighted ranges.`)), Q(`editor.symbolHighlightBackground`, { dark: Sv, light: Sv, hcDark: null, hcLight: null }, C(614, `Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations.`), true), Q(`editor.symbolHighlightBorder`, { dark: null, light: null, hcDark: J_, hcLight: J_ }, C(615, `Background color of the border around highlighted symbols.`));
var ZS = Q(`editorCursor.foreground`, { dark: `#AEAFAD`, light: Y.black, hcDark: Y.white, hcLight: `#0F4A85` }, C(616, `Color of the editor cursor.`)), QS = Q(`editorCursor.background`, null, C(617, `The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.`)), $S = Q(`editorMultiCursor.primary.foreground`, ZS, C(618, `Color of the primary editor cursor when multiple cursors are present.`)), Gse = Q(`editorMultiCursor.primary.background`, QS, C(619, `The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)), eC = Q(`editorMultiCursor.secondary.foreground`, ZS, C(620, `Color of secondary editor cursors when multiple cursors are present.`)), Kse = Q(`editorMultiCursor.secondary.background`, QS, C(621, `The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)), tC = Q(`editorWhitespace.foreground`, { dark: `#e3e4e229`, light: `#33333333`, hcDark: `#e3e4e229`, hcLight: `#CCCCCC` }, C(622, `Color of whitespace characters in the editor.`)), qse = Q(`editorLineNumber.foreground`, { dark: `#858585`, light: `#237893`, hcDark: Y.white, hcLight: `#292929` }, C(623, `Color of editor line numbers.`)), Jse = Q(`editorIndentGuide.background`, tC, C(624, `Color of the editor indentation guides.`), false, C(625, `'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.`)), Yse = Q(`editorIndentGuide.activeBackground`, tC, C(626, `Color of the active editor indentation guides.`), false, C(627, `'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.`)), nC = Q(`editorIndentGuide.background1`, Jse, C(628, `Color of the editor indentation guides (1).`)), Xse = Q(`editorIndentGuide.background2`, `#00000000`, C(629, `Color of the editor indentation guides (2).`)), Zse = Q(`editorIndentGuide.background3`, `#00000000`, C(630, `Color of the editor indentation guides (3).`)), Qse = Q(`editorIndentGuide.background4`, `#00000000`, C(631, `Color of the editor indentation guides (4).`)), $se = Q(`editorIndentGuide.background5`, `#00000000`, C(632, `Color of the editor indentation guides (5).`)), ece = Q(`editorIndentGuide.background6`, `#00000000`, C(633, `Color of the editor indentation guides (6).`)), rC = Q(`editorIndentGuide.activeBackground1`, Yse, C(634, `Color of the active editor indentation guides (1).`)), tce = Q(`editorIndentGuide.activeBackground2`, `#00000000`, C(635, `Color of the active editor indentation guides (2).`)), nce = Q(`editorIndentGuide.activeBackground3`, `#00000000`, C(636, `Color of the active editor indentation guides (3).`)), rce = Q(`editorIndentGuide.activeBackground4`, `#00000000`, C(637, `Color of the active editor indentation guides (4).`)), ice = Q(`editorIndentGuide.activeBackground5`, `#00000000`, C(638, `Color of the active editor indentation guides (5).`)), ace = Q(`editorIndentGuide.activeBackground6`, `#00000000`, C(639, `Color of the active editor indentation guides (6).`));
Q(`editorLineNumber.activeForeground`, Q(`editorActiveLineNumber.foreground`, { dark: `#c6c6c6`, light: `#0B216F`, hcDark: J_, hcLight: J_ }, C(640, `Color of editor active line number`), false, C(641, `Id is deprecated. Use 'editorLineNumber.activeForeground' instead.`)), C(642, `Color of editor active line number`));
var oce = Q(`editorLineNumber.dimmedForeground`, null, C(643, `Color of the final editor line when editor.renderFinalNewline is set to dimmed.`)), sce = Q(`editorRuler.foreground`, { dark: `#5A5A5A`, light: Y.lightgrey, hcDark: Y.white, hcLight: `#292929` }, C(644, `Color of the editor rulers.`));
Q(`editorCodeLens.foreground`, { dark: `#999999`, light: `#919191`, hcDark: `#999999`, hcLight: `#292929` }, C(645, `Foreground color of editor CodeLens`)), Q(`editorBracketMatch.background`, { dark: `#0064001a`, light: `#0064001a`, hcDark: `#0064001a`, hcLight: `#0000` }, C(646, `Background color behind matching brackets`)), Q(`editorBracketMatch.border`, { dark: `#888`, light: `#B9B9B9`, hcDark: q_, hcLight: q_ }, C(647, `Color for matching brackets boxes`));
var cce = Q(`editorOverviewRuler.border`, { dark: `#7f7f7f4d`, light: `#7f7f7f4d`, hcDark: `#7f7f7f4d`, hcLight: `#666666` }, C(648, `Color of the overview ruler border.`)), lce = Q(`editorOverviewRuler.background`, null, C(649, `Background color of the editor overview ruler.`));
Q(`editorGutter.background`, rv, C(650, `Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.`)), Q(`editorUnnecessaryCode.border`, { dark: null, light: null, hcDark: Y.fromHex(`#fff`).transparent(0.8), hcLight: q_ }, C(651, `Border color of unnecessary (unused) source code in the editor.`));
var uce = Q(`editorUnnecessaryCode.opacity`, { dark: Y.fromHex(`#000a`), light: Y.fromHex(`#0007`), hcDark: null, hcLight: null }, C(652, `Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the  'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));
Q(`editorGhostText.border`, { dark: null, light: null, hcDark: Y.fromHex(`#fff`).transparent(0.8), hcLight: Y.fromHex(`#292929`).transparent(0.8) }, C(653, `Border color of ghost text in the editor.`));
var dce = Q(`editorGhostText.foreground`, { dark: Y.fromHex(`#ffffff56`), light: Y.fromHex(`#0007`), hcDark: null, hcLight: null }, C(654, `Foreground color of the ghost text in the editor.`));
Q(`editorGhostText.background`, null, C(655, `Background color of the ghost text in the editor.`));
var iC = Q(`editorOverviewRuler.rangeHighlightForeground`, new Y(new J(0, 122, 204, 0.6)), C(656, `Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.`), true), fce = Q(`editorOverviewRuler.errorForeground`, { dark: new Y(new J(255, 18, 18, 0.7)), light: new Y(new J(255, 18, 18, 0.7)), hcDark: new Y(new J(255, 50, 50, 1)), hcLight: `#B5200D` }, C(657, `Overview ruler marker color for errors.`)), pce = Q(`editorOverviewRuler.warningForeground`, { dark: dv, light: dv, hcDark: fv, hcLight: fv }, C(658, `Overview ruler marker color for warnings.`)), mce = Q(`editorOverviewRuler.infoForeground`, { dark: pv, light: pv, hcDark: mv, hcLight: mv }, C(659, `Overview ruler marker color for infos.`)), aC = Q(`editorBracketHighlight.foreground1`, { dark: `#FFD700`, light: `#0431FAFF`, hcDark: `#FFD700`, hcLight: `#0431FAFF` }, C(660, `Foreground color of brackets (1). Requires enabling bracket pair colorization.`)), oC = Q(`editorBracketHighlight.foreground2`, { dark: `#DA70D6`, light: `#319331FF`, hcDark: `#DA70D6`, hcLight: `#319331FF` }, C(661, `Foreground color of brackets (2). Requires enabling bracket pair colorization.`)), sC = Q(`editorBracketHighlight.foreground3`, { dark: `#179FFF`, light: `#7B3814FF`, hcDark: `#87CEFA`, hcLight: `#7B3814FF` }, C(662, `Foreground color of brackets (3). Requires enabling bracket pair colorization.`)), cC = Q(`editorBracketHighlight.foreground4`, `#00000000`, C(663, `Foreground color of brackets (4). Requires enabling bracket pair colorization.`)), lC = Q(`editorBracketHighlight.foreground5`, `#00000000`, C(664, `Foreground color of brackets (5). Requires enabling bracket pair colorization.`)), uC = Q(`editorBracketHighlight.foreground6`, `#00000000`, C(665, `Foreground color of brackets (6). Requires enabling bracket pair colorization.`)), hce = Q(`editorBracketHighlight.unexpectedBracket.foreground`, { dark: new Y(new J(255, 18, 18, 0.8)), light: new Y(new J(255, 18, 18, 0.8)), hcDark: new Y(new J(255, 50, 50, 1)), hcLight: `#B5200D` }, C(666, `Foreground color of unexpected brackets.`)), gce = Q(`editorBracketPairGuide.background1`, `#00000000`, C(667, `Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.`)), _ce = Q(`editorBracketPairGuide.background2`, `#00000000`, C(668, `Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.`)), vce = Q(`editorBracketPairGuide.background3`, `#00000000`, C(669, `Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.`)), yce = Q(`editorBracketPairGuide.background4`, `#00000000`, C(670, `Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.`)), bce = Q(`editorBracketPairGuide.background5`, `#00000000`, C(671, `Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.`)), xce = Q(`editorBracketPairGuide.background6`, `#00000000`, C(672, `Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.`)), Sce = Q(`editorBracketPairGuide.activeBackground1`, `#00000000`, C(673, `Background color of active bracket pair guides (1). Requires enabling bracket pair guides.`)), Cce = Q(`editorBracketPairGuide.activeBackground2`, `#00000000`, C(674, `Background color of active bracket pair guides (2). Requires enabling bracket pair guides.`)), wce = Q(`editorBracketPairGuide.activeBackground3`, `#00000000`, C(675, `Background color of active bracket pair guides (3). Requires enabling bracket pair guides.`)), Tce = Q(`editorBracketPairGuide.activeBackground4`, `#00000000`, C(676, `Background color of active bracket pair guides (4). Requires enabling bracket pair guides.`)), Ece = Q(`editorBracketPairGuide.activeBackground5`, `#00000000`, C(677, `Background color of active bracket pair guides (5). Requires enabling bracket pair guides.`)), Dce = Q(`editorBracketPairGuide.activeBackground6`, `#00000000`, C(678, `Background color of active bracket pair guides (6). Requires enabling bracket pair guides.`));
Q(`editorUnicodeHighlight.border`, dv, C(679, `Border color used to highlight unicode characters.`)), Q(`editorUnicodeHighlight.background`, uv, C(680, `Background color used to highlight unicode characters.`)), JS((e206, t10) => {
  let n10 = e206.getColor(rv), r10 = e206.getColor(YS), i10 = r10 && !r10.isTransparent() ? r10 : n10;
  i10 && t10.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${i10}; }`);
});
var dC = class extends HS {
  constructor(e206) {
    super(), this._context = e206;
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    this._renderLineHighlight = t10.get(110), this._renderLineHighlightOnlyWhenFocus = t10.get(111), this._wordWrap = n10.isViewportWrapping, this._contentLeft = n10.contentLeft, this._contentWidth = n10.contentWidth, this._selectionIsEmpty = true, this._focused = false, this._cursorLineNumbers = [1], this._selections = [new N(1, 1, 1, 1)], this._renderData = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), super.dispose();
  }
  _readFromSelections() {
    let e206 = false, t10 = /* @__PURE__ */ new Set();
    for (let e207 of this._selections) t10.add(e207.positionLineNumber);
    let n10 = Array.from(t10);
    n10.sort((e207, t11) => e207 - t11), o(this._cursorLineNumbers, n10) || (this._cursorLineNumbers = n10, e206 = true);
    let r10 = this._selections.every((e207) => e207.isEmpty());
    return this._selectionIsEmpty !== r10 && (this._selectionIsEmpty = r10, e206 = true), e206;
  }
  onThemeChanged(e206) {
    return this._readFromSelections();
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    return this._renderLineHighlight = t10.get(110), this._renderLineHighlightOnlyWhenFocus = t10.get(111), this._wordWrap = n10.isViewportWrapping, this._contentLeft = n10.contentLeft, this._contentWidth = n10.contentWidth, true;
  }
  onCursorStateChanged(e206) {
    return this._selections = e206.selections, this._readFromSelections();
  }
  onFlushed(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollWidthChanged || e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  onFocusChanged(e206) {
    return this._renderLineHighlightOnlyWhenFocus ? (this._focused = e206.isFocused, true) : false;
  }
  prepareRender(e206) {
    if (!this._shouldRenderThis()) {
      this._renderData = null;
      return;
    }
    let t10 = e206.visibleRange.startLineNumber, n10 = e206.visibleRange.endLineNumber, r10 = [];
    for (let e207 = t10; e207 <= n10; e207++) {
      let n11 = e207 - t10;
      r10[n11] = ``;
    }
    if (this._wordWrap) {
      let i11 = this._renderOne(e206, false);
      for (let e207 of this._cursorLineNumbers) {
        let a10 = this._context.viewModel.coordinatesConverter, o10 = a10.convertViewPositionToModelPosition(new j(e207, 1)).lineNumber, s10 = a10.convertModelPositionToViewPosition(new j(o10, 1)).lineNumber, c10 = a10.convertModelPositionToViewPosition(new j(o10, this._context.viewModel.model.getLineMaxColumn(o10))).lineNumber, l10 = Math.max(s10, t10), u10 = Math.min(c10, n10);
        for (let e208 = l10; e208 <= u10; e208++) {
          let n11 = e208 - t10;
          r10[n11] = i11;
        }
      }
    }
    let i10 = this._renderOne(e206, true);
    for (let e207 of this._cursorLineNumbers) {
      if (e207 < t10 || e207 > n10) continue;
      let a10 = e207 - t10;
      r10[a10] = i10;
    }
    this._renderData = r10;
  }
  render(e206, t10) {
    if (!this._renderData) return ``;
    let n10 = t10 - e206;
    return n10 >= this._renderData.length ? `` : this._renderData[n10];
  }
  _shouldRenderInMargin() {
    return (this._renderLineHighlight === `gutter` || this._renderLineHighlight === `all`) && (!this._renderLineHighlightOnlyWhenFocus || this._focused);
  }
  _shouldRenderInContent() {
    return (this._renderLineHighlight === `line` || this._renderLineHighlight === `all`) && this._selectionIsEmpty && (!this._renderLineHighlightOnlyWhenFocus || this._focused);
  }
}, Oce = class extends dC {
  _renderOne(e206, t10) {
    return `<div class="${`current-line` + (this._shouldRenderInMargin() ? ` current-line-both` : ``) + (t10 ? ` current-line-exact` : ``)}" style="width:${Math.max(e206.scrollWidth, this._contentWidth)}px;"></div>`;
  }
  _shouldRenderThis() {
    return this._shouldRenderInContent();
  }
  _shouldRenderOther() {
    return this._shouldRenderInMargin();
  }
}, kce = class extends dC {
  _renderOne(e206, t10) {
    return `<div class="${`current-line` + (this._shouldRenderInMargin() ? ` current-line-margin` : ``) + (this._shouldRenderOther() ? ` current-line-margin-both` : ``) + (this._shouldRenderInMargin() && t10 ? ` current-line-exact-margin` : ``)}" style="width:${this._contentLeft}px"></div>`;
  }
  _shouldRenderThis() {
    return true;
  }
  _shouldRenderOther() {
    return this._shouldRenderInContent();
  }
};
JS((e206, t10) => {
  let n10 = e206.getColor(YS);
  if (n10 && (t10.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n10}; }`), t10.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n10}; border: none; }`)), !n10 || n10.isTransparent() || e206.defines(XS)) {
    let n11 = e206.getColor(XS);
    n11 && (t10.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n11}; }`), t10.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n11}; }`), Fb(e206.type) && (t10.addRule(`.monaco-editor .view-overlays .current-line-exact { border-width: 1px; }`), t10.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }`)));
  }
});
var Ace = class extends HS {
  constructor(e206) {
    super(), this._context = e206, this._typicalHalfwidthCharacterWidth = this._context.configuration.options.get(59).typicalHalfwidthCharacterWidth, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    return this._typicalHalfwidthCharacterWidth = this._context.configuration.options.get(59).typicalHalfwidthCharacterWidth, true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged || e206.scrollWidthChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  prepareRender(e206) {
    let t10 = e206.getDecorationsInViewport(), n10 = [], r10 = 0;
    for (let e207 = 0, i11 = t10.length; e207 < i11; e207++) {
      let i12 = t10[e207];
      i12.options.className && (n10[r10++] = i12);
    }
    n10 = n10.sort((e207, t11) => {
      if (e207.options.zIndex < t11.options.zIndex) return -1;
      if (e207.options.zIndex > t11.options.zIndex) return 1;
      let n11 = e207.options.className, r11 = t11.options.className;
      return n11 < r11 ? -1 : n11 > r11 ? 1 : M.compareRangesUsingStarts(e207.range, t11.range);
    });
    let i10 = e206.visibleRange.startLineNumber, a10 = e206.visibleRange.endLineNumber, o10 = [];
    for (let e207 = i10; e207 <= a10; e207++) {
      let t11 = e207 - i10;
      o10[t11] = ``;
    }
    this._renderWholeLineDecorations(e206, n10, o10), this._renderNormalDecorations(e206, n10, o10), this._renderResult = o10;
  }
  _renderWholeLineDecorations(e206, t10, n10) {
    let r10 = e206.visibleRange.startLineNumber, i10 = e206.visibleRange.endLineNumber;
    for (let e207 = 0, a10 = t10.length; e207 < a10; e207++) {
      let a11 = t10[e207];
      if (!a11.options.isWholeLine) continue;
      let o10 = `<div class="cdr ` + a11.options.className + `" style="left:0;width:100%;"></div>`, s10 = Math.max(a11.range.startLineNumber, r10), c10 = Math.min(a11.range.endLineNumber, i10);
      for (let e208 = s10; e208 <= c10; e208++) {
        let t11 = e208 - r10;
        n10[t11] += o10;
      }
    }
  }
  _renderNormalDecorations(e206, t10, n10) {
    let r10 = e206.visibleRange.startLineNumber, i10 = null, a10 = false, o10 = null, s10 = false;
    for (let c10 = 0, l10 = t10.length; c10 < l10; c10++) {
      let l11 = t10[c10];
      if (l11.options.isWholeLine) continue;
      let u10 = l11.options.className, d10 = !!l11.options.showIfCollapsed, f10 = l11.range;
      if (d10 && f10.endColumn === 1 && f10.endLineNumber !== f10.startLineNumber && (f10 = new M(f10.startLineNumber, f10.startColumn, f10.endLineNumber - 1, this._context.viewModel.getLineMaxColumn(f10.endLineNumber - 1))), i10 === u10 && a10 === d10 && M.areIntersectingOrTouching(o10, f10)) {
        o10 = M.plusRange(o10, f10);
        continue;
      }
      i10 !== null && this._renderNormalDecoration(e206, o10, i10, s10, a10, r10, n10), i10 = u10, a10 = d10, o10 = f10, s10 = l11.options.shouldFillLineOnLineBreak ?? false;
    }
    i10 !== null && this._renderNormalDecoration(e206, o10, i10, s10, a10, r10, n10);
  }
  _renderNormalDecoration(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = e206.linesVisibleRangesForRange(t10, n10 === `findMatch`);
    if (s10) for (let e207 = 0, t11 = s10.length; e207 < t11; e207++) {
      let t12 = s10[e207];
      if (t12.outsideRenderedLine) continue;
      let c10 = t12.lineNumber - a10;
      if (i10 && t12.ranges.length === 1) {
        let e208 = t12.ranges[0];
        if (e208.width < this._typicalHalfwidthCharacterWidth) {
          let n11 = Math.round(e208.left + e208.width / 2), r11 = Math.max(0, Math.round(n11 - this._typicalHalfwidthCharacterWidth / 2));
          t12.ranges[0] = new Ob(r11, this._typicalHalfwidthCharacterWidth);
        }
      }
      for (let e208 = 0, i11 = t12.ranges.length; e208 < i11; e208++) {
        let a11 = r10 && t12.continuesOnNextLine && i11 === 1, s11 = t12.ranges[e208], l10 = `<div class="cdr ` + n10 + `" style="left:` + String(s11.left) + `px;width:` + (a11 ? `100%;` : String(s11.width) + `px;`) + `"></div>`;
        o10[c10] += l10;
      }
    }
  }
  render(e206, t10) {
    if (!this._renderResult) return ``;
    let n10 = t10 - e206;
    return n10 < 0 || n10 >= this._renderResult.length ? `` : this._renderResult[n10];
  }
}, jce = class extends Tb {
  constructor(e206, t10, n10, r10) {
    super(e206);
    let i10 = this._context.configuration.options, a10 = i10.get(117), o10 = i10.get(83), s10 = i10.get(49), c10 = i10.get(120), l10 = i10.get(158), u10 = { listenOnDomNode: n10.domNode, className: `editor-scrollable ` + GS(e206.theme.type), useShadows: false, lazyRender: true, vertical: a10.vertical, horizontal: a10.horizontal, verticalHasArrows: a10.verticalHasArrows, horizontalHasArrows: a10.horizontalHasArrows, verticalScrollbarSize: a10.verticalScrollbarSize, verticalSliderSize: a10.verticalSliderSize, horizontalScrollbarSize: a10.horizontalScrollbarSize, horizontalSliderSize: a10.horizontalSliderSize, handleMouseWheel: a10.handleMouseWheel, alwaysConsumeMouseWheel: a10.alwaysConsumeMouseWheel, arrowSize: a10.arrowSize, mouseWheelScrollSensitivity: o10, fastScrollSensitivity: s10, scrollPredominantAxis: c10, scrollByPage: a10.scrollByPage, inertialScroll: l10 };
    this.scrollbar = this._register(new mx(t10.domNode, u10, this._context.viewLayout.getScrollable())), Eb.write(this.scrollbar.getDomNode(), 6), this.scrollbarDomNode = _u(this.scrollbar.getDomNode()), this.scrollbarDomNode.setPosition(`absolute`), this._setLayout();
    let d10 = (e207, t11, n11) => {
      let r11 = {};
      {
        let t12 = e207.scrollTop;
        t12 && (r11.scrollTop = this._context.viewLayout.getCurrentScrollTop() + t12, e207.scrollTop = 0);
      }
      if (n11) {
        let t12 = e207.scrollLeft;
        t12 && (r11.scrollLeft = this._context.viewLayout.getCurrentScrollLeft() + t12, e207.scrollLeft = 0);
      }
      this._context.viewModel.viewLayout.setScrollPosition(r11, 1);
    };
    this._register(L(n10.domNode, `scroll`, (e207) => d10(n10.domNode, true, true))), this._register(L(t10.domNode, `scroll`, (e207) => d10(t10.domNode, true, false))), this._register(L(r10.domNode, `scroll`, (e207) => d10(r10.domNode, true, false))), this._register(L(this.scrollbarDomNode.domNode, `scroll`, (e207) => d10(this.scrollbarDomNode.domNode, true, false)));
  }
  dispose() {
    super.dispose();
  }
  _setLayout() {
    let e206 = this._context.configuration.options, t10 = e206.get(165);
    this.scrollbarDomNode.setLeft(t10.contentLeft), e206.get(81).side === `right` ? this.scrollbarDomNode.setWidth(t10.contentWidth + t10.minimap.minimapWidth) : this.scrollbarDomNode.setWidth(t10.contentWidth), this.scrollbarDomNode.setHeight(t10.height);
  }
  getOverviewRulerLayoutInfo() {
    return this.scrollbar.getOverviewRulerLayoutInfo();
  }
  getDomNode() {
    return this.scrollbarDomNode;
  }
  delegateVerticalScrollbarPointerDown(e206) {
    this.scrollbar.delegateVerticalScrollbarPointerDown(e206);
  }
  delegateScrollFromMouseWheelEvent(e206) {
    this.scrollbar.delegateScrollFromMouseWheelEvent(e206);
  }
  onConfigurationChanged(e206) {
    if (e206.hasChanged(117) || e206.hasChanged(83) || e206.hasChanged(49)) {
      let e207 = this._context.configuration.options, t10 = e207.get(117), n10 = e207.get(83), r10 = e207.get(49), i10 = e207.get(120), a10 = { vertical: t10.vertical, horizontal: t10.horizontal, verticalScrollbarSize: t10.verticalScrollbarSize, horizontalScrollbarSize: t10.horizontalScrollbarSize, scrollByPage: t10.scrollByPage, handleMouseWheel: t10.handleMouseWheel, mouseWheelScrollSensitivity: n10, fastScrollSensitivity: r10, scrollPredominantAxis: i10 };
      this.scrollbar.updateOptions(a10);
    }
    return e206.hasChanged(165) && this._setLayout(), true;
  }
  onScrollChanged(e206) {
    return true;
  }
  onThemeChanged(e206) {
    return this.scrollbar.updateClassName(`editor-scrollable ` + GS(this._context.theme.type)), true;
  }
  prepareRender(e206) {
  }
  render(e206) {
    this.scrollbar.renderNow();
  }
}, fC = class {
  constructor(e206, t10, n10, r10, i10) {
    this.startLineNumber = e206, this.endLineNumber = t10, this.className = n10, this.tooltip = r10, this._decorationToRenderBrand = void 0, this.zIndex = i10 ?? 0;
  }
}, Mce = class {
  constructor(e206, t10, n10) {
    this.className = e206, this.zIndex = t10, this.tooltip = n10;
  }
}, Nce = class {
  constructor() {
    this.decorations = [];
  }
  add(e206) {
    this.decorations.push(e206);
  }
  getDecorations() {
    return this.decorations;
  }
}, pC = class extends HS {
  _render(e206, t10, n10) {
    let r10 = [];
    for (let n11 = e206; n11 <= t10; n11++) {
      let t11 = n11 - e206;
      r10[t11] = new Nce();
    }
    if (n10.length === 0) return r10;
    n10.sort((e207, t11) => e207.className === t11.className ? e207.startLineNumber === t11.startLineNumber ? e207.endLineNumber - t11.endLineNumber : e207.startLineNumber - t11.startLineNumber : e207.className < t11.className ? -1 : 1);
    let i10 = null, a10 = 0;
    for (let o10 = 0, s10 = n10.length; o10 < s10; o10++) {
      let s11 = n10[o10], c10 = s11.className, l10 = s11.zIndex, u10 = Math.max(s11.startLineNumber, e206) - e206, d10 = Math.min(s11.endLineNumber, t10) - e206;
      i10 === c10 ? (u10 = Math.max(a10 + 1, u10), a10 = Math.max(a10, d10)) : (i10 = c10, a10 = d10);
      for (let e207 = u10; e207 <= a10; e207++) r10[e207].add(new Mce(c10, l10, s11.tooltip));
    }
    return r10;
  }
}, Pce = class extends Tb {
  constructor(e206) {
    super(e206), this._widgets = {}, this._context = e206;
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    this.domNode = _u(document.createElement(`div`)), this.domNode.setClassName(`glyph-margin-widgets`), this.domNode.setPosition(`absolute`), this.domNode.setTop(0), this._lineHeight = t10.get(75), this._glyphMargin = t10.get(66), this._glyphMarginLeft = n10.glyphMarginLeft, this._glyphMarginWidth = n10.glyphMarginWidth, this._glyphMarginDecorationLaneCount = n10.glyphMarginDecorationLaneCount, this._managedDomNodes = [], this._decorationGlyphsToRender = [];
  }
  dispose() {
    this._managedDomNodes = [], this._decorationGlyphsToRender = [], this._widgets = {}, super.dispose();
  }
  getWidgets() {
    return Object.values(this._widgets);
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    return this._lineHeight = t10.get(75), this._glyphMargin = t10.get(66), this._glyphMarginLeft = n10.glyphMarginLeft, this._glyphMarginWidth = n10.glyphMarginWidth, this._glyphMarginDecorationLaneCount = n10.glyphMarginDecorationLaneCount, true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  addWidget(e206) {
    let t10 = _u(e206.getDomNode());
    this._widgets[e206.getId()] = { widget: e206, preference: e206.getPosition(), domNode: t10, renderInfo: null }, t10.setPosition(`absolute`), t10.setDisplay(`none`), t10.setAttribute(`widgetId`, e206.getId()), this.domNode.appendChild(t10), this.setShouldRender();
  }
  setWidgetPosition(e206, t10) {
    let n10 = this._widgets[e206.getId()];
    return n10.preference.lane === t10.lane && n10.preference.zIndex === t10.zIndex && M.equalsRange(n10.preference.range, t10.range) ? false : (n10.preference = t10, this.setShouldRender(), true);
  }
  removeWidget(e206) {
    let t10 = e206.getId();
    if (this._widgets[t10]) {
      let e207 = this._widgets[t10].domNode.domNode;
      delete this._widgets[t10], e207.remove(), this.setShouldRender();
    }
  }
  _collectDecorationBasedGlyphRenderRequest(e206, t10) {
    let n10 = e206.visibleRange.startLineNumber, r10 = e206.visibleRange.endLineNumber, i10 = e206.getDecorationsInViewport();
    for (let e207 of i10) {
      let i11 = e207.options.glyphMarginClassName;
      if (!i11) continue;
      let a10 = Math.max(e207.range.startLineNumber, n10), o10 = Math.min(e207.range.endLineNumber, r10), s10 = e207.options.glyphMargin?.position ?? $p.Center, c10 = e207.options.zIndex ?? 0;
      for (let e208 = a10; e208 <= o10; e208++) {
        let n11 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(e208, 0)), r11 = this._context.viewModel.glyphLanes.getLanesAtLine(n11.lineNumber).indexOf(s10);
        t10.push(new Fce(e208, r11, c10, i11));
      }
    }
  }
  _collectWidgetBasedGlyphRenderRequest(e206, t10) {
    let n10 = e206.visibleRange.startLineNumber, r10 = e206.visibleRange.endLineNumber;
    for (let e207 of Object.values(this._widgets)) {
      let i10 = e207.preference.range, { startLineNumber: a10, endLineNumber: o10 } = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(M.lift(i10));
      if (!a10 || !o10 || o10 < n10 || a10 > r10) continue;
      let s10 = Math.max(a10, n10), c10 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(s10, 0)), l10 = this._context.viewModel.glyphLanes.getLanesAtLine(c10.lineNumber).indexOf(e207.preference.lane);
      t10.push(new Ice(s10, l10, e207.preference.zIndex, e207));
    }
  }
  _collectSortedGlyphRenderRequests(e206) {
    let t10 = [];
    return this._collectDecorationBasedGlyphRenderRequest(e206, t10), this._collectWidgetBasedGlyphRenderRequest(e206, t10), t10.sort((e207, t11) => e207.lineNumber === t11.lineNumber ? e207.laneIndex === t11.laneIndex ? e207.zIndex === t11.zIndex ? t11.type === e207.type ? e207.type === 0 && t11.type === 0 ? e207.className < t11.className ? -1 : 1 : 0 : t11.type - e207.type : t11.zIndex - e207.zIndex : e207.laneIndex - t11.laneIndex : e207.lineNumber - t11.lineNumber), t10;
  }
  prepareRender(e206) {
    if (!this._glyphMargin) {
      this._decorationGlyphsToRender = [];
      return;
    }
    for (let e207 of Object.values(this._widgets)) e207.renderInfo = null;
    let t10 = new me(this._collectSortedGlyphRenderRequests(e206)), n10 = [];
    for (; t10.length > 0; ) {
      let e207 = t10.peek();
      if (!e207) break;
      let r10 = t10.takeWhile((t11) => t11.lineNumber === e207.lineNumber && t11.laneIndex === e207.laneIndex);
      if (!r10 || r10.length === 0) break;
      let i10 = r10[0];
      if (i10.type === 0) {
        let e208 = [];
        for (let t11 of r10) {
          if (t11.zIndex !== i10.zIndex || t11.type !== i10.type) break;
          (e208.length === 0 || e208[e208.length - 1] !== t11.className) && e208.push(t11.className);
        }
        n10.push(i10.accept(e208.join(` `)));
      } else i10.widget.renderInfo = { lineNumber: i10.lineNumber, laneIndex: i10.laneIndex };
    }
    this._decorationGlyphsToRender = n10;
  }
  render(e206) {
    if (!this._glyphMargin) {
      for (let e207 of Object.values(this._widgets)) e207.domNode.setDisplay(`none`);
      for (; this._managedDomNodes.length > 0; ) this._managedDomNodes.pop()?.domNode.remove();
      return;
    }
    let t10 = Math.round(this._glyphMarginWidth / this._glyphMarginDecorationLaneCount);
    for (let n10 of Object.values(this._widgets)) if (!n10.renderInfo) n10.domNode.setDisplay(`none`);
    else {
      let r10 = e206.viewportData.relativeVerticalOffset[n10.renderInfo.lineNumber - e206.viewportData.startLineNumber], i10 = this._glyphMarginLeft + n10.renderInfo.laneIndex * this._lineHeight;
      n10.domNode.setDisplay(`block`), n10.domNode.setTop(r10), n10.domNode.setLeft(i10), n10.domNode.setWidth(t10), n10.domNode.setHeight(this._lineHeight);
    }
    for (let n10 = 0; n10 < this._decorationGlyphsToRender.length; n10++) {
      let r10 = this._decorationGlyphsToRender[n10], i10 = r10.lineNumber, a10 = e206.viewportData.relativeVerticalOffset[i10 - e206.viewportData.startLineNumber], o10 = this._glyphMarginLeft + r10.laneIndex * this._lineHeight, s10;
      n10 < this._managedDomNodes.length ? s10 = this._managedDomNodes[n10] : (s10 = _u(document.createElement(`div`)), this._managedDomNodes.push(s10), this.domNode.appendChild(s10));
      let c10 = this._context.viewLayout.getLineHeightForLineNumber(i10);
      s10.setClassName(`cgmr codicon ` + r10.combinedClassName), s10.setPosition(`absolute`), s10.setTop(a10), s10.setLeft(o10), s10.setWidth(t10), s10.setHeight(c10);
    }
    for (; this._managedDomNodes.length > this._decorationGlyphsToRender.length; ) this._managedDomNodes.pop()?.domNode.remove();
  }
}, Fce = class {
  constructor(e206, t10, n10, r10) {
    this.lineNumber = e206, this.laneIndex = t10, this.zIndex = n10, this.className = r10, this.type = 0;
  }
  accept(e206) {
    return new Lce(this.lineNumber, this.laneIndex, e206);
  }
}, Ice = class {
  constructor(e206, t10, n10, r10) {
    this.lineNumber = e206, this.laneIndex = t10, this.zIndex = n10, this.widget = r10, this.type = 1;
  }
}, Lce = class {
  constructor(e206, t10, n10) {
    this.lineNumber = e206, this.laneIndex = t10, this.combinedClassName = n10;
  }
}, mC = class extends D {
  constructor() {
    super(...arguments), this._isDisposed = false;
  }
  dispose() {
    super.dispose(), this._isDisposed = true;
  }
  assertNotDisposed() {
    if (this._isDisposed) throw Error(`TextModelPart is disposed!`);
  }
};
function hC(e206, t10) {
  let n10 = 0, r10 = 0, i10 = e206.length;
  for (; r10 < i10; ) {
    let i11 = e206.charCodeAt(r10);
    if (i11 === 32) n10++;
    else if (i11 === 9) n10 = n10 - n10 % t10 + t10;
    else break;
    r10++;
  }
  return r10 === i10 ? -1 : n10;
}
var gC;
(function(e206) {
  e206[e206.Disabled = 0] = `Disabled`, e206[e206.EnabledForActive = 1] = `EnabledForActive`, e206[e206.Enabled = 2] = `Enabled`;
})(gC || (gC = {}));
var _C2 = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    if (this.visibleColumn = e206, this.column = t10, this.className = n10, this.horizontalLine = r10, this.forWrappedLinesAfterColumn = i10, this.forWrappedLinesBeforeOrAtColumn = a10, e206 !== -1 == (t10 !== -1)) throw Error();
  }
}, vC = class {
  constructor(e206, t10) {
    this.top = e206, this.endColumn = t10;
  }
}, Rce = class extends mC {
  constructor(e206, t10) {
    super(), this.textModel = e206, this.languageConfigurationService = t10;
  }
  getLanguageConfiguration(e206) {
    return this.languageConfigurationService.getLanguageConfiguration(e206);
  }
  _computeIndentLevel(e206) {
    return hC(this.textModel.getLineContent(e206 + 1), this.textModel.getOptions().tabSize);
  }
  getActiveIndentGuide(e206, t10, n10) {
    this.assertNotDisposed();
    let r10 = this.textModel.getLineCount();
    if (e206 < 1 || e206 > r10) throw new je(`Illegal value for lineNumber`);
    let i10 = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules, a10 = !!(i10 && i10.offSide), o10 = -2, s10 = -1, c10 = -2, l10 = -1, u10 = (e207) => {
      if (o10 !== -1 && (o10 === -2 || o10 > e207 - 1)) {
        o10 = -1, s10 = -1;
        for (let t11 = e207 - 2; t11 >= 0; t11--) {
          let e208 = this._computeIndentLevel(t11);
          if (e208 >= 0) {
            o10 = t11, s10 = e208;
            break;
          }
        }
      }
      if (c10 === -2) {
        c10 = -1, l10 = -1;
        for (let t11 = e207; t11 < r10; t11++) {
          let e208 = this._computeIndentLevel(t11);
          if (e208 >= 0) {
            c10 = t11, l10 = e208;
            break;
          }
        }
      }
    }, d10 = -2, f10 = -1, p10 = -2, m10 = -1, h10 = (e207) => {
      if (d10 === -2) {
        d10 = -1, f10 = -1;
        for (let t11 = e207 - 2; t11 >= 0; t11--) {
          let e208 = this._computeIndentLevel(t11);
          if (e208 >= 0) {
            d10 = t11, f10 = e208;
            break;
          }
        }
      }
      if (p10 !== -1 && (p10 === -2 || p10 < e207 - 1)) {
        p10 = -1, m10 = -1;
        for (let t11 = e207; t11 < r10; t11++) {
          let e208 = this._computeIndentLevel(t11);
          if (e208 >= 0) {
            p10 = t11, m10 = e208;
            break;
          }
        }
      }
    }, g10 = 0, _10 = true, v10 = 0, y10 = true, b10 = 0, x10 = 0;
    for (let i11 = 0; _10 || y10; i11++) {
      let o11 = e206 - i11, p11 = e206 + i11;
      i11 > 1 && (o11 < 1 || o11 < t10) && (_10 = false), i11 > 1 && (p11 > r10 || p11 > n10) && (y10 = false), i11 > 5e4 && (_10 = false, y10 = false);
      let S10 = -1;
      if (_10 && o11 >= 1) {
        let e207 = this._computeIndentLevel(o11 - 1);
        e207 >= 0 ? (c10 = o11 - 1, l10 = e207, S10 = Math.ceil(e207 / this.textModel.getOptions().indentSize)) : (u10(o11), S10 = this._getIndentLevelForWhitespaceLine(a10, s10, l10));
      }
      let ee2 = -1;
      if (y10 && p11 <= r10) {
        let e207 = this._computeIndentLevel(p11 - 1);
        e207 >= 0 ? (d10 = p11 - 1, f10 = e207, ee2 = Math.ceil(e207 / this.textModel.getOptions().indentSize)) : (h10(p11), ee2 = this._getIndentLevelForWhitespaceLine(a10, f10, m10));
      }
      if (i11 === 0) {
        x10 = S10;
        continue;
      }
      if (i11 === 1) {
        if (p11 <= r10 && ee2 >= 0 && x10 + 1 === ee2) {
          _10 = false, g10 = p11, v10 = p11, b10 = ee2;
          continue;
        }
        if (o11 >= 1 && S10 >= 0 && S10 - 1 === x10) {
          y10 = false, g10 = o11, v10 = o11, b10 = S10;
          continue;
        }
        if (g10 = e206, v10 = e206, b10 = x10, b10 === 0) return { startLineNumber: g10, endLineNumber: v10, indent: b10 };
      }
      _10 && (S10 >= b10 ? g10 = o11 : _10 = false), y10 && (ee2 >= b10 ? v10 = p11 : y10 = false);
    }
    return { startLineNumber: g10, endLineNumber: v10, indent: b10 };
  }
  getLinesBracketGuides(e206, t10, n10, r10) {
    let i10 = [];
    for (let n11 = e206; n11 <= t10; n11++) i10.push([]);
    let a10 = this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new M(e206, 1, t10, this.textModel.getLineMaxColumn(t10))).toArray(), o10;
    n10 && a10.length > 0 && (o10 = Dm((e206 <= n10.lineNumber && n10.lineNumber <= t10 ? a10 : this.textModel.bracketPairs.getBracketPairsInRange(M.fromPositions(n10)).toArray()).filter((e207) => M.strictContainsPosition(e207.range, n10)), (e207) => true)?.range);
    let s10 = this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType, c10 = new yC();
    for (let n11 of a10) {
      if (!n11.closingBracketRange) continue;
      let a11 = o10 && n11.range.equalsRange(o10);
      if (!a11 && !r10.includeInactive) continue;
      let l10 = c10.getInlineClassName(n11.nestingLevel, n11.nestingLevelOfEqualBracketType, s10) + (r10.highlightActive && a11 ? ` ` + c10.activeClassName : ``), u10 = n11.openingBracketRange.getStartPosition(), d10 = n11.closingBracketRange.getStartPosition(), f10 = r10.horizontalGuides === gC.Enabled || r10.horizontalGuides === gC.EnabledForActive && a11;
      if (n11.range.startLineNumber === n11.range.endLineNumber) {
        f10 && i10[n11.range.startLineNumber - e206].push(new _C2(-1, n11.openingBracketRange.getEndPosition().column, l10, new vC(false, d10.column), -1, -1));
        continue;
      }
      let p10 = this.getVisibleColumnFromPosition(d10), m10 = this.getVisibleColumnFromPosition(n11.openingBracketRange.getStartPosition()), h10 = Math.min(m10, p10, n11.minVisibleColumnIndentation + 1), g10 = false;
      Ga(this.textModel.getLineContent(n11.closingBracketRange.startLineNumber)) < n11.closingBracketRange.startColumn - 1 && (g10 = true);
      let _10 = Math.max(u10.lineNumber, e206), v10 = Math.min(d10.lineNumber, t10), y10 = +!!g10;
      for (let t11 = _10; t11 < v10 + y10; t11++) i10[t11 - e206].push(new _C2(h10, -1, l10, null, t11 === u10.lineNumber ? u10.column : -1, t11 === d10.lineNumber ? d10.column : -1));
      f10 && (u10.lineNumber >= e206 && m10 > h10 && i10[u10.lineNumber - e206].push(new _C2(h10, -1, l10, new vC(false, u10.column), -1, -1)), d10.lineNumber <= t10 && p10 > h10 && i10[d10.lineNumber - e206].push(new _C2(h10, -1, l10, new vC(!g10, d10.column), -1, -1)));
    }
    for (let e207 of i10) e207.sort((e208, t11) => e208.visibleColumn - t11.visibleColumn);
    return i10;
  }
  getVisibleColumnFromPosition(e206) {
    return Ub.visibleColumnFromColumn(this.textModel.getLineContent(e206.lineNumber), e206.column, this.textModel.getOptions().tabSize) + 1;
  }
  getLinesIndentGuides(e206, t10) {
    this.assertNotDisposed();
    let n10 = this.textModel.getLineCount();
    if (e206 < 1 || e206 > n10) throw Error(`Illegal value for startLineNumber`);
    if (t10 < 1 || t10 > n10) throw Error(`Illegal value for endLineNumber`);
    let r10 = this.textModel.getOptions(), i10 = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules, a10 = !!(i10 && i10.offSide), o10 = Array(t10 - e206 + 1), s10 = -2, c10 = -1, l10 = -2, u10 = -1;
    for (let i11 = e206; i11 <= t10; i11++) {
      let t11 = i11 - e206, d10 = this._computeIndentLevel(i11 - 1);
      if (d10 >= 0) {
        s10 = i11 - 1, c10 = d10, o10[t11] = Math.ceil(d10 / r10.indentSize);
        continue;
      }
      if (s10 === -2) {
        s10 = -1, c10 = -1;
        for (let e207 = i11 - 2; e207 >= 0; e207--) {
          let t12 = this._computeIndentLevel(e207);
          if (t12 >= 0) {
            s10 = e207, c10 = t12;
            break;
          }
        }
      }
      if (l10 !== -1 && (l10 === -2 || l10 < i11 - 1)) {
        l10 = -1, u10 = -1;
        for (let e207 = i11; e207 < n10; e207++) {
          let t12 = this._computeIndentLevel(e207);
          if (t12 >= 0) {
            l10 = e207, u10 = t12;
            break;
          }
        }
      }
      o10[t11] = this._getIndentLevelForWhitespaceLine(a10, c10, u10);
    }
    return o10;
  }
  _getIndentLevelForWhitespaceLine(e206, t10, n10) {
    let r10 = this.textModel.getOptions();
    return t10 === -1 || n10 === -1 ? 0 : t10 < n10 ? 1 + Math.floor(t10 / r10.indentSize) : t10 === n10 || e206 ? Math.ceil(n10 / r10.indentSize) : 1 + Math.floor(n10 / r10.indentSize);
  }
}, yC = class {
  constructor() {
    this.activeClassName = `indent-active`;
  }
  getInlineClassName(e206, t10, n10) {
    return this.getInlineClassNameOfLevel(n10 ? t10 : e206);
  }
  getInlineClassNameOfLevel(e206) {
    return `bracket-indent-guide lvl-${e206 % 30}`;
  }
}, zce = class extends HS {
  constructor(e206) {
    super(), this._context = e206, this._primaryPosition = null;
    let t10 = this._context.configuration.options, n10 = t10.get(166), r10 = t10.get(59);
    this._spaceWidth = r10.spaceWidth, this._maxIndentLeft = n10.wrappingColumn === -1 ? -1 : n10.wrappingColumn * r10.typicalHalfwidthCharacterWidth, this._bracketPairGuideOptions = t10.get(22), this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(166), r10 = t10.get(59);
    return this._spaceWidth = r10.spaceWidth, this._maxIndentLeft = n10.wrappingColumn === -1 ? -1 : n10.wrappingColumn * r10.typicalHalfwidthCharacterWidth, this._bracketPairGuideOptions = t10.get(22), true;
  }
  onCursorStateChanged(e206) {
    let t10 = e206.selections[0].getPosition();
    return this._primaryPosition?.equals(t10) ? false : (this._primaryPosition = t10, true);
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  onLanguageConfigurationChanged(e206) {
    return true;
  }
  prepareRender(e206) {
    if (!this._bracketPairGuideOptions.indentation && this._bracketPairGuideOptions.bracketPairs === false) {
      this._renderResult = null;
      return;
    }
    let t10 = e206.visibleRange.startLineNumber, n10 = e206.visibleRange.endLineNumber, r10 = e206.scrollWidth, i10 = this._primaryPosition, a10 = this.getGuidesByLine(t10, Math.min(n10 + 1, this._context.viewModel.getLineCount()), i10), o10 = [];
    for (let i11 = t10; i11 <= n10; i11++) {
      let n11 = i11 - t10, s10 = a10[n11], c10 = ``, l10 = e206.visibleRangeForPosition(new j(i11, 1))?.left ?? 0;
      for (let t11 of s10) {
        let n12 = t11.column === -1 ? l10 + (t11.visibleColumn - 1) * this._spaceWidth : e206.visibleRangeForPosition(new j(i11, t11.column)).left;
        if (n12 > r10 || this._maxIndentLeft > 0 && n12 > this._maxIndentLeft) break;
        let a11 = t11.horizontalLine ? t11.horizontalLine.top ? `horizontal-top` : `horizontal-bottom` : `vertical`, o11 = t11.horizontalLine ? (e206.visibleRangeForPosition(new j(i11, t11.horizontalLine.endColumn))?.left ?? n12 + this._spaceWidth) - n12 : this._spaceWidth;
        c10 += `<div class="core-guide ${t11.className} ${a11}" style="left:${n12}px;width:${o11}px"></div>`;
      }
      o10[n11] = c10;
    }
    this._renderResult = o10;
  }
  getGuidesByLine(e206, t10, n10) {
    let r10 = this._bracketPairGuideOptions.bracketPairs === false ? null : this._context.viewModel.getBracketGuidesInRangeByLine(e206, t10, n10, { highlightActive: this._bracketPairGuideOptions.highlightActiveBracketPair, horizontalGuides: this._bracketPairGuideOptions.bracketPairsHorizontal === true ? gC.Enabled : this._bracketPairGuideOptions.bracketPairsHorizontal === `active` ? gC.EnabledForActive : gC.Disabled, includeInactive: this._bracketPairGuideOptions.bracketPairs === true }), i10 = this._bracketPairGuideOptions.indentation ? this._context.viewModel.getLinesIndentGuides(e206, t10) : null, a10 = 0, o10 = 0, s10 = 0;
    if (this._bracketPairGuideOptions.highlightActiveIndentation !== false && n10) {
      let r11 = this._context.viewModel.getActiveIndentGuide(n10.lineNumber, e206, t10);
      a10 = r11.startLineNumber, o10 = r11.endLineNumber, s10 = r11.indent;
    }
    let { indentSize: c10 } = this._context.viewModel.model.getOptions(), l10 = [];
    for (let n11 = e206; n11 <= t10; n11++) {
      let t11 = [];
      l10.push(t11);
      let u10 = r10 ? r10[n11 - e206] : [], d10 = new me(u10), f10 = i10 ? i10[n11 - e206] : 0;
      for (let e207 = 1; e207 <= f10; e207++) {
        let r11 = (e207 - 1) * c10 + 1, i11 = (this._bracketPairGuideOptions.highlightActiveIndentation === `always` || u10.length === 0) && a10 <= n11 && n11 <= o10 && e207 === s10;
        t11.push(...d10.takeWhile((e208) => e208.visibleColumn < r11) || []);
        let l11 = d10.peek();
        (!l11 || l11.visibleColumn !== r11 || l11.horizontalLine) && t11.push(new _C2(r11, -1, `core-guide-indent lvl-${(e207 - 1) % 30}` + (i11 ? ` indent-active` : ``), null, -1, -1));
      }
      t11.push(...d10.takeWhile((e207) => true) || []);
    }
    return l10;
  }
  render(e206, t10) {
    if (!this._renderResult) return ``;
    let n10 = t10 - e206;
    return n10 < 0 || n10 >= this._renderResult.length ? `` : this._renderResult[n10];
  }
};
function bC(e206) {
  if (!(e206 && e206.isTransparent())) return e206;
}
JS((e206, t10) => {
  let n10 = [{ bracketColor: aC, guideColor: gce, guideColorActive: Sce }, { bracketColor: oC, guideColor: _ce, guideColorActive: Cce }, { bracketColor: sC, guideColor: vce, guideColorActive: wce }, { bracketColor: cC, guideColor: yce, guideColorActive: Tce }, { bracketColor: lC, guideColor: bce, guideColorActive: Ece }, { bracketColor: uC, guideColor: xce, guideColorActive: Dce }], r10 = new yC(), i10 = [{ indentColor: nC, indentColorActive: rC }, { indentColor: Xse, indentColorActive: tce }, { indentColor: Zse, indentColorActive: nce }, { indentColor: Qse, indentColorActive: rce }, { indentColor: $se, indentColorActive: ice }, { indentColor: ece, indentColorActive: ace }], a10 = n10.map((t11) => {
    let n11 = e206.getColor(t11.bracketColor), r11 = e206.getColor(t11.guideColor), i11 = e206.getColor(t11.guideColorActive), a11 = bC(bC(r11) ?? n11?.transparent(0.3)), o11 = bC(bC(i11) ?? n11);
    if (!(!a11 || !o11)) return { guideColor: a11, guideColorActive: o11 };
  }).filter(Ke), o10 = i10.map((t11) => {
    let n11 = e206.getColor(t11.indentColor), r11 = e206.getColor(t11.indentColorActive), i11 = bC(n11), a11 = bC(r11);
    if (!(!i11 || !a11)) return { indentColor: i11, indentColorActive: a11 };
  }).filter(Ke);
  if (a10.length > 0) {
    for (let e207 = 0; e207 < 30; e207++) {
      let n11 = a10[e207 % a10.length];
      t10.addRule(`.monaco-editor .${r10.getInlineClassNameOfLevel(e207).replace(/ /g, `.`)} { --guide-color: ${n11.guideColor}; --guide-color-active: ${n11.guideColorActive}; }`);
    }
    t10.addRule(`.monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }`), t10.addRule(`.monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }`), t10.addRule(`.monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }`), t10.addRule(`.monaco-editor .vertical.${r10.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`), t10.addRule(`.monaco-editor .horizontal-top.${r10.activeClassName} { border-top: 1px solid var(--guide-color-active); }`), t10.addRule(`.monaco-editor .horizontal-bottom.${r10.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`);
  }
  if (o10.length > 0) {
    for (let e207 = 0; e207 < 30; e207++) {
      let n11 = o10[e207 % o10.length];
      t10.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e207} { --indent-color: ${n11.indentColor}; --indent-color-active: ${n11.indentColorActive}; }`);
    }
    t10.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }`), t10.addRule(`.monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }`);
  }
});
var xC = (_ga = class extends HS {
  constructor(e206) {
    super(), this._context = e206, this._readConfig(), this._lastCursorModelPosition = new j(1, 1), this._renderResult = null, this._activeModelLineNumber = 1, this._context.addEventHandler(this);
  }
  _readConfig() {
    let e206 = this._context.configuration.options;
    this._lineHeight = e206.get(75);
    let t10 = e206.get(76);
    this._renderLineNumbers = t10.renderType, this._renderCustomLineNumbers = t10.renderFn, this._renderFinalNewline = e206.get(109);
    let n10 = e206.get(165);
    this._lineNumbersLeft = n10.lineNumbersLeft, this._lineNumbersWidth = n10.lineNumbersWidth;
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    return this._readConfig(), true;
  }
  onCursorStateChanged(e206) {
    let t10 = e206.selections[0].getPosition();
    this._lastCursorModelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t10);
    let n10 = false;
    return this._activeModelLineNumber !== this._lastCursorModelPosition.lineNumber && (this._activeModelLineNumber = this._lastCursorModelPosition.lineNumber, n10 = true), (this._renderLineNumbers === 2 || this._renderLineNumbers === 3) && (n10 = true), n10;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  onDecorationsChanged(e206) {
    return e206.affectsLineNumber;
  }
  _getLineRenderLineNumber(e206) {
    let t10 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(e206, 1));
    if (t10.column !== 1) return ``;
    let n10 = t10.lineNumber;
    if (this._renderCustomLineNumbers) return this._renderCustomLineNumbers(n10);
    if (this._renderLineNumbers === 2) {
      let e207 = Math.abs(this._lastCursorModelPosition.lineNumber - n10);
      return e207 === 0 ? `<span class="relative-current-line-number">` + n10 + `</span>` : String(e207);
    }
    return this._renderLineNumbers === 3 ? this._lastCursorModelPosition.lineNumber === n10 || n10 % 10 == 0 || n10 === this._context.viewModel.getLineCount() ? String(n10) : `` : String(n10);
  }
  prepareRender(t10) {
    if (this._renderLineNumbers === 0) {
      this._renderResult = null;
      return;
    }
    let n10 = Et ? this._lineHeight % 2 == 0 ? ` lh-even` : ` lh-odd` : ``, r10 = t10.visibleRange.startLineNumber, i10 = t10.visibleRange.endLineNumber, a10 = this._context.viewModel.getDecorationsInViewport(t10.visibleRange).filter((e206) => !!e206.options.lineNumberClassName);
    a10.sort((e206, t11) => M.compareRangesUsingEnds(e206.range, t11.range));
    let o10 = 0, s10 = this._context.viewModel.getLineCount(), c10 = [];
    for (let t11 = r10; t11 <= i10; t11++) {
      let i11 = t11 - r10, l10 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(t11, 1)).lineNumber, u10 = this._getLineRenderLineNumber(t11), d10 = ``;
      for (; o10 < a10.length && a10[o10].range.endLineNumber < t11; ) o10++;
      for (let e206 = o10; e206 < a10.length; e206++) {
        let { range: n11, options: r11 } = a10[e206];
        n11.startLineNumber <= t11 && (d10 += ` ` + r11.lineNumberClassName);
      }
      if (!u10 && !d10) {
        c10[i11] = ``;
        continue;
      }
      t11 === s10 && this._context.viewModel.getLineLength(t11) === 0 && (this._renderFinalNewline === `off` && (u10 = ``), this._renderFinalNewline === `dimmed` && (d10 += ` dimmed-line-number`)), l10 === this._activeModelLineNumber && (d10 += ` active-line-number`), c10[i11] = `<div class="${_ga.CLASS_NAME}${n10}${d10}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${u10}</div>`;
    }
    this._renderResult = c10;
  }
  render(e206, t10) {
    if (!this._renderResult) return ``;
    let n10 = t10 - e206;
    return n10 < 0 || n10 >= this._renderResult.length ? `` : this._renderResult[n10];
  }
}, _ga.CLASS_NAME = `line-numbers`, _ga);
JS((e206, t10) => {
  let n10 = e206.getColor(qse), r10 = e206.getColor(oce);
  r10 ? t10.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${r10}; }`) : n10 && t10.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n10.transparent(0.4)}; }`);
});
var SC = `monaco-mouse-cursor-text`, CC = class {
  get didDomLayout() {
    return this._didDomLayout;
  }
  readClientRect() {
    if (!this._clientRectRead) {
      this._clientRectRead = true;
      let e206 = this._domNode.getBoundingClientRect();
      this.markDidDomLayout(), this._clientRectDeltaLeft = e206.left, this._clientRectScale = e206.width / this._domNode.offsetWidth;
    }
  }
  get clientRectDeltaLeft() {
    return this._clientRectRead || this.readClientRect(), this._clientRectDeltaLeft;
  }
  get clientRectScale() {
    return this._clientRectRead || this.readClientRect(), this._clientRectScale;
  }
  constructor(e206, t10) {
    this._domNode = e206, this.endNode = t10, this._didDomLayout = false, this._clientRectDeltaLeft = 0, this._clientRectScale = 1, this._clientRectRead = false;
  }
  markDidDomLayout() {
    this._didDomLayout = true;
  }
}, wC = class {
  constructor(e206, t10) {
    this.themeType = t10;
    let n10 = e206.options, r10 = n10.get(59);
    this.renderWhitespace = n10.get(113), this.experimentalWhitespaceRendering = n10.get(47), this.renderControlCharacters = n10.get(108), this.spaceWidth = r10.spaceWidth, this.middotWidth = r10.middotWidth, this.wsmiddotWidth = r10.wsmiddotWidth, this.useMonospaceOptimizations = r10.isMonospace && !n10.get(40), this.canUseHalfwidthRightwardsArrow = r10.canUseHalfwidthRightwardsArrow, this.lineHeight = n10.get(75), this.stopRenderingLineAfter = n10.get(133), this.fontLigatures = n10.get(60), this.verticalScrollbarSize = n10.get(117).verticalScrollbarSize, this.useGpu = n10.get(46) === `on`;
  }
  equals(e206) {
    return this.themeType === e206.themeType && this.renderWhitespace === e206.renderWhitespace && this.experimentalWhitespaceRendering === e206.experimentalWhitespaceRendering && this.renderControlCharacters === e206.renderControlCharacters && this.spaceWidth === e206.spaceWidth && this.middotWidth === e206.middotWidth && this.wsmiddotWidth === e206.wsmiddotWidth && this.useMonospaceOptimizations === e206.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === e206.canUseHalfwidthRightwardsArrow && this.lineHeight === e206.lineHeight && this.stopRenderingLineAfter === e206.stopRenderingLineAfter && this.fontLigatures === e206.fontLigatures && this.verticalScrollbarSize === e206.verticalScrollbarSize && this.useGpu === e206.useGpu;
  }
}, Bce = class {
  constructor() {
    this._currentVisibleRange = new M(1, 1, 1, 1);
  }
  getCurrentVisibleRange() {
    return this._currentVisibleRange;
  }
  setCurrentVisibleRange(e206) {
    this._currentVisibleRange = e206;
  }
}, Vce = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.minimalReveal = e206, this.lineNumber = t10, this.startColumn = n10, this.endColumn = r10, this.startScrollTop = i10, this.stopScrollTop = a10, this.scrollType = o10, this.type = `range`, this.minLineNumber = t10, this.maxLineNumber = t10;
  }
}, Hce = class {
  constructor(e206, t10, n10, r10, i10) {
    this.minimalReveal = e206, this.selections = t10, this.startScrollTop = n10, this.stopScrollTop = r10, this.scrollType = i10, this.type = `selections`;
    let a10 = t10[0].startLineNumber, o10 = t10[0].endLineNumber;
    for (let e207 = 1, n11 = t10.length; e207 < n11; e207++) {
      let n12 = t10[e207];
      a10 = Math.min(a10, n12.startLineNumber), o10 = Math.max(o10, n12.endLineNumber);
    }
    this.minLineNumber = a10, this.maxLineNumber = o10;
  }
}, Uce = (_ha = class extends Tb {
  constructor(e206, t10, n10) {
    super(e206);
    let r10 = this._context.configuration, i10 = this._context.configuration.options, a10 = i10.get(59), o10 = i10.get(166);
    this._lineHeight = i10.get(75), this._typicalHalfwidthCharacterWidth = a10.typicalHalfwidthCharacterWidth, this._isViewportWrapping = o10.isViewportWrapping, this._revealHorizontalRightPadding = i10.get(114), this._cursorSurroundingLines = i10.get(35), this._cursorSurroundingLinesStyle = i10.get(36), this._canUseLayerHinting = !i10.get(39), this._viewLineOptions = new wC(r10, this._context.theme.type), this._linesContent = n10, this._textRangeRestingSpot = document.createElement(`div`), this._visibleLines = new FS(this._context, { createLine: () => new Rb(t10, this._viewLineOptions) }), this.domNode = this._visibleLines.domNode, Eb.write(this.domNode, 8), this.domNode.setClassName(`view-lines ${SC}`), vu(this.domNode, a10), this._maxLineWidth = 0, this._asyncUpdateLineWidths = new us(() => {
      this._updateLineWidthsSlow();
    }, 200), this._asyncCheckMonospaceFontAssumptions = new us(() => {
      this._checkMonospaceFontAssumptions();
    }, 2e3), this._lastRenderedData = new Bce(), this._horizontalRevealRequest = null, this._stickyScrollEnabled = i10.get(131).enabled, this._maxNumberStickyLines = i10.get(131).maxLineCount;
  }
  dispose() {
    this._asyncUpdateLineWidths.dispose(), this._asyncCheckMonospaceFontAssumptions.dispose(), super.dispose();
  }
  getDomNode() {
    return this.domNode;
  }
  onConfigurationChanged(e206) {
    this._visibleLines.onConfigurationChanged(e206), e206.hasChanged(166) && (this._maxLineWidth = 0);
    let t10 = this._context.configuration.options, n10 = t10.get(59), r10 = t10.get(166);
    return this._lineHeight = t10.get(75), this._typicalHalfwidthCharacterWidth = n10.typicalHalfwidthCharacterWidth, this._isViewportWrapping = r10.isViewportWrapping, this._revealHorizontalRightPadding = t10.get(114), this._cursorSurroundingLines = t10.get(35), this._cursorSurroundingLinesStyle = t10.get(36), this._canUseLayerHinting = !t10.get(39), this._stickyScrollEnabled = t10.get(131).enabled, this._maxNumberStickyLines = t10.get(131).maxLineCount, vu(this.domNode, n10), this._onOptionsMaybeChanged(), e206.hasChanged(165) && (this._maxLineWidth = 0), true;
  }
  _onOptionsMaybeChanged() {
    let e206 = this._context.configuration, t10 = new wC(e206, this._context.theme.type);
    if (!this._viewLineOptions.equals(t10)) {
      this._viewLineOptions = t10;
      let e207 = this._visibleLines.getStartLineNumber(), n10 = this._visibleLines.getEndLineNumber();
      for (let t11 = e207; t11 <= n10; t11++) this._visibleLines.getVisibleLine(t11).onOptionsChanged(this._viewLineOptions);
      return true;
    }
    return false;
  }
  onCursorStateChanged(e206) {
    let t10 = this._visibleLines.getStartLineNumber(), n10 = this._visibleLines.getEndLineNumber(), r10 = false;
    for (let e207 = t10; e207 <= n10; e207++) r10 = this._visibleLines.getVisibleLine(e207).onSelectionChanged() || r10;
    return r10;
  }
  onDecorationsChanged(e206) {
    {
      let e207 = this._visibleLines.getStartLineNumber(), t10 = this._visibleLines.getEndLineNumber();
      for (let n10 = e207; n10 <= t10; n10++) this._visibleLines.getVisibleLine(n10).onDecorationsChanged();
    }
    return true;
  }
  onFlushed(e206) {
    let t10 = this._visibleLines.onFlushed(e206, this._viewLineOptions.useGpu);
    return this._maxLineWidth = 0, t10;
  }
  onLinesChanged(e206) {
    return this._visibleLines.onLinesChanged(e206);
  }
  onLinesDeleted(e206) {
    return this._visibleLines.onLinesDeleted(e206);
  }
  onLinesInserted(e206) {
    return this._visibleLines.onLinesInserted(e206);
  }
  onRevealRangeRequest(e206) {
    let t10 = this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(), e206.source, e206.minimalReveal, e206.range, e206.selections, e206.verticalType);
    if (t10 === -1) return false;
    let n10 = this._context.viewLayout.validateScrollPosition({ scrollTop: t10 });
    e206.revealHorizontal ? e206.range && e206.range.startLineNumber !== e206.range.endLineNumber ? n10 = { scrollTop: n10.scrollTop, scrollLeft: 0 } : e206.range ? this._horizontalRevealRequest = new Vce(e206.minimalReveal, e206.range.startLineNumber, e206.range.startColumn, e206.range.endColumn, this._context.viewLayout.getCurrentScrollTop(), n10.scrollTop, e206.scrollType) : e206.selections && e206.selections.length > 0 && (this._horizontalRevealRequest = new Hce(e206.minimalReveal, e206.selections, this._context.viewLayout.getCurrentScrollTop(), n10.scrollTop, e206.scrollType)) : this._horizontalRevealRequest = null;
    let r10 = Math.abs(this._context.viewLayout.getCurrentScrollTop() - n10.scrollTop) <= this._lineHeight ? 1 : e206.scrollType;
    return this._context.viewModel.viewLayout.setScrollPosition(n10, r10), true;
  }
  onScrollChanged(e206) {
    if (this._horizontalRevealRequest && e206.scrollLeftChanged && (this._horizontalRevealRequest = null), this._horizontalRevealRequest && e206.scrollTopChanged) {
      let t10 = Math.min(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop), n10 = Math.max(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop);
      (e206.scrollTop < t10 || e206.scrollTop > n10) && (this._horizontalRevealRequest = null);
    }
    return this.domNode.setWidth(e206.scrollWidth), this._visibleLines.onScrollChanged(e206) || true;
  }
  onTokensChanged(e206) {
    return this._visibleLines.onTokensChanged(e206);
  }
  onZonesChanged(e206) {
    return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth), this._visibleLines.onZonesChanged(e206);
  }
  onThemeChanged(e206) {
    return this._onOptionsMaybeChanged();
  }
  getPositionFromDOMInfo(e206, t10) {
    let n10 = this._getViewLineDomNode(e206);
    if (n10 === null) return null;
    let r10 = this._getLineNumberFor(n10);
    if (r10 === -1 || r10 < 1 || r10 > this._context.viewModel.getLineCount()) return null;
    if (this._context.viewModel.getLineMaxColumn(r10) === 1) return new j(r10, 1);
    let i10 = this._visibleLines.getStartLineNumber(), a10 = this._visibleLines.getEndLineNumber();
    if (r10 < i10 || r10 > a10) return null;
    let o10 = this._visibleLines.getVisibleLine(r10).getColumnOfNodeOffset(e206, t10), s10 = this._context.viewModel.getLineMinColumn(r10);
    return o10 < s10 && (o10 = s10), new j(r10, o10);
  }
  _getViewLineDomNode(e206) {
    for (; e206 && e206.nodeType === 1; ) {
      if (e206.className === Rb.CLASS_NAME) return e206;
      e206 = e206.parentElement;
    }
    return null;
  }
  _getLineNumberFor(e206) {
    let t10 = this._visibleLines.getStartLineNumber(), n10 = this._visibleLines.getEndLineNumber();
    for (let r10 = t10; r10 <= n10; r10++) if (e206 === this._visibleLines.getVisibleLine(r10).getDomNode()) return r10;
    return -1;
  }
  getLineWidth(e206) {
    let t10 = this._visibleLines.getStartLineNumber(), n10 = this._visibleLines.getEndLineNumber();
    if (e206 < t10 || e206 > n10) return -1;
    let r10 = new CC(this.domNode.domNode, this._textRangeRestingSpot), i10 = this._visibleLines.getVisibleLine(e206).getWidth(r10);
    return this._updateLineWidthsSlowIfDomDidLayout(r10), i10;
  }
  linesVisibleRangesForRange(e206, t10) {
    if (this.shouldRender()) return null;
    let n10 = e206.endLineNumber, r10 = M.intersectRanges(e206, this._lastRenderedData.getCurrentVisibleRange());
    if (!r10) return null;
    let i10 = [], a10 = 0, o10 = new CC(this.domNode.domNode, this._textRangeRestingSpot), s10 = 0;
    t10 && (s10 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(r10.startLineNumber, 1)).lineNumber);
    let c10 = this._visibleLines.getStartLineNumber(), l10 = this._visibleLines.getEndLineNumber();
    for (let e207 = r10.startLineNumber; e207 <= r10.endLineNumber; e207++) {
      if (e207 < c10 || e207 > l10) continue;
      let u10 = e207 === r10.startLineNumber ? r10.startColumn : 1, d10 = e207 !== n10, f10 = d10 ? this._context.viewModel.getLineMaxColumn(e207) : r10.endColumn, p10 = this._visibleLines.getVisibleLine(e207).getVisibleRangesForRange(e207, u10, f10, o10);
      if (p10) {
        if (t10 && e207 < n10) {
          let t11 = s10;
          if (s10 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(e207 + 1, 1)).lineNumber, t11 !== s10) {
            let e208 = p10.ranges[p10.ranges.length - 1];
            e208.width += this._typicalHalfwidthCharacterWidth, this._context.viewModel.getTextDirection(t11) === em.RTL && (e208.left -= this._typicalHalfwidthCharacterWidth);
          }
        }
        i10[a10++] = new Db(p10.outsideRenderedLine, e207, Ob.from(p10.ranges), d10);
      }
    }
    return this._updateLineWidthsSlowIfDomDidLayout(o10), a10 === 0 ? null : i10;
  }
  _visibleRangesForLineRange(e206, t10, n10) {
    if (this.shouldRender() || e206 < this._visibleLines.getStartLineNumber() || e206 > this._visibleLines.getEndLineNumber()) return null;
    let r10 = new CC(this.domNode.domNode, this._textRangeRestingSpot), i10 = this._visibleLines.getVisibleLine(e206).getVisibleRangesForRange(e206, t10, n10, r10);
    return this._updateLineWidthsSlowIfDomDidLayout(r10), i10;
  }
  _lineIsRenderedRTL(e206) {
    return e206 < this._visibleLines.getStartLineNumber() || e206 > this._visibleLines.getEndLineNumber() ? false : this._visibleLines.getVisibleLine(e206).isRenderedRTL();
  }
  visibleRangeForPosition(e206) {
    let t10 = this._visibleRangesForLineRange(e206.lineNumber, e206.column, e206.column);
    return t10 ? new Ab(t10.outsideRenderedLine, t10.ranges[0].left) : null;
  }
  _updateLineWidthsFast() {
    return this._updateLineWidths(true);
  }
  _updateLineWidthsSlow() {
    this._updateLineWidths(false);
  }
  _updateLineWidthsSlowIfDomDidLayout(e206) {
    e206.didDomLayout && (this._asyncUpdateLineWidths.isScheduled() || (this._asyncUpdateLineWidths.cancel(), this._updateLineWidthsSlow()));
  }
  _updateLineWidths(e206) {
    let t10 = this._visibleLines.getStartLineNumber(), n10 = this._visibleLines.getEndLineNumber(), r10 = 1, i10 = true;
    for (let a10 = t10; a10 <= n10; a10++) {
      let t11 = this._visibleLines.getVisibleLine(a10);
      if (e206 && !t11.getWidthIsFast()) {
        i10 = false;
        continue;
      }
      r10 = Math.max(r10, t11.getWidth(null));
    }
    return i10 && t10 === 1 && n10 === this._context.viewModel.getLineCount() && (this._maxLineWidth = 0), this._ensureMaxLineWidth(r10), i10;
  }
  _checkMonospaceFontAssumptions() {
    let e206 = -1, t10 = -1, n10 = this._visibleLines.getStartLineNumber(), r10 = this._visibleLines.getEndLineNumber();
    for (let i10 = n10; i10 <= r10; i10++) {
      let n11 = this._visibleLines.getVisibleLine(i10);
      if (n11.needsMonospaceFontCheck()) {
        let r11 = n11.getWidth(null);
        r11 > t10 && (t10 = r11, e206 = i10);
      }
    }
    if (e206 !== -1 && !this._visibleLines.getVisibleLine(e206).monospaceAssumptionsAreValid()) for (let e207 = n10; e207 <= r10; e207++) this._visibleLines.getVisibleLine(e207).onMonospaceAssumptionsInvalidated();
  }
  prepareRender() {
    throw Error(`Not supported`);
  }
  render() {
    throw Error(`Not supported`);
  }
  renderText(e206) {
    if (this._visibleLines.renderLines(e206), this._lastRenderedData.setCurrentVisibleRange(e206.visibleRange), this.domNode.setWidth(this._context.viewLayout.getScrollWidth()), this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(), 1e6)), this._horizontalRevealRequest) {
      let t11 = this._horizontalRevealRequest;
      if (e206.startLineNumber <= t11.minLineNumber && t11.maxLineNumber <= e206.endLineNumber) {
        this._horizontalRevealRequest = null, this.onDidRender();
        let e207 = this._computeScrollLeftToReveal(t11);
        e207 && (!this._isViewportWrapping && !e207.hasRTL && this._ensureMaxLineWidth(e207.maxHorizontalOffset), this._context.viewModel.viewLayout.setScrollPosition({ scrollLeft: e207.scrollLeft }, t11.scrollType));
      }
    }
    if (this._updateLineWidthsFast() ? this._asyncUpdateLineWidths.cancel() : this._asyncUpdateLineWidths.schedule(), Et && !this._asyncCheckMonospaceFontAssumptions.isScheduled()) {
      let e207 = this._visibleLines.getStartLineNumber(), t11 = this._visibleLines.getEndLineNumber();
      for (let n10 = e207; n10 <= t11; n10++) if (this._visibleLines.getVisibleLine(n10).needsMonospaceFontCheck()) {
        this._asyncCheckMonospaceFontAssumptions.schedule();
        break;
      }
    }
    this._linesContent.setLayerHinting(this._canUseLayerHinting), this._linesContent.setContain(`strict`);
    let t10 = this._context.viewLayout.getCurrentScrollTop() - e206.bigNumbersDelta;
    this._linesContent.setTop(-t10), this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft());
  }
  _ensureMaxLineWidth(e206) {
    let t10 = Math.ceil(e206);
    this._maxLineWidth < t10 && (this._maxLineWidth = t10, this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth));
  }
  _computeScrollTopToRevealRange(e206, t10, n10, r10, i10, a10) {
    let o10 = e206.top, s10 = e206.height, c10 = o10 + s10, l10, u10, d10;
    if (i10 && i10.length > 0) {
      let e207 = i10[0].startLineNumber, t11 = i10[0].endLineNumber;
      for (let n11 = 1, r11 = i10.length; n11 < r11; n11++) {
        let r12 = i10[n11];
        e207 = Math.min(e207, r12.startLineNumber), t11 = Math.max(t11, r12.endLineNumber);
      }
      l10 = false, u10 = this._context.viewLayout.getVerticalOffsetForLineNumber(e207), d10 = this._context.viewLayout.getVerticalOffsetForLineNumber(t11) + this._lineHeight;
    } else if (r10) l10 = true, u10 = this._context.viewLayout.getVerticalOffsetForLineNumber(r10.startLineNumber), d10 = this._context.viewLayout.getVerticalOffsetForLineNumber(r10.endLineNumber) + this._lineHeight;
    else return -1;
    let f10 = (t10 === `mouse` || n10) && this._cursorSurroundingLinesStyle === `default`, p10 = 0, m10 = 0;
    if (f10) n10 || (p10 = this._lineHeight);
    else {
      let e207 = s10 / this._lineHeight, t11 = Math.max(this._cursorSurroundingLines, this._stickyScrollEnabled ? this._maxNumberStickyLines : 0), n11 = Math.min(e207 / 2, t11);
      p10 = n11 * this._lineHeight, m10 = Math.max(0, n11 - 1) * this._lineHeight;
    }
    n10 || (a10 === 0 || a10 === 4) && (m10 += this._lineHeight), u10 -= p10, d10 += m10;
    let h10;
    if (d10 - u10 > s10) {
      if (!l10) return -1;
      h10 = u10;
    } else if (a10 === 5 || a10 === 6) if (a10 === 6 && o10 <= u10 && d10 <= c10) h10 = o10;
    else {
      let e207 = Math.max(5 * this._lineHeight, s10 * 0.2), t11 = u10 - e207, n11 = d10 - s10;
      h10 = Math.max(n11, t11);
    }
    else if (a10 === 1 || a10 === 2) if (a10 === 2 && o10 <= u10 && d10 <= c10) h10 = o10;
    else {
      let e207 = (u10 + d10) / 2;
      h10 = Math.max(0, e207 - s10 / 2);
    }
    else h10 = this._computeMinimumScrolling(o10, c10, u10, d10, a10 === 3, a10 === 4);
    return h10;
  }
  _computeScrollLeftToReveal(t10) {
    let n10 = this._context.viewLayout.getCurrentViewport(), r10 = this._context.configuration.options.get(165), i10 = n10.left, a10 = i10 + n10.width - r10.verticalScrollbarWidth, o10 = 1073741824, s10 = 0, c10 = false;
    if (t10.type === `range`) {
      c10 = this._lineIsRenderedRTL(t10.lineNumber);
      let e206 = this._visibleRangesForLineRange(t10.lineNumber, t10.startColumn, t10.endColumn);
      if (!e206) return null;
      for (let t11 of e206.ranges) o10 = Math.min(o10, Math.round(t11.left)), s10 = Math.max(s10, Math.round(t11.left + t11.width));
    } else for (let e206 of t10.selections) {
      if (e206.startLineNumber !== e206.endLineNumber) return null;
      let t11 = this._visibleRangesForLineRange(e206.startLineNumber, e206.startColumn, e206.endColumn);
      if (c10 || (c10 = this._lineIsRenderedRTL(e206.startLineNumber)), !t11) return null;
      for (let e207 of t11.ranges) o10 = Math.min(o10, Math.round(e207.left)), s10 = Math.max(s10, Math.round(e207.left + e207.width));
    }
    return t10.minimalReveal || (o10 = Math.max(0, o10 - _ha.HORIZONTAL_EXTRA_PX), s10 += this._revealHorizontalRightPadding), t10.type === `selections` && s10 - o10 > n10.width ? null : { scrollLeft: this._computeMinimumScrolling(i10, a10, o10, s10), maxHorizontalOffset: s10, hasRTL: c10 };
  }
  _computeMinimumScrolling(e206, t10, n10, r10, i10, a10) {
    e206 |= 0, t10 |= 0, n10 |= 0, r10 |= 0, i10 = !!i10, a10 = !!a10;
    let o10 = t10 - e206;
    if (r10 - n10 < o10) {
      if (i10) return n10;
      if (a10) return Math.max(0, r10 - o10);
      if (n10 < e206) return n10;
      if (r10 > t10) return Math.max(0, r10 - o10);
    } else return n10;
    return e206;
  }
}, _ha.HORIZONTAL_EXTRA_PX = 30, _ha), Wce = class extends pC {
  constructor(e206) {
    super(), this._context = e206;
    let t10 = this._context.configuration.options.get(165);
    this._decorationsLeft = t10.decorationsLeft, this._decorationsWidth = t10.decorationsWidth, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options.get(165);
    return this._decorationsLeft = t10.decorationsLeft, this._decorationsWidth = t10.decorationsWidth, true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  _getDecorations(e206) {
    let t10 = e206.getDecorationsInViewport(), n10 = [], r10 = 0;
    for (let e207 = 0, i10 = t10.length; e207 < i10; e207++) {
      let i11 = t10[e207], a10 = i11.options.linesDecorationsClassName, o10 = i11.options.zIndex;
      a10 && (n10[r10++] = new fC(i11.range.startLineNumber, i11.range.endLineNumber, a10, i11.options.linesDecorationsTooltip ?? null, o10));
      let s10 = i11.options.firstLineDecorationClassName;
      s10 && (n10[r10++] = new fC(i11.range.startLineNumber, i11.range.startLineNumber, s10, i11.options.linesDecorationsTooltip ?? null, o10));
    }
    return n10;
  }
  prepareRender(e206) {
    let t10 = e206.visibleRange.startLineNumber, n10 = e206.visibleRange.endLineNumber, r10 = this._render(t10, n10, this._getDecorations(e206)), i10 = this._decorationsLeft.toString(), a10 = this._decorationsWidth.toString(), o10 = `" style="left:` + i10 + `px;width:` + a10 + `px;"></div>`, s10 = [];
    for (let e207 = t10; e207 <= n10; e207++) {
      let n11 = e207 - t10, i11 = r10[n11].getDecorations(), a11 = ``;
      for (let e208 of i11) {
        let t11 = `<div class="cldr ` + e208.className;
        e208.tooltip !== null && (t11 += `" title="` + e208.tooltip), t11 += o10, a11 += t11;
      }
      s10[n11] = a11;
    }
    this._renderResult = s10;
  }
  render(e206, t10) {
    return this._renderResult ? this._renderResult[t10 - e206] : ``;
  }
}, TC = (_ia = class extends Tb {
  constructor(t10) {
    super(t10);
    let n10 = this._context.configuration.options, r10 = n10.get(165);
    this._canUseLayerHinting = !n10.get(39), this._contentLeft = r10.contentLeft, this._glyphMarginLeft = r10.glyphMarginLeft, this._glyphMarginWidth = r10.glyphMarginWidth, this._domNode = _u(document.createElement(`div`)), this._domNode.setClassName(_ia.OUTER_CLASS_NAME), this._domNode.setPosition(`absolute`), this._domNode.setAttribute(`role`, `presentation`), this._domNode.setAttribute(`aria-hidden`, `true`), this._glyphMarginBackgroundDomNode = _u(document.createElement(`div`)), this._glyphMarginBackgroundDomNode.setClassName(_ia.CLASS_NAME), this._domNode.appendChild(this._glyphMarginBackgroundDomNode);
  }
  dispose() {
    super.dispose();
  }
  getDomNode() {
    return this._domNode;
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    return this._canUseLayerHinting = !t10.get(39), this._contentLeft = n10.contentLeft, this._glyphMarginLeft = n10.glyphMarginLeft, this._glyphMarginWidth = n10.glyphMarginWidth, true;
  }
  onScrollChanged(e206) {
    return super.onScrollChanged(e206) || e206.scrollTopChanged;
  }
  prepareRender(e206) {
  }
  render(e206) {
    this._domNode.setLayerHinting(this._canUseLayerHinting), this._domNode.setContain(`strict`);
    let t10 = e206.scrollTop - e206.bigNumbersDelta;
    this._domNode.setTop(-t10);
    let n10 = Math.min(e206.scrollHeight, 1e6);
    this._domNode.setHeight(n10), this._domNode.setWidth(this._contentLeft), this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft), this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth), this._glyphMarginBackgroundDomNode.setHeight(n10);
  }
}, _ia.CLASS_NAME = `glyph-margin`, _ia.OUTER_CLASS_NAME = `margin`, _ia), Gce = class extends pC {
  constructor(e206) {
    super(), this._context = e206, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    return true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  _getDecorations(e206) {
    let t10 = e206.getDecorationsInViewport(), n10 = [], r10 = 0;
    for (let e207 = 0, i10 = t10.length; e207 < i10; e207++) {
      let i11 = t10[e207], a10 = i11.options.marginClassName, o10 = i11.options.zIndex;
      a10 && (n10[r10++] = new fC(i11.range.startLineNumber, i11.range.endLineNumber, a10, null, o10));
    }
    return n10;
  }
  prepareRender(e206) {
    let t10 = e206.visibleRange.startLineNumber, n10 = e206.visibleRange.endLineNumber, r10 = this._render(t10, n10, this._getDecorations(e206)), i10 = [];
    for (let e207 = t10; e207 <= n10; e207++) {
      let n11 = e207 - t10, a10 = r10[n11].getDecorations(), o10 = ``;
      for (let e208 of a10) o10 += `<div class="cmdr ` + e208.className + `" style=""></div>`;
      i10[n11] = o10;
    }
    this._renderResult = i10;
  }
  render(e206, t10) {
    return this._renderResult ? this._renderResult[t10 - e206] : ``;
  }
}, EC = (_ja = class {
  constructor(t10, n10, r10, i10) {
    this._rgba8Brand = void 0, this.r = _ja._clamp(t10), this.g = _ja._clamp(n10), this.b = _ja._clamp(r10), this.a = _ja._clamp(i10);
  }
  equals(e206) {
    return this.r === e206.r && this.g === e206.g && this.b === e206.b && this.a === e206.a;
  }
  static _clamp(e206) {
    return e206 < 0 ? 0 : e206 > 255 ? 255 : e206 | 0;
  }
}, _ja.Empty = new _ja(0, 0, 0, 0), _ja), DC = (_ka = class extends D {
  static getInstance() {
    return this._INSTANCE || (this._INSTANCE = Wt(new _ka())), this._INSTANCE;
  }
  constructor() {
    super(), this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._updateColorMap(), this._register(Pi.onDidChange((e206) => {
      e206.changedColorMap && this._updateColorMap();
    }));
  }
  _updateColorMap() {
    let e206 = Pi.getColorMap();
    if (!e206) {
      this._colors = [EC.Empty], this._backgroundIsLight = true;
      return;
    }
    this._colors = [EC.Empty];
    for (let t10 = 1; t10 < e206.length; t10++) {
      let n10 = e206[t10].rgba;
      this._colors[t10] = new EC(n10.r, n10.g, n10.b, Math.round(n10.a * 255));
    }
    this._backgroundIsLight = e206[2].getRelativeLuminance() >= 0.5, this._onDidChange.fire(void 0);
  }
  getColor(e206) {
    return (e206 < 1 || e206 >= this._colors.length) && (e206 = 2), this._colors[e206];
  }
  backgroundIsLight() {
    return this._backgroundIsLight;
  }
}, _ka._INSTANCE = null, _ka), Kce = (() => {
  let e206 = [];
  for (let t10 = 32; t10 <= 126; t10++) e206.push(t10);
  return e206.push(65533), e206;
})(), qce = (e206, t10) => (e206 -= 32, e206 < 0 || e206 > 96 ? t10 <= 2 ? (e206 + 96) % 96 : 95 : e206), OC = class e90 {
  constructor(t10, n10) {
    this.scale = n10, this._minimapCharRendererBrand = void 0, this.charDataNormal = e90.soften(t10, 12 / 15), this.charDataLight = e90.soften(t10, 50 / 60);
  }
  static soften(e206, t10) {
    let n10 = new Uint8ClampedArray(e206.length);
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) n10[r10] = Fp(e206[r10] * t10);
    return n10;
  }
  renderChar(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    let d10 = 1 * this.scale, f10 = 2 * this.scale, p10 = u10 ? 1 : f10;
    if (t10 + d10 > e206.width || n10 + p10 > e206.height) {
      console.warn(`bad render request outside image data`);
      return;
    }
    let m10 = l10 ? this.charDataLight : this.charDataNormal, h10 = qce(r10, c10), g10 = e206.width * 4, _10 = o10.r, v10 = o10.g, y10 = o10.b, b10 = i10.r - _10, x10 = i10.g - v10, S10 = i10.b - y10, ee2 = Math.max(a10, s10), te2 = e206.data, ne2 = h10 * d10 * f10, re2 = n10 * g10 + t10 * 4;
    for (let e207 = 0; e207 < p10; e207++) {
      let e208 = re2;
      for (let t11 = 0; t11 < d10; t11++) {
        let t12 = m10[ne2++] / 255 * (a10 / 255);
        te2[e208++] = _10 + b10 * t12, te2[e208++] = v10 + x10 * t12, te2[e208++] = y10 + S10 * t12, te2[e208++] = ee2;
      }
      re2 += g10;
    }
  }
  blockRenderChar(e206, t10, n10, r10, i10, a10, o10, s10) {
    let c10 = 1 * this.scale, l10 = 2 * this.scale, u10 = s10 ? 1 : l10;
    if (t10 + c10 > e206.width || n10 + u10 > e206.height) {
      console.warn(`bad render request outside image data`);
      return;
    }
    let d10 = e206.width * 4, f10 = i10 / 255 * 0.5, p10 = a10.r, m10 = a10.g, h10 = a10.b, g10 = r10.r - p10, _10 = r10.g - m10, v10 = r10.b - h10, y10 = p10 + g10 * f10, b10 = m10 + _10 * f10, x10 = h10 + v10 * f10, S10 = Math.max(i10, o10), ee2 = e206.data, te2 = n10 * d10 + t10 * 4;
    for (let e207 = 0; e207 < u10; e207++) {
      let e208 = te2;
      for (let t11 = 0; t11 < c10; t11++) ee2[e208++] = y10, ee2[e208++] = b10, ee2[e208++] = x10, ee2[e208++] = S10;
      te2 += d10;
    }
  }
}, kC = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 }, AC = (e206) => {
  let t10 = new Uint8ClampedArray(e206.length / 2);
  for (let n10 = 0; n10 < e206.length; n10 += 2) t10[n10 >> 1] = kC[e206[n10]] << 4 | kC[e206[n10 + 1]] & 15;
  return t10;
}, jC = { 1: Ht(() => AC(`0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792`)), 2: Ht(() => AC(`000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126`)) }, Jce = class e91 {
  static create(t10, n10) {
    if (this.lastCreated && t10 === this.lastCreated.scale && n10 === this.lastFontFamily) return this.lastCreated;
    let r10;
    return r10 = jC[t10] ? new OC(jC[t10](), t10) : e91.createFromSampleData(e91.createSampleData(n10).data, t10), this.lastFontFamily = n10, this.lastCreated = r10, r10;
  }
  static createSampleData(e206) {
    let t10 = document.createElement(`canvas`), n10 = t10.getContext(`2d`);
    t10.style.height = `16px`, t10.height = 16, t10.width = 960, t10.style.width = `960px`, n10.fillStyle = `#ffffff`, n10.font = `bold 16px ${e206}`, n10.textBaseline = `middle`;
    let r10 = 0;
    for (let e207 of Kce) n10.fillText(String.fromCharCode(e207), r10, 16 / 2), r10 += 10;
    return n10.getImageData(0, 0, 960, 16);
  }
  static createFromSampleData(t10, n10) {
    if (t10.length !== 640 * 96) throw Error(`Unexpected source in MinimapCharRenderer`);
    return new OC(e91._downsample(t10, n10), n10);
  }
  static _downsampleChar(e206, t10, n10, r10, i10) {
    let a10 = 1 * i10, o10 = 2 * i10, s10 = r10, c10 = 0;
    for (let r11 = 0; r11 < o10; r11++) {
      let i11 = r11 / o10 * 16, l10 = (r11 + 1) / o10 * 16;
      for (let r12 = 0; r12 < a10; r12++) {
        let o11 = r12 / a10 * 10, u10 = (r12 + 1) / a10 * 10, d10 = 0, f10 = 0;
        for (let n11 = i11; n11 < l10; n11++) {
          let r13 = t10 + Math.floor(n11) * 3840, i12 = 1 - (n11 - Math.floor(n11));
          for (let t11 = o11; t11 < u10; t11++) {
            let n12 = 1 - (t11 - Math.floor(t11)), a11 = r13 + Math.floor(t11) * 4, o12 = n12 * i12;
            f10 += o12, d10 += e206[a11] * e206[a11 + 3] / 255 * o12;
          }
        }
        let p10 = d10 / f10;
        c10 = Math.max(c10, p10), n10[s10++] = Fp(p10);
      }
    }
    return c10;
  }
  static _downsample(e206, t10) {
    let n10 = 2 * t10 * 1 * t10, r10 = n10 * 96, i10 = new Uint8ClampedArray(r10), a10 = 0, o10 = 0, s10 = 0;
    for (let r11 = 0; r11 < 96; r11++) s10 = Math.max(s10, this._downsampleChar(e206, o10, i10, a10, t10)), a10 += n10, o10 += 40;
    if (s10 > 0) {
      let e207 = 255 / s10;
      for (let t11 = 0; t11 < r10; t11++) i10[t11] *= e207;
    }
    return i10;
  }
}, Yce = wt ? `"Segoe WPC", "Segoe UI", sans-serif` : Tt ? `-apple-system, BlinkMacSystemFont, sans-serif` : `system-ui, "Ubuntu", "Droid Sans", sans-serif`, MC = class {
  constructor(e206, t10) {
    this._viewModelDecorationBrand = void 0, this.range = e206, this.options = t10;
  }
};
function NC(e206, t10) {
  return !(t10.options.hideInCommentTokens && PC(e206, t10) || t10.options.hideInStringTokens && FC(e206, t10));
}
function PC(e206, t10) {
  return IC(e206, t10.range, (e207) => e207 === 1);
}
function FC(e206, t10) {
  return IC(e206, t10.range, (e207) => e207 === 2);
}
function IC(e206, t10, n10) {
  for (let r10 = t10.startLineNumber; r10 <= t10.endLineNumber; r10++) {
    let i10 = e206.tokenization.getLineTokens(r10), a10 = r10 === t10.startLineNumber, o10 = r10 === t10.endLineNumber, s10 = a10 ? i10.findTokenIndexAtOffset(t10.startColumn - 1) : 0;
    for (; s10 < i10.getCount() && !(o10 && i10.getStartOffset(s10) > t10.endColumn - 1); ) {
      if (!n10(i10.getStandardTokenType(s10))) return false;
      s10++;
    }
  }
  return true;
}
var Xce = 140, Zce = 2, LC = class e92 {
  constructor(t10, n10, r10) {
    let i10 = t10.options, a10 = i10.get(163), o10 = i10.get(165), s10 = o10.minimap, c10 = i10.get(59), l10 = i10.get(81);
    this.renderMinimap = s10.renderMinimap, this.size = l10.size, this.minimapHeightIsEditorHeight = s10.minimapHeightIsEditorHeight, this.scrollBeyondLastLine = i10.get(119), this.paddingTop = i10.get(96).top, this.paddingBottom = i10.get(96).bottom, this.showSlider = l10.showSlider, this.autohide = l10.autohide, this.pixelRatio = a10, this.typicalHalfwidthCharacterWidth = c10.typicalHalfwidthCharacterWidth, this.lineHeight = i10.get(75), this.minimapLeft = s10.minimapLeft, this.minimapWidth = s10.minimapWidth, this.minimapHeight = o10.height, this.canvasInnerWidth = s10.minimapCanvasInnerWidth, this.canvasInnerHeight = s10.minimapCanvasInnerHeight, this.canvasOuterWidth = s10.minimapCanvasOuterWidth, this.canvasOuterHeight = s10.minimapCanvasOuterHeight, this.isSampling = s10.minimapIsSampling, this.editorHeight = o10.height, this.fontScale = s10.minimapScale, this.minimapLineHeight = s10.minimapLineHeight, this.minimapCharWidth = 1 * this.fontScale, this.sectionHeaderFontFamily = Yce, this.sectionHeaderFontSize = l10.sectionHeaderFontSize * a10, this.sectionHeaderLetterSpacing = l10.sectionHeaderLetterSpacing, this.sectionHeaderFontColor = e92._getSectionHeaderColor(n10, r10.getColor(1)), this.charRenderer = Ht(() => Jce.create(this.fontScale, c10.fontFamily)), this.defaultBackgroundColor = r10.getColor(2), this.backgroundColor = e92._getMinimapBackground(n10, this.defaultBackgroundColor), this.foregroundAlpha = e92._getMinimapForegroundOpacity(n10);
  }
  static _getMinimapBackground(e206, t10) {
    let n10 = e206.getColor(_y);
    return n10 ? new EC(n10.rgba.r, n10.rgba.g, n10.rgba.b, Math.round(255 * n10.rgba.a)) : t10;
  }
  static _getMinimapForegroundOpacity(e206) {
    let t10 = e206.getColor(vy);
    return t10 ? EC._clamp(Math.round(255 * t10.rgba.a)) : 255;
  }
  static _getSectionHeaderColor(e206, t10) {
    let n10 = e206.getColor(iv);
    return n10 ? new EC(n10.rgba.r, n10.rgba.g, n10.rgba.b, Math.round(255 * n10.rgba.a)) : t10;
  }
  equals(e206) {
    return this.renderMinimap === e206.renderMinimap && this.size === e206.size && this.minimapHeightIsEditorHeight === e206.minimapHeightIsEditorHeight && this.scrollBeyondLastLine === e206.scrollBeyondLastLine && this.paddingTop === e206.paddingTop && this.paddingBottom === e206.paddingBottom && this.showSlider === e206.showSlider && this.autohide === e206.autohide && this.pixelRatio === e206.pixelRatio && this.typicalHalfwidthCharacterWidth === e206.typicalHalfwidthCharacterWidth && this.lineHeight === e206.lineHeight && this.minimapLeft === e206.minimapLeft && this.minimapWidth === e206.minimapWidth && this.minimapHeight === e206.minimapHeight && this.canvasInnerWidth === e206.canvasInnerWidth && this.canvasInnerHeight === e206.canvasInnerHeight && this.canvasOuterWidth === e206.canvasOuterWidth && this.canvasOuterHeight === e206.canvasOuterHeight && this.isSampling === e206.isSampling && this.editorHeight === e206.editorHeight && this.fontScale === e206.fontScale && this.minimapLineHeight === e206.minimapLineHeight && this.minimapCharWidth === e206.minimapCharWidth && this.sectionHeaderFontSize === e206.sectionHeaderFontSize && this.sectionHeaderLetterSpacing === e206.sectionHeaderLetterSpacing && this.defaultBackgroundColor && this.defaultBackgroundColor.equals(e206.defaultBackgroundColor) && this.backgroundColor && this.backgroundColor.equals(e206.backgroundColor) && this.foregroundAlpha === e206.foregroundAlpha;
  }
}, Qce = class e93 {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    this.scrollTop = e206, this.scrollHeight = t10, this.sliderNeeded = n10, this._computedSliderRatio = r10, this.sliderTop = i10, this.sliderHeight = a10, this.topPaddingLineCount = o10, this.startLineNumber = s10, this.endLineNumber = c10;
  }
  getDesiredScrollTopFromDelta(e206) {
    return Math.round(this.scrollTop + e206 / this._computedSliderRatio);
  }
  getDesiredScrollTopFromTouchLocation(e206) {
    return Math.round((e206 - this.sliderHeight / 2) / this._computedSliderRatio);
  }
  intersectWithViewport(e206) {
    let t10 = Math.max(this.startLineNumber, e206.startLineNumber), n10 = Math.min(this.endLineNumber, e206.endLineNumber);
    return t10 > n10 ? null : [t10, n10];
  }
  getYForLineNumber(e206, t10) {
    return +(e206 - this.startLineNumber + this.topPaddingLineCount) * t10;
  }
  static create(t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10) {
    let f10 = t10.pixelRatio, p10 = t10.minimapLineHeight, m10 = Math.floor(t10.canvasInnerHeight / p10), h10 = t10.lineHeight;
    if (t10.minimapHeightIsEditorHeight) {
      let n11 = c10 * t10.lineHeight + t10.paddingTop + t10.paddingBottom;
      t10.scrollBeyondLastLine && (n11 += Math.max(0, a10 - t10.lineHeight - t10.paddingBottom));
      let r11 = Math.max(1, Math.floor(a10 * a10 / n11)), i11 = Math.max(0, t10.minimapHeight - r11), o11 = i11 / (u10 - a10), d11 = l10 * o11, f11 = i11 > 0, p11 = Math.floor(t10.canvasInnerHeight / t10.minimapLineHeight);
      return new e93(l10, u10, f11, o11, d11, r11, Math.floor(t10.paddingTop / t10.lineHeight), 1, Math.min(s10, p11));
    }
    let g10;
    if (o10 && r10 !== s10) {
      let e206 = r10 - n10 + 1;
      g10 = Math.floor(e206 * p10 / f10);
    } else {
      let e206 = a10 / h10;
      g10 = Math.floor(e206 * p10 / f10);
    }
    let _10 = Math.floor(t10.paddingTop / h10), v10 = Math.floor(t10.paddingBottom / h10);
    if (t10.scrollBeyondLastLine) {
      let e206 = a10 / h10;
      v10 = Math.max(v10, e206 - 1);
    }
    let y10;
    if (v10 > 0) {
      let e206 = a10 / h10;
      y10 = (_10 + s10 + v10 - e206 - 1) * p10 / f10;
    } else y10 = Math.max(0, (_10 + s10) * p10 / f10 - g10);
    y10 = Math.min(t10.minimapHeight - g10, y10);
    let b10 = y10 / (u10 - a10), x10 = l10 * b10;
    if (m10 >= _10 + s10 + v10) return new e93(l10, u10, y10 > 0, b10, x10, g10, _10, 1, s10);
    {
      let r11;
      r11 = n10 > 1 ? n10 + _10 : Math.max(1, l10 / h10);
      let a11, o11 = Math.max(1, Math.floor(r11 - x10 * f10 / p10));
      o11 < _10 ? (a11 = _10 - o11 + 1, o11 = 1) : (a11 = 0, o11 = Math.max(1, o11 - _10)), d10 && d10.scrollHeight === u10 && (d10.scrollTop > l10 && (o11 = Math.min(o11, d10.startLineNumber), a11 = Math.max(a11, d10.topPaddingLineCount)), d10.scrollTop < l10 && (o11 = Math.max(o11, d10.startLineNumber), a11 = Math.min(a11, d10.topPaddingLineCount)));
      let c11 = Math.min(s10, o11 - a11 + m10 - 1), v11 = (l10 - i10) / h10, y11;
      return y11 = l10 >= t10.paddingTop ? (n10 - o11 + a11 + v11) * p10 / f10 : l10 / t10.paddingTop * (a11 + v11) * p10 / f10, new e93(l10, u10, true, b10, y11, g10, a11, o11, c11);
    }
  }
}, RC = (_la = class {
  constructor(e206) {
    this.dy = e206;
  }
  onContentChanged() {
    this.dy = -1;
  }
  onTokensChanged() {
    this.dy = -1;
  }
}, _la.INVALID = new _la(-1), _la), zC = class {
  constructor(e206, t10, n10) {
    this.renderedLayout = e206, this._imageData = t10, this._renderedLines = new PS({ createLine: () => RC.INVALID }), this._renderedLines._set(e206.startLineNumber, n10);
  }
  linesEquals(e206) {
    if (!this.scrollEquals(e206)) return false;
    let t10 = this._renderedLines._get().lines;
    for (let e207 = 0, n10 = t10.length; e207 < n10; e207++) if (t10[e207].dy === -1) return false;
    return true;
  }
  scrollEquals(e206) {
    return this.renderedLayout.startLineNumber === e206.startLineNumber && this.renderedLayout.endLineNumber === e206.endLineNumber;
  }
  _get() {
    let e206 = this._renderedLines._get();
    return { imageData: this._imageData, rendLineNumberStart: e206.rendLineNumberStart, lines: e206.lines };
  }
  onLinesChanged(e206, t10) {
    return this._renderedLines.onLinesChanged(e206, t10);
  }
  onLinesDeleted(e206, t10) {
    this._renderedLines.onLinesDeleted(e206, t10);
  }
  onLinesInserted(e206, t10) {
    this._renderedLines.onLinesInserted(e206, t10);
  }
  onTokensChanged(e206) {
    return this._renderedLines.onTokensChanged(e206);
  }
}, $ce = class e94 {
  constructor(t10, n10, r10, i10) {
    this._backgroundFillData = e94._createBackgroundFillData(n10, r10, i10), this._buffers = [t10.createImageData(n10, r10), t10.createImageData(n10, r10)], this._lastUsedBuffer = 0;
  }
  getBuffer() {
    this._lastUsedBuffer = 1 - this._lastUsedBuffer;
    let e206 = this._buffers[this._lastUsedBuffer];
    return e206.data.set(this._backgroundFillData), e206;
  }
  static _createBackgroundFillData(e206, t10, n10) {
    let r10 = n10.r, i10 = n10.g, a10 = n10.b, o10 = n10.a, s10 = new Uint8ClampedArray(e206 * t10 * 4), c10 = 0;
    for (let n11 = 0; n11 < t10; n11++) for (let t11 = 0; t11 < e206; t11++) s10[c10] = r10, s10[c10 + 1] = i10, s10[c10 + 2] = a10, s10[c10 + 3] = o10, c10 += 4;
    return s10;
  }
}, BC = class e95 {
  static compute(t10, n10, r10) {
    if (t10.renderMinimap === 0 || !t10.isSampling) return [null, []];
    let { minimapLineCount: i10 } = Kn.computeContainedMinimapLineCount({ viewLineCount: n10, scrollBeyondLastLine: t10.scrollBeyondLastLine, paddingTop: t10.paddingTop, paddingBottom: t10.paddingBottom, height: t10.editorHeight, lineHeight: t10.lineHeight, pixelRatio: t10.pixelRatio }), a10 = n10 / i10, o10 = a10 / 2;
    if (!r10 || r10.minimapLines.length === 0) {
      let t11 = [];
      if (t11[0] = 1, i10 > 1) {
        for (let e206 = 0, n11 = i10 - 1; e206 < n11; e206++) t11[e206] = Math.round(e206 * a10 + o10);
        t11[i10 - 1] = n10;
      }
      return [new e95(a10, t11), []];
    }
    let s10 = r10.minimapLines, c10 = s10.length, l10 = [], u10 = 0, d10 = 0, f10 = 1, p10 = [], m10 = null;
    for (let e206 = 0; e206 < i10; e206++) {
      let t11 = Math.max(f10, Math.round(e206 * a10)), r11 = Math.max(t11, Math.round((e206 + 1) * a10));
      for (; u10 < c10 && s10[u10] < t11; ) {
        if (p10.length < 10) {
          let e207 = u10 + 1 + d10;
          m10 && m10.type === `deleted` && m10._oldIndex === u10 - 1 ? m10.deleteToLineNumber++ : (m10 = { type: `deleted`, _oldIndex: u10, deleteFromLineNumber: e207, deleteToLineNumber: e207 }, p10.push(m10)), d10--;
        }
        u10++;
      }
      let h10;
      if (u10 < c10 && s10[u10] <= r11) h10 = s10[u10], u10++;
      else if (h10 = e206 === 0 ? 1 : e206 + 1 === i10 ? n10 : Math.round(e206 * a10 + o10), p10.length < 10) {
        let t12 = u10 + 1 + d10;
        m10 && m10.type === `inserted` && m10._i === e206 - 1 ? m10.insertToLineNumber++ : (m10 = { type: `inserted`, _i: e206, insertFromLineNumber: t12, insertToLineNumber: t12 }, p10.push(m10)), d10++;
      }
      l10[e206] = h10, f10 = h10;
    }
    if (p10.length < 10) for (; u10 < c10; ) {
      let e206 = u10 + 1 + d10;
      m10 && m10.type === `deleted` && m10._oldIndex === u10 - 1 ? m10.deleteToLineNumber++ : (m10 = { type: `deleted`, _oldIndex: u10, deleteFromLineNumber: e206, deleteToLineNumber: e206 }, p10.push(m10)), d10--, u10++;
    }
    else p10 = [{ type: `flush` }];
    return [new e95(a10, l10), p10];
  }
  constructor(e206, t10) {
    this.samplingRatio = e206, this.minimapLines = t10;
  }
  modelLineToMinimapLine(e206) {
    return Math.min(this.minimapLines.length, Math.max(1, Math.round(e206 / this.samplingRatio)));
  }
  modelLineRangeToMinimapLineRange(e206, t10) {
    let n10 = this.modelLineToMinimapLine(e206) - 1;
    for (; n10 > 0 && this.minimapLines[n10 - 1] >= e206; ) n10--;
    let r10 = this.modelLineToMinimapLine(t10) - 1;
    for (; r10 + 1 < this.minimapLines.length && this.minimapLines[r10 + 1] <= t10; ) r10++;
    if (n10 === r10) {
      let r11 = this.minimapLines[n10];
      if (r11 < e206 || r11 > t10) return null;
    }
    return [n10 + 1, r10 + 1];
  }
  decorationLineRangeToMinimapLineRange(e206, t10) {
    let n10 = this.modelLineToMinimapLine(e206), r10 = this.modelLineToMinimapLine(t10);
    return e206 !== t10 && r10 === n10 && (r10 === this.minimapLines.length ? n10 > 1 && n10-- : r10++), [n10, r10];
  }
  onLinesDeleted(e206) {
    let t10 = e206.toLineNumber - e206.fromLineNumber + 1, n10 = this.minimapLines.length, r10 = 0;
    for (let i10 = this.minimapLines.length - 1; i10 >= 0 && !(this.minimapLines[i10] < e206.fromLineNumber); i10--) this.minimapLines[i10] <= e206.toLineNumber ? (this.minimapLines[i10] = Math.max(1, e206.fromLineNumber - 1), n10 = Math.min(n10, i10), r10 = Math.max(r10, i10)) : this.minimapLines[i10] -= t10;
    return [n10, r10];
  }
  onLinesInserted(e206) {
    let t10 = e206.toLineNumber - e206.fromLineNumber + 1;
    for (let n10 = this.minimapLines.length - 1; n10 >= 0 && !(this.minimapLines[n10] < e206.fromLineNumber); n10--) this.minimapLines[n10] += t10;
  }
}, ele = class extends Tb {
  constructor(e206) {
    super(e206), this._sectionHeaderCache = new Td(10, 1.5), this.tokensColorTracker = DC.getInstance(), this._selections = [], this._minimapSelections = null, this.options = new LC(this._context.configuration, this._context.theme, this.tokensColorTracker);
    let [t10] = BC.compute(this.options, this._context.viewModel.getLineCount(), null);
    this._samplingState = t10, this._shouldCheckSampling = false, this._actual = new tle(e206.theme, this);
  }
  dispose() {
    this._actual.dispose(), super.dispose();
  }
  getDomNode() {
    return this._actual.getDomNode();
  }
  _onOptionsMaybeChanged() {
    let e206 = new LC(this._context.configuration, this._context.theme, this.tokensColorTracker);
    return this.options.equals(e206) ? false : (this.options = e206, this._recreateLineSampling(), this._actual.onDidChangeOptions(), true);
  }
  onConfigurationChanged(e206) {
    return this._onOptionsMaybeChanged();
  }
  onCursorStateChanged(e206) {
    return this._selections = e206.selections, this._minimapSelections = null, this._actual.onSelectionChanged();
  }
  onDecorationsChanged(e206) {
    return e206.affectsMinimap ? this._actual.onDecorationsChanged() : false;
  }
  onFlushed(e206) {
    return this._samplingState && (this._shouldCheckSampling = true), this._actual.onFlushed();
  }
  onLinesChanged(e206) {
    if (this._samplingState) {
      let t10 = this._samplingState.modelLineRangeToMinimapLineRange(e206.fromLineNumber, e206.fromLineNumber + e206.count - 1);
      return t10 ? this._actual.onLinesChanged(t10[0], t10[1] - t10[0] + 1) : false;
    } else return this._actual.onLinesChanged(e206.fromLineNumber, e206.count);
  }
  onLinesDeleted(e206) {
    if (this._samplingState) {
      let [t10, n10] = this._samplingState.onLinesDeleted(e206);
      return t10 <= n10 && this._actual.onLinesChanged(t10 + 1, n10 - t10 + 1), this._shouldCheckSampling = true, true;
    } else return this._actual.onLinesDeleted(e206.fromLineNumber, e206.toLineNumber);
  }
  onLinesInserted(e206) {
    return this._samplingState ? (this._samplingState.onLinesInserted(e206), this._shouldCheckSampling = true, true) : this._actual.onLinesInserted(e206.fromLineNumber, e206.toLineNumber);
  }
  onScrollChanged(e206) {
    return this._actual.onScrollChanged(e206);
  }
  onThemeChanged(e206) {
    return this._actual.onThemeChanged(), this._onOptionsMaybeChanged(), true;
  }
  onTokensChanged(e206) {
    if (this._samplingState) {
      let t10 = [];
      for (let n10 of e206.ranges) {
        let e207 = this._samplingState.modelLineRangeToMinimapLineRange(n10.fromLineNumber, n10.toLineNumber);
        e207 && t10.push({ fromLineNumber: e207[0], toLineNumber: e207[1] });
      }
      return t10.length ? this._actual.onTokensChanged(t10) : false;
    } else return this._actual.onTokensChanged(e206.ranges);
  }
  onTokensColorsChanged(e206) {
    return this._onOptionsMaybeChanged(), this._actual.onTokensColorsChanged();
  }
  onZonesChanged(e206) {
    return this._actual.onZonesChanged();
  }
  prepareRender(e206) {
    this._shouldCheckSampling && (this._shouldCheckSampling = false, this._recreateLineSampling());
  }
  render(e206) {
    let t10 = e206.visibleRange.startLineNumber, n10 = e206.visibleRange.endLineNumber;
    this._samplingState && (t10 = this._samplingState.modelLineToMinimapLine(t10), n10 = this._samplingState.modelLineToMinimapLine(n10));
    let r10 = { viewportContainsWhitespaceGaps: e206.viewportData.whitespaceViewportData.length > 0, scrollWidth: e206.scrollWidth, scrollHeight: e206.scrollHeight, viewportStartLineNumber: t10, viewportEndLineNumber: n10, viewportStartLineNumberVerticalOffset: e206.getVerticalOffsetForLineNumber(t10), scrollTop: e206.scrollTop, scrollLeft: e206.scrollLeft, viewportWidth: e206.viewportWidth, viewportHeight: e206.viewportHeight };
    this._actual.render(r10);
  }
  _recreateLineSampling() {
    this._minimapSelections = null;
    let e206 = !!this._samplingState, [t10, n10] = BC.compute(this.options, this._context.viewModel.getLineCount(), this._samplingState);
    if (this._samplingState = t10, e206 && this._samplingState) for (let e207 of n10) switch (e207.type) {
      case `deleted`:
        this._actual.onLinesDeleted(e207.deleteFromLineNumber, e207.deleteToLineNumber);
        break;
      case `inserted`:
        this._actual.onLinesInserted(e207.insertFromLineNumber, e207.insertToLineNumber);
        break;
      case `flush`:
        this._actual.onFlushed();
        break;
    }
  }
  getLineCount() {
    return this._samplingState ? this._samplingState.minimapLines.length : this._context.viewModel.getLineCount();
  }
  getRealLineCount() {
    return this._context.viewModel.getLineCount();
  }
  getLineContent(e206) {
    return this._samplingState ? this._context.viewModel.getLineContent(this._samplingState.minimapLines[e206 - 1]) : this._context.viewModel.getLineContent(e206);
  }
  getLineMaxColumn(e206) {
    return this._samplingState ? this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e206 - 1]) : this._context.viewModel.getLineMaxColumn(e206);
  }
  getMinimapLinesRenderingData(e206, t10, n10) {
    if (this._samplingState) {
      let r10 = [];
      for (let i10 = 0, a10 = t10 - e206 + 1; i10 < a10; i10++) n10[i10] ? r10[i10] = this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e206 + i10 - 1]) : r10[i10] = null;
      return r10;
    }
    return this._context.viewModel.getMinimapLinesRenderingData(e206, t10, n10).data;
  }
  getSelections() {
    if (this._minimapSelections === null) if (this._samplingState) {
      this._minimapSelections = [];
      for (let e206 of this._selections) {
        let [t10, n10] = this._samplingState.decorationLineRangeToMinimapLineRange(e206.startLineNumber, e206.endLineNumber);
        this._minimapSelections.push(new N(t10, e206.startColumn, n10, e206.endColumn));
      }
    } else this._minimapSelections = this._selections;
    return this._minimapSelections;
  }
  getMinimapDecorationsInViewport(e206, t10) {
    return this._getMinimapDecorationsInViewport(e206, t10).filter((e207) => !e207.options.minimap?.sectionHeaderStyle);
  }
  getSectionHeaderDecorationsInViewport(e206, t10) {
    let n10 = this.options.sectionHeaderFontSize / this.options.minimapLineHeight;
    return e206 = Math.floor(Math.max(1, e206 - n10)), this._getMinimapDecorationsInViewport(e206, t10).filter((e207) => !!e207.options.minimap?.sectionHeaderStyle);
  }
  _getMinimapDecorationsInViewport(e206, t10) {
    let n10;
    if (this._samplingState) {
      let r11 = this._samplingState.minimapLines[e206 - 1], i10 = this._samplingState.minimapLines[t10 - 1];
      n10 = new M(r11, 1, i10, this._context.viewModel.getLineMaxColumn(i10));
    } else n10 = new M(e206, 1, t10, this._context.viewModel.getLineMaxColumn(t10));
    let r10 = this._context.viewModel.getMinimapDecorationsInRange(n10);
    if (this._samplingState) {
      let e207 = [];
      for (let t11 of r10) {
        if (!t11.options.minimap) continue;
        let n11 = t11.range, r11 = this._samplingState.modelLineToMinimapLine(n11.startLineNumber), i10 = this._samplingState.modelLineToMinimapLine(n11.endLineNumber);
        e207.push(new MC(new M(r11, n11.startColumn, i10, n11.endColumn), t11.options));
      }
      return e207;
    }
    return r10;
  }
  getSectionHeaderText(e206, t10) {
    let n10 = e206.options.minimap?.sectionHeaderText;
    if (!n10) return null;
    let r10 = this._sectionHeaderCache.get(n10);
    if (r10) return r10;
    let i10 = t10(n10);
    return this._sectionHeaderCache.set(n10, i10), i10;
  }
  getOptions() {
    return this._context.viewModel.model.getOptions();
  }
  revealLineNumber(e206) {
    this._samplingState && (e206 = this._samplingState.minimapLines[e206 - 1]), this._context.viewModel.revealRange(`mouse`, false, new M(e206, 1, e206, 1), 1, 0);
  }
  setScrollTop(e206) {
    this._context.viewModel.viewLayout.setScrollPosition({ scrollTop: e206 }, 1);
  }
}, tle = class e96 extends D {
  constructor(e206, t10) {
    super(), this._renderDecorations = false, this._gestureInProgress = false, this._isMouseOverMinimap = false, this._theme = e206, this._model = t10, this._lastRenderData = null, this._buffers = null, this._selectionColor = this._theme.getColor(py), this._domNode = _u(document.createElement(`div`)), Eb.write(this._domNode, 9), this._domNode.setClassName(this._getMinimapDomNodeClassName()), this._domNode.setPosition(`absolute`), this._domNode.setAttribute(`role`, `presentation`), this._domNode.setAttribute(`aria-hidden`, `true`), this._shadow = _u(document.createElement(`div`)), this._shadow.setClassName(`minimap-shadow-hidden`), this._domNode.appendChild(this._shadow), this._canvas = _u(document.createElement(`canvas`)), this._canvas.setPosition(`absolute`), this._canvas.setLeft(0), this._domNode.appendChild(this._canvas), this._decorationsCanvas = _u(document.createElement(`canvas`)), this._decorationsCanvas.setPosition(`absolute`), this._decorationsCanvas.setClassName(`minimap-decorations-layer`), this._decorationsCanvas.setLeft(0), this._domNode.appendChild(this._decorationsCanvas), this._slider = _u(document.createElement(`div`)), this._slider.setPosition(`absolute`), this._slider.setClassName(`minimap-slider`), this._slider.setLayerHinting(true), this._slider.setContain(`strict`), this._domNode.appendChild(this._slider), this._sliderHorizontal = _u(document.createElement(`div`)), this._sliderHorizontal.setPosition(`absolute`), this._sliderHorizontal.setClassName(`minimap-slider-horizontal`), this._slider.appendChild(this._sliderHorizontal), this._applyLayout(), this._hideDelayedScheduler = this._register(new us(() => this._hideImmediatelyIfMouseIsOutside(), 500)), this._register(el(this._domNode.domNode, R.MOUSE_OVER, () => {
      this._isMouseOverMinimap = true;
    })), this._register(el(this._domNode.domNode, R.MOUSE_LEAVE, () => {
      this._isMouseOverMinimap = false;
    })), this._pointerDownListener = el(this._domNode.domNode, R.POINTER_DOWN, (e207) => {
      e207.preventDefault();
      let t11 = e207.pointerType === `mouse`, n10 = e207.button === 0;
      if (this._model.options.renderMinimap !== 0 && this._lastRenderData) {
        if (this._model.options.size !== `proportional`) {
          if (n10 && this._lastRenderData) {
            let t12 = _l2(this._slider.domNode), n11 = t12.top + t12.height / 2;
            this._startSliderDragging(e207, n11, this._lastRenderData.renderedLayout);
          }
          return;
        }
        if (n10 || !t11) {
          let t12 = this._model.options.minimapLineHeight, n11 = this._model.options.canvasInnerHeight / this._model.options.canvasOuterHeight * e207.offsetY, r10 = Math.floor(n11 / t12) + this._lastRenderData.renderedLayout.startLineNumber - this._lastRenderData.renderedLayout.topPaddingLineCount;
          r10 = Math.min(r10, this._model.getLineCount()), this._model.revealLineNumber(r10);
        }
      }
    }), this._sliderPointerMoveMonitor = new T_(), this._sliderPointerDownListener = el(this._slider.domNode, R.POINTER_DOWN, (e207) => {
      e207.preventDefault(), e207.stopPropagation(), e207.button === 0 && this._lastRenderData && this._startSliderDragging(e207, e207.pageY, this._lastRenderData.renderedLayout);
    }), this._gestureDisposable = nx.addTarget(this._domNode.domNode), this._sliderTouchStartListener = L(this._domNode.domNode, tx.Start, (e207) => {
      e207.preventDefault(), e207.stopPropagation(), this._lastRenderData && (this._slider.toggleClassName(`active`, true), this._gestureInProgress = true, this.scrollDueToTouchEvent(e207));
    }, { passive: false }), this._sliderTouchMoveListener = L(this._domNode.domNode, tx.Change, (e207) => {
      e207.preventDefault(), e207.stopPropagation(), this._lastRenderData && this._gestureInProgress && this.scrollDueToTouchEvent(e207);
    }, { passive: false }), this._sliderTouchEndListener = el(this._domNode.domNode, tx.End, (e207) => {
      e207.preventDefault(), e207.stopPropagation(), this._gestureInProgress = false, this._slider.toggleClassName(`active`, false);
    });
  }
  _hideSoon() {
    this._hideDelayedScheduler.cancel(), this._hideDelayedScheduler.schedule();
  }
  _hideImmediatelyIfMouseIsOutside() {
    if (this._isMouseOverMinimap) {
      this._hideSoon();
      return;
    }
    this._domNode.toggleClassName(`active`, false);
  }
  _startSliderDragging(e206, t10, n10) {
    if (!e206.target || !(e206.target instanceof Element)) return;
    let r10 = e206.pageX;
    this._slider.toggleClassName(`active`, true);
    let i10 = (e207, i11) => {
      let a10 = _l2(this._domNode.domNode), o10 = Math.min(Math.abs(i11 - r10), Math.abs(i11 - a10.left), Math.abs(i11 - a10.left - a10.width));
      if (wt && o10 > Xce) {
        this._model.setScrollTop(n10.scrollTop);
        return;
      }
      let s10 = e207 - t10;
      this._model.setScrollTop(n10.getDesiredScrollTopFromDelta(s10));
    };
    e206.pageY !== t10 && i10(e206.pageY, r10), this._sliderPointerMoveMonitor.startMonitoring(e206.target, e206.pointerId, e206.buttons, (e207) => i10(e207.pageY, e207.pageX), () => {
      this._slider.toggleClassName(`active`, false);
    });
  }
  scrollDueToTouchEvent(e206) {
    let t10 = this._domNode.domNode.getBoundingClientRect().top, n10 = this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e206.pageY - t10);
    this._model.setScrollTop(n10);
  }
  dispose() {
    this._pointerDownListener.dispose(), this._sliderPointerMoveMonitor.dispose(), this._sliderPointerDownListener.dispose(), this._gestureDisposable.dispose(), this._sliderTouchStartListener.dispose(), this._sliderTouchMoveListener.dispose(), this._sliderTouchEndListener.dispose(), super.dispose();
  }
  _getMinimapDomNodeClassName() {
    let e206 = [`minimap`];
    return this._model.options.showSlider === `always` ? e206.push(`slider-always`) : e206.push(`slider-mouseover`), this._model.options.autohide === `mouseover` ? e206.push(`minimap-autohide-mouseover`) : this._model.options.autohide === `scroll` && e206.push(`minimap-autohide-scroll`), e206.join(` `);
  }
  getDomNode() {
    return this._domNode;
  }
  _applyLayout() {
    this._domNode.setLeft(this._model.options.minimapLeft), this._domNode.setWidth(this._model.options.minimapWidth), this._domNode.setHeight(this._model.options.minimapHeight), this._shadow.setHeight(this._model.options.minimapHeight), this._canvas.setWidth(this._model.options.canvasOuterWidth), this._canvas.setHeight(this._model.options.canvasOuterHeight), this._canvas.domNode.width = this._model.options.canvasInnerWidth, this._canvas.domNode.height = this._model.options.canvasInnerHeight, this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth), this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight), this._decorationsCanvas.domNode.width = this._model.options.canvasInnerWidth, this._decorationsCanvas.domNode.height = this._model.options.canvasInnerHeight, this._slider.setWidth(this._model.options.minimapWidth);
  }
  _getBuffer() {
    return this._buffers || this._model.options.canvasInnerWidth > 0 && this._model.options.canvasInnerHeight > 0 && (this._buffers = new $ce(this._canvas.domNode.getContext(`2d`), this._model.options.canvasInnerWidth, this._model.options.canvasInnerHeight, this._model.options.backgroundColor)), this._buffers ? this._buffers.getBuffer() : null;
  }
  onDidChangeOptions() {
    this._lastRenderData = null, this._buffers = null, this._applyLayout(), this._domNode.setClassName(this._getMinimapDomNodeClassName());
  }
  onSelectionChanged() {
    return this._renderDecorations = true, true;
  }
  onDecorationsChanged() {
    return this._renderDecorations = true, true;
  }
  onFlushed() {
    return this._lastRenderData = null, true;
  }
  onLinesChanged(e206, t10) {
    return this._lastRenderData ? this._lastRenderData.onLinesChanged(e206, t10) : false;
  }
  onLinesDeleted(e206, t10) {
    return this._lastRenderData?.onLinesDeleted(e206, t10), true;
  }
  onLinesInserted(e206, t10) {
    return this._lastRenderData?.onLinesInserted(e206, t10), true;
  }
  onScrollChanged(e206) {
    return this._model.options.autohide === `scroll` && (e206.scrollTopChanged || e206.scrollHeightChanged) && (this._domNode.toggleClassName(`active`, true), this._hideSoon()), this._renderDecorations = true, true;
  }
  onThemeChanged() {
    return this._selectionColor = this._theme.getColor(py), this._renderDecorations = true, true;
  }
  onTokensChanged(e206) {
    return this._lastRenderData ? this._lastRenderData.onTokensChanged(e206) : false;
  }
  onTokensColorsChanged() {
    return this._lastRenderData = null, this._buffers = null, true;
  }
  onZonesChanged() {
    return this._lastRenderData = null, true;
  }
  render(e206) {
    if (this._model.options.renderMinimap === 0) {
      this._shadow.setClassName(`minimap-shadow-hidden`), this._sliderHorizontal.setWidth(0), this._sliderHorizontal.setHeight(0);
      return;
    }
    e206.scrollLeft + e206.viewportWidth >= e206.scrollWidth ? this._shadow.setClassName(`minimap-shadow-hidden`) : this._shadow.setClassName(`minimap-shadow-visible`);
    let t10 = Qce.create(this._model.options, e206.viewportStartLineNumber, e206.viewportEndLineNumber, e206.viewportStartLineNumberVerticalOffset, e206.viewportHeight, e206.viewportContainsWhitespaceGaps, this._model.getLineCount(), this._model.getRealLineCount(), e206.scrollTop, e206.scrollHeight, this._lastRenderData ? this._lastRenderData.renderedLayout : null);
    this._slider.setDisplay(t10.sliderNeeded ? `block` : `none`), this._slider.setTop(t10.sliderTop), this._slider.setHeight(t10.sliderHeight), this._sliderHorizontal.setLeft(0), this._sliderHorizontal.setWidth(this._model.options.minimapWidth), this._sliderHorizontal.setTop(0), this._sliderHorizontal.setHeight(t10.sliderHeight), this.renderDecorations(t10), this._lastRenderData = this.renderLines(t10);
  }
  renderDecorations(e206) {
    if (this._renderDecorations) {
      this._renderDecorations = false;
      let t10 = this._model.getSelections();
      t10.sort(M.compareRangesUsingStarts);
      let n10 = this._model.getMinimapDecorationsInViewport(e206.startLineNumber, e206.endLineNumber);
      n10.sort((e207, t11) => (e207.options.zIndex || 0) - (t11.options.zIndex || 0));
      let { canvasInnerWidth: r10, canvasInnerHeight: i10 } = this._model.options, a10 = this._model.options.minimapLineHeight, o10 = this._model.options.minimapCharWidth, s10 = this._model.getOptions().tabSize, c10 = this._decorationsCanvas.domNode.getContext(`2d`);
      c10.clearRect(0, 0, r10, i10);
      let l10 = new VC(e206.startLineNumber, e206.endLineNumber, false);
      this._renderSelectionLineHighlights(c10, t10, l10, e206, a10), this._renderDecorationsLineHighlights(c10, n10, l10, e206, a10);
      let u10 = new VC(e206.startLineNumber, e206.endLineNumber, null);
      this._renderSelectionsHighlights(c10, t10, u10, e206, a10, s10, o10, r10), this._renderDecorationsHighlights(c10, n10, u10, e206, a10, s10, o10, r10), this._renderSectionHeaders(e206);
    }
  }
  _renderSelectionLineHighlights(e206, t10, n10, r10, i10) {
    if (!this._selectionColor || this._selectionColor.isTransparent()) return;
    e206.fillStyle = this._selectionColor.transparent(0.5).toString();
    let a10 = 0, o10 = 0;
    for (let s10 of t10) {
      let t11 = r10.intersectWithViewport(s10);
      if (!t11) continue;
      let [c10, l10] = t11;
      for (let e207 = c10; e207 <= l10; e207++) n10.set(e207, true);
      let u10 = r10.getYForLineNumber(c10, i10), d10 = r10.getYForLineNumber(l10, i10);
      o10 >= u10 ? o10 = d10 : (o10 > a10 && e206.fillRect(8, a10, e206.canvas.width, o10 - a10), a10 = u10, o10 = d10);
    }
    o10 > a10 && e206.fillRect(8, a10, e206.canvas.width, o10 - a10);
  }
  _renderDecorationsLineHighlights(e206, t10, n10, r10, i10) {
    let a10 = /* @__PURE__ */ new Map();
    for (let o10 = t10.length - 1; o10 >= 0; o10--) {
      let s10 = t10[o10], c10 = s10.options.minimap;
      if (!c10 || c10.position !== 1) continue;
      let l10 = r10.intersectWithViewport(s10.range);
      if (!l10) continue;
      let [u10, d10] = l10, f10 = c10.getColor(this._theme.value);
      if (!f10 || f10.isTransparent()) continue;
      let p10 = a10.get(f10.toString());
      p10 || (p10 = f10.transparent(0.5).toString(), a10.set(f10.toString(), p10)), e206.fillStyle = p10;
      for (let t11 = u10; t11 <= d10; t11++) {
        if (n10.has(t11)) continue;
        n10.set(t11, true);
        let a11 = r10.getYForLineNumber(u10, i10);
        e206.fillRect(8, a11, e206.canvas.width, i10);
      }
    }
  }
  _renderSelectionsHighlights(e206, t10, n10, r10, i10, a10, o10, s10) {
    if (!(!this._selectionColor || this._selectionColor.isTransparent())) for (let c10 of t10) {
      let t11 = r10.intersectWithViewport(c10);
      if (!t11) continue;
      let [l10, u10] = t11;
      for (let t12 = l10; t12 <= u10; t12++) this.renderDecorationOnLine(e206, n10, c10, this._selectionColor, r10, t12, i10, i10, a10, o10, s10);
    }
  }
  _renderDecorationsHighlights(e206, t10, n10, r10, i10, a10, o10, s10) {
    for (let c10 of t10) {
      let t11 = c10.options.minimap;
      if (!t11) continue;
      let l10 = r10.intersectWithViewport(c10.range);
      if (!l10) continue;
      let [u10, d10] = l10, f10 = t11.getColor(this._theme.value);
      if (!(!f10 || f10.isTransparent())) for (let l11 = u10; l11 <= d10; l11++) switch (t11.position) {
        case 1:
          this.renderDecorationOnLine(e206, n10, c10.range, f10, r10, l11, i10, i10, a10, o10, s10);
          continue;
        case 2: {
          let t12 = r10.getYForLineNumber(l11, i10);
          this.renderDecoration(e206, f10, 2, t12, Zce, i10);
          continue;
        }
      }
    }
  }
  renderDecorationOnLine(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    let d10 = i10.getYForLineNumber(a10, s10);
    if (d10 + o10 < 0 || d10 > this._model.options.canvasInnerHeight) return;
    let { startLineNumber: f10, endLineNumber: p10 } = n10, m10 = f10 === a10 ? n10.startColumn : 1, h10 = p10 === a10 ? n10.endColumn : this._model.getLineMaxColumn(a10), g10 = this.getXOffsetForPosition(t10, a10, m10, c10, l10, u10), _10 = this.getXOffsetForPosition(t10, a10, h10, c10, l10, u10);
    this.renderDecoration(e206, r10, g10, d10, _10 - g10, o10);
  }
  getXOffsetForPosition(e206, t10, n10, r10, i10, a10) {
    if (n10 === 1) return 8;
    if ((n10 - 1) * i10 >= a10) return a10;
    let o10 = e206.get(t10);
    if (!o10) {
      let n11 = this._model.getLineContent(t10);
      o10 = [8];
      let s10 = 8;
      for (let e207 = 1; e207 < n11.length + 1; e207++) {
        let t11 = n11.charCodeAt(e207 - 1), c10 = t11 === 9 ? r10 * i10 : yo(t11) ? 2 * i10 : i10, l10 = s10 + c10;
        if (l10 >= a10) {
          o10[e207] = a10;
          break;
        }
        o10[e207] = l10, s10 = l10;
      }
      e206.set(t10, o10);
    }
    return n10 - 1 < o10.length ? o10[n10 - 1] : a10;
  }
  renderDecoration(e206, t10, n10, r10, i10, a10) {
    e206.fillStyle = t10 && t10.toString() || ``, e206.fillRect(n10, r10, i10, a10);
  }
  _renderSectionHeaders(t10) {
    let n10 = this._model.options.minimapLineHeight, r10 = this._model.options.sectionHeaderFontSize, i10 = this._model.options.sectionHeaderLetterSpacing, a10 = r10 * 1.5, { canvasInnerWidth: o10 } = this._model.options, s10 = this._model.options.backgroundColor, c10 = `rgb(${s10.r} ${s10.g} ${s10.b} / .7)`, l10 = this._model.options.sectionHeaderFontColor, u10 = `rgb(${l10.r} ${l10.g} ${l10.b})`, d10 = u10, f10 = this._decorationsCanvas.domNode.getContext(`2d`);
    f10.letterSpacing = i10 + `px`, f10.font = `500 ` + r10 + `px ` + this._model.options.sectionHeaderFontFamily, f10.strokeStyle = d10, f10.lineWidth = 0.4;
    let p10 = this._model.getSectionHeaderDecorationsInViewport(t10.startLineNumber, t10.endLineNumber);
    p10.sort((e206, t11) => e206.range.startLineNumber - t11.range.startLineNumber);
    let m10 = e96._fitSectionHeader.bind(null, f10, o10 - 8);
    for (let i11 of p10) {
      let s11 = t10.getYForLineNumber(i11.range.startLineNumber, n10) + r10, l11 = s11 - r10, d11 = l11 + 2, p11 = this._model.getSectionHeaderText(i11, m10);
      e96._renderSectionLabel(f10, p11, i11.options.minimap?.sectionHeaderStyle === 2, c10, u10, o10, l11, a10, s11, d11);
    }
  }
  static _fitSectionHeader(e206, t10, n10) {
    if (!n10) return n10;
    let r10 = e206.measureText(n10).width, i10 = e206.measureText(`\u2026`).width;
    if (r10 <= t10 || r10 <= i10) return n10;
    let a10 = n10.length, o10 = r10 / n10.length, s10 = Math.floor((t10 - i10) / o10) - 1, c10 = Math.ceil(s10 / 2);
    for (; c10 > 0 && /\s/.test(n10[c10 - 1]); ) --c10;
    return n10.substring(0, c10) + `\u2026` + n10.substring(a10 - (s10 - c10));
  }
  static _renderSectionLabel(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    t10 && (e206.fillStyle = r10, e206.fillRect(0, o10, a10, s10), e206.fillStyle = i10, e206.fillText(t10, 8, c10)), n10 && (e206.beginPath(), e206.moveTo(0, l10), e206.lineTo(a10, l10), e206.closePath(), e206.stroke());
  }
  renderLines(t10) {
    let n10 = t10.startLineNumber, r10 = t10.endLineNumber, i10 = this._model.options.minimapLineHeight;
    if (this._lastRenderData && this._lastRenderData.linesEquals(t10)) {
      let e206 = this._lastRenderData._get();
      return new zC(t10, e206.imageData, e206.lines);
    }
    let a10 = this._getBuffer();
    if (!a10) return null;
    let [o10, s10, c10] = e96._renderUntouchedLines(a10, t10.topPaddingLineCount, n10, r10, i10, this._lastRenderData), l10 = this._model.getMinimapLinesRenderingData(n10, r10, c10), u10 = this._model.getOptions().tabSize, d10 = this._model.options.defaultBackgroundColor, f10 = this._model.options.backgroundColor, p10 = this._model.options.foregroundAlpha, m10 = this._model.tokensColorTracker, h10 = m10.backgroundIsLight(), g10 = this._model.options.renderMinimap, _10 = this._model.options.charRenderer(), v10 = this._model.options.fontScale, y10 = this._model.options.minimapCharWidth, b10 = (g10 === 1 ? 2 : 3) * v10, x10 = i10 > b10 ? Math.floor((i10 - b10) / 2) : 0, S10 = f10.a / 255, ee2 = new EC(Math.round((f10.r - d10.r) * S10 + d10.r), Math.round((f10.g - d10.g) * S10 + d10.g), Math.round((f10.b - d10.b) * S10 + d10.b), 255), te2 = t10.topPaddingLineCount * i10, ne2 = [];
    for (let t11 = 0, o11 = r10 - n10 + 1; t11 < o11; t11++) c10[t11] && e96._renderLine(a10, ee2, f10.a, h10, g10, y10, m10, p10, _10, te2, x10, u10, l10[t11], v10, i10), ne2[t11] = new RC(te2), te2 += i10;
    let re2 = o10 === -1 ? 0 : o10, ie2 = (s10 === -1 ? a10.height : s10) - re2;
    return this._canvas.domNode.getContext(`2d`).putImageData(a10, 0, 0, 0, re2, a10.width, ie2), new zC(t10, a10, ne2);
  }
  static _renderUntouchedLines(e206, t10, n10, r10, i10, a10) {
    let o10 = [];
    if (!a10) {
      for (let e207 = 0, t11 = r10 - n10 + 1; e207 < t11; e207++) o10[e207] = true;
      return [-1, -1, o10];
    }
    let s10 = a10._get(), c10 = s10.imageData.data, l10 = s10.rendLineNumberStart, u10 = s10.lines, d10 = u10.length, f10 = e206.width, p10 = e206.data, m10 = (r10 - n10 + 1) * i10 * f10 * 4, h10 = -1, g10 = -1, _10 = -1, v10 = -1, y10 = -1, b10 = -1, x10 = t10 * i10;
    for (let e207 = n10; e207 <= r10; e207++) {
      let t11 = e207 - n10, r11 = e207 - l10, a11 = r11 >= 0 && r11 < d10 ? u10[r11].dy : -1;
      if (a11 === -1) {
        o10[t11] = true, x10 += i10;
        continue;
      }
      let s11 = a11 * f10 * 4, S10 = (a11 + i10) * f10 * 4, ee2 = x10 * f10 * 4, te2 = (x10 + i10) * f10 * 4;
      v10 === s11 && b10 === ee2 ? (v10 = S10, b10 = te2) : (_10 !== -1 && (p10.set(c10.subarray(_10, v10), y10), h10 === -1 && _10 === 0 && _10 === y10 && (h10 = v10), g10 === -1 && v10 === m10 && _10 === y10 && (g10 = _10)), _10 = s11, v10 = S10, y10 = ee2, b10 = te2), o10[t11] = false, x10 += i10;
    }
    return _10 !== -1 && (p10.set(c10.subarray(_10, v10), y10), h10 === -1 && _10 === 0 && _10 === y10 && (h10 = v10), g10 === -1 && v10 === m10 && _10 === y10 && (g10 = _10)), [h10 === -1 ? -1 : h10 / (f10 * 4), g10 === -1 ? -1 : g10 / (f10 * 4), o10];
  }
  static _renderLine(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10, p10, m10) {
    let h10 = f10.content, g10 = f10.tokens, _10 = e206.width - a10, v10 = m10 === 1, y10 = 8, b10 = 0, x10 = 0;
    for (let f11 = 0, m11 = g10.getCount(); f11 < m11; f11++) {
      let m12 = g10.getEndOffset(f11), S10 = g10.getForeground(f11), ee2 = o10.getColor(S10);
      for (; b10 < m12; b10++) {
        if (y10 > _10) return;
        let o11 = h10.charCodeAt(b10);
        if (o11 === 9) {
          let e207 = d10 - (b10 + x10) % d10;
          x10 += e207 - 1, y10 += e207 * a10;
        } else if (o11 === 32) y10 += a10;
        else {
          let d11 = yo(o11) ? 2 : 1;
          for (let f12 = 0; f12 < d11; f12++) if (i10 === 2 ? c10.blockRenderChar(e206, y10, l10 + u10, ee2, s10, t10, n10, v10) : c10.renderChar(e206, y10, l10 + u10, o11, ee2, s10, t10, n10, p10, r10, v10), y10 += a10, y10 > _10) return;
        }
      }
    }
  }
}, VC = class {
  constructor(e206, t10, n10) {
    this._startLineNumber = e206, this._endLineNumber = t10, this._defaultValue = n10, this._values = [];
    for (let e207 = 0, t11 = this._endLineNumber - this._startLineNumber + 1; e207 < t11; e207++) this._values[e207] = n10;
  }
  has(e206) {
    return this.get(e206) !== this._defaultValue;
  }
  set(e206, t10) {
    e206 < this._startLineNumber || e206 > this._endLineNumber || (this._values[e206 - this._startLineNumber] = t10);
  }
  get(e206) {
    return e206 < this._startLineNumber || e206 > this._endLineNumber ? this._defaultValue : this._values[e206 - this._startLineNumber];
  }
}, nle = class extends Tb {
  constructor(e206, t10) {
    super(e206), this._viewDomNode = t10;
    let n10 = this._context.configuration.options.get(165);
    this._widgets = {}, this._verticalScrollbarWidth = n10.verticalScrollbarWidth, this._minimapWidth = n10.minimap.minimapWidth, this._horizontalScrollbarHeight = n10.horizontalScrollbarHeight, this._editorHeight = n10.height, this._editorWidth = n10.width, this._viewDomNodeRect = { top: 0, left: 0, width: 0, height: 0 }, this._domNode = _u(document.createElement(`div`)), Eb.write(this._domNode, 4), this._domNode.setClassName(`overlayWidgets`), this.overflowingOverlayWidgetsDomNode = _u(document.createElement(`div`)), Eb.write(this.overflowingOverlayWidgetsDomNode, 5), this.overflowingOverlayWidgetsDomNode.setClassName(`overflowingOverlayWidgets`);
  }
  dispose() {
    super.dispose(), this._widgets = {};
  }
  getDomNode() {
    return this._domNode;
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options.get(165);
    return this._verticalScrollbarWidth = t10.verticalScrollbarWidth, this._minimapWidth = t10.minimap.minimapWidth, this._horizontalScrollbarHeight = t10.horizontalScrollbarHeight, this._editorHeight = t10.height, this._editorWidth = t10.width, true;
  }
  _widgetCanOverflow(e206) {
    let t10 = this._context.configuration.options.get(4);
    return (e206.allowEditorOverflow || false) && t10;
  }
  addWidget(e206) {
    let t10 = _u(e206.getDomNode());
    this._widgets[e206.getId()] = { widget: e206, preference: null, domNode: t10 }, t10.setPosition(`absolute`), t10.setAttribute(`widgetId`, e206.getId()), this._widgetCanOverflow(e206) ? this.overflowingOverlayWidgetsDomNode.appendChild(t10) : this._domNode.appendChild(t10), this.setShouldRender(), this._updateMaxMinWidth();
  }
  setWidgetPosition(e206, t10) {
    let n10 = this._widgets[e206.getId()], r10 = t10 ? t10.preference : null, i10 = t10?.stackOridinal;
    return n10.preference === r10 && n10.stack === i10 ? (this._updateMaxMinWidth(), false) : (n10.preference = r10, n10.stack = i10, this.setShouldRender(), this._updateMaxMinWidth(), true);
  }
  removeWidget(e206) {
    let t10 = e206.getId();
    if (this._widgets.hasOwnProperty(t10)) {
      let e207 = this._widgets[t10].domNode.domNode;
      delete this._widgets[t10], e207.remove(), this.setShouldRender(), this._updateMaxMinWidth();
    }
  }
  _updateMaxMinWidth() {
    let e206 = 0, t10 = Object.keys(this._widgets);
    for (let n10 = 0, r10 = t10.length; n10 < r10; n10++) {
      let r11 = t10[n10], i10 = this._widgets[r11].widget.getMinContentWidthInPx?.();
      i10 !== void 0 && (e206 = Math.max(e206, i10));
    }
    this._context.viewLayout.setOverlayWidgetsMinWidth(e206);
  }
  _renderWidget(e206, t10) {
    let n10 = e206.domNode;
    if (e206.preference === null) {
      n10.setTop(``);
      return;
    }
    let r10 = 2 * this._verticalScrollbarWidth + this._minimapWidth;
    if (e206.preference === 0 || e206.preference === 1) {
      if (e206.preference === 1) {
        let e207 = n10.domNode.clientHeight;
        n10.setTop(this._editorHeight - e207 - 2 * this._horizontalScrollbarHeight);
      } else n10.setTop(0);
      e206.stack === void 0 ? n10.setRight(r10) : (n10.setTop(t10[e206.preference]), t10[e206.preference] += n10.domNode.clientWidth);
    } else if (e206.preference === 2) n10.domNode.style.right = `50%`, e206.stack === void 0 ? n10.setTop(0) : (n10.setTop(t10[2]), t10[2] += n10.domNode.clientHeight);
    else {
      let { top: t11, left: r11 } = e206.preference;
      if (this._context.configuration.options.get(51) && this._widgetCanOverflow(e206.widget)) {
        let e207 = this._viewDomNodeRect;
        n10.setTop(t11 + e207.top), n10.setLeft(r11 + e207.left), n10.setPosition(`fixed`);
      } else n10.setTop(t11), n10.setLeft(r11), n10.setPosition(`absolute`);
    }
  }
  prepareRender(e206) {
    this._viewDomNodeRect = _l2(this._viewDomNode.domNode);
  }
  render(e206) {
    this._domNode.setWidth(this._editorWidth);
    let t10 = Object.keys(this._widgets), n10 = Array.from({ length: 3 }, () => 0);
    t10.sort((e207, t11) => (this._widgets[e207].stack || 0) - (this._widgets[t11].stack || 0));
    for (let e207 = 0, r10 = t10.length; e207 < r10; e207++) {
      let r11 = t10[e207];
      this._renderWidget(this._widgets[r11], n10);
    }
  }
}, rle = class {
  constructor(e206, t10) {
    let n10 = e206.options;
    this.lineHeight = n10.get(75), this.pixelRatio = n10.get(163), this.overviewRulerLanes = n10.get(95), this.renderBorder = n10.get(94);
    let r10 = t10.getColor(cce);
    this.borderColor = r10 ? r10.toString() : null, this.hideCursor = n10.get(68);
    let i10 = t10.getColor(ZS);
    this.cursorColorSingle = i10 ? i10.transparent(0.7).toString() : null;
    let a10 = t10.getColor($S);
    this.cursorColorPrimary = a10 ? a10.transparent(0.7).toString() : null;
    let o10 = t10.getColor(eC);
    this.cursorColorSecondary = o10 ? o10.transparent(0.7).toString() : null, this.themeType = t10.type;
    let s10 = n10.get(81), c10 = s10.enabled, l10 = s10.side, u10 = t10.getColor(lce), d10 = Pi.getDefaultBackground();
    u10 ? this.backgroundColor = u10 : c10 && l10 === `right` ? this.backgroundColor = d10 : this.backgroundColor = null;
    let f10 = n10.get(165).overviewRuler;
    this.top = f10.top, this.right = f10.right, this.domWidth = f10.width, this.domHeight = f10.height, this.overviewRulerLanes === 0 ? (this.canvasWidth = 0, this.canvasHeight = 0) : (this.canvasWidth = this.domWidth * this.pixelRatio | 0, this.canvasHeight = this.domHeight * this.pixelRatio | 0);
    let [p10, m10] = this._initLanes(1, this.canvasWidth, this.overviewRulerLanes);
    this.x = p10, this.w = m10;
  }
  _initLanes(e206, t10, n10) {
    let r10 = t10 - e206;
    if (n10 >= 3) {
      let t11 = Math.floor(r10 / 3), n11 = Math.floor(r10 / 3), i10 = r10 - t11 - n11, a10 = e206, o10 = a10 + t11;
      return [[0, a10, o10, a10, a10 + t11 + i10, a10, o10, a10], [0, t11, i10, t11 + i10, n11, t11 + i10 + n11, i10 + n11, t11 + i10 + n11]];
    } else if (n10 === 2) {
      let t11 = Math.floor(r10 / 2), n11 = r10 - t11, i10 = e206;
      return [[0, i10, i10, i10, i10 + t11, i10, i10, i10], [0, t11, t11, t11, n11, t11 + n11, t11 + n11, t11 + n11]];
    } else {
      let t11 = e206, n11 = r10;
      return [[0, t11, t11, t11, t11, t11, t11, t11], [0, n11, n11, n11, n11, n11, n11, n11]];
    }
  }
  equals(e206) {
    return this.lineHeight === e206.lineHeight && this.pixelRatio === e206.pixelRatio && this.overviewRulerLanes === e206.overviewRulerLanes && this.renderBorder === e206.renderBorder && this.borderColor === e206.borderColor && this.hideCursor === e206.hideCursor && this.cursorColorSingle === e206.cursorColorSingle && this.cursorColorPrimary === e206.cursorColorPrimary && this.cursorColorSecondary === e206.cursorColorSecondary && this.themeType === e206.themeType && Y.equals(this.backgroundColor, e206.backgroundColor) && this.top === e206.top && this.right === e206.right && this.domWidth === e206.domWidth && this.domHeight === e206.domHeight && this.canvasWidth === e206.canvasWidth && this.canvasHeight === e206.canvasHeight;
  }
}, ile = class extends Tb {
  constructor(e206) {
    super(e206), this._actualShouldRender = 0, this._renderedDecorations = [], this._renderedCursorPositions = [], this._domNode = _u(document.createElement(`canvas`)), this._domNode.setClassName(`decorationsOverviewRuler`), this._domNode.setPosition(`absolute`), this._domNode.setLayerHinting(true), this._domNode.setContain(`strict`), this._domNode.setAttribute(`aria-hidden`, `true`), this._updateSettings(false), this._tokensColorTrackerListener = Pi.onDidChange((e207) => {
      e207.changedColorMap && this._updateSettings(true);
    }), this._cursorPositions = [{ position: new j(1, 1), color: this._settings.cursorColorSingle }];
  }
  dispose() {
    super.dispose(), this._tokensColorTrackerListener.dispose();
  }
  _updateSettings(e206) {
    let t10 = new rle(this._context.configuration, this._context.theme);
    return this._settings && this._settings.equals(t10) ? false : (this._settings = t10, this._domNode.setTop(this._settings.top), this._domNode.setRight(this._settings.right), this._domNode.setWidth(this._settings.domWidth), this._domNode.setHeight(this._settings.domHeight), this._domNode.domNode.width = this._settings.canvasWidth, this._domNode.domNode.height = this._settings.canvasHeight, e206 && this._render(), true);
  }
  _markRenderingIsNeeded() {
    return this._actualShouldRender = 2, true;
  }
  _markRenderingIsMaybeNeeded() {
    return this._actualShouldRender = 1, true;
  }
  onConfigurationChanged(e206) {
    return this._updateSettings(false) ? this._markRenderingIsNeeded() : false;
  }
  onCursorStateChanged(e206) {
    this._cursorPositions = [];
    for (let t10 = 0, n10 = e206.selections.length; t10 < n10; t10++) {
      let r10 = this._settings.cursorColorSingle;
      n10 > 1 && (r10 = t10 === 0 ? this._settings.cursorColorPrimary : this._settings.cursorColorSecondary), this._cursorPositions.push({ position: e206.selections[t10].getPosition(), color: r10 });
    }
    return this._cursorPositions.sort((e207, t10) => j.compare(e207.position, t10.position)), this._markRenderingIsMaybeNeeded();
  }
  onDecorationsChanged(e206) {
    return e206.affectsOverviewRuler ? this._markRenderingIsMaybeNeeded() : false;
  }
  onFlushed(e206) {
    return this._markRenderingIsNeeded();
  }
  onScrollChanged(e206) {
    return e206.scrollHeightChanged ? this._markRenderingIsNeeded() : false;
  }
  onZonesChanged(e206) {
    return this._markRenderingIsNeeded();
  }
  onThemeChanged(e206) {
    return this._updateSettings(false) ? this._markRenderingIsNeeded() : false;
  }
  getDomNode() {
    return this._domNode.domNode;
  }
  prepareRender(e206) {
  }
  render(e206) {
    this._render(), this._actualShouldRender = 0;
  }
  _render() {
    let e206 = this._settings.backgroundColor;
    if (this._settings.overviewRulerLanes === 0) {
      this._domNode.setBackgroundColor(e206 ? Y.Format.CSS.formatHexA(e206) : ``), this._domNode.setDisplay(`none`);
      return;
    }
    let t10 = this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);
    if (t10.sort(yg.compareByRenderingProps), this._actualShouldRender === 1 && !yg.equalsArr(this._renderedDecorations, t10) && (this._actualShouldRender = 2), this._actualShouldRender === 1 && !o(this._renderedCursorPositions, this._cursorPositions, (e207, t11) => e207.position.lineNumber === t11.position.lineNumber && e207.color === t11.color) && (this._actualShouldRender = 2), this._actualShouldRender === 1) return;
    this._renderedDecorations = t10, this._renderedCursorPositions = this._cursorPositions, this._domNode.setDisplay(`block`);
    let n10 = this._settings.canvasWidth, r10 = this._settings.canvasHeight, i10 = this._settings.lineHeight, a10 = this._context.viewLayout, s10 = r10 / this._context.viewLayout.getScrollHeight(), c10 = 6 * this._settings.pixelRatio | 0, l10 = c10 / 2 | 0, u10 = this._domNode.domNode.getContext(`2d`);
    e206 ? e206.isOpaque() ? (u10.fillStyle = Y.Format.CSS.formatHexA(e206), u10.fillRect(0, 0, n10, r10)) : (u10.clearRect(0, 0, n10, r10), u10.fillStyle = Y.Format.CSS.formatHexA(e206), u10.fillRect(0, 0, n10, r10)) : u10.clearRect(0, 0, n10, r10);
    let d10 = this._settings.x, f10 = this._settings.w;
    for (let e207 of t10) {
      let t11 = e207.color, n11 = e207.data;
      u10.fillStyle = t11;
      let o10 = 0, p10 = 0, m10 = 0;
      for (let e208 = 0, t12 = n11.length / 3; e208 < t12; e208++) {
        let t13 = n11[3 * e208], h10 = n11[3 * e208 + 1], g10 = n11[3 * e208 + 2], _10 = a10.getVerticalOffsetForLineNumber(h10) * s10 | 0, v10 = (a10.getVerticalOffsetForLineNumber(g10) + i10) * s10 | 0;
        if (v10 - _10 < c10) {
          let e209 = (_10 + v10) / 2 | 0;
          e209 < l10 ? e209 = l10 : e209 + l10 > r10 && (e209 = r10 - l10), _10 = e209 - l10, v10 = e209 + l10;
        }
        _10 > m10 + 1 || t13 !== o10 ? (e208 !== 0 && u10.fillRect(d10[o10], p10, f10[o10], m10 - p10), o10 = t13, p10 = _10, m10 = v10) : v10 > m10 && (m10 = v10);
      }
      u10.fillRect(d10[o10], p10, f10[o10], m10 - p10);
    }
    if (!this._settings.hideCursor) {
      let e207 = 2 * this._settings.pixelRatio | 0, t11 = e207 / 2 | 0, n11 = this._settings.x[7], i11 = this._settings.w[7], o10 = -100, c11 = -100, l11 = null;
      for (let d11 = 0, f11 = this._cursorPositions.length; d11 < f11; d11++) {
        let f12 = this._cursorPositions[d11].color;
        if (!f12) continue;
        let p10 = this._cursorPositions[d11].position, m10 = a10.getVerticalOffsetForLineNumber(p10.lineNumber) * s10 | 0;
        m10 < t11 ? m10 = t11 : m10 + t11 > r10 && (m10 = r10 - t11);
        let h10 = m10 - t11, g10 = h10 + e207;
        h10 > c11 + 1 || f12 !== l11 ? (d11 !== 0 && l11 && u10.fillRect(n11, o10, i11, c11 - o10), o10 = h10, c11 = g10) : g10 > c11 && (c11 = g10), l11 = f12, u10.fillStyle = f12;
      }
      l11 && u10.fillRect(n11, o10, i11, c11 - o10);
    }
    this._settings.renderBorder && this._settings.borderColor && this._settings.overviewRulerLanes > 0 && (u10.beginPath(), u10.lineWidth = 1, u10.strokeStyle = this._settings.borderColor, u10.moveTo(0, 0), u10.lineTo(0, r10), u10.moveTo(1, 0), u10.lineTo(n10, 0), u10.stroke());
  }
}, HC = class {
  constructor(e206, t10, n10) {
    this._colorZoneBrand = void 0, this.from = e206 | 0, this.to = t10 | 0, this.colorId = n10 | 0;
  }
  static compare(e206, t10) {
    return e206.colorId === t10.colorId ? e206.from === t10.from ? e206.to - t10.to : e206.from - t10.from : e206.colorId - t10.colorId;
  }
}, UC = class {
  constructor(e206, t10, n10, r10) {
    this._overviewRulerZoneBrand = void 0, this.startLineNumber = e206, this.endLineNumber = t10, this.heightInLines = n10, this.color = r10, this._colorZone = null;
  }
  static compare(e206, t10) {
    return e206.color === t10.color ? e206.startLineNumber === t10.startLineNumber ? e206.heightInLines === t10.heightInLines ? e206.endLineNumber - t10.endLineNumber : e206.heightInLines - t10.heightInLines : e206.startLineNumber - t10.startLineNumber : e206.color < t10.color ? -1 : 1;
  }
  setColorZone(e206) {
    this._colorZone = e206;
  }
  getColorZones() {
    return this._colorZone;
  }
}, ale = class {
  constructor(e206) {
    this._getVerticalOffsetForLine = e206, this._zones = [], this._colorZonesInvalid = false, this._lineHeight = 0, this._domWidth = 0, this._domHeight = 0, this._outerHeight = 0, this._pixelRatio = 1, this._lastAssignedId = 0, this._color2Id = /* @__PURE__ */ Object.create(null), this._id2Color = [];
  }
  getId2Color() {
    return this._id2Color;
  }
  setZones(e206) {
    this._zones = e206, this._zones.sort(UC.compare);
  }
  setLineHeight(e206) {
    return this._lineHeight === e206 ? false : (this._lineHeight = e206, this._colorZonesInvalid = true, true);
  }
  setPixelRatio(e206) {
    this._pixelRatio = e206, this._colorZonesInvalid = true;
  }
  getDOMWidth() {
    return this._domWidth;
  }
  getCanvasWidth() {
    return this._domWidth * this._pixelRatio;
  }
  setDOMWidth(e206) {
    return this._domWidth === e206 ? false : (this._domWidth = e206, this._colorZonesInvalid = true, true);
  }
  getDOMHeight() {
    return this._domHeight;
  }
  getCanvasHeight() {
    return this._domHeight * this._pixelRatio;
  }
  setDOMHeight(e206) {
    return this._domHeight === e206 ? false : (this._domHeight = e206, this._colorZonesInvalid = true, true);
  }
  getOuterHeight() {
    return this._outerHeight;
  }
  setOuterHeight(e206) {
    return this._outerHeight === e206 ? false : (this._outerHeight = e206, this._colorZonesInvalid = true, true);
  }
  resolveColorZones() {
    let e206 = this._colorZonesInvalid, t10 = Math.floor(this._lineHeight), n10 = Math.floor(this.getCanvasHeight()), r10 = n10 / Math.floor(this._outerHeight), i10 = Math.floor(4 * this._pixelRatio / 2), a10 = [];
    for (let o10 = 0, s10 = this._zones.length; o10 < s10; o10++) {
      let s11 = this._zones[o10];
      if (!e206) {
        let e207 = s11.getColorZones();
        if (e207) {
          a10.push(e207);
          continue;
        }
      }
      let c10 = this._getVerticalOffsetForLine(s11.startLineNumber), l10 = s11.heightInLines === 0 ? this._getVerticalOffsetForLine(s11.endLineNumber) + t10 : c10 + s11.heightInLines * t10, u10 = Math.floor(r10 * c10), d10 = Math.floor(r10 * l10), f10 = Math.floor((u10 + d10) / 2), p10 = d10 - f10;
      p10 < i10 && (p10 = i10), f10 - p10 < 0 && (f10 = p10), f10 + p10 > n10 && (f10 = n10 - p10);
      let m10 = s11.color, h10 = this._color2Id[m10];
      h10 || (h10 = ++this._lastAssignedId, this._color2Id[m10] = h10, this._id2Color[h10] = m10);
      let g10 = new HC(f10 - p10, f10 + p10, h10);
      s11.setColorZone(g10), a10.push(g10);
    }
    return this._colorZonesInvalid = false, a10.sort(HC.compare), a10;
  }
}, ole = class extends wb {
  constructor(e206, t10) {
    super(), this._context = e206;
    let n10 = this._context.configuration.options;
    this._domNode = _u(document.createElement(`canvas`)), this._domNode.setClassName(t10), this._domNode.setPosition(`absolute`), this._domNode.setLayerHinting(true), this._domNode.setContain(`strict`), this._zoneManager = new ale((e207) => this._context.viewLayout.getVerticalOffsetForLineNumber(e207)), this._zoneManager.setDOMWidth(0), this._zoneManager.setDOMHeight(0), this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()), this._zoneManager.setLineHeight(n10.get(75)), this._zoneManager.setPixelRatio(n10.get(163)), this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), super.dispose();
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options;
    return e206.hasChanged(75) && (this._zoneManager.setLineHeight(t10.get(75)), this._render()), e206.hasChanged(163) && (this._zoneManager.setPixelRatio(t10.get(163)), this._domNode.setWidth(this._zoneManager.getDOMWidth()), this._domNode.setHeight(this._zoneManager.getDOMHeight()), this._domNode.domNode.width = this._zoneManager.getCanvasWidth(), this._domNode.domNode.height = this._zoneManager.getCanvasHeight(), this._render()), true;
  }
  onFlushed(e206) {
    return this._render(), true;
  }
  onScrollChanged(e206) {
    return e206.scrollHeightChanged && (this._zoneManager.setOuterHeight(e206.scrollHeight), this._render()), true;
  }
  onZonesChanged(e206) {
    return this._render(), true;
  }
  getDomNode() {
    return this._domNode.domNode;
  }
  setLayout(e206) {
    this._domNode.setTop(e206.top), this._domNode.setRight(e206.right);
    let t10 = false;
    t10 = this._zoneManager.setDOMWidth(e206.width) || t10, t10 = this._zoneManager.setDOMHeight(e206.height) || t10, t10 && (this._domNode.setWidth(this._zoneManager.getDOMWidth()), this._domNode.setHeight(this._zoneManager.getDOMHeight()), this._domNode.domNode.width = this._zoneManager.getCanvasWidth(), this._domNode.domNode.height = this._zoneManager.getCanvasHeight(), this._render());
  }
  setZones(e206) {
    this._zoneManager.setZones(e206), this._render();
  }
  _render() {
    if (this._zoneManager.getOuterHeight() === 0) return false;
    let e206 = this._zoneManager.getCanvasWidth(), t10 = this._zoneManager.getCanvasHeight(), n10 = this._zoneManager.resolveColorZones(), r10 = this._zoneManager.getId2Color(), i10 = this._domNode.domNode.getContext(`2d`);
    return i10.clearRect(0, 0, e206, t10), n10.length > 0 && this._renderOneLane(i10, n10, r10, e206), true;
  }
  _renderOneLane(e206, t10, n10, r10) {
    let i10 = 0, a10 = 0, o10 = 0;
    for (let s10 of t10) {
      let t11 = s10.colorId, c10 = s10.from, l10 = s10.to;
      t11 === i10 ? o10 >= c10 ? o10 = Math.max(o10, l10) : (e206.fillRect(0, a10, r10, o10 - a10), a10 = c10, o10 = l10) : (e206.fillRect(0, a10, r10, o10 - a10), i10 = t11, e206.fillStyle = n10[i10], a10 = c10, o10 = l10);
    }
    e206.fillRect(0, a10, r10, o10 - a10);
  }
}, sle = class extends Tb {
  constructor(e206) {
    super(e206), this.domNode = _u(document.createElement(`div`)), this.domNode.setAttribute(`role`, `presentation`), this.domNode.setAttribute(`aria-hidden`, `true`), this.domNode.setClassName(`view-rulers`), this._renderedRulers = [];
    let t10 = this._context.configuration.options;
    this._rulers = t10.get(116), this._typicalHalfwidthCharacterWidth = t10.get(59).typicalHalfwidthCharacterWidth;
  }
  dispose() {
    super.dispose();
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options;
    return this._rulers = t10.get(116), this._typicalHalfwidthCharacterWidth = t10.get(59).typicalHalfwidthCharacterWidth, true;
  }
  onScrollChanged(e206) {
    return e206.scrollHeightChanged;
  }
  prepareRender(e206) {
  }
  _ensureRulersCount() {
    let e206 = this._renderedRulers.length, t10 = this._rulers.length;
    if (e206 === t10) return;
    if (e206 < t10) {
      let { tabSize: n11 } = this._context.viewModel.model.getOptions(), r10 = n11, i10 = t10 - e206;
      for (; i10 > 0; ) {
        let e207 = _u(document.createElement(`div`));
        e207.setClassName(`view-ruler`), e207.setWidth(r10), this.domNode.appendChild(e207), this._renderedRulers.push(e207), i10--;
      }
      return;
    }
    let n10 = e206 - t10;
    for (; n10 > 0; ) {
      let e207 = this._renderedRulers.pop();
      this.domNode.removeChild(e207), n10--;
    }
  }
  render(e206) {
    this._ensureRulersCount();
    for (let t10 = 0, n10 = this._rulers.length; t10 < n10; t10++) {
      let n11 = this._renderedRulers[t10], r10 = this._rulers[t10];
      n11.setBoxShadow(r10.color ? `1px 0 0 0 ${r10.color} inset` : ``), n11.setHeight(Math.min(e206.scrollHeight, 1e6)), n11.setLeft(r10.column * this._typicalHalfwidthCharacterWidth);
    }
  }
}, cle = class extends Tb {
  constructor(e206) {
    super(e206), this._scrollTop = 0, this._width = 0, this._updateWidth(), this._shouldShow = false, this._useShadows = this._context.configuration.options.get(117).useShadows, this._domNode = _u(document.createElement(`div`)), this._domNode.setAttribute(`role`, `presentation`), this._domNode.setAttribute(`aria-hidden`, `true`);
  }
  dispose() {
    super.dispose();
  }
  _updateShouldShow() {
    let e206 = this._useShadows && this._scrollTop > 0;
    return this._shouldShow === e206 ? false : (this._shouldShow = e206, true);
  }
  getDomNode() {
    return this._domNode;
  }
  _updateWidth() {
    let e206 = this._context.configuration.options.get(165);
    e206.minimap.renderMinimap === 0 || e206.minimap.minimapWidth > 0 && e206.minimap.minimapLeft === 0 ? this._width = e206.width : this._width = e206.width - e206.verticalScrollbarWidth;
  }
  onConfigurationChanged(e206) {
    return this._useShadows = this._context.configuration.options.get(117).useShadows, this._updateWidth(), this._updateShouldShow(), true;
  }
  onScrollChanged(e206) {
    return this._scrollTop = e206.scrollTop, this._updateShouldShow();
  }
  prepareRender(e206) {
  }
  render(e206) {
    this._domNode.setWidth(this._width), this._domNode.setClassName(this._shouldShow ? `scroll-decoration` : ``);
  }
}, lle = class {
  constructor(e206) {
    this.left = e206.left, this.width = e206.width, this.startStyle = null, this.endStyle = null;
  }
}, ule = class {
  constructor(e206, t10) {
    this.lineNumber = e206, this.ranges = t10;
  }
};
function dle(e206) {
  return new lle(e206);
}
function fle(e206) {
  return new ule(e206.lineNumber, e206.ranges.map(dle));
}
var ple = (_ma = class extends HS {
  constructor(e206) {
    super(), this._previousFrameVisibleRangesWithStyle = [], this._context = e206;
    let t10 = this._context.configuration.options;
    this._roundedSelection = t10.get(115), this._typicalHalfwidthCharacterWidth = t10.get(59).typicalHalfwidthCharacterWidth, this._selections = [], this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options;
    return this._roundedSelection = t10.get(115), this._typicalHalfwidthCharacterWidth = t10.get(59).typicalHalfwidthCharacterWidth, true;
  }
  onCursorStateChanged(e206) {
    return this._selections = e206.selections.slice(0), true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  _visibleRangesHaveGaps(e206) {
    for (let t10 = 0, n10 = e206.length; t10 < n10; t10++) if (e206[t10].ranges.length > 1) return true;
    return false;
  }
  _enrichVisibleRangesWithStyle(e206, t10, n10) {
    let r10 = this._typicalHalfwidthCharacterWidth / 4, i10 = null, a10 = null;
    if (n10 && n10.length > 0 && t10.length > 0) {
      let r11 = t10[0].lineNumber;
      if (r11 === e206.startLineNumber) for (let e207 = 0; !i10 && e207 < n10.length; e207++) n10[e207].lineNumber === r11 && (i10 = n10[e207].ranges[0]);
      let o10 = t10[t10.length - 1].lineNumber;
      if (o10 === e206.endLineNumber) for (let e207 = n10.length - 1; !a10 && e207 >= 0; e207--) n10[e207].lineNumber === o10 && (a10 = n10[e207].ranges[0]);
      i10 && !i10.startStyle && (i10 = null), a10 && !a10.startStyle && (a10 = null);
    }
    for (let e207 = 0, n11 = t10.length; e207 < n11; e207++) {
      let o10 = t10[e207].ranges[0], s10 = o10.left, c10 = o10.left + o10.width, l10 = { top: 0, bottom: 0 }, u10 = { top: 0, bottom: 0 };
      if (e207 > 0) {
        let n12 = t10[e207 - 1].ranges[0].left, i11 = t10[e207 - 1].ranges[0].left + t10[e207 - 1].ranges[0].width;
        WC(s10 - n12) < r10 ? l10.top = 2 : s10 > n12 && (l10.top = 1), WC(c10 - i11) < r10 ? u10.top = 2 : n12 < c10 && c10 < i11 && (u10.top = 1);
      } else i10 && (l10.top = i10.startStyle.top, u10.top = i10.endStyle.top);
      if (e207 + 1 < n11) {
        let n12 = t10[e207 + 1].ranges[0].left, i11 = t10[e207 + 1].ranges[0].left + t10[e207 + 1].ranges[0].width;
        WC(s10 - n12) < r10 ? l10.bottom = 2 : n12 < s10 && s10 < i11 && (l10.bottom = 1), WC(c10 - i11) < r10 ? u10.bottom = 2 : c10 < i11 && (u10.bottom = 1);
      } else a10 && (l10.bottom = a10.startStyle.bottom, u10.bottom = a10.endStyle.bottom);
      o10.startStyle = l10, o10.endStyle = u10;
    }
  }
  _getVisibleRangesWithStyle(e206, t10, n10) {
    let r10 = (t10.linesVisibleRangesForRange(e206, true) || []).map(fle);
    return !this._visibleRangesHaveGaps(r10) && this._roundedSelection && this._enrichVisibleRangesWithStyle(t10.visibleRange, r10, n10), r10;
  }
  _createSelectionPiece(e206, t10, n10, r10, i10) {
    return `<div class="cslr ` + n10 + `" style="top:` + e206.toString() + `px;bottom:` + t10.toString() + `px;left:` + r10.toString() + `px;width:` + i10.toString() + `px;"></div>`;
  }
  _actualRenderOneSelection(t10, n10, r10, i10) {
    if (i10.length === 0) return;
    let a10 = !!i10[0].ranges[0].startStyle, o10 = i10[0].lineNumber, s10 = i10[i10.length - 1].lineNumber;
    for (let c10 = 0, l10 = i10.length; c10 < l10; c10++) {
      let l11 = i10[c10], u10 = l11.lineNumber, d10 = u10 - n10, f10 = r10 ? +(u10 === o10) : 0, p10 = r10 ? +(u10 !== o10 && u10 === s10) : 0, m10 = ``, h10 = ``;
      for (let t11 = 0, n11 = l11.ranges.length; t11 < n11; t11++) {
        let n12 = l11.ranges[t11];
        if (a10) {
          let t12 = n12.startStyle, r12 = n12.endStyle;
          if (t12.top === 1 || t12.bottom === 1) {
            m10 += this._createSelectionPiece(f10, p10, _ma.SELECTION_CLASS_NAME, n12.left - _ma.ROUNDED_PIECE_WIDTH, _ma.ROUNDED_PIECE_WIDTH);
            let r13 = _ma.EDITOR_BACKGROUND_CLASS_NAME;
            t12.top === 1 && (r13 += ` ` + _ma.SELECTION_TOP_RIGHT), t12.bottom === 1 && (r13 += ` ` + _ma.SELECTION_BOTTOM_RIGHT), m10 += this._createSelectionPiece(f10, p10, r13, n12.left - _ma.ROUNDED_PIECE_WIDTH, _ma.ROUNDED_PIECE_WIDTH);
          }
          if (r12.top === 1 || r12.bottom === 1) {
            m10 += this._createSelectionPiece(f10, p10, _ma.SELECTION_CLASS_NAME, n12.left + n12.width, _ma.ROUNDED_PIECE_WIDTH);
            let t13 = _ma.EDITOR_BACKGROUND_CLASS_NAME;
            r12.top === 1 && (t13 += ` ` + _ma.SELECTION_TOP_LEFT), r12.bottom === 1 && (t13 += ` ` + _ma.SELECTION_BOTTOM_LEFT), m10 += this._createSelectionPiece(f10, p10, t13, n12.left + n12.width, _ma.ROUNDED_PIECE_WIDTH);
          }
        }
        let r11 = _ma.SELECTION_CLASS_NAME;
        if (a10) {
          let t12 = n12.startStyle, i11 = n12.endStyle;
          t12.top === 0 && (r11 += ` ` + _ma.SELECTION_TOP_LEFT), t12.bottom === 0 && (r11 += ` ` + _ma.SELECTION_BOTTOM_LEFT), i11.top === 0 && (r11 += ` ` + _ma.SELECTION_TOP_RIGHT), i11.bottom === 0 && (r11 += ` ` + _ma.SELECTION_BOTTOM_RIGHT);
        }
        h10 += this._createSelectionPiece(f10, p10, r11, n12.left, n12.width);
      }
      t10[d10][0] += m10, t10[d10][1] += h10;
    }
  }
  prepareRender(e206) {
    let t10 = [], n10 = e206.visibleRange.startLineNumber, r10 = e206.visibleRange.endLineNumber;
    for (let e207 = n10; e207 <= r10; e207++) {
      let r11 = e207 - n10;
      t10[r11] = [``, ``];
    }
    let i10 = [];
    for (let r11 = 0, a10 = this._selections.length; r11 < a10; r11++) {
      let a11 = this._selections[r11];
      if (a11.isEmpty()) {
        i10[r11] = null;
        continue;
      }
      let o10 = this._getVisibleRangesWithStyle(a11, e206, this._previousFrameVisibleRangesWithStyle[r11]);
      i10[r11] = o10, this._actualRenderOneSelection(t10, n10, this._selections.length > 1, o10);
    }
    this._previousFrameVisibleRangesWithStyle = i10, this._renderResult = t10.map(([e207, t11]) => e207 + t11);
  }
  render(e206, t10) {
    if (!this._renderResult) return ``;
    let n10 = t10 - e206;
    return n10 < 0 || n10 >= this._renderResult.length ? `` : this._renderResult[n10];
  }
}, _ma.SELECTION_CLASS_NAME = `selected-text`, _ma.SELECTION_TOP_LEFT = `top-left-radius`, _ma.SELECTION_BOTTOM_LEFT = `bottom-left-radius`, _ma.SELECTION_TOP_RIGHT = `top-right-radius`, _ma.SELECTION_BOTTOM_RIGHT = `bottom-right-radius`, _ma.EDITOR_BACKGROUND_CLASS_NAME = `monaco-editor-background`, _ma.ROUNDED_PIECE_WIDTH = 10, _ma);
JS((e206, t10) => {
  let n10 = e206.getColor(vv);
  n10 && !n10.isTransparent() && t10.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n10}; }`);
});
function WC(e206) {
  return e206 < 0 ? -e206 : e206;
}
var GC = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.top = e206, this.left = t10, this.paddingLeft = n10, this.width = r10, this.height = i10, this.textContent = a10, this.textContentClassName = o10;
  }
}, KC;
(function(e206) {
  e206[e206.Single = 0] = `Single`, e206[e206.MultiPrimary = 1] = `MultiPrimary`, e206[e206.MultiSecondary = 2] = `MultiSecondary`;
})(KC || (KC = {}));
var qC = class {
  constructor(e206, t10) {
    this._context = e206;
    let n10 = this._context.configuration.options, r10 = n10.get(59);
    this._cursorStyle = n10.get(161), this._typicalHalfwidthCharacterWidth = r10.typicalHalfwidthCharacterWidth, this._lineCursorWidth = Math.min(n10.get(37), this._typicalHalfwidthCharacterWidth), this._lineCursorHeight = n10.get(38), this._isVisible = true, this._domNode = _u(document.createElement(`div`)), this._domNode.setClassName(`cursor ${SC}`), this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)), this._domNode.setTop(0), this._domNode.setLeft(0), vu(this._domNode, r10), this._domNode.setDisplay(`none`), this._position = new j(1, 1), this._pluralityClass = ``, this.setPlurality(t10), this._lastRenderedContent = ``, this._renderData = null;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._position;
  }
  setPlurality(e206) {
    switch (e206) {
      default:
      case KC.Single:
        this._pluralityClass = ``;
        break;
      case KC.MultiPrimary:
        this._pluralityClass = `cursor-primary`;
        break;
      case KC.MultiSecondary:
        this._pluralityClass = `cursor-secondary`;
        break;
    }
  }
  show() {
    this._isVisible || (this._isVisible = (this._domNode.setVisibility(`inherit`), true));
  }
  hide() {
    this._isVisible && (this._isVisible = (this._domNode.setVisibility(`hidden`), false));
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(59);
    return this._cursorStyle = t10.get(161), this._typicalHalfwidthCharacterWidth = n10.typicalHalfwidthCharacterWidth, this._lineCursorWidth = Math.min(t10.get(37), this._typicalHalfwidthCharacterWidth), this._lineCursorHeight = t10.get(38), vu(this._domNode, n10), true;
  }
  onCursorPositionChanged(e206, t10) {
    return t10 ? this._domNode.domNode.style.transitionProperty = `none` : this._domNode.domNode.style.transitionProperty = ``, this._position = e206, true;
  }
  _getGraphemeAwarePosition() {
    let { lineNumber: e206, column: t10 } = this._position, n10 = this._context.viewModel.getLineContent(e206), [r10, i10] = wte(n10, t10 - 1);
    return [new j(e206, r10 + 1), n10.substring(r10, i10)];
  }
  _prepareRender(e206) {
    let t10 = ``, n10 = ``, [r10, i10] = this._getGraphemeAwarePosition(), a10 = this._context.viewLayout.getLineHeightForLineNumber(r10.lineNumber), o10 = this._lineCursorHeight === 0 ? a10 : Math.min(a10, this._lineCursorHeight), s10 = (a10 - o10) / 2;
    if (this._cursorStyle === Un.Line || this._cursorStyle === Un.LineThin) {
      let a11 = e206.visibleRangeForPosition(r10);
      if (!a11 || a11.outsideRenderedLine) return null;
      let c11 = Vc(this._domNode.domNode), l11;
      this._cursorStyle === Un.Line ? (l11 = $l(c11, this._lineCursorWidth > 0 ? this._lineCursorWidth : 2), l11 > 2 && (t10 = i10, n10 = this._getTokenClassName(r10))) : l11 = $l(c11, 1);
      let u11 = a11.left, d11 = 0;
      return l11 >= 2 && u11 >= 1 && (d11 = 1, u11 -= d11), new GC(e206.getVerticalOffsetForLineNumber(r10.lineNumber) - e206.bigNumbersDelta + s10, u11, d11, l11, o10, t10, n10);
    }
    let c10 = e206.linesVisibleRangesForRange(new M(r10.lineNumber, r10.column, r10.lineNumber, r10.column + i10.length), false);
    if (!c10 || c10.length === 0) return null;
    let l10 = c10[0];
    if (l10.outsideRenderedLine || l10.ranges.length === 0) return null;
    let u10 = l10.ranges[0], d10 = i10 === `	` || u10.width < 1 ? this._typicalHalfwidthCharacterWidth : u10.width;
    this._cursorStyle === Un.Block && (t10 = i10, n10 = this._getTokenClassName(r10));
    let f10 = e206.getVerticalOffsetForLineNumber(r10.lineNumber) - e206.bigNumbersDelta, p10 = a10;
    return (this._cursorStyle === Un.Underline || this._cursorStyle === Un.UnderlineThin) && (f10 += a10 - 2, p10 = 2), new GC(f10, u10.left, 0, d10, p10, t10, n10);
  }
  _getTokenClassName(e206) {
    let t10 = this._context.viewModel.getViewLineData(e206.lineNumber), n10 = t10.tokens.findTokenIndexAtOffset(e206.column - 1);
    return t10.tokens.getClassName(n10);
  }
  prepareRender(e206) {
    this._renderData = this._prepareRender(e206);
  }
  render(e206) {
    return this._renderData ? (this._lastRenderedContent !== this._renderData.textContent && (this._lastRenderedContent = this._renderData.textContent, this._domNode.domNode.textContent = this._lastRenderedContent), this._domNode.setClassName(`cursor ${this._pluralityClass} ${SC} ${this._renderData.textContentClassName}`), this._domNode.setDisplay(`block`), this._domNode.setTop(this._renderData.top), this._domNode.setLeft(this._renderData.left), this._domNode.setPaddingLeft(this._renderData.paddingLeft), this._domNode.setWidth(this._renderData.width), this._domNode.setLineHeight(this._renderData.height), this._domNode.setHeight(this._renderData.height), { domNode: this._domNode.domNode, position: this._position, contentLeft: this._renderData.left, height: this._renderData.height, width: 2 }) : (this._domNode.setDisplay(`none`), null);
  }
}, mle = (_na = class extends Tb {
  constructor(e206) {
    super(e206);
    let t10 = this._context.configuration.options;
    this._readOnly = t10.get(104), this._cursorBlinking = t10.get(32), this._cursorStyle = t10.get(161), this._cursorSmoothCaretAnimation = t10.get(33), this._editContextEnabled = t10.get(170), this._selectionIsEmpty = true, this._isComposingInput = false, this._isVisible = false, this._primaryCursor = new qC(this._context, KC.Single), this._secondaryCursors = [], this._renderData = [], this._domNode = _u(document.createElement(`div`)), this._domNode.setAttribute(`role`, `presentation`), this._domNode.setAttribute(`aria-hidden`, `true`), this._updateDomClassName(), this._domNode.appendChild(this._primaryCursor.getDomNode()), this._startCursorBlinkAnimation = new cs(), this._cursorFlatBlinkInterval = new ll(), this._blinkingEnabled = false, this._editorHasFocus = false, this._updateBlinking();
  }
  dispose() {
    super.dispose(), this._startCursorBlinkAnimation.dispose(), this._cursorFlatBlinkInterval.dispose();
  }
  getDomNode() {
    return this._domNode;
  }
  onCompositionStart(e206) {
    return this._isComposingInput = true, this._updateBlinking(), true;
  }
  onCompositionEnd(e206) {
    return this._isComposingInput = false, this._updateBlinking(), true;
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options;
    this._readOnly = t10.get(104), this._cursorBlinking = t10.get(32), this._cursorStyle = t10.get(161), this._cursorSmoothCaretAnimation = t10.get(33), this._editContextEnabled = t10.get(170), this._updateBlinking(), this._updateDomClassName(), this._primaryCursor.onConfigurationChanged(e206);
    for (let t11 = 0, n10 = this._secondaryCursors.length; t11 < n10; t11++) this._secondaryCursors[t11].onConfigurationChanged(e206);
    return true;
  }
  _onCursorPositionChanged(e206, t10, n10) {
    let r10 = this._secondaryCursors.length !== t10.length || this._cursorSmoothCaretAnimation === `explicit` && n10 !== 3;
    if (this._primaryCursor.setPlurality(t10.length ? KC.MultiPrimary : KC.Single), this._primaryCursor.onCursorPositionChanged(e206, r10), this._updateBlinking(), this._secondaryCursors.length < t10.length) {
      let e207 = t10.length - this._secondaryCursors.length;
      for (let t11 = 0; t11 < e207; t11++) {
        let e208 = new qC(this._context, KC.MultiSecondary);
        this._domNode.domNode.insertBefore(e208.getDomNode().domNode, this._primaryCursor.getDomNode().domNode.nextSibling), this._secondaryCursors.push(e208);
      }
    } else if (this._secondaryCursors.length > t10.length) {
      let e207 = this._secondaryCursors.length - t10.length;
      for (let t11 = 0; t11 < e207; t11++) this._domNode.removeChild(this._secondaryCursors[0].getDomNode()), this._secondaryCursors.splice(0, 1);
    }
    for (let e207 = 0; e207 < t10.length; e207++) this._secondaryCursors[e207].onCursorPositionChanged(t10[e207], r10);
  }
  onCursorStateChanged(e206) {
    let t10 = [];
    for (let n11 = 0, r10 = e206.selections.length; n11 < r10; n11++) t10[n11] = e206.selections[n11].getPosition();
    this._onCursorPositionChanged(t10[0], t10.slice(1), e206.reason);
    let n10 = e206.selections[0].isEmpty();
    return this._selectionIsEmpty !== n10 && (this._selectionIsEmpty = n10, this._updateDomClassName()), true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onFocusChanged(e206) {
    return this._editorHasFocus = e206.isFocused, this._updateBlinking(), false;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return true;
  }
  onTokensChanged(e206) {
    let t10 = (t11) => {
      for (let n10 = 0, r10 = e206.ranges.length; n10 < r10; n10++) if (e206.ranges[n10].fromLineNumber <= t11.lineNumber && t11.lineNumber <= e206.ranges[n10].toLineNumber) return true;
      return false;
    };
    if (t10(this._primaryCursor.getPosition())) return true;
    for (let e207 of this._secondaryCursors) if (t10(e207.getPosition())) return true;
    return false;
  }
  onZonesChanged(e206) {
    return true;
  }
  _getCursorBlinking() {
    return this._isComposingInput && !this._editContextEnabled || !this._editorHasFocus ? 0 : this._readOnly ? 5 : this._cursorBlinking;
  }
  _updateBlinking() {
    this._startCursorBlinkAnimation.cancel(), this._cursorFlatBlinkInterval.cancel();
    let t10 = this._getCursorBlinking(), n10 = t10 === 0, r10 = t10 === 5;
    n10 ? this._hide() : this._show(), this._blinkingEnabled = false, this._updateDomClassName(), !n10 && !r10 && (t10 === 1 ? this._cursorFlatBlinkInterval.cancelAndSet(() => {
      this._isVisible ? this._hide() : this._show();
    }, _na.BLINK_INTERVAL, Vc(this._domNode.domNode)) : this._startCursorBlinkAnimation.setIfNotSet(() => {
      this._blinkingEnabled = true, this._updateDomClassName();
    }, _na.BLINK_INTERVAL));
  }
  _updateDomClassName() {
    this._domNode.setClassName(this._getClassName());
  }
  _getClassName() {
    let e206 = `cursors-layer`;
    switch (this._selectionIsEmpty || (e206 += ` has-selection`), this._cursorStyle) {
      case Un.Line:
        e206 += ` cursor-line-style`;
        break;
      case Un.Block:
        e206 += ` cursor-block-style`;
        break;
      case Un.Underline:
        e206 += ` cursor-underline-style`;
        break;
      case Un.LineThin:
        e206 += ` cursor-line-thin-style`;
        break;
      case Un.BlockOutline:
        e206 += ` cursor-block-outline-style`;
        break;
      case Un.UnderlineThin:
        e206 += ` cursor-underline-thin-style`;
        break;
      default:
        e206 += ` cursor-line-style`;
    }
    if (this._blinkingEnabled) switch (this._getCursorBlinking()) {
      case 1:
        e206 += ` cursor-blink`;
        break;
      case 2:
        e206 += ` cursor-smooth`;
        break;
      case 3:
        e206 += ` cursor-phase`;
        break;
      case 4:
        e206 += ` cursor-expand`;
        break;
      case 5:
        e206 += ` cursor-solid`;
        break;
      default:
        e206 += ` cursor-solid`;
    }
    else e206 += ` cursor-solid`;
    return (this._cursorSmoothCaretAnimation === `on` || this._cursorSmoothCaretAnimation === `explicit`) && (e206 += ` cursor-smooth-caret-animation`), e206;
  }
  _show() {
    this._primaryCursor.show();
    for (let e206 = 0, t10 = this._secondaryCursors.length; e206 < t10; e206++) this._secondaryCursors[e206].show();
    this._isVisible = true;
  }
  _hide() {
    this._primaryCursor.hide();
    for (let e206 = 0, t10 = this._secondaryCursors.length; e206 < t10; e206++) this._secondaryCursors[e206].hide();
    this._isVisible = false;
  }
  prepareRender(e206) {
    this._primaryCursor.prepareRender(e206);
    for (let t10 = 0, n10 = this._secondaryCursors.length; t10 < n10; t10++) this._secondaryCursors[t10].prepareRender(e206);
  }
  render(e206) {
    let t10 = [], n10 = 0, r10 = this._primaryCursor.render(e206);
    r10 && (t10[n10++] = r10);
    for (let r11 = 0, i10 = this._secondaryCursors.length; r11 < i10; r11++) {
      let i11 = this._secondaryCursors[r11].render(e206);
      i11 && (t10[n10++] = i11);
    }
    this._renderData = t10;
  }
  getLastRenderData() {
    return this._renderData;
  }
}, _na.BLINK_INTERVAL = 500, _na);
JS((e206, t10) => {
  let n10 = [{ class: `.cursor`, foreground: ZS, background: QS }, { class: `.cursor-primary`, foreground: $S, background: Gse }, { class: `.cursor-secondary`, foreground: eC, background: Kse }];
  for (let r10 of n10) {
    let n11 = e206.getColor(r10.foreground);
    if (n11) {
      let i10 = e206.getColor(r10.background);
      i10 || (i10 = n11.opposite()), t10.addRule(`.monaco-editor .cursors-layer ${r10.class} { background-color: ${n11}; border-color: ${n11}; color: ${i10}; }`), Fb(e206.type) && t10.addRule(`.monaco-editor .cursors-layer.has-selection ${r10.class} { border-left: 1px solid ${i10}; border-right: 1px solid ${i10}; }`);
    }
  }
});
var JC = () => {
  throw Error(`Invalid change accessor`);
}, hle = class extends Tb {
  constructor(e206) {
    super(e206);
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    this._lineHeight = t10.get(75), this._contentWidth = n10.contentWidth, this._contentLeft = n10.contentLeft, this.domNode = _u(document.createElement(`div`)), this.domNode.setClassName(`view-zones`), this.domNode.setPosition(`absolute`), this.domNode.setAttribute(`role`, `presentation`), this.domNode.setAttribute(`aria-hidden`, `true`), this.marginDomNode = _u(document.createElement(`div`)), this.marginDomNode.setClassName(`margin-view-zones`), this.marginDomNode.setPosition(`absolute`), this.marginDomNode.setAttribute(`role`, `presentation`), this.marginDomNode.setAttribute(`aria-hidden`, `true`), this._zones = {};
  }
  dispose() {
    super.dispose(), this._zones = {};
  }
  _recomputeWhitespacesProps() {
    let e206 = this._context.viewLayout.getWhitespaces(), t10 = /* @__PURE__ */ new Map();
    for (let n11 of e206) t10.set(n11.id, n11);
    let n10 = false;
    return this._context.viewModel.changeWhitespace((e207) => {
      let r10 = Object.keys(this._zones);
      for (let i10 = 0, a10 = r10.length; i10 < a10; i10++) {
        let a11 = r10[i10], o10 = this._zones[a11], s10 = this._computeWhitespaceProps(o10.delegate);
        o10.isInHiddenArea = s10.isInHiddenArea;
        let c10 = t10.get(a11);
        c10 && (c10.afterLineNumber !== s10.afterViewLineNumber || c10.height !== s10.heightInPx) && (e207.changeOneWhitespace(a11, s10.afterViewLineNumber, s10.heightInPx), this._safeCallOnComputedHeight(o10.delegate, s10.heightInPx), n10 = true);
      }
    }), n10;
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    return this._lineHeight = t10.get(75), this._contentWidth = n10.contentWidth, this._contentLeft = n10.contentLeft, e206.hasChanged(75) && this._recomputeWhitespacesProps(), true;
  }
  onLineMappingChanged(e206) {
    return this._recomputeWhitespacesProps();
  }
  onLinesDeleted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged || e206.scrollWidthChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  _getZoneOrdinal(e206) {
    return e206.ordinal ?? e206.afterColumn ?? 1e4;
  }
  _computeWhitespaceProps(e206) {
    if (e206.afterLineNumber === 0) return { isInHiddenArea: false, afterViewLineNumber: 0, heightInPx: this._heightInPixels(e206), minWidthInPx: this._minWidthInPixels(e206) };
    let t10;
    if (e206.afterColumn !== void 0) t10 = this._context.viewModel.model.validatePosition({ lineNumber: e206.afterLineNumber, column: e206.afterColumn });
    else {
      let n11 = this._context.viewModel.model.validatePosition({ lineNumber: e206.afterLineNumber, column: 1 }).lineNumber;
      t10 = new j(n11, this._context.viewModel.model.getLineMaxColumn(n11));
    }
    let n10;
    n10 = t10.column === this._context.viewModel.model.getLineMaxColumn(t10.lineNumber) ? this._context.viewModel.model.validatePosition({ lineNumber: t10.lineNumber + 1, column: 1 }) : this._context.viewModel.model.validatePosition({ lineNumber: t10.lineNumber, column: t10.column + 1 });
    let r10 = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t10, e206.afterColumnAffinity, true), i10 = e206.showInHiddenAreas || this._context.viewModel.coordinatesConverter.modelPositionIsVisible(n10);
    return { isInHiddenArea: !i10, afterViewLineNumber: r10.lineNumber, heightInPx: i10 ? this._heightInPixels(e206) : 0, minWidthInPx: this._minWidthInPixels(e206) };
  }
  changeViewZones(e206) {
    let t10 = false;
    return this._context.viewModel.changeWhitespace((n10) => {
      let r10 = { addZone: (e207) => (t10 = true, this._addZone(n10, e207)), removeZone: (e207) => {
        e207 && (t10 = this._removeZone(n10, e207) || t10);
      }, layoutZone: (e207) => {
        e207 && (t10 = this._layoutZone(n10, e207) || t10);
      } };
      gle(e206, r10), r10.addZone = JC, r10.removeZone = JC, r10.layoutZone = JC;
    }), t10;
  }
  _addZone(e206, t10) {
    let n10 = this._computeWhitespaceProps(t10), r10 = { whitespaceId: e206.insertWhitespace(n10.afterViewLineNumber, this._getZoneOrdinal(t10), n10.heightInPx, n10.minWidthInPx), delegate: t10, isInHiddenArea: n10.isInHiddenArea, isVisible: false, domNode: _u(t10.domNode), marginDomNode: t10.marginDomNode ? _u(t10.marginDomNode) : null };
    return this._safeCallOnComputedHeight(r10.delegate, n10.heightInPx), r10.domNode.setPosition(`absolute`), r10.domNode.domNode.style.width = `100%`, r10.domNode.setDisplay(`none`), r10.domNode.setAttribute(`monaco-view-zone`, r10.whitespaceId), this.domNode.appendChild(r10.domNode), r10.marginDomNode && (r10.marginDomNode.setPosition(`absolute`), r10.marginDomNode.domNode.style.width = `100%`, r10.marginDomNode.setDisplay(`none`), r10.marginDomNode.setAttribute(`monaco-view-zone`, r10.whitespaceId), this.marginDomNode.appendChild(r10.marginDomNode)), this._zones[r10.whitespaceId] = r10, this.setShouldRender(), r10.whitespaceId;
  }
  _removeZone(e206, t10) {
    if (this._zones.hasOwnProperty(t10)) {
      let n10 = this._zones[t10];
      return delete this._zones[t10], e206.removeWhitespace(n10.whitespaceId), n10.domNode.removeAttribute(`monaco-visible-view-zone`), n10.domNode.removeAttribute(`monaco-view-zone`), n10.domNode.domNode.remove(), n10.marginDomNode && (n10.marginDomNode.removeAttribute(`monaco-visible-view-zone`), n10.marginDomNode.removeAttribute(`monaco-view-zone`), n10.marginDomNode.domNode.remove()), this.setShouldRender(), true;
    }
    return false;
  }
  _layoutZone(e206, t10) {
    if (this._zones.hasOwnProperty(t10)) {
      let n10 = this._zones[t10], r10 = this._computeWhitespaceProps(n10.delegate);
      return n10.isInHiddenArea = r10.isInHiddenArea, e206.changeOneWhitespace(n10.whitespaceId, r10.afterViewLineNumber, r10.heightInPx), this._safeCallOnComputedHeight(n10.delegate, r10.heightInPx), this.setShouldRender(), true;
    }
    return false;
  }
  shouldSuppressMouseDownOnViewZone(e206) {
    return this._zones.hasOwnProperty(e206) ? !!this._zones[e206].delegate.suppressMouseDown : false;
  }
  _heightInPixels(e206) {
    return typeof e206.heightInPx == `number` ? e206.heightInPx : typeof e206.heightInLines == `number` ? this._lineHeight * e206.heightInLines : this._lineHeight;
  }
  _minWidthInPixels(e206) {
    return typeof e206.minWidthInPx == `number` ? e206.minWidthInPx : 0;
  }
  _safeCallOnComputedHeight(e206, t10) {
    if (typeof e206.onComputedHeight == `function`) try {
      e206.onComputedHeight(t10);
    } catch (e207) {
      be(e207);
    }
  }
  _safeCallOnDomNodeTop(e206, t10) {
    if (typeof e206.onDomNodeTop == `function`) try {
      e206.onDomNodeTop(t10);
    } catch (e207) {
      be(e207);
    }
  }
  prepareRender(e206) {
  }
  render(e206) {
    let t10 = e206.viewportData.whitespaceViewportData, n10 = {}, r10 = false;
    for (let e207 of t10) this._zones[e207.id].isInHiddenArea || (n10[e207.id] = e207, r10 = true);
    let i10 = Object.keys(this._zones);
    for (let t11 = 0, r11 = i10.length; t11 < r11; t11++) {
      let r12 = i10[t11], a10 = this._zones[r12], o10 = 0, s10 = 0, c10 = `none`;
      n10.hasOwnProperty(r12) ? (o10 = n10[r12].verticalOffset - e206.bigNumbersDelta, s10 = n10[r12].height, c10 = `block`, a10.isVisible || (a10.isVisible = (a10.domNode.setAttribute(`monaco-visible-view-zone`, `true`), true)), this._safeCallOnDomNodeTop(a10.delegate, e206.getScrolledTopFromAbsoluteTop(n10[r12].verticalOffset))) : (a10.isVisible && (a10.isVisible = (a10.domNode.removeAttribute(`monaco-visible-view-zone`), false)), this._safeCallOnDomNodeTop(a10.delegate, e206.getScrolledTopFromAbsoluteTop(-1e6))), a10.domNode.setTop(o10), a10.domNode.setHeight(s10), a10.domNode.setDisplay(c10), a10.marginDomNode && (a10.marginDomNode.setTop(o10), a10.marginDomNode.setHeight(s10), a10.marginDomNode.setDisplay(c10));
    }
    r10 && (this.domNode.setWidth(Math.max(e206.scrollWidth, this._contentWidth)), this.marginDomNode.setWidth(this._contentLeft));
  }
};
function gle(e206, t10) {
  try {
    return e206(t10);
  } catch (e207) {
    be(e207);
    return;
  }
}
var _le = class extends HS {
  constructor(e206) {
    super(), this._context = e206, this._options = new YC(this._context.configuration), this._selection = [], this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    let t10 = new YC(this._context.configuration);
    return this._options.equals(t10) ? e206.hasChanged(165) : (this._options = t10, true);
  }
  onCursorStateChanged(e206) {
    return this._selection = e206.selections, this._options.renderWhitespace === `selection`;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  prepareRender(e206) {
    if (this._options.renderWhitespace === `none`) {
      this._renderResult = null;
      return;
    }
    let t10 = e206.visibleRange.startLineNumber, n10 = e206.visibleRange.endLineNumber - t10 + 1, r10 = Array(n10);
    for (let e207 = 0; e207 < n10; e207++) r10[e207] = true;
    this._renderResult = [];
    for (let t11 = e206.viewportData.startLineNumber; t11 <= e206.viewportData.endLineNumber; t11++) {
      let n11 = t11 - e206.viewportData.startLineNumber, r11 = this._context.viewModel.getViewLineRenderingData(t11), i10 = null;
      if (this._options.renderWhitespace === `selection`) {
        let e207 = this._selection;
        for (let n12 of e207) {
          if (n12.endLineNumber < t11 || n12.startLineNumber > t11) continue;
          let e208 = n12.startLineNumber === t11 ? n12.startColumn : r11.minColumn, a10 = n12.endLineNumber === t11 ? n12.endColumn : r11.maxColumn;
          e208 < a10 && (i10 || (i10 = []), i10.push(new Tm(e208 - 1, a10 - 1)));
        }
      }
      this._renderResult[n11] = this._applyRenderWhitespace(e206, t11, i10, r11);
    }
  }
  _applyRenderWhitespace(e206, t10, n10, r10) {
    if (r10.hasVariableFonts || this._options.renderWhitespace === `selection` && !n10 || this._options.renderWhitespace === `trailing` && r10.continuesWithWrappedLine) return ``;
    let i10 = this._context.theme.getColor(tC), a10 = this._options.renderWithSVG, o10 = r10.content, s10 = this._options.stopRenderingLineAfter === -1 ? o10.length : Math.min(this._options.stopRenderingLineAfter, o10.length), c10 = r10.continuesWithWrappedLine, l10 = r10.minColumn - 1, u10 = this._options.renderWhitespace === `boundary`, d10 = this._options.renderWhitespace === `trailing`, f10 = e206.getLineHeightForLineNumber(t10), p10 = this._options.middotWidth, m10 = this._options.wsmiddotWidth, h10 = this._options.spaceWidth, g10 = Math.abs(m10 - h10) < Math.abs(p10 - h10) ? 11825 : 183, _10 = this._options.canUseHalfwidthRightwardsArrow, v10 = ``, y10 = false, b10 = Ga(o10), x10;
    b10 === -1 ? (y10 = true, b10 = s10, x10 = s10) : x10 = qa(o10);
    let S10 = 0, ee2 = n10 && n10[S10], te2 = 0;
    for (let r11 = l10; r11 < s10; r11++) {
      let i11 = o10.charCodeAt(r11);
      if (ee2 && ee2.endExclusive <= r11 && (S10++, ee2 = n10 && n10[S10]), i11 !== 9 && i11 !== 32 || d10 && !y10 && r11 <= x10) continue;
      if (u10 && r11 >= b10 && r11 <= x10 && i11 === 32) {
        let e207 = r11 - 1 >= 0 ? o10.charCodeAt(r11 - 1) : 0, t11 = r11 + 1 < s10 ? o10.charCodeAt(r11 + 1) : 0;
        if (e207 !== 32 && t11 !== 32) continue;
      }
      if (u10 && c10 && r11 === s10 - 1) {
        let e207 = r11 - 1 >= 0 ? o10.charCodeAt(r11 - 1) : 0;
        if (i11 === 32 && e207 !== 32 && e207 !== 9) continue;
      }
      if (n10 && !(ee2 && ee2.start <= r11 && r11 < ee2.endExclusive)) continue;
      let l11 = e206.visibleRangeForPosition(new j(t10, r11 + 1));
      l11 && (a10 ? (te2 = Math.max(te2, l11.left), i11 === 9 ? v10 += this._renderArrow(f10, h10, l11.left) : v10 += `<circle cx="${(l11.left + h10 / 2).toFixed(2)}" cy="${(f10 / 2).toFixed(2)}" r="${(h10 / 7).toFixed(2)}" />`) : i11 === 9 ? v10 += `<div class="mwh" style="left:${l11.left}px;height:${f10}px;">${_10 ? `\uFFEB` : `\u2192`}</div>` : v10 += `<div class="mwh" style="left:${l11.left}px;height:${f10}px;">${String.fromCharCode(g10)}</div>`);
    }
    return a10 ? (te2 = Math.round(te2 + h10), `<svg style="bottom:0;position:absolute;width:${te2}px;height:${f10}px" viewBox="0 0 ${te2} ${f10}" xmlns="http://www.w3.org/2000/svg" fill="${i10}">` + v10 + `</svg>`) : v10;
  }
  _renderArrow(e206, t10, n10) {
    let r10 = t10 / 7, i10 = t10, a10 = e206 / 2, o10 = n10, s10 = { x: 0, y: r10 / 2 }, c10 = { x: 100 / 125 * i10, y: s10.y }, l10 = { x: c10.x - 0.2 * c10.x, y: c10.y + 0.2 * c10.x }, u10 = { x: l10.x + 0.1 * c10.x, y: l10.y + 0.1 * c10.x }, d10 = { x: u10.x + 0.35 * c10.x, y: u10.y - 0.35 * c10.x };
    return `<path d="M ${[s10, c10, l10, u10, d10, { x: d10.x, y: -d10.y }, { x: u10.x, y: -u10.y }, { x: l10.x, y: -l10.y }, { x: c10.x, y: -c10.y }, { x: s10.x, y: -s10.y }].map((e207) => `${(o10 + e207.x).toFixed(2)} ${(a10 + e207.y).toFixed(2)}`).join(` L `)}" />`;
  }
  render(e206, t10) {
    if (!this._renderResult) return ``;
    let n10 = t10 - e206;
    return n10 < 0 || n10 >= this._renderResult.length ? `` : this._renderResult[n10];
  }
}, YC = class {
  constructor(e206) {
    let t10 = e206.options, n10 = t10.get(59), r10 = t10.get(47);
    r10 === `off` ? (this.renderWhitespace = `none`, this.renderWithSVG = false) : r10 === `svg` ? (this.renderWhitespace = t10.get(113), this.renderWithSVG = true) : (this.renderWhitespace = t10.get(113), this.renderWithSVG = false), this.spaceWidth = n10.spaceWidth, this.middotWidth = n10.middotWidth, this.wsmiddotWidth = n10.wsmiddotWidth, this.canUseHalfwidthRightwardsArrow = n10.canUseHalfwidthRightwardsArrow, this.lineHeight = t10.get(75), this.stopRenderingLineAfter = t10.get(133);
  }
  equals(e206) {
    return this.renderWhitespace === e206.renderWhitespace && this.renderWithSVG === e206.renderWithSVG && this.spaceWidth === e206.spaceWidth && this.middotWidth === e206.middotWidth && this.wsmiddotWidth === e206.wsmiddotWidth && this.canUseHalfwidthRightwardsArrow === e206.canUseHalfwidthRightwardsArrow && this.lineHeight === e206.lineHeight && this.stopRenderingLineAfter === e206.stopRenderingLineAfter;
  }
}, vle = class {
  constructor(e206, t10, n10, r10) {
    this.selections = e206, this.startLineNumber = t10.startLineNumber | 0, this.endLineNumber = t10.endLineNumber | 0, this.relativeVerticalOffset = t10.relativeVerticalOffset, this.bigNumbersDelta = t10.bigNumbersDelta | 0, this.lineHeight = t10.lineHeight | 0, this.whitespaceViewportData = n10, this._model = r10, this.visibleRange = new M(t10.startLineNumber, this._model.getLineMinColumn(t10.startLineNumber), t10.endLineNumber, this._model.getLineMaxColumn(t10.endLineNumber));
  }
  getViewLineRenderingData(e206) {
    return this._model.getViewportViewLineRenderingData(this.visibleRange, e206);
  }
  getDecorationsInViewport() {
    return this._model.getDecorationsInViewport(this.visibleRange);
  }
}, yle = class {
  get type() {
    return this._theme.type;
  }
  get value() {
    return this._theme;
  }
  constructor(e206) {
    this._theme = e206;
  }
  update(e206) {
    this._theme = e206;
  }
  getColor(e206) {
    return this._theme.getColor(e206);
  }
}, ble = class {
  constructor(e206, t10, n10) {
    this.configuration = e206, this.theme = new yle(t10), this.viewModel = n10, this.viewLayout = n10.viewLayout;
  }
  addEventHandler(e206) {
    this.viewModel.addViewEventHandler(e206);
  }
  removeEventHandler(e206) {
    this.viewModel.removeViewEventHandler(e206);
  }
}, XC = new Float32Array([1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0]);
function ZC(e206) {
  if (!e206) throw Error(`Value "${e206}" cannot be null`);
  return e206;
}
function QC(e206, t10, n10) {
  let r10 = new t10.ResizeObserver((t11) => {
    let i10 = t11.find((t12) => t12.target === e206);
    if (!i10) return;
    if (!(`devicePixelContentBoxSize` in i10)) {
      r10?.disconnect(), r10 = void 0;
      return;
    }
    let a10 = i10.devicePixelContentBoxSize[0].inlineSize, o10 = i10.devicePixelContentBoxSize[0].blockSize;
    a10 > 0 && o10 > 0 && n10(a10, o10);
  });
  try {
    r10.observe(e206, { box: [`device-pixel-content-box`] });
  } catch {
    throw r10.disconnect(), r10 = void 0, new je(`Could not observe device pixel dimensions`);
  }
  return T(() => r10?.disconnect());
}
var xle = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Sle = 0, $C = class extends D {
  get cacheKey() {
    return `${this.fontFamily}_${this.fontSize}px`;
  }
  constructor(e206, t10, n10, r10) {
    super(), this.fontSize = e206, this.fontFamily = t10, this.devicePixelRatio = n10, this._decorationStyleCache = r10, this.id = Sle++, this._workGlyph = { source: null, boundingBox: { left: 0, bottom: 0, right: 0, top: 0 }, originOffset: { x: 0, y: 0 }, fontBoundingBoxAscent: 0, fontBoundingBoxDescent: 0 }, this._workGlyphConfig = { chars: void 0, tokenMetadata: 0, decorationStyleSetId: 0 }, this._antiAliasing = Tt ? `greyscale` : `subpixel`;
    let i10 = Math.ceil(this.fontSize * n10);
    this._canvas = new OffscreenCanvas(i10 * 3, i10 * 3), this._ctx = ZC(this._canvas.getContext(`2d`, { willReadFrequently: true, alpha: this._antiAliasing === `greyscale` })), this._ctx.textBaseline = `top`, this._ctx.fillStyle = `#FFFFFF`, this._ctx.font = `${i10}px ${this.fontFamily}`, this._textMetrics = this._ctx.measureText(`A`);
  }
  rasterizeGlyph(e206, t10, n10, r10) {
    return e206 === `` ? { source: this._canvas, boundingBox: { top: 0, left: 0, bottom: -1, right: -1 }, originOffset: { x: 0, y: 0 }, fontBoundingBoxAscent: 0, fontBoundingBoxDescent: 0 } : this._workGlyphConfig.chars === e206 && this._workGlyphConfig.tokenMetadata === t10 && this._workGlyphConfig.decorationStyleSetId === n10 ? this._workGlyph : (this._workGlyphConfig.chars = e206, this._workGlyphConfig.tokenMetadata = t10, this._workGlyphConfig.decorationStyleSetId = n10, this._rasterizeGlyph(e206, t10, n10, r10));
  }
  _rasterizeGlyph(e206, t10, n10, r10) {
    let i10 = Math.ceil(this.fontSize * this.devicePixelRatio), a10 = i10 * 3;
    this._canvas.width !== a10 && (this._canvas.width = a10, this._canvas.height = a10), this._ctx.save();
    let o10 = (t10 & 15) / 10, s10 = r10[ng.getBackground(t10)], c10 = this._decorationStyleCache.getStyleSet(n10);
    this._antiAliasing === `subpixel` ? (this._ctx.fillStyle = s10, this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height)) : this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
    let l10 = new Ff(200), u10 = ng.getFontStyle(t10);
    u10 & 1 && l10.appendString(`italic `), c10?.bold === void 0 ? u10 & 2 && l10.appendString(`bold `) : c10.bold && l10.appendString(`bold `), l10.appendString(`${i10}px ${this.fontFamily}`), this._ctx.font = l10.build();
    let d10 = i10, f10 = i10;
    c10?.color === void 0 ? this._ctx.fillStyle = r10[ng.getForeground(t10)] : this._ctx.fillStyle = `#${c10.color.toString(16).padStart(8, `0`)}`, this._ctx.textBaseline = `top`, c10?.opacity !== void 0 && (this._ctx.globalAlpha = c10.opacity), this._ctx.fillText(e206, d10 + o10, f10), this._ctx.restore();
    let p10 = this._ctx.getImageData(0, 0, this._canvas.width, this._canvas.height);
    if (this._antiAliasing === `subpixel`) {
      let e207 = parseInt(s10.substring(1, 3), 16), t11 = parseInt(s10.substring(3, 5), 16), n11 = parseInt(s10.substring(5, 7), 16);
      this._clearColor(p10, e207, t11, n11), this._ctx.putImageData(p10, 0, 0);
    }
    return this._findGlyphBoundingBox(p10, this._workGlyph.boundingBox), this._workGlyph.source = this._canvas, this._workGlyph.originOffset.x = this._workGlyph.boundingBox.left - d10, this._workGlyph.originOffset.y = this._workGlyph.boundingBox.top - f10, this._workGlyph.fontBoundingBoxAscent = this._textMetrics.fontBoundingBoxAscent, this._workGlyph.fontBoundingBoxDescent = this._textMetrics.fontBoundingBoxDescent, this._workGlyph;
  }
  _clearColor(e206, t10, n10, r10) {
    for (let i10 = 0; i10 < e206.data.length; i10 += 4) e206.data[i10] === t10 && e206.data[i10 + 1] === n10 && e206.data[i10 + 2] === r10 && (e206.data[i10 + 3] = 0);
  }
  _findGlyphBoundingBox(e206, t10) {
    let n10 = this._canvas.height, r10 = this._canvas.width, i10 = false;
    for (let a10 = 0; a10 < n10; a10++) {
      for (let n11 = 0; n11 < r10; n11++) {
        let o10 = a10 * r10 * 4 + n11 * 4 + 3;
        if (e206.data[o10] !== 0) {
          t10.top = a10, i10 = true;
          break;
        }
      }
      if (i10) break;
    }
    t10.left = 0, i10 = false;
    for (let a10 = 0; a10 < r10; a10++) {
      for (let o10 = 0; o10 < n10; o10++) {
        let n11 = o10 * r10 * 4 + a10 * 4 + 3;
        if (e206.data[n11] !== 0) {
          t10.left = a10, i10 = true;
          break;
        }
      }
      if (i10) break;
    }
    t10.right = r10, i10 = false;
    for (let a10 = r10 - 1; a10 >= t10.left; a10--) {
      for (let o10 = 0; o10 < n10; o10++) {
        let n11 = o10 * r10 * 4 + a10 * 4 + 3;
        if (e206.data[n11] !== 0) {
          t10.right = a10, i10 = true;
          break;
        }
      }
      if (i10) break;
    }
    t10.bottom = t10.top, i10 = false;
    for (let a10 = n10 - 1; a10 >= 0; a10--) {
      for (let n11 = 0; n11 < r10; n11++) {
        let o10 = a10 * r10 * 4 + n11 * 4 + 3;
        if (e206.data[o10] !== 0) {
          t10.bottom = a10, i10 = true;
          break;
        }
      }
      if (i10) break;
    }
  }
  getTextMetrics(e206) {
    return this._ctx.measureText(e206);
  }
};
xle([ex], $C.prototype, `cacheKey`, null);
var Cle = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, wle = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, ew = class extends D {
  constructor(e206) {
    super(), this._logService = e206, this._tasks = [], this._i = 0, this._register(T(() => this.clear()));
  }
  enqueue(e206) {
    this._tasks.push(e206), this._start();
  }
  clear() {
    this._idleCallback && (this._idleCallback = (this._cancelCallback(this._idleCallback), void 0)), this._i = 0, this._tasks.length = 0;
  }
  _start() {
    this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
  }
  _process(e206) {
    this._idleCallback = void 0;
    let t10 = 0, n10 = 0, r10 = e206.timeRemaining(), i10 = 0;
    for (; this._i < this._tasks.length; ) {
      if (t10 = Date.now(), this._tasks[this._i]() || this._i++, t10 = Math.max(1, Date.now() - t10), n10 = Math.max(t10, n10), i10 = e206.timeRemaining(), n10 * 1.5 > i10) {
        r10 - t10 < -20 && this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r10 - t10))}ms`), this._start();
        return;
      }
      r10 = i10;
    }
    this.clear();
  }
};
ew = Cle([wle(0, Ud)], ew);
var Tle = class extends ew {
  _requestCallback(e206) {
    return Nl().setTimeout(() => e206(this._createDeadline(16)));
  }
  _cancelCallback(e206) {
    Nl().clearTimeout(e206);
  }
  _createDeadline(e206) {
    let t10 = Date.now() + e206;
    return { timeRemaining: () => Math.max(0, t10 - Date.now()) };
  }
}, Ele = class extends ew {
  _requestCallback(e206) {
    return Nl().requestIdleCallback(e206);
  }
  _cancelCallback(e206) {
    Nl().cancelIdleCallback(e206);
  }
}, Dle = `requestIdleCallback` in Nl() ? Ele : Tle, Ole = class {
  constructor(e206, t10) {
    this._canvas = e206, this._textureIndex = t10, this._currentRow = { x: 0, y: 0, h: 0 }, this._allocatedGlyphs = /* @__PURE__ */ new Set(), this._nextIndex = 0, this._ctx = ZC(this._canvas.getContext(`2d`, { willReadFrequently: true }));
  }
  allocate(e206) {
    let t10 = e206.boundingBox.right - e206.boundingBox.left + 1, n10 = e206.boundingBox.bottom - e206.boundingBox.top + 1;
    if (t10 > this._canvas.width || n10 > this._canvas.height) throw new je(`Glyph is too large for the atlas page`);
    if (e206.boundingBox.right - e206.boundingBox.left + 1 > this._canvas.width - this._currentRow.x && (this._currentRow.x = 0, this._currentRow.y += this._currentRow.h, this._currentRow.h = 1), this._currentRow.y + e206.boundingBox.bottom - e206.boundingBox.top + 1 > this._canvas.height) return;
    this._ctx.drawImage(e206.source, e206.boundingBox.left, e206.boundingBox.top, t10, n10, this._currentRow.x, this._currentRow.y, t10, n10);
    let r10 = { pageIndex: this._textureIndex, glyphIndex: this._nextIndex++, x: this._currentRow.x, y: this._currentRow.y, w: t10, h: n10, originOffsetX: e206.originOffset.x, originOffsetY: e206.originOffset.y, fontBoundingBoxAscent: e206.fontBoundingBoxAscent, fontBoundingBoxDescent: e206.fontBoundingBoxDescent };
    return this._currentRow.x += t10, this._currentRow.h = Math.max(this._currentRow.h, n10), this._allocatedGlyphs.add(r10), r10;
  }
  getUsagePreview() {
    let e206 = this._canvas.width, t10 = this._canvas.height, n10 = new OffscreenCanvas(e206, t10), r10 = ZC(n10.getContext(`2d`));
    r10.fillStyle = `#808080`, r10.fillRect(0, 0, e206, t10);
    let i10 = /* @__PURE__ */ new Map(), a10 = /* @__PURE__ */ new Map();
    for (let e207 of this._allocatedGlyphs) i10.set(e207.y, Math.max(i10.get(e207.y) ?? 0, e207.h)), a10.set(e207.y, Math.max(a10.get(e207.y) ?? 0, e207.x + e207.w));
    for (let e207 of this._allocatedGlyphs) r10.fillStyle = `#4040FF`, r10.fillRect(e207.x, e207.y, e207.w, e207.h), r10.fillStyle = `#FF0000`, r10.fillRect(e207.x, e207.y + e207.h, e207.w, i10.get(e207.y) - e207.h);
    for (let [t11, n11] of a10.entries()) t11 !== this._currentRow.y && (r10.fillStyle = `#FF0000`, r10.fillRect(n11, t11, e206 - n11, i10.get(t11)));
    return n10.convertToBlob();
  }
  getStats() {
    let e206 = this._canvas.width, t10 = this._canvas.height, n10 = 0, r10 = 0, i10 = e206 * t10, a10 = /* @__PURE__ */ new Map(), o10 = /* @__PURE__ */ new Map();
    for (let e207 of this._allocatedGlyphs) a10.set(e207.y, Math.max(a10.get(e207.y) ?? 0, e207.h)), o10.set(e207.y, Math.max(o10.get(e207.y) ?? 0, e207.x + e207.w));
    for (let e207 of this._allocatedGlyphs) n10 += e207.w * e207.h, r10 += e207.w * (a10.get(e207.y) - e207.h);
    for (let [t11, n11] of o10.entries()) t11 !== this._currentRow.y && (r10 += (e206 - n11) * a10.get(t11));
    return [`page${this._textureIndex}:`, `     Total: ${i10} (${e206}x${t10})`, `      Used: ${n10} (${(n10 / i10 * 100).toPrecision(2)}%)`, `    Wasted: ${r10} (${(r10 / i10 * 100).toPrecision(2)}%)`, `Efficiency: ${(n10 / (n10 + r10) * 100).toPrecision(2)}%`].join(`
`);
  }
}, kle = class {
  constructor(e206, t10, n10) {
    this._canvas = e206, this._textureIndex = t10, this._slabs = [], this._activeSlabsByDims = new Dd(), this._unusedRects = [], this._openRegionsByHeight = /* @__PURE__ */ new Map(), this._openRegionsByWidth = /* @__PURE__ */ new Map(), this._allocatedGlyphs = /* @__PURE__ */ new Set(), this._nextIndex = 0, this._ctx = ZC(this._canvas.getContext(`2d`, { willReadFrequently: true })), this._slabW = Math.min(n10?.slabW ?? 64 << Math.max(Math.floor(Nl().devicePixelRatio) - 1, 0), this._canvas.width), this._slabH = Math.min(n10?.slabH ?? this._slabW, this._canvas.height), this._slabsPerRow = Math.floor(this._canvas.width / this._slabW), this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH);
  }
  allocate(e206) {
    let t10 = e206.boundingBox.right - e206.boundingBox.left + 1, n10 = e206.boundingBox.bottom - e206.boundingBox.top + 1;
    if (t10 > this._canvas.width || n10 > this._canvas.height) throw new je(`Glyph is too large for the atlas page`);
    if (t10 > this._slabW || n10 > this._slabH) {
      if (this._allocatedGlyphs.size > 0) return;
      let e207 = this._canvas.width;
      for (; t10 < e207 / 2 && n10 < e207 / 2; ) e207 /= 2;
      this._slabW = e207, this._slabH = e207, this._slabsPerRow = Math.floor(this._canvas.width / this._slabW), this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH);
    }
    let r10 = { w: t10, h: n10 }, i10 = this._activeSlabsByDims.get(r10.w, r10.h);
    if (i10) {
      let e207 = Math.floor(this._slabW / i10.entryW) * Math.floor(this._slabH / i10.entryH);
      i10.count >= e207 && (i10 = void 0);
    }
    let a10, o10;
    if (!i10) if (t10 < n10) {
      let e207 = this._openRegionsByWidth.get(t10);
      if (e207?.length) for (let r11 = e207.length - 1; r11 >= 0; r11--) {
        let i11 = e207[r11];
        if (i11.w >= t10 && i11.h >= n10) {
          a10 = i11.x, o10 = i11.y, t10 < i11.w && this._unusedRects.push({ x: i11.x + t10, y: i11.y, w: i11.w - t10, h: n10 }), i11.y += n10, i11.h -= n10, i11.h === 0 && (r11 === e207.length - 1 ? e207.pop() : this._unusedRects.splice(r11, 1));
          break;
        }
      }
    } else {
      let e207 = this._openRegionsByHeight.get(n10);
      if (e207?.length) for (let r11 = e207.length - 1; r11 >= 0; r11--) {
        let i11 = e207[r11];
        if (i11.w >= t10 && i11.h >= n10) {
          a10 = i11.x, o10 = i11.y, n10 < i11.h && this._unusedRects.push({ x: i11.x, y: i11.y + n10, w: t10, h: i11.h - n10 }), i11.x += t10, i11.w -= t10, i11.h === 0 && (r11 === e207.length - 1 ? e207.pop() : this._unusedRects.splice(r11, 1));
          break;
        }
      }
    }
    if (a10 === void 0 || o10 === void 0) {
      if (!i10) {
        if (this._slabs.length >= this._slabsPerRow * this._slabsPerColumn) return;
        i10 = { x: Math.floor(this._slabs.length % this._slabsPerRow) * this._slabW, y: Math.floor(this._slabs.length / this._slabsPerRow) * this._slabH, entryW: r10.w, entryH: r10.h, count: 0 };
        let e208 = this._slabW % i10.entryW, t11 = this._slabH % i10.entryH;
        e208 && tw(this._openRegionsByWidth, e208, { x: i10.x + this._slabW - e208, w: e208, y: i10.y, h: this._slabH - (t11 ?? 0) }), t11 && tw(this._openRegionsByHeight, t11, { x: i10.x, w: this._slabW, y: i10.y + this._slabH - t11, h: t11 }), this._slabs.push(i10), this._activeSlabsByDims.set(i10, r10.w, r10.h);
      }
      let e207 = Math.floor(this._slabW / i10.entryW);
      a10 = i10.x + Math.floor(i10.count % e207) * i10.entryW, o10 = i10.y + Math.floor(i10.count / e207) * i10.entryH, i10.count++;
    }
    this._ctx.drawImage(e206.source, e206.boundingBox.left, e206.boundingBox.top, t10, n10, a10, o10, t10, n10);
    let s10 = { pageIndex: this._textureIndex, glyphIndex: this._nextIndex++, x: a10, y: o10, w: t10, h: n10, originOffsetX: e206.originOffset.x, originOffsetY: e206.originOffset.y, fontBoundingBoxAscent: e206.fontBoundingBoxAscent, fontBoundingBoxDescent: e206.fontBoundingBoxDescent };
    return this._allocatedGlyphs.add(s10), s10;
  }
  getUsagePreview() {
    let e206 = this._canvas.width, t10 = this._canvas.height, n10 = new OffscreenCanvas(e206, t10), r10 = ZC(n10.getContext(`2d`));
    r10.fillStyle = `#808080`, r10.fillRect(0, 0, e206, t10);
    let i10 = 0, a10 = 0, o10 = 0, s10 = 64 << Math.floor(Nl().devicePixelRatio) - 1, c10 = s10;
    for (let e207 of this._slabs) {
      let t11 = 0, n11 = 0;
      for (let a12 = 0; a12 < e207.count; a12++) t11 + e207.entryW > s10 && (t11 = 0, n11 += e207.entryH), r10.fillStyle = `#FF0000`, r10.fillRect(e207.x + t11, e207.y + n11, e207.entryW, e207.entryH), i10 += e207.entryW * e207.entryH, t11 += e207.entryW;
      let a11 = Math.floor(s10 / e207.entryW), o11 = Math.floor(c10 / e207.entryH);
      e207.entryW * a11 * e207.entryH * o11;
    }
    for (let e207 of this._allocatedGlyphs) a10 += e207.w * e207.h, r10.fillStyle = `#4040FF`, r10.fillRect(e207.x, e207.y, e207.w, e207.h);
    let l10 = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());
    for (let e207 of l10) r10.fillStyle = `#FF000088`, r10.fillRect(e207.x, e207.y, e207.w, e207.h), o10 += e207.w * e207.h;
    return r10.globalAlpha = 0.5, r10.drawImage(this._canvas, 0, 0), r10.globalAlpha = 1, n10.convertToBlob();
  }
  getStats() {
    let e206 = this._canvas.width, t10 = this._canvas.height, n10 = 0, r10 = 0, i10 = 0, a10 = 0, o10 = 0, s10 = e206 * t10, c10 = 64 << Math.floor(Nl().devicePixelRatio) - 1, l10 = c10;
    for (let e207 of this._slabs) {
      let t11 = 0, r11 = 0;
      for (let i11 = 0; i11 < e207.count; i11++) t11 + e207.entryW > c10 && (t11 = 0, r11 += e207.entryH), n10 += e207.entryW * e207.entryH, t11 += e207.entryW;
      let a11 = Math.floor(c10 / e207.entryW), o11 = Math.floor(l10 / e207.entryH), s11 = e207.entryW * a11 * e207.entryH * o11;
      i10 += c10 * l10 - s11;
    }
    for (let e207 of this._allocatedGlyphs) r10 += e207.w * e207.h;
    let u10 = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());
    for (let e207 of u10) o10 += e207.w * e207.h;
    let d10 = i10 - o10;
    a10 = n10 - (r10 - d10);
    let f10 = r10 / (r10 + a10 + o10);
    return [`page[${this._textureIndex}]:`, `     Total: ${s10}px (${e206}x${t10})`, `      Used: ${r10}px (${(r10 / s10 * 100).toFixed(2)}%)`, `    Wasted: ${a10}px (${(a10 / s10 * 100).toFixed(2)}%)`, `Restricted: ${o10}px (${(o10 / s10 * 100).toFixed(2)}%) (hard to allocate)`, `Efficiency: ${f10 === 1 ? `100` : (f10 * 100).toFixed(2)}%`, `     Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width / c10) * Math.floor(this._canvas.height / l10)}`].join(`
`);
  }
};
function tw(e206, t10, n10) {
  let r10 = e206.get(t10);
  r10 || (r10 = [], e206.set(t10, r10)), r10.push(n10);
}
var Ale = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, nw = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, rw, iw = (_oa = class extends D {
  get version() {
    return this._version;
  }
  get usedArea() {
    return this._usedArea;
  }
  get source() {
    return this._canvas;
  }
  get glyphs() {
    return this._glyphInOrderSet.values();
  }
  constructor(e206, t10, n10, r10, i10) {
    switch (super(), this._logService = r10, this._version = 0, this._usedArea = { left: 0, top: 0, right: 0, bottom: 0 }, this._glyphMap = new Dd(), this._glyphInOrderSet = /* @__PURE__ */ new Set(), this._canvas = new OffscreenCanvas(t10, t10), this._colorMap = i10.getColorTheme().tokenColorMap, n10) {
      case `shelf`:
        this._allocator = new Ole(this._canvas, e206);
        break;
      case `slab`:
        this._allocator = new kle(this._canvas, e206);
        break;
      default:
        this._allocator = n10(this._canvas, e206);
        break;
    }
    this._register(T(() => {
      this._canvas.width = 1, this._canvas.height = 1;
    }));
  }
  getGlyph(e206, t10, n10, r10) {
    return this._glyphMap.get(t10, n10, r10, e206.cacheKey) ?? this._createGlyph(e206, t10, n10, r10);
  }
  _createGlyph(e206, t10, n10, r10) {
    if (this._glyphInOrderSet.size >= rw.maximumGlyphCount) return;
    let i10 = e206.rasterizeGlyph(t10, n10, r10, this._colorMap), a10 = this._allocator.allocate(i10);
    if (a10 !== void 0) return this._glyphMap.set(a10, t10, n10, r10, e206.cacheKey), this._glyphInOrderSet.add(a10), this._version++, this._usedArea.right = Math.max(this._usedArea.right, a10.x + a10.w - 1), this._usedArea.bottom = Math.max(this._usedArea.bottom, a10.y + a10.h - 1), this._logService.getLevel() === Gd.Trace && this._logService.trace(`New glyph`, { chars: t10, tokenMetadata: n10, decorationStyleSetId: r10, rasterizedGlyph: i10, glyph: a10 }), a10;
  }
  getUsagePreview() {
    return this._allocator.getUsagePreview();
  }
  getStats() {
    return this._allocator.getStats();
  }
}, rw = _oa, _oa.maximumGlyphCount = 5e3, _oa);
iw = rw = Ale([nw(3, Ud), nw(4, US)], iw);
var jle = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, aw = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, ow, sw = (_pa = class extends D {
  get pages() {
    return this._pages;
  }
  constructor(e206, t10, n10, r10, i10) {
    super(), this._maxTextureSize = e206, this._decorationStyleCache = n10, this._themeService = r10, this._instantiationService = i10, this._warmUpTask = this._register(new Jt()), this._warmedUpRasterizers = /* @__PURE__ */ new Set(), this._pages = [], this._glyphPageIndex = new Dd(), this._onDidDeleteGlyphs = this._register(new k()), this.onDidDeleteGlyphs = this._onDidDeleteGlyphs.event, this._allocatorType = t10?.allocatorType ?? `slab`, this._register(O.runAndSubscribe(this._themeService.onDidColorThemeChange, () => {
      this._colorMap && this.clear(), this._colorMap = this._themeService.getColorTheme().tokenColorMap;
    }));
    let a10 = Math.max(1, Math.floor(Nl().devicePixelRatio));
    this.pageSize = Math.min(1024 * a10, this._maxTextureSize), this._initFirstPage(), this._register(T(() => Kt(this._pages)));
  }
  _initFirstPage() {
    let e206 = this._instantiationService.createInstance(iw, 0, this.pageSize, this._allocatorType);
    this._pages.push(e206);
    let t10 = new $C(1, ``, 1, this._decorationStyleCache);
    e206.getGlyph(t10, ``, 0, 0), t10.dispose();
  }
  clear() {
    for (let e206 of this._pages) e206.dispose();
    this._pages.length = 0, this._glyphPageIndex.clear(), this._warmedUpRasterizers.clear(), this._warmUpTask.clear(), this._initFirstPage(), this._onDidDeleteGlyphs.fire();
  }
  getGlyph(e206, t10, n10, r10, i10) {
    return n10 &= -2048, n10 |= Math.floor(i10 % 1 * 10), this._warmedUpRasterizers.has(e206.id) || (this._warmUpAtlas(e206), this._warmedUpRasterizers.add(e206.id)), this._tryGetGlyph(this._glyphPageIndex.get(t10, n10, r10, e206.cacheKey) ?? 0, e206, t10, n10, r10);
  }
  _tryGetGlyph(e206, t10, n10, r10, i10) {
    return this._glyphPageIndex.set(e206, n10, r10, i10, t10.cacheKey), this._pages[e206].getGlyph(t10, n10, r10, i10) ?? (e206 + 1 < this._pages.length ? this._tryGetGlyph(e206 + 1, t10, n10, r10, i10) : void 0) ?? this._getGlyphFromNewPage(t10, n10, r10, i10);
  }
  _getGlyphFromNewPage(e206, t10, n10, r10) {
    if (this._pages.length >= ow.maximumPageCount) throw Error(`Attempt to create a texture atlas page past the limit ${ow.maximumPageCount}`);
    return this._pages.push(this._instantiationService.createInstance(iw, this._pages.length, this.pageSize, this._allocatorType)), this._glyphPageIndex.set(this._pages.length - 1, t10, n10, r10, e206.cacheKey), this._pages[this._pages.length - 1].getGlyph(e206, t10, n10, r10);
  }
  getStats() {
    return this._pages.map((e206) => e206.getStats());
  }
  _warmUpAtlas(e206) {
    let t10 = this._colorMap;
    if (!t10) throw new je(`Cannot warm atlas without color map`);
    this._warmUpTask.value?.clear();
    let n10 = this._warmUpTask.value = this._instantiationService.createInstance(Dle);
    for (let r10 = 65; r10 <= 90; r10++) for (let i10 of t10.keys()) n10.enqueue(() => {
      for (let t11 = 0; t11 < 1; t11 += 0.1) this.getGlyph(e206, String.fromCharCode(r10), i10 << 15 & 16744448, 0, t11);
    });
    for (let r10 = 97; r10 <= 122; r10++) for (let i10 of t10.keys()) n10.enqueue(() => {
      for (let t11 = 0; t11 < 1; t11 += 0.1) this.getGlyph(e206, String.fromCharCode(r10), i10 << 15 & 16744448, 0, t11);
    });
    for (let r10 = 33; r10 <= 126; r10++) for (let i10 of t10.keys()) n10.enqueue(() => {
      for (let t11 = 0; t11 < 1; t11 += 0.1) this.getGlyph(e206, String.fromCharCode(r10), i10 << 15 & 16744448, 0, t11);
    });
  }
}, ow = _pa, _pa.maximumPageCount = 16, _pa);
sw = ow = jle([aw(3, US), aw(4, V)], sw);
var cw;
(function(e206) {
  e206[e206.Ignore = 0] = `Ignore`, e206[e206.Info = 1] = `Info`, e206[e206.Warning = 2] = `Warning`, e206[e206.Error = 3] = `Error`;
})(cw || (cw = {})), (function(e206) {
  let t10 = `error`, n10 = `warning`, r10 = `info`;
  function i10(i11) {
    return i11 ? to(t10, i11) ? e206.Error : to(n10, i11) || to(`warn`, i11) ? e206.Warning : to(r10, i11) ? e206.Info : e206.Ignore : e206.Ignore;
  }
  e206.fromValue = i10;
  function a10(i11) {
    switch (i11) {
      case e206.Error:
        return t10;
      case e206.Warning:
        return n10;
      case e206.Info:
        return r10;
      default:
        return `ignore`;
    }
  }
  e206.toString = a10;
})(cw || (cw = {}));
var lw = cw, uw = lw, dw = xu(`notificationService`), Mle = class {
}, fw;
(function(e206) {
  async function t10(e207) {
    try {
      if (!navigator.gpu) throw Error(`This browser does not support WebGPU`);
      let e208 = await navigator.gpu.requestAdapter();
      if (!e208) throw Error(`This browser supports WebGPU but it appears to be disabled`);
      return pw(await e208.requestDevice());
    } catch (t11) {
      throw e207 && e207(t11.message), t11;
    }
  }
  e206.requestDevice = t10;
  function n10(e207, t11, n11) {
    let r11 = e207.createBuffer(t11);
    return n11 && e207.queue.writeBuffer(r11, 0, Xe(n11) ? n11() : n11), pw(r11);
  }
  e206.createBuffer = n10;
  function r10(e207, t11) {
    return pw(e207.createTexture(t11));
  }
  e206.createTexture = r10;
})(fw || (fw = {}));
function pw(e206) {
  return { object: e206, dispose: () => e206.destroy() };
}
var Nle = class {
  get dataOffset() {
    return this._startIndex;
  }
  get dirtySize() {
    if (!(this._startIndex === void 0 || this._endIndex === void 0)) return this._endIndex - this._startIndex + 1;
  }
  get isDirty() {
    return this._startIndex !== void 0;
  }
  flag(e206, t10 = 1) {
    return this._flag(e206), t10 > 1 && this._flag(e206 + t10 - 1), e206;
  }
  _flag(e206) {
    (this._startIndex === void 0 || e206 < this._startIndex) && (this._startIndex = e206), (this._endIndex === void 0 || e206 > this._endIndex) && (this._endIndex = e206);
  }
  clear() {
    this._startIndex = void 0, this._endIndex = void 0;
  }
};
function Ple(e206, t10) {
  return new Fle(e206, t10);
}
var Fle = class extends D {
  get entryCount() {
    return this._entries.size;
  }
  get dirtyTracker() {
    return this._dirtyTracker;
  }
  constructor(e206, t10) {
    super(), this.propertySpecs = e206, this.capacity = t10, this._dirtyTracker = new Nle(), this._propertySpecsMap = /* @__PURE__ */ new Map(), this._entries = new Qt(), this._onDidChange = this._register(new k()), this._onDidChangeBuffer = this._register(new k()), this.onDidChangeBuffer = this._onDidChangeBuffer.event, this.view = new Float32Array(t10 * e206.length), this.buffer = this.view.buffer, this._entrySize = e206.length;
    for (let t11 = 0; t11 < e206.length; t11++) {
      let n10 = { offset: t11, ...e206[t11] };
      this._propertySpecsMap.set(n10.name, n10);
    }
    this._register(T(() => Kt(this._entries)));
  }
  createEntry(e206) {
    this._entries.size === this.capacity && (this._expandBuffer(), this._onDidChangeBuffer.fire());
    let t10 = new Ile(this.view, this._propertySpecsMap, this._dirtyTracker, this._entries.size, e206), n10 = this._entries.push(t10), r10 = [];
    return r10.push(O.forward(t10.onDidChange, this._onDidChange)), r10.push(t10.onWillDispose(() => {
      let e207 = t10.i;
      n10(), this.view.set(this.view.subarray(e207 * this._entrySize + 2, this._entries.size * this._entrySize + 2), e207 * this._entrySize);
      for (let t11 of this._entries) t11.i > e207 && t11.i--;
      this._dirtyTracker.flag(e207, (this._entries.size - e207) * this._entrySize), Kt(r10);
    })), t10;
  }
  _expandBuffer() {
    this.capacity *= 2;
    let e206 = new Float32Array(this.capacity * this._entrySize);
    e206.set(this.view), this.view = e206, this.buffer = this.view.buffer;
  }
}, Ile = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._view = e206, this._propertySpecsMap = t10, this._dirtyTracker = n10, this.i = r10, this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, this._onWillDispose = this._register(new k()), this.onWillDispose = this._onWillDispose.event;
    for (let e207 of this._propertySpecsMap.values()) this._view[this.i * this._propertySpecsMap.size + e207.offset] = i10[e207.name];
    this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size);
  }
  dispose() {
    this._onWillDispose.fire(), super.dispose();
  }
  setRaw(e206) {
    if (e206.length !== this._propertySpecsMap.size) throw Error(`Data length ${e206.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);
    this._view.set(e206, this.i * this._propertySpecsMap.size), this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size);
  }
}, Lle = `

struct Vertex {
	@location(0) position: vec2f,
};

struct LayoutInfo {
	canvasDims: vec2f,
	viewportOffset: vec2f,
	viewportDims: vec2f,
}

struct ScrollOffset {
	offset: vec2f,
}

struct Shape {
	position: vec2f,
	size: vec2f,
	color: vec4f,
};

struct VSOutput {
	@builtin(position) position: vec4f,
	@location(1)       color:    vec4f,
};

// Uniforms
@group(0) @binding(1) var<uniform>       layoutInfo:      LayoutInfo;

// Storage buffers
@group(0) @binding(0)            var<storage, read> shapes:          array<Shape>;
@group(0) @binding(2)      var<uniform>       scrollOffset:    ScrollOffset;

@vertex fn vs(
	vert: Vertex,
	@builtin(instance_index) instanceIndex: u32,
	@builtin(vertex_index) vertexIndex : u32
) -> VSOutput {
	let shape = shapes[instanceIndex];

	var vsOut: VSOutput;
	vsOut.position = vec4f(
		(
			// Top left corner
			vec2f(-1,  1) +
			// Convert pixel position to clipspace
			vec2f( 2, -2) / layoutInfo.canvasDims *
			// Shape position and size
			(layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)
		),
		0.0,
		1.0
	);
	vsOut.color = shape.color;
	return vsOut;
}

@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
	return vsOut.color;
}
`, Rle = class extends wb {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._context = e206, this._contentLeft = t10, this._devicePixelRatio = n10, this._canvas = r10, this._ctx = i10, this._shapeBindBuffer = this._register(new Jt()), this._initialized = false, this._shapeCollection = this._register(Ple([{ name: `x` }, { name: `y` }, { name: `width` }, { name: `height` }, { name: `red` }, { name: `green` }, { name: `blue` }, { name: `alpha` }], 32)), this._context.addEventHandler(this), this._initWebgpu(a10);
  }
  async _initWebgpu(e206) {
    if (this._device = await e206, this._store.isDisposed) return;
    let t10 = navigator.gpu.getPreferredCanvasFormat();
    this._ctx.configure({ device: this._device, format: t10, alphaMode: `premultiplied` }), this._renderPassColorAttachment = { view: null, loadOp: `load`, storeOp: `store` }, this._renderPassDescriptor = { label: `Monaco rectangle renderer render pass`, colorAttachments: [this._renderPassColorAttachment] };
    let n10;
    {
      let e207 = new Float32Array(6), t11 = (t12 = this._canvas.width, n11 = this._canvas.height) => (e207[0] = t12, e207[1] = n11, e207[2] = Math.ceil(this._context.configuration.options.get(165).contentLeft * Nl().devicePixelRatio), e207[3] = 0, e207[4] = e207[0] - e207[2], e207[5] = e207[1] - e207[3], e207);
      n10 = this._register(fw.createBuffer(this._device, { label: `Monaco rectangle renderer uniform buffer`, size: 24, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST }, () => t11())).object, this._register(QC(this._canvas, Nl(), (e208, r11) => {
        this._device.queue.writeBuffer(n10, 0, t11(e208, r11));
      }));
    }
    this._scrollOffsetBindBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco rectangle renderer scroll offset buffer`, size: 2 * Float32Array.BYTES_PER_ELEMENT, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST })).object, this._scrollOffsetValueBuffer = new Float32Array(2);
    let r10 = () => fw.createBuffer(this._device, { label: `Monaco rectangle renderer shape buffer`, size: this._shapeCollection.buffer.byteLength, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST });
    this._shapeBindBuffer.value = r10(), this._register(O.runAndSubscribe(this._shapeCollection.onDidChangeBuffer, () => {
      this._shapeBindBuffer.value = r10(), this._pipeline && this._updateBindGroup(this._pipeline, n10);
    })), this._vertexBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco rectangle renderer vertex buffer`, size: XC.byteLength, usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST }, XC)).object;
    let i10 = this._device.createShaderModule({ label: `Monaco rectangle renderer shader module`, code: Lle });
    this._pipeline = this._device.createRenderPipeline({ label: `Monaco rectangle renderer render pipeline`, layout: `auto`, vertex: { module: i10, buffers: [{ arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT, attributes: [{ shaderLocation: 0, offset: 0, format: `float32x2` }] }] }, fragment: { module: i10, targets: [{ format: t10, blend: { color: { srcFactor: `src-alpha`, dstFactor: `one-minus-src-alpha` }, alpha: { srcFactor: `src-alpha`, dstFactor: `one-minus-src-alpha` } } }] } }), this._updateBindGroup(this._pipeline, n10), this._initialized = true;
  }
  _updateBindGroup(e206, t10) {
    this._bindGroup = this._device.createBindGroup({ label: `Monaco rectangle renderer bind group`, layout: e206.getBindGroupLayout(0), entries: [{ binding: 0, resource: { buffer: this._shapeBindBuffer.value.object } }, { binding: 1, resource: { buffer: t10 } }, { binding: 2, resource: { buffer: this._scrollOffsetBindBuffer } }] });
  }
  register(e206, t10, n10, r10, i10, a10, o10, s10) {
    return this._shapeCollection.createEntry({ x: e206, y: t10, width: n10, height: r10, red: i10, green: a10, blue: o10, alpha: s10 });
  }
  onScrollChanged(e206) {
    if (this._device) {
      let e207 = Nl().devicePixelRatio;
      this._scrollOffsetValueBuffer[0] = this._context.viewLayout.getCurrentScrollLeft() * e207, this._scrollOffsetValueBuffer[1] = this._context.viewLayout.getCurrentScrollTop() * e207, this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer);
    }
    return true;
  }
  _update() {
    if (!this._device) return;
    let e206 = this._shapeCollection;
    e206.dirtyTracker.isDirty && (this._device.queue.writeBuffer(this._shapeBindBuffer.value.object, 0, e206.buffer, e206.dirtyTracker.dataOffset, e206.dirtyTracker.dirtySize * e206.view.BYTES_PER_ELEMENT), e206.dirtyTracker.clear());
  }
  draw(e206) {
    if (!this._initialized) return;
    this._update();
    let t10 = this._device.createCommandEncoder({ label: `Monaco rectangle renderer command encoder` });
    this._renderPassColorAttachment.view = this._ctx.getCurrentTexture().createView();
    let n10 = t10.beginRenderPass(this._renderPassDescriptor);
    n10.setPipeline(this._pipeline), n10.setVertexBuffer(0, this._vertexBuffer), n10.setBindGroup(0, this._bindGroup);
    let r10 = Math.ceil(this._contentLeft.get() * this._devicePixelRatio.get());
    n10.setScissorRect(r10, 0, this._canvas.width - r10, this._canvas.height), n10.draw(XC.length / 2, this._shapeCollection.entryCount), n10.end();
    let i10 = t10.finish();
    this._device.queue.submit([i10]);
  }
}, zle = class extends D {
  constructor() {
    super(), this._ruleCache = /* @__PURE__ */ new Map(), this._container = B(`div.monaco-decoration-css-rule-extractor`), this._dummyElement = B(`span`), this._container.appendChild(this._dummyElement), this._register(T(() => this._container.remove()));
  }
  getStyleRules(e206, t10) {
    let n10 = this._ruleCache.get(t10);
    if (n10) return n10;
    this._dummyElement.className = t10, e206.appendChild(this._container);
    let r10 = this._getStyleRules(t10);
    return this._ruleCache.set(t10, r10), e206.removeChild(this._container), r10;
  }
  _getStyleRules(e206) {
    let t10 = [], n10 = [...Ml().styleSheets];
    for (let r10 = 0; r10 < n10.length; r10++) {
      let i10 = n10[r10];
      for (let r11 of i10.cssRules) if (r11 instanceof CSSImportRule) r11.styleSheet && n10.push(r11.styleSheet);
      else if (r11 instanceof CSSStyleRule) {
        let n11 = `.${e206}`, i11 = r11.selectorText.indexOf(n11);
        if (i11 !== -1) {
          let e207 = i11 + n11.length;
          (r11.selectorText.length === e207 || r11.selectorText.substring(e207, e207 + 1).match(/[ :]/)) && t10.push(r11);
        }
      }
    }
    return t10;
  }
}, Ble = class {
  constructor() {
    this._nextId = 1, this._cacheById = /* @__PURE__ */ new Map(), this._cacheByStyle = new Dd();
  }
  getOrCreateEntry(e206, t10, n10) {
    if (e206 === void 0 && t10 === void 0 && n10 === void 0) return 0;
    let r10 = this._cacheByStyle.get(e206 ?? 0, +!!t10, n10 === void 0 ? `` : n10.toFixed(2));
    if (r10) return r10.id;
    let i10 = this._nextId++, a10 = { id: i10, color: e206, bold: t10, opacity: n10 };
    return this._cacheById.set(i10, a10), this._cacheByStyle.set(a10, e206 ?? 0, +!!t10, n10 === void 0 ? `` : n10.toFixed(2)), i10;
  }
  getStyleSet(e206) {
    if (e206 !== 0) return this._cacheById.get(e206);
  }
};
function mw(e206, t10) {
  let n10, r10 = true;
  return ane({ changeTracker: { createChangeSummary: () => ({ deltas: [], didChange: false }), handleChange: (t11, n11) => {
    if (t11.didChange(e206)) {
      let e207 = t11.change;
      e207 !== void 0 && n11.deltas.push(e207), n11.didChange = true;
    }
    return true;
  } } }, (i10, a10) => {
    let o10 = e206.read(i10), s10 = n10;
    a10.didChange && (n10 = o10, t10(o10, s10, a10.deltas)), r10 && (r10 = false, n10 = o10);
  });
}
function hw(e206, t10) {
  let n10 = new E(), r10 = mw(e206, (e207, r11, i10) => {
    n10.clear(), t10(e207, r11, i10, n10);
  });
  return { dispose() {
    r10.dispose(), n10.dispose();
  } };
}
function Vle(e206, t10) {
  return hw(e206, (e207, n10, r10, i10) => {
    t10(e207, n10, r10, mr(i10));
  });
}
var Hle = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, gw = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, _w2, vw = (_qa = class extends D {
  static get decorationCssRuleExtractor() {
    return _w2._decorationCssRuleExtractor;
  }
  static get decorationStyleCache() {
    return _w2._decorationStyleCache;
  }
  static get atlas() {
    if (!_w2._atlas) throw new je(`Cannot call ViewGpuContext.textureAtlas before device is resolved`);
    return _w2._atlas;
  }
  get atlas() {
    return _w2.atlas;
  }
  constructor(e206, t10, n10, r10) {
    super(), this._instantiationService = t10, this._notificationService = n10, this.configurationService = r10, this.maxGpuCols = 2e3, this.canvas = _u(document.createElement(`canvas`)), this.canvas.setClassName(`editorCanvas`), this._register(O.runAndSubscribe(r10.onDidChangeConfiguration, (e207) => {
      if (!e207 || e207.affectsConfiguration(`editor.scrollbar.verticalScrollbarSize`)) {
        let e208 = r10.getValue(`editor`).scrollbar?.verticalScrollbarSize ?? 14;
        this.canvas.domNode.style.boxSizing = `border-box`, this.canvas.domNode.style.paddingRight = `${e208}px`;
      }
    })), this.ctx = ZC(this.canvas.domNode.getContext(`webgpu`)), _w2.device || (_w2.device = fw.requestDevice((e207) => {
      let t11 = [{ label: C(78, `Use DOM-based rendering`), run: () => this.configurationService.updateValue(`editor.experimentalGpuAcceleration`, `off`) }];
      this._notificationService.prompt(uw.Warning, e207, t11);
    }).then((e207) => (_w2.deviceSync = e207.object, _w2._atlas || (_w2._atlas = this._instantiationService.createInstance(sw, e207.object.limits.maxTextureDimension2D, void 0, _w2.decorationStyleCache)), e207.object)));
    let i10 = Ic(this, Nl().devicePixelRatio);
    this._register(L(Nl(), `resize`, () => {
      i10.set(Nl().devicePixelRatio, void 0);
    })), this.devicePixelRatio = i10, this._register(mw(this.devicePixelRatio, () => _w2.atlas?.clear()));
    let a10 = Ic(this, { width: this.canvas.domNode.width, height: this.canvas.domNode.height });
    this._register(QC(this.canvas.domNode, Nl(), (e207, t11) => {
      this.canvas.domNode.width = e207, this.canvas.domNode.height = t11, a10.set({ width: e207, height: t11 }, void 0);
    })), this.canvasDevicePixelDimensions = a10;
    let o10 = Ic(this, 0);
    this._register(this.configurationService.onDidChangeConfiguration((t11) => {
      o10.set(e206.configuration.options.get(165).contentLeft, void 0);
    })), this.contentLeft = o10, this.rectangleRenderer = this._instantiationService.createInstance(Rle, e206, this.contentLeft, this.devicePixelRatio, this.canvas.domNode, this.ctx, _w2.device);
  }
  canRender(e206, t10, n10) {
    let r10 = t10.getViewLineRenderingData(n10);
    if (r10.containsRTL || r10.maxColumn > this.maxGpuCols) return false;
    if (r10.inlineDecorations.length > 0) {
      let e207 = true;
      for (let t11 of r10.inlineDecorations) {
        if (t11.type !== 0) {
          e207 = false;
          break;
        }
        let n11 = _w2._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, t11.inlineClassName);
        if (e207 && (e207 = n11.every((e208) => {
          if (e208.selectorText.includes(`:`)) return false;
          for (let t12 of e208.style) if (!yw(t12, e208.style)) return false;
          return true;
        })), !e207) break;
      }
      return e207;
    }
    return true;
  }
  canRenderDetailed(e206, t10, n10) {
    let r10 = t10.getViewLineRenderingData(n10), i10 = [];
    if (r10.containsRTL && i10.push(`containsRTL`), r10.maxColumn > this.maxGpuCols && i10.push(`maxColumn > maxGpuCols`), r10.inlineDecorations.length > 0) {
      let e207 = true, t11 = [], n11 = [], a10 = [];
      for (let i11 of r10.inlineDecorations) {
        if (i11.type !== 0) {
          t11.push(i11.type), e207 = false;
          continue;
        }
        let r11 = _w2._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, i11.inlineClassName);
        e207 && (e207 = r11.every((e208) => {
          if (e208.selectorText.includes(`:`)) return n11.push(e208.selectorText), false;
          for (let t12 of e208.style) if (!yw(t12, e208.style)) return a10.push(`${t12}: ${e208.style[t12]}`), false;
          return true;
        }));
      }
      t11.length > 0 && i10.push(`inlineDecorations with unsupported types (${t11.map((e208) => `\`${e208}\``).join(`, `)})`), a10.length > 0 && i10.push(`inlineDecorations with unsupported CSS rules (${a10.map((e208) => `\`${e208}\``).join(`, `)})`), n11.length > 0 && i10.push(`inlineDecorations with unsupported CSS selectors (${n11.map((e208) => `\`${e208}\``).join(`, `)})`);
    }
    return i10;
  }
}, _w2 = _qa, _qa._decorationCssRuleExtractor = new zle(), _qa._decorationStyleCache = new Ble(), _qa);
vw = _w2 = Hle([gw(1, V), gw(2, dw), gw(3, Uf)], vw);
var Ule = [`color`, `font-weight`, `opacity`];
function yw(e206, t10) {
  if (!Ule.includes(e206)) return false;
  switch (e206) {
    default:
      return true;
  }
}
function bw(e206, t10) {
  return e206.isBasicASCII && t10.useMonospaceOptimizations ? new Wle(e206) : new Gle(e206);
}
var Wle = class {
  constructor(e206) {
    this._content = e206.content;
  }
  getSegmentAtIndex(e206) {
    return this._content[e206];
  }
}, Gle = class {
  constructor(e206) {
    this._segments = [];
    let t10 = e206.content, n10 = Jp.Segmenter(void 0, { granularity: `grapheme` }).value, r10 = Array.from(n10.segment(t10)), i10 = 0;
    for (let e207 = 0; e207 < t10.length; e207++) {
      let t11 = r10[i10];
      if (!t11) break;
      if (t11.index !== e207) {
        this._segments.push(void 0);
        continue;
      }
      i10++, this._segments.push(t11);
    }
  }
  getSegmentAtIndex(e206) {
    return this._segments[e206]?.segment;
  }
}, xw = class extends wb {
  get glyphRasterizer() {
    return this._glyphRasterizer.value;
  }
  constructor(e206, t10, n10, r10) {
    super(), this._context = e206, this._viewGpuContext = t10, this._device = n10, this._glyphRasterizer = r10, this._context.addEventHandler(this);
  }
}, Sw = `
struct GlyphInfo {
	position: vec2f,
	size: vec2f,
	origin: vec2f,
};

struct Vertex {
	@location(0) position: vec2f,
};

struct Cell {
	position: vec2f,
	unused1: vec2f,
	glyphIndex: f32,
	textureIndex: f32
};

struct LayoutInfo {
	canvasDims: vec2f,
	viewportOffset: vec2f,
	viewportDims: vec2f,
}

struct ScrollOffset {
	offset: vec2f
}

struct VSOutput {
	@builtin(position) position:   vec4f,
	@location(1)       layerIndex: f32,
	@location(0)       texcoord:   vec2f,
};

// Uniforms
@group(0) @binding(4)       var<uniform>       layoutInfo:      LayoutInfo;
@group(0) @binding(5)  var<uniform>       atlasDims:       vec2f;
@group(0) @binding(6)            var<uniform>       scrollOffset:    ScrollOffset;

// Storage buffers
@group(0) @binding(0)               var<storage, read> glyphInfo:       array<array<GlyphInfo, ${iw.maximumGlyphCount}>, ${sw.maximumPageCount}>;
@group(0) @binding(1)                   var<storage, read> cells:           array<Cell>;

@vertex fn vs(
	vert: Vertex,
	@builtin(instance_index) instanceIndex: u32,
	@builtin(vertex_index) vertexIndex : u32
) -> VSOutput {
	let cell = cells[instanceIndex];
	var glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];

	var vsOut: VSOutput;
	// Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1
	vsOut.position = vec4f(
		// Make everything relative to top left instead of center
		vec2f(-1, 1) +
		((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +
		((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +
		((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +
		(((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),
		0.0,
		1.0
	);

	vsOut.layerIndex = cell.textureIndex;
	// Textures are flipped from natural direction on the y-axis, so flip it back
	vsOut.texcoord = vert.position;
	vsOut.texcoord = (
		// Glyph offset (0-1)
		(glyph.position / atlasDims) +
		// Glyph coordinate (0-1)
		(vsOut.texcoord * (glyph.size / atlasDims))
	);

	return vsOut;
}

@group(0) @binding(2) var ourSampler: sampler;
@group(0) @binding(3)        var ourTexture: texture_2d_array<f32>;

@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
	return textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));
}
`, Kle = (_ra = class extends xw {
  get bindGroupEntries() {
    return [{ binding: 1, resource: { buffer: this._cellBindBuffer } }, { binding: 6, resource: { buffer: this._scrollOffsetBindBuffer } }];
  }
  constructor(e206, t10, n10, r10) {
    super(e206, t10, n10, r10), this.type = `viewport`, this.wgsl = Sw, this._cellBindBufferLineCapacity = 63, this._activeDoubleBufferIndex = 0, this._visibleObjectCount = 0, this._scrollInitialized = false, this._onDidChangeBindGroupEntries = this._register(new k()), this.onDidChangeBindGroupEntries = this._onDidChangeBindGroupEntries.event, this._rebuildCellBuffer(this._cellBindBufferLineCapacity), this._scrollOffsetBindBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco scroll offset buffer`, size: 2 * Float32Array.BYTES_PER_ELEMENT, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST })).object, this._scrollOffsetValueBuffer = new Float32Array(2);
  }
  _rebuildCellBuffer(t10) {
    this._cellBindBuffer?.destroy();
    let n10 = (Math.floor(t10 / 32) + 1) * 32, r10 = n10 * _ra.maxSupportedColumns * 6 * Float32Array.BYTES_PER_ELEMENT;
    this._cellBindBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco full file cell buffer`, size: r10, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST })).object, this._cellValueBuffers = [new ArrayBuffer(r10), new ArrayBuffer(r10)], this._cellBindBufferLineCapacity = n10, this._onDidChangeBindGroupEntries.fire();
  }
  onConfigurationChanged(e206) {
    return true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onTokensChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onScrollChanged(e206) {
    let t10 = Nl().devicePixelRatio;
    return this._scrollOffsetValueBuffer[0] = (e206?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * t10, this._scrollOffsetValueBuffer[1] = (e206?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * t10, this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer), true;
  }
  onThemeChanged(e206) {
    return true;
  }
  onLineMappingChanged(e206) {
    return true;
  }
  onZonesChanged(e206) {
    return true;
  }
  reset() {
    for (let e206 of [0, 1]) {
      let t10 = new Float32Array(this._cellValueBuffers[e206]);
      t10.fill(0, 0, t10.length), this._device.queue.writeBuffer(this._cellBindBuffer, 0, t10.buffer, 0, t10.byteLength);
    }
  }
  update(t10, n10) {
    let r10 = ``, i10, a10 = 0, o10 = 0, s10 = 0, c10 = 0, l10 = 0, u10 = 0, d10, f10 = 0, p10 = 0, m10 = 0, h10 = 0, g10, _10, v10, y10, b10, x10 = 0, S10 = 0, ee2, te2 = Nl().devicePixelRatio, ne2;
    this._scrollInitialized || (this._scrollInitialized = (this.onScrollChanged(), true)), this._cellBindBufferLineCapacity < t10.endLineNumber - t10.startLineNumber + 1 && this._rebuildCellBuffer(t10.endLineNumber - t10.startLineNumber + 1);
    let re2 = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);
    re2.fill(0);
    let ie2 = _ra.maxSupportedColumns * 6;
    for (o10 = t10.startLineNumber; o10 <= t10.endLineNumber; o10++) if (this._viewGpuContext.canRender(n10, t10, o10)) {
      y10 = t10.getViewLineRenderingData(o10), u10 = 0, ne2 = bw(y10, n10), a10 = n10.spaceWidth * te2, c10 = 0, ee2 = y10.tokens, p10 = y10.minColumn - 1, m10 = 0;
      for (let x11 = 0, S11 = ee2.getCount(); x11 < S11; x11++) if (m10 = ee2.getEndOffset(x11), !(m10 <= p10)) {
        for (h10 = ee2.getMetadata(x11), s10 = p10; s10 < m10 && !(s10 > _ra.maxSupportedColumns); s10++) {
          if (i10 = ne2.getSegmentAtIndex(s10), i10 === void 0) continue;
          r10 = i10, y10.isBasicASCII && n10.useMonospaceOptimizations || (a10 = this.glyphRasterizer.getTextMetrics(r10).width), _10 = void 0, g10 = void 0, v10 = void 0;
          for (b10 of y10.inlineDecorations) {
            if (o10 < b10.range.startLineNumber || o10 > b10.range.endLineNumber || o10 === b10.range.startLineNumber && s10 < b10.range.startColumn - 1 || o10 === b10.range.endLineNumber && s10 >= b10.range.endColumn - 1) continue;
            let e206 = vw.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, b10.inlineClassName);
            for (let t11 of e206) for (let e207 of t11.style) {
              let n11 = t11.styleMap.get(e207)?.toString() ?? ``;
              switch (e207) {
                case `color`: {
                  let e208 = Y.Format.CSS.parse(n11);
                  if (!e208) throw new je(`Invalid color format ` + n11);
                  _10 = e208.toNumber32Bit();
                  break;
                }
                case `font-weight`:
                  g10 = qle(n11) >= 400;
                  break;
                case `opacity`:
                  v10 = Jle(n11);
                  break;
                default:
                  throw new je(`Unexpected inline decoration style`);
              }
            }
          }
          if (r10 === ` ` || r10 === `	`) {
            if (f10 = ((o10 - 1) * _ra.maxSupportedColumns + s10) * 6, re2.fill(0, f10, f10 + 6), r10 === `	`) {
              let e206 = s10 + u10;
              u10 = Ub.nextRenderTabStop(s10 + u10, y10.tabSize), c10 += a10 * (u10 - e206), u10 -= s10 + 1;
            } else c10 += a10;
            continue;
          }
          let p11 = vw.decorationStyleCache.getOrCreateEntry(_10, g10, v10);
          d10 = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, r10, h10, p11, c10), l10 = Math.round(t10.relativeVerticalOffset[o10 - t10.startLineNumber] * te2 + Math.floor((t10.lineHeight * te2 - (d10.fontBoundingBoxAscent + d10.fontBoundingBoxDescent)) / 2) + d10.fontBoundingBoxAscent), f10 = ((o10 - t10.startLineNumber) * _ra.maxSupportedColumns + s10) * 6, re2[f10 + 0] = Math.floor(c10), re2[f10 + 1] = l10, re2[f10 + 4] = d10.glyphIndex, re2[f10 + 5] = d10.pageIndex, c10 += a10;
        }
        p10 = m10;
      }
      x10 = ((o10 - t10.startLineNumber) * _ra.maxSupportedColumns + m10) * 6, S10 = (o10 - t10.startLineNumber) * _ra.maxSupportedColumns * 6, re2.fill(0, x10, S10);
    }
    let ae2 = (t10.endLineNumber - t10.startLineNumber + 1) * ie2;
    return this._device.queue.writeBuffer(this._cellBindBuffer, 0, re2.buffer, 0, (t10.endLineNumber - t10.startLineNumber) * ie2 * Float32Array.BYTES_PER_ELEMENT), this._activeDoubleBufferIndex = +!this._activeDoubleBufferIndex, this._visibleObjectCount = ae2, ae2;
  }
  draw(e206, t10) {
    if (this._visibleObjectCount <= 0) throw new je(`Attempt to draw 0 objects`);
    e206.draw(XC.length / 2, this._visibleObjectCount);
  }
}, _ra.maxSupportedColumns = 2e3, _ra);
function qle(e206) {
  switch (e206) {
    case `lighter`:
    case `normal`:
      return 400;
    case `bolder`:
    case `bold`:
      return 700;
  }
  return parseInt(e206);
}
function Jle(e206) {
  return e206.endsWith(`%`) ? parseFloat(e206.substring(0, e206.length - 1)) / 100 : e206.match(/^\d+(?:\.\d*)/) ? parseFloat(e206) : 1;
}
var Cw = (_sa = class extends xw {
  get bindGroupEntries() {
    return [{ binding: 1, resource: { buffer: this._cellBindBuffer } }, { binding: 6, resource: { buffer: this._scrollOffsetBindBuffer } }];
  }
  constructor(t10, n10, r10, i10) {
    super(t10, n10, r10, i10), this.type = `fullfile`, this.wgsl = Sw, this._activeDoubleBufferIndex = 0, this._upToDateLines = [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()], this._visibleObjectCount = 0, this._finalRenderedLine = 0, this._scrollInitialized = false, this._queuedBufferUpdates = [[], []];
    let a10 = _sa.maxSupportedLines * _sa.maxSupportedColumns * 6 * Float32Array.BYTES_PER_ELEMENT;
    this._cellBindBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco full file cell buffer`, size: a10, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST })).object, this._cellValueBuffers = [new ArrayBuffer(a10), new ArrayBuffer(a10)], this._scrollOffsetBindBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco scroll offset buffer`, size: 2 * Float32Array.BYTES_PER_ELEMENT, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST })).object, this._scrollOffsetValueBuffer = new Float32Array(2);
  }
  onConfigurationChanged(e206) {
    return this._invalidateAllLines(), this._queueBufferUpdate(e206), true;
  }
  onDecorationsChanged(e206) {
    return this._invalidateAllLines(), true;
  }
  onTokensChanged(e206) {
    for (let t10 of e206.ranges) this._invalidateLineRange(t10.fromLineNumber, t10.toLineNumber);
    return true;
  }
  onLinesDeleted(e206) {
    return this._invalidateLinesFrom(e206.fromLineNumber), this._queueBufferUpdate(e206), true;
  }
  onLinesInserted(e206) {
    return this._invalidateLinesFrom(e206.fromLineNumber), true;
  }
  onLinesChanged(e206) {
    return this._invalidateLineRange(e206.fromLineNumber, e206.fromLineNumber + e206.count), true;
  }
  onScrollChanged(e206) {
    let t10 = Nl().devicePixelRatio;
    return this._scrollOffsetValueBuffer[0] = (e206?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * t10, this._scrollOffsetValueBuffer[1] = (e206?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * t10, this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer), true;
  }
  onThemeChanged(e206) {
    return this._invalidateAllLines(), true;
  }
  onLineMappingChanged(e206) {
    return this._invalidateAllLines(), this._queueBufferUpdate(e206), true;
  }
  onZonesChanged(e206) {
    return this._invalidateAllLines(), this._queueBufferUpdate(e206), true;
  }
  _invalidateAllLines() {
    this._upToDateLines[0].clear(), this._upToDateLines[1].clear();
  }
  _invalidateLinesFrom(e206) {
    for (let t10 of [0, 1]) {
      let n10 = this._upToDateLines[t10];
      for (let t11 of n10) t11 >= e206 && n10.delete(t11);
    }
  }
  _invalidateLineRange(e206, t10) {
    for (let n10 = e206; n10 <= t10; n10++) this._upToDateLines[0].delete(n10), this._upToDateLines[1].delete(n10);
  }
  reset() {
    this._invalidateAllLines();
    for (let e206 of [0, 1]) {
      let t10 = new Float32Array(this._cellValueBuffers[e206]);
      t10.fill(0, 0, t10.length), this._device.queue.writeBuffer(this._cellBindBuffer, 0, t10.buffer, 0, t10.byteLength);
    }
    this._finalRenderedLine = 0;
  }
  update(t10, n10) {
    let r10 = ``, i10, a10 = 0, o10 = 0, s10 = 0, c10 = 0, l10 = 0, u10 = 0, d10, f10 = 0, p10 = 0, m10 = 0, h10 = 0, g10, _10, v10, y10, b10, x10 = 0, S10 = 0, ee2, te2 = Nl().devicePixelRatio, ne2;
    this._scrollInitialized || (this._scrollInitialized = (this.onScrollChanged(), true));
    let re2 = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]), ie2 = _sa.maxSupportedColumns * 6, ae2 = this._upToDateLines[this._activeDoubleBufferIndex], oe2 = 3e3, se2 = 0, ce2 = this._queuedBufferUpdates[this._activeDoubleBufferIndex];
    for (; ce2.length; ) {
      let t11 = ce2.shift();
      switch (t11.type) {
        case 2:
        case 8:
        case 17:
          re2.fill(0), oe2 = 1, se2 = Math.max(se2, this._finalRenderedLine), this._finalRenderedLine = 0;
          break;
        case 10: {
          let n11 = (t11.fromLineNumber - 1) * _sa.maxSupportedColumns * 6, r11 = t11.toLineNumber * _sa.maxSupportedColumns * 6, i11 = (this._finalRenderedLine - (t11.toLineNumber - t11.fromLineNumber + 1)) * _sa.maxSupportedColumns * 6;
          re2.set(re2.subarray(r11), n11), re2.fill(0, i11), oe2 = Math.min(oe2, t11.fromLineNumber), se2 = Math.max(se2, this._finalRenderedLine), this._finalRenderedLine -= t11.toLineNumber - t11.fromLineNumber + 1;
          break;
        }
      }
    }
    for (o10 = t10.startLineNumber; o10 <= t10.endLineNumber; o10++) {
      if (!this._viewGpuContext.canRender(n10, t10, o10)) {
        x10 = (o10 - 1) * _sa.maxSupportedColumns * 6, S10 = o10 * _sa.maxSupportedColumns * 6, re2.fill(0, x10, S10), oe2 = Math.min(oe2, o10), se2 = Math.max(se2, o10);
        continue;
      }
      if (!ae2.has(o10)) {
        oe2 = Math.min(oe2, o10), se2 = Math.max(se2, o10), y10 = t10.getViewLineRenderingData(o10), u10 = 0, ne2 = bw(y10, n10), a10 = n10.spaceWidth * te2, c10 = 0, ee2 = y10.tokens, p10 = y10.minColumn - 1, m10 = 0;
        for (let x11 = 0, S11 = ee2.getCount(); x11 < S11; x11++) if (m10 = ee2.getEndOffset(x11), !(m10 <= p10)) {
          for (h10 = ee2.getMetadata(x11), s10 = p10; s10 < m10 && !(s10 > _sa.maxSupportedColumns); s10++) {
            if (i10 = ne2.getSegmentAtIndex(s10), i10 === void 0) continue;
            r10 = i10, y10.isBasicASCII && n10.useMonospaceOptimizations || (a10 = this.glyphRasterizer.getTextMetrics(r10).width), _10 = void 0, g10 = void 0, v10 = void 0;
            for (b10 of y10.inlineDecorations) {
              if (o10 < b10.range.startLineNumber || o10 > b10.range.endLineNumber || o10 === b10.range.startLineNumber && s10 < b10.range.startColumn - 1 || o10 === b10.range.endLineNumber && s10 >= b10.range.endColumn - 1) continue;
              let e206 = vw.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, b10.inlineClassName);
              for (let t11 of e206) for (let e207 of t11.style) {
                let n11 = t11.styleMap.get(e207)?.toString() ?? ``;
                switch (e207) {
                  case `color`: {
                    let e208 = Y.Format.CSS.parse(n11);
                    if (!e208) throw new je(`Invalid color format ` + n11);
                    _10 = e208.toNumber32Bit();
                    break;
                  }
                  case `font-weight`:
                    g10 = Yle(n11) >= 400;
                    break;
                  case `opacity`:
                    v10 = Xle(n11);
                    break;
                  default:
                    throw new je(`Unexpected inline decoration style`);
                }
              }
            }
            if (r10 === ` ` || r10 === `	`) {
              if (f10 = ((o10 - 1) * _sa.maxSupportedColumns + s10) * 6, re2.fill(0, f10, f10 + 6), r10 === `	`) {
                let e206 = s10 + u10;
                u10 = Ub.nextRenderTabStop(s10 + u10, y10.tabSize), c10 += a10 * (u10 - e206), u10 -= s10 + 1;
              } else c10 += a10;
              continue;
            }
            let p11 = vw.decorationStyleCache.getOrCreateEntry(_10, g10, v10);
            d10 = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, r10, h10, p11, c10), l10 = Math.round(t10.relativeVerticalOffset[o10 - t10.startLineNumber] * te2 + Math.floor((t10.lineHeight * te2 - (d10.fontBoundingBoxAscent + d10.fontBoundingBoxDescent)) / 2) + d10.fontBoundingBoxAscent), f10 = ((o10 - 1) * _sa.maxSupportedColumns + s10) * 6, re2[f10 + 0] = Math.floor(c10), re2[f10 + 1] = l10, re2[f10 + 4] = d10.glyphIndex, re2[f10 + 5] = d10.pageIndex, c10 += a10;
          }
          p10 = m10;
        }
        x10 = ((o10 - 1) * _sa.maxSupportedColumns + m10) * 6, S10 = o10 * _sa.maxSupportedColumns * 6, re2.fill(0, x10, S10), ae2.add(o10);
      }
    }
    let le2 = (t10.endLineNumber - t10.startLineNumber + 1) * ie2;
    return oe2 = Math.min(oe2, _sa.maxSupportedLines), se2 = Math.min(se2, _sa.maxSupportedLines), oe2 <= se2 && this._device.queue.writeBuffer(this._cellBindBuffer, (oe2 - 1) * ie2 * Float32Array.BYTES_PER_ELEMENT, re2.buffer, (oe2 - 1) * ie2 * Float32Array.BYTES_PER_ELEMENT, (se2 - oe2 + 1) * ie2 * Float32Array.BYTES_PER_ELEMENT), this._finalRenderedLine = Math.max(this._finalRenderedLine, se2), this._activeDoubleBufferIndex = +!this._activeDoubleBufferIndex, this._visibleObjectCount = le2, le2;
  }
  draw(t10, n10) {
    if (this._visibleObjectCount <= 0) throw new je(`Attempt to draw 0 objects`);
    t10.draw(XC.length / 2, this._visibleObjectCount, void 0, (n10.startLineNumber - 1) * _sa.maxSupportedColumns);
  }
  _queueBufferUpdate(e206) {
    this._queuedBufferUpdates[0].push(e206), this._queuedBufferUpdates[1].push(e206);
  }
}, _sa.maxSupportedLines = 3e3, _sa.maxSupportedColumns = 200, _sa);
function Yle(e206) {
  switch (e206) {
    case `lighter`:
    case `normal`:
      return 400;
    case `bolder`:
    case `bold`:
      return 700;
  }
  return parseInt(e206);
}
function Xle(e206) {
  return e206.endsWith(`%`) ? parseFloat(e206.substring(0, e206.length - 1)) / 100 : e206.match(/^\d+(?:\.\d*)/) ? parseFloat(e206) : 1;
}
var Zle = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, ww = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Tw = class extends Tb {
  constructor(e206, t10, n10, r10) {
    super(e206), this._viewGpuContext = t10, this._instantiationService = n10, this._logService = r10, this._atlasGpuTextureVersions = [], this._initialized = false, this._glyphRasterizer = this._register(new Jt()), this._renderStrategy = this._register(new Jt()), this.canvas = this._viewGpuContext.canvas.domNode, this._register(hc((e207) => {
      this._viewGpuContext.canvasDevicePixelDimensions.read(e207);
      let t11 = this._lastViewportData;
      t11 && setTimeout(() => {
        t11 === this._lastViewportData && this.renderText(t11);
      });
    })), this.initWebgpu();
  }
  async initWebgpu() {
    if (this._device = vw.deviceSync || await vw.device, this._store.isDisposed) return;
    let e206 = vw.atlas;
    this._register(e206.onDidDeleteGlyphs(() => {
      this._atlasGpuTextureVersions.length = 0, this._atlasGpuTextureVersions[0] = 0, this._atlasGpuTextureVersions[1] = 0, this._renderStrategy.value.reset();
    }));
    let t10 = navigator.gpu.getPreferredCanvasFormat();
    this._viewGpuContext.ctx.configure({ device: this._device, format: t10, alphaMode: `premultiplied` }), this._renderPassColorAttachment = { view: null, loadOp: `load`, storeOp: `store` }, this._renderPassDescriptor = { label: `Monaco render pass`, colorAttachments: [this._renderPassColorAttachment] };
    let n10;
    {
      let e207 = new Float32Array(6), t11 = (t12 = this.canvas.width, n11 = this.canvas.height) => (e207[0] = t12, e207[1] = n11, e207[2] = Math.ceil(this._context.configuration.options.get(165).contentLeft * Nl().devicePixelRatio), e207[3] = 0, e207[4] = e207[0] - e207[2], e207[5] = e207[1] - e207[3], e207);
      n10 = this._register(fw.createBuffer(this._device, { label: `Monaco uniform buffer`, size: 24, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST }, () => t11())).object, this._register(mw(this._viewGpuContext.canvasDevicePixelDimensions, ({ width: e208, height: r11 }) => {
        this._device.queue.writeBuffer(n10, 0, t11(e208, r11));
      })), this._register(mw(this._viewGpuContext.contentLeft, () => {
        this._device.queue.writeBuffer(n10, 0, t11());
      }));
    }
    let r10;
    r10 = this._register(fw.createBuffer(this._device, { label: `Monaco atlas info uniform buffer`, size: 8, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST }, () => {
      let t11 = new Float32Array(2);
      return t11[0] = e206.pageSize, t11[1] = e206.pageSize, t11;
    })).object;
    let i10 = this._context.configuration.options.get(58), a10 = this._context.configuration.options.get(61);
    this._glyphRasterizer.value = this._register(new $C(a10, i10, this._viewGpuContext.devicePixelRatio.get(), vw.decorationStyleCache)), this._register(mw(this._viewGpuContext.devicePixelRatio, () => {
      this._refreshGlyphRasterizer();
    })), this._renderStrategy.value = this._instantiationService.createInstance(Cw, this._context, this._viewGpuContext, this._device, this._glyphRasterizer), this._glyphStorageBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco glyph storage buffer`, size: sw.maximumPageCount * (iw.maximumGlyphCount * 24), usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST })).object, this._atlasGpuTextureVersions[0] = 0, this._atlasGpuTextureVersions[1] = 0, this._atlasGpuTexture = this._register(fw.createTexture(this._device, { label: `Monaco atlas texture`, format: `rgba8unorm`, size: { width: e206.pageSize, height: e206.pageSize, depthOrArrayLayers: sw.maximumPageCount }, dimension: `2d`, usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT })).object, this._updateAtlasStorageBufferAndTexture(), this._vertexBuffer = this._register(fw.createBuffer(this._device, { label: `Monaco vertex buffer`, size: XC.byteLength, usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST }, XC)).object;
    let o10 = this._device.createShaderModule({ label: `Monaco shader module`, code: this._renderStrategy.value.wgsl });
    if (this._pipeline = this._device.createRenderPipeline({ label: `Monaco render pipeline`, layout: `auto`, vertex: { module: o10, buffers: [{ arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT, attributes: [{ shaderLocation: 0, offset: 0, format: `float32x2` }] }] }, fragment: { module: o10, targets: [{ format: t10, blend: { color: { srcFactor: `src-alpha`, dstFactor: `one-minus-src-alpha` }, alpha: { srcFactor: `src-alpha`, dstFactor: `one-minus-src-alpha` } } }] } }), this._rebuildBindGroup = () => {
      this._bindGroup = this._device.createBindGroup({ label: `Monaco bind group`, layout: this._pipeline.getBindGroupLayout(0), entries: [{ binding: 0, resource: { buffer: this._glyphStorageBuffer } }, { binding: 2, resource: this._device.createSampler({ label: `Monaco atlas sampler`, magFilter: `nearest`, minFilter: `nearest` }) }, { binding: 3, resource: this._atlasGpuTexture.createView() }, { binding: 4, resource: { buffer: n10 } }, { binding: 5, resource: { buffer: r10 } }, ...this._renderStrategy.value.bindGroupEntries] });
    }, this._rebuildBindGroup(), this._initialized = true, this._initViewportData) {
      for (let e207 of this._initViewportData) this.renderText(e207);
      this._initViewportData = void 0;
    }
  }
  _refreshRenderStrategy(e206) {
    if (this._renderStrategy.value?.type === `viewport` || e206.endLineNumber < Cw.maxSupportedLines && this._viewportMaxColumn(e206) < Cw.maxSupportedColumns) return;
    this._logService.trace(`File is larger than ${Cw.maxSupportedLines} lines or ${Cw.maxSupportedColumns} columns, switching to viewport render strategy`);
    let t10 = this._instantiationService.createInstance(Kle, this._context, this._viewGpuContext, this._device, this._glyphRasterizer);
    this._renderStrategy.value = t10, this._register(t10.onDidChangeBindGroupEntries(() => this._rebuildBindGroup?.())), this._rebuildBindGroup?.();
  }
  _viewportMaxColumn(e206) {
    let t10 = 0, n10;
    for (let r10 = e206.startLineNumber; r10 <= e206.endLineNumber; r10++) n10 = e206.getViewLineRenderingData(r10), t10 = Math.max(t10, n10.maxColumn);
    return t10;
  }
  _updateAtlasStorageBufferAndTexture() {
    for (let [e206, t10] of vw.atlas.pages.entries()) {
      if (e206 >= sw.maximumPageCount) {
        console.log(`Attempt to upload atlas page [${e206}], only ${sw.maximumPageCount} are supported currently`);
        continue;
      }
      if (t10.version === this._atlasGpuTextureVersions[e206]) continue;
      this._logService.trace(`Updating atlas page[`, e206, `] from version `, this._atlasGpuTextureVersions[e206], ` to version `, t10.version);
      let n10 = 6 * iw.maximumGlyphCount, r10 = new Float32Array(n10), i10 = 0;
      for (let e207 of t10.glyphs) r10[i10 + 0] = e207.x, r10[i10 + 0 + 1] = e207.y, r10[i10 + 2] = e207.w, r10[i10 + 2 + 1] = e207.h, r10[i10 + 4] = e207.originOffsetX, r10[i10 + 4 + 1] = e207.originOffsetY, i10 += 6;
      if (i10 / 6 > iw.maximumGlyphCount) throw Error(`Attempting to write more glyphs (${i10 / 6}) than the GPUBuffer can hold (${iw.maximumGlyphCount})`);
      this._device.queue.writeBuffer(this._glyphStorageBuffer, e206 * 6 * iw.maximumGlyphCount * Float32Array.BYTES_PER_ELEMENT, r10, 0, 6 * iw.maximumGlyphCount), t10.usedArea.right - t10.usedArea.left > 0 && t10.usedArea.bottom - t10.usedArea.top > 0 && this._device.queue.copyExternalImageToTexture({ source: t10.source }, { texture: this._atlasGpuTexture, origin: { x: t10.usedArea.left, y: t10.usedArea.top, z: e206 } }, { width: t10.usedArea.right - t10.usedArea.left + 1, height: t10.usedArea.bottom - t10.usedArea.top + 1 }), this._atlasGpuTextureVersions[e206] = t10.version;
    }
  }
  prepareRender(e206) {
    throw new je(`Should not be called`);
  }
  render(e206) {
    throw new je(`Should not be called`);
  }
  onConfigurationChanged(e206) {
    return this._refreshGlyphRasterizer(), true;
  }
  onCursorStateChanged(e206) {
    return true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onLineMappingChanged(e206) {
    return true;
  }
  onRevealRangeRequest(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return true;
  }
  onThemeChanged(e206) {
    return true;
  }
  onZonesChanged(e206) {
    return true;
  }
  _refreshGlyphRasterizer() {
    let e206 = this._glyphRasterizer.value;
    if (!e206) return;
    let t10 = this._context.configuration.options.get(58), n10 = this._context.configuration.options.get(61), r10 = this._viewGpuContext.devicePixelRatio.get();
    (e206.fontFamily !== t10 || e206.fontSize !== n10 || e206.devicePixelRatio !== r10) && (this._glyphRasterizer.value = new $C(n10, t10, r10, vw.decorationStyleCache));
  }
  renderText(e206) {
    if (this._initialized) return this._refreshRenderStrategy(e206), this._renderText(e206);
    this._initViewportData = this._initViewportData ?? [], this._initViewportData.push(e206);
  }
  _renderText(e206) {
    this._viewGpuContext.rectangleRenderer.draw(e206);
    let t10 = new wC(this._context.configuration, this._context.theme.type);
    this._renderStrategy.value.update(e206, t10), this._updateAtlasStorageBufferAndTexture();
    let n10 = this._device.createCommandEncoder({ label: `Monaco command encoder` });
    this._renderPassColorAttachment.view = this._viewGpuContext.ctx.getCurrentTexture().createView({ label: `Monaco canvas texture view` });
    let r10 = n10.beginRenderPass(this._renderPassDescriptor);
    r10.setPipeline(this._pipeline), r10.setVertexBuffer(0, this._vertexBuffer);
    let i10 = Math.ceil(this._viewGpuContext.contentLeft.get() * this._viewGpuContext.devicePixelRatio.get());
    r10.setScissorRect(i10, 0, this.canvas.width - i10, this.canvas.height), r10.setBindGroup(0, this._bindGroup), this._renderStrategy.value.draw(r10, e206), r10.end();
    let a10 = n10.finish();
    this._device.queue.submit([a10]), this._lastViewportData = e206, this._lastViewLineOptions = t10;
  }
  linesVisibleRangesForRange(e206, t10) {
    if (!this._lastViewportData) return null;
    let n10 = e206.endLineNumber, r10 = M.intersectRanges(e206, this._lastViewportData.visibleRange);
    if (!r10) return null;
    let i10 = this._lastViewportData.startLineNumber, a10 = this._lastViewportData.endLineNumber, o10 = this._lastViewportData, s10 = this._lastViewLineOptions;
    if (!o10 || !s10) return null;
    let c10 = [], l10 = 0;
    t10 && (l10 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(r10.startLineNumber, 1)).lineNumber);
    for (let e207 = r10.startLineNumber; e207 <= r10.endLineNumber; e207++) {
      if (e207 < i10 || e207 > a10) continue;
      let o11 = e207 === r10.startLineNumber ? r10.startColumn : 1, u10 = e207 !== n10, d10 = u10 ? this._context.viewModel.getLineMaxColumn(e207) : r10.endColumn, f10 = this._visibleRangesForLineRange(e207, o11, d10);
      if (f10) {
        if (t10 && e207 < n10) {
          let t11 = l10;
          l10 = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new j(e207 + 1, 1)).lineNumber, t11 !== l10 && (f10.ranges[f10.ranges.length - 1].width += s10.spaceWidth);
        }
        c10.push(new Db(f10.outsideRenderedLine, e207, Ob.from(f10.ranges), u10));
      }
    }
    return c10.length === 0 ? null : c10;
  }
  _visibleRangesForLineRange(e206, t10, n10) {
    if (this.shouldRender()) return null;
    let r10 = this._lastViewportData, i10 = this._lastViewLineOptions;
    if (!r10 || !i10 || e206 < r10.startLineNumber || e206 > r10.endLineNumber) return null;
    let a10 = r10.getViewLineRenderingData(e206), o10 = a10.content, s10;
    a10.isBasicASCII && i10.useMonospaceOptimizations || (s10 = bw(a10, i10));
    let c10 = ``, l10 = 0, u10 = 0;
    for (let e207 = 0; e207 < t10 - 1; e207++) {
      if (a10.isBasicASCII && i10.useMonospaceOptimizations) c10 = o10.charAt(e207);
      else {
        if (c10 = s10.getSegmentAtIndex(e207), c10 === void 0) continue;
        u10 += this._renderStrategy.value.glyphRasterizer.getTextMetrics(c10).width / Nl().devicePixelRatio - i10.spaceWidth;
      }
      c10 === `	` ? l10 = Ub.nextRenderTabStop(l10, a10.tabSize) : l10++;
    }
    let d10 = l10, f10 = 0;
    for (let e207 = t10 - 1; e207 < n10 - 1; e207++) {
      if (a10.isBasicASCII && i10.useMonospaceOptimizations) c10 = o10.charAt(e207);
      else {
        if (c10 = s10.getSegmentAtIndex(e207), c10 === void 0) continue;
        f10 += this._renderStrategy.value.glyphRasterizer.getTextMetrics(c10).width / Nl().devicePixelRatio - i10.spaceWidth;
      }
      c10 === `	` ? d10 = Ub.nextRenderTabStop(d10, a10.tabSize) : d10++;
    }
    return new jb(false, [new kb(l10 * i10.spaceWidth + u10, (d10 - l10) * i10.spaceWidth + f10)]);
  }
  visibleRangeForPosition(e206) {
    let t10 = this._visibleRangesForLineRange(e206.lineNumber, e206.column, e206.column);
    return t10 ? new Ab(t10.outsideRenderedLine, t10.ranges[0].left) : null;
  }
  getLineWidth(e206) {
    if (!this._lastViewportData || !this._lastViewLineOptions || !this._viewGpuContext.canRender(this._lastViewLineOptions, this._lastViewportData, e206)) return;
    let t10 = this._lastViewportData.getViewLineRenderingData(e206), n10 = this._visibleRangesForLineRange(e206, 1, t10.maxColumn)?.ranges.at(-1);
    if (n10) return n10.width;
  }
  getPositionAtCoordinate(e206, t10) {
    if (!this._lastViewportData || !this._lastViewLineOptions || !this._viewGpuContext.canRender(this._lastViewLineOptions, this._lastViewportData, e206)) return;
    let n10 = this._lastViewportData.getViewLineRenderingData(e206), r10 = n10.content, i10 = Nl().devicePixelRatio, a10 = t10 * i10, o10 = this._lastViewLineOptions.spaceWidth * i10, s10 = bw(n10, this._lastViewLineOptions), c10 = 0, l10 = 0, u10 = 0, d10 = 0;
    for (let e207 = 0; e207 < r10.length; e207++) {
      let t11 = s10.getSegmentAtIndex(e207);
      if (t11 === void 0) {
        d10++;
        continue;
      }
      if (t11 === `	`) {
        let t12 = e207 + u10;
        u10 = Ub.nextRenderTabStop(e207 + u10, n10.tabSize), l10 = o10 * (u10 - t12), u10 -= e207 + 1;
      } else l10 = n10.isBasicASCII && this._lastViewLineOptions.useMonospaceOptimizations ? o10 : this._renderStrategy.value.glyphRasterizer.getTextMetrics(t11).width;
      if (a10 < c10 + l10 / 2) break;
      c10 += l10, d10++;
    }
    return new j(e206, d10 + 1);
  }
};
Tw = Zle([ww(2, V), ww(3, Ud)], Tw);
var Ew = new class {
  constructor() {
    this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._enabled = true;
  }
  get enabled() {
    return this._enabled;
  }
  enable() {
    this._enabled = true, this._onDidChange.fire();
  }
  disable() {
    this._enabled = false, this._onDidChange.fire();
  }
}(), Dw = xu(`keybindingService`), Ow = class extends Tb {
}, kw = class {
  _getPageOfLine(e206, t10) {
    return Math.floor((e206 - 1) / t10);
  }
  _getRangeForPage(e206, t10) {
    let n10 = e206 * t10;
    return new M(n10 + 1, 1, n10 + t10 + 1, 1);
  }
  fromEditorSelection(e206, t10, n10, r10) {
    let i10 = this._getPageOfLine(t10.startLineNumber, n10), a10 = this._getRangeForPage(i10, n10), o10 = this._getPageOfLine(t10.endLineNumber, n10), s10 = this._getRangeForPage(o10, n10), c10 = a10.intersectRanges(new M(1, 1, t10.startLineNumber, t10.startColumn));
    if (r10 && e206.getValueLengthInRange(c10, 1) > 500) {
      let t11 = e206.modifyPosition(c10.getEndPosition(), -500);
      c10 = M.fromPositions(t11, c10.getEndPosition());
    }
    let l10 = e206.getValueInRange(c10, 1), u10 = e206.getLineCount(), d10 = e206.getLineMaxColumn(u10), f10 = s10.intersectRanges(new M(t10.endLineNumber, t10.endColumn, u10, d10));
    if (r10 && e206.getValueLengthInRange(f10, 1) > 500) {
      let t11 = e206.modifyPosition(f10.getStartPosition(), 500);
      f10 = M.fromPositions(f10.getStartPosition(), t11);
    }
    let p10 = e206.getValueInRange(f10, 1), m10;
    if (i10 === o10 || i10 + 1 === o10) m10 = e206.getValueInRange(t10, 1);
    else {
      let n11 = a10.intersectRanges(t10), r11 = s10.intersectRanges(t10);
      m10 = e206.getValueInRange(n11, 1) + `\u2026` + e206.getValueInRange(r11, 1);
    }
    r10 && m10.length > 2 * 500 && (m10 = m10.substring(0, 500) + `\u2026` + m10.substring(m10.length - 500, m10.length));
    let h10, g10;
    return t10.getDirection() === 0 ? (h10 = l10.length, g10 = l10.length + m10.length) : (g10 = l10.length, h10 = l10.length + m10.length), { value: l10 + m10 + p10, selection: t10, selectionStart: h10, selectionEnd: g10, startPositionWithinEditor: c10.getStartPosition(), newlineCountBeforeSelection: c10.endLineNumber - c10.startLineNumber };
  }
};
function Aw(e206, t10) {
  if (e206.get(2) === 1) {
    let e207 = t10.lookupKeybinding(`editor.action.toggleScreenReaderAccessibilityMode`)?.getAriaLabel(), n10 = t10.lookupKeybinding(`workbench.action.showCommands`)?.getAriaLabel(), r10 = t10.lookupKeybinding(`workbench.action.openGlobalKeybindings`)?.getAriaLabel(), i10 = C(61, `The editor is not accessible at this time.`);
    return e207 ? C(62, `{0} To enable screen reader optimized mode, use {1}`, i10, e207) : n10 ? C(63, `{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.`, i10, n10) : r10 ? C(64, `{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.`, i10, r10) : i10;
  }
  return e206.get(8);
}
function jw(e206) {
  let t10 = 0, n10 = -1;
  do {
    if (n10 = e206.indexOf(`
`, n10 + 1), n10 === -1) break;
    t10++;
  } while (true);
  return t10;
}
var Qle = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Mw = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, $le = class {
  constructor(e206, t10, n10, r10, i10) {
    this._context = e206, this.modelLineNumber = t10, this.distanceToModelLineStart = n10, this.widthOfHiddenLineTextBefore = r10, this.distanceToModelLineEnd = i10, this._visibleTextAreaBrand = void 0, this.startPosition = null, this.endPosition = null, this.visibleTextareaStart = null, this.visibleTextareaEnd = null, this._previousPresentation = null;
  }
  prepareRender(e206) {
    let t10 = new j(this.modelLineNumber, this.distanceToModelLineStart + 1), n10 = new j(this.modelLineNumber, this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber) - this.distanceToModelLineEnd);
    this.startPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t10), this.endPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n10), this.startPosition.lineNumber === this.endPosition.lineNumber ? (this.visibleTextareaStart = e206.visibleRangeForPosition(this.startPosition), this.visibleTextareaEnd = e206.visibleRangeForPosition(this.endPosition)) : (this.visibleTextareaStart = null, this.visibleTextareaEnd = null);
  }
  definePresentation(e206) {
    return this._previousPresentation || (e206 ? this._previousPresentation = e206 : this._previousPresentation = { foreground: 1, italic: false, bold: false, underline: false, strikethrough: false }), this._previousPresentation;
  }
}, Nw = Mo, Pw = class extends Ow {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(e206), this._keybindingService = i10, this._instantiationService = a10, this._primaryCursorPosition = new j(1, 1), this._primaryCursorVisibleRange = null, this._viewController = n10, this._visibleRangeProvider = r10, this._scrollLeft = 0, this._scrollTop = 0;
    let o10 = this._context.configuration.options, s10 = o10.get(165);
    this._setAccessibilityOptions(o10), this._contentLeft = s10.contentLeft, this._contentWidth = s10.contentWidth, this._contentHeight = s10.height, this._fontInfo = o10.get(59), this._emptySelectionClipboard = o10.get(45), this._copyWithSyntaxHighlighting = o10.get(31), this._visibleTextArea = null, this._selections = [new N(1, 1, 1, 1)], this._modelSelections = [new N(1, 1, 1, 1)], this._lastRenderPosition = null, this.textArea = _u(document.createElement(`textarea`)), Eb.write(this.textArea, 7), this.textArea.setClassName(`inputarea ${SC}`), this.textArea.setAttribute(`wrap`, this._textAreaWrapping && !this._visibleTextArea ? `on` : `off`);
    let { tabSize: c10 } = this._context.viewModel.model.getOptions();
    this.textArea.domNode.style.tabSize = `${c10 * this._fontInfo.spaceWidth}px`, this.textArea.setAttribute(`autocorrect`, `off`), this.textArea.setAttribute(`autocapitalize`, `off`), this.textArea.setAttribute(`autocomplete`, `off`), this.textArea.setAttribute(`spellcheck`, `false`), this.textArea.setAttribute(`aria-label`, Aw(o10, this._keybindingService)), this.textArea.setAttribute(`aria-required`, o10.get(9) ? `true` : `false`), this.textArea.setAttribute(`tabindex`, String(o10.get(140))), this.textArea.setAttribute(`role`, `textbox`), this.textArea.setAttribute(`aria-roledescription`, C(65, `editor`)), this.textArea.setAttribute(`aria-multiline`, `true`), this.textArea.setAttribute(`aria-autocomplete`, o10.get(104) ? `none` : `both`), this._ensureReadOnlyAttribute(), this.textAreaCover = _u(document.createElement(`div`)), this.textAreaCover.setPosition(`absolute`), t10.appendChild(this.textArea), t10.appendChild(this.textAreaCover);
    let l10 = new kw(), u10 = { getDataToCopy: () => bx(this._context.viewModel, this._modelSelections, this._emptySelectionClipboard, this._copyWithSyntaxHighlighting), getScreenReaderContent: () => {
      if (this._accessibilitySupport === 1) {
        let e208 = this._selections[0];
        if (Tt && e208.isEmpty()) {
          let t11 = e208.getStartPosition(), n11 = this._getWordBeforePosition(t11);
          if (n11.length === 0 && (n11 = this._getCharacterBeforePosition(t11)), n11.length > 0) return new wx(n11, n11.length, n11.length, M.fromPositions(t11), 0);
        }
        if (Tt && !e208.isEmpty() && this._context.viewModel.getValueLengthInRange(e208, 0) < 500) {
          let t11 = this._context.viewModel.getValueInRange(e208, 0);
          return new wx(t11, 0, t11.length, e208, 0);
        }
        return Fo && !e208.isEmpty() ? new wx(`vscode-placeholder`, 0, 18, null, void 0) : wx.EMPTY;
      }
      if (Lo) {
        let e208 = this._selections[0];
        if (e208.isEmpty()) {
          let t11 = e208.getStartPosition(), [n11, r11] = this._getAndroidWordAtPosition(t11);
          if (n11.length > 0) return new wx(n11, r11, r11, M.fromPositions(t11), 0);
        }
        return wx.EMPTY;
      }
      let e207 = l10.fromEditorSelection(this._context.viewModel, this._selections[0], this._accessibilityPageSize, this._accessibilitySupport === 0);
      return wx.fromScreenReaderContentState(e207);
    }, deduceModelPosition: (e207, t11, n11) => this._context.viewModel.deduceModelPositionRelativeToViewPosition(e207, t11, n11) }, d10 = this._register(new nse(this.textArea.domNode));
    this._textAreaInput = this._register(this._instantiationService.createInstance(kx, u10, d10, Pt, { isAndroid: Lo, isChrome: Po, isFirefox: Mo, isSafari: Fo })), this._register(this._textAreaInput.onKeyDown((e207) => {
      this._viewController.emitKeyDown(e207);
    })), this._register(this._textAreaInput.onKeyUp((e207) => {
      this._viewController.emitKeyUp(e207);
    })), this._register(this._textAreaInput.onPaste((e207) => {
      let t11 = false, n11 = null, r11 = null;
      e207.metadata && (t11 = this._emptySelectionClipboard && !!e207.metadata.isFromEmptySelection, n11 = e207.metadata.multicursorText === void 0 ? null : e207.metadata.multicursorText, r11 = e207.metadata.mode), this._viewController.paste(e207.text, t11, n11, r11);
    })), this._register(this._textAreaInput.onCut(() => {
      this._viewController.cut();
    })), this._register(this._textAreaInput.onType((e207) => {
      e207.replacePrevCharCnt || e207.replaceNextCharCnt || e207.positionDelta ? this._viewController.compositionType(e207.text, e207.replacePrevCharCnt, e207.replaceNextCharCnt, e207.positionDelta) : this._viewController.type(e207.text);
    })), this._register(this._textAreaInput.onSelectionChangeRequest((e207) => {
      this._viewController.setSelection(e207);
    })), this._register(this._textAreaInput.onCompositionStart((e207) => {
      let t11 = this.textArea.domNode, n11 = this._modelSelections[0], { distanceToModelLineStart: r11, widthOfHiddenTextBefore: i11 } = (() => {
        let e208 = t11.value.substring(0, Math.min(t11.selectionStart, t11.selectionEnd)), r12 = e208.lastIndexOf(`
`), i12 = e208.substring(r12 + 1), a12 = i12.lastIndexOf(`	`), o11 = i12.length - a12 - 1, s11 = n11.getStartPosition(), c11 = Math.min(s11.column - 1, o11), l11 = s11.column - 1 - c11, u11 = i12.substring(0, i12.length - c11), { tabSize: d11 } = this._context.viewModel.model.getOptions();
        return { distanceToModelLineStart: l11, widthOfHiddenTextBefore: eue(this.textArea.domNode.ownerDocument, u11, this._fontInfo, d11) };
      })(), { distanceToModelLineEnd: a11 } = (() => {
        let e208 = t11.value.substring(Math.max(t11.selectionStart, t11.selectionEnd)), r12 = e208.indexOf(`
`), i12 = r12 === -1 ? e208 : e208.substring(0, r12), a12 = i12.indexOf(`	`), o11 = a12 === -1 ? i12.length : i12.length - a12 - 1, s11 = n11.getEndPosition(), c11 = Math.min(this._context.viewModel.model.getLineMaxColumn(s11.lineNumber) - s11.column, o11);
        return { distanceToModelLineEnd: this._context.viewModel.model.getLineMaxColumn(s11.lineNumber) - s11.column - c11 };
      })();
      this._context.viewModel.revealRange(`keyboard`, true, M.fromPositions(this._selections[0].getStartPosition()), 0, 1), this._visibleTextArea = new $le(this._context, n11.startLineNumber, r11, i11, a11), this.textArea.setAttribute(`wrap`, this._textAreaWrapping && !this._visibleTextArea ? `on` : `off`), this._visibleTextArea.prepareRender(this._visibleRangeProvider), this._render(), this.textArea.setClassName(`inputarea ${SC} ime-input`), this._viewController.compositionStart(), this._context.viewModel.onCompositionStart();
    })), this._register(this._textAreaInput.onCompositionUpdate((e207) => {
      this._visibleTextArea && (this._visibleTextArea.prepareRender(this._visibleRangeProvider), this._render());
    })), this._register(this._textAreaInput.onCompositionEnd(() => {
      this._visibleTextArea = null, this.textArea.setAttribute(`wrap`, this._textAreaWrapping && !this._visibleTextArea ? `on` : `off`), this._render(), this.textArea.setClassName(`inputarea ${SC}`), this._viewController.compositionEnd(), this._context.viewModel.onCompositionEnd();
    })), this._register(this._textAreaInput.onFocus(() => {
      this._context.viewModel.setHasFocus(true);
    })), this._register(this._textAreaInput.onBlur(() => {
      this._context.viewModel.setHasFocus(false);
    })), this._register(Ew.onDidChange(() => {
      this._ensureReadOnlyAttribute();
    }));
  }
  get domNode() {
    return this.textArea;
  }
  writeScreenReaderContent(e206) {
    this._textAreaInput.writeNativeTextAreaContent(e206);
  }
  dispose() {
    super.dispose(), this.textArea.domNode.remove(), this.textAreaCover.domNode.remove();
  }
  _getAndroidWordAtPosition(e206) {
    let t10 = this._context.viewModel.getLineContent(e206.lineNumber), n10 = Zp('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?', []), r10 = true, i10 = e206.column, a10 = true, o10 = e206.column, s10 = 0;
    for (; s10 < 50 && (r10 || a10); ) {
      if (r10 && i10 <= 1 && (r10 = false), r10) {
        let e207 = t10.charCodeAt(i10 - 2);
        n10.get(e207) === 0 ? i10-- : r10 = false;
      }
      if (a10 && o10 > t10.length && (a10 = false), a10) {
        let e207 = t10.charCodeAt(o10 - 1);
        n10.get(e207) === 0 ? o10++ : a10 = false;
      }
      s10++;
    }
    return [t10.substring(i10 - 1, o10 - 1), e206.column - i10];
  }
  _getWordBeforePosition(e206) {
    let t10 = this._context.viewModel.getLineContent(e206.lineNumber), n10 = Zp(this._context.configuration.options.get(148), []), r10 = e206.column, i10 = 0;
    for (; r10 > 1; ) {
      let a10 = t10.charCodeAt(r10 - 2);
      if (n10.get(a10) !== 0 || i10 > 50) return t10.substring(r10 - 1, e206.column - 1);
      i10++, r10--;
    }
    return t10.substring(0, e206.column - 1);
  }
  _getCharacterBeforePosition(e206) {
    if (e206.column > 1) {
      let t10 = this._context.viewModel.getLineContent(e206.lineNumber).charAt(e206.column - 2);
      if (!ao(t10.charCodeAt(0))) return t10;
    }
    return ``;
  }
  _setAccessibilityOptions(e206) {
    this._accessibilitySupport = e206.get(2);
    let t10 = e206.get(3);
    this._accessibilitySupport === 2 && t10 === lr.accessibilityPageSize.defaultValue ? this._accessibilityPageSize = 500 : this._accessibilityPageSize = t10;
    let n10 = e206.get(165).wrappingColumn;
    if (n10 !== -1 && this._accessibilitySupport !== 1) {
      let t11 = e206.get(59);
      this._textAreaWrapping = true, this._textAreaWidth = Math.round(n10 * t11.typicalHalfwidthCharacterWidth);
    } else this._textAreaWrapping = false, this._textAreaWidth = +!Nw;
  }
  onConfigurationChanged(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(165);
    this._setAccessibilityOptions(t10), this._contentLeft = n10.contentLeft, this._contentWidth = n10.contentWidth, this._contentHeight = n10.height, this._fontInfo = t10.get(59), this._emptySelectionClipboard = t10.get(45), this._copyWithSyntaxHighlighting = t10.get(31), this.textArea.setAttribute(`wrap`, this._textAreaWrapping && !this._visibleTextArea ? `on` : `off`);
    let { tabSize: r10 } = this._context.viewModel.model.getOptions();
    return this.textArea.domNode.style.tabSize = `${r10 * this._fontInfo.spaceWidth}px`, this.textArea.setAttribute(`aria-label`, Aw(t10, this._keybindingService)), this.textArea.setAttribute(`aria-required`, t10.get(9) ? `true` : `false`), this.textArea.setAttribute(`tabindex`, String(t10.get(140))), (e206.hasChanged(41) || e206.hasChanged(104)) && this._ensureReadOnlyAttribute(), e206.hasChanged(2) && this._textAreaInput.writeNativeTextAreaContent(`strategy changed`), true;
  }
  onCursorStateChanged(e206) {
    return this._selections = e206.selections.slice(0), this._modelSelections = e206.modelSelections.slice(0), this._textAreaInput.writeNativeTextAreaContent(`selection changed`), true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return this._scrollLeft = e206.scrollLeft, this._scrollTop = e206.scrollTop, true;
  }
  onZonesChanged(e206) {
    return true;
  }
  isFocused() {
    return this._textAreaInput.isFocused();
  }
  focus() {
    this._textAreaInput.focusTextArea();
  }
  refreshFocusState() {
    this._textAreaInput.refreshFocusState();
  }
  getLastRenderData() {
    return this._lastRenderPosition;
  }
  setAriaOptions(e206) {
    e206.activeDescendant ? (this.textArea.setAttribute(`aria-haspopup`, `true`), this.textArea.setAttribute(`aria-autocomplete`, `list`), this.textArea.setAttribute(`aria-activedescendant`, e206.activeDescendant)) : (this.textArea.setAttribute(`aria-haspopup`, `false`), this.textArea.setAttribute(`aria-autocomplete`, `both`), this.textArea.removeAttribute(`aria-activedescendant`)), e206.role && this.textArea.setAttribute(`role`, e206.role);
  }
  _ensureReadOnlyAttribute() {
    let e206 = this._context.configuration.options;
    !Ew.enabled || e206.get(41) && e206.get(104) ? this.textArea.setAttribute(`readonly`, `true`) : this.textArea.removeAttribute(`readonly`);
  }
  prepareRender(e206) {
    this._primaryCursorPosition = new j(this._selections[0].positionLineNumber, this._selections[0].positionColumn), this._primaryCursorVisibleRange = e206.visibleRangeForPosition(this._primaryCursorPosition), this._visibleTextArea?.prepareRender(e206);
  }
  render(e206) {
    this._textAreaInput.writeNativeTextAreaContent(`render`), this._render();
  }
  _render() {
    if (this._visibleTextArea) {
      let e207 = this._visibleTextArea.visibleTextareaStart, t11 = this._visibleTextArea.visibleTextareaEnd, n10 = this._visibleTextArea.startPosition, r10 = this._visibleTextArea.endPosition;
      if (n10 && r10 && e207 && t11 && t11.left >= this._scrollLeft && e207.left <= this._scrollLeft + this._contentWidth) {
        let i10 = this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber) - this._scrollTop, a10 = jw(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart)), o10 = this._visibleTextArea.widthOfHiddenLineTextBefore, s10 = this._contentLeft + e207.left - this._scrollLeft, c10 = t11.left - e207.left + 1;
        if (s10 < this._contentLeft) {
          let e208 = this._contentLeft - s10;
          s10 += e208, o10 += e208, c10 -= e208;
        }
        c10 > this._contentWidth && (c10 = this._contentWidth);
        let l10 = this._context.viewLayout.getLineHeightForLineNumber(n10.lineNumber), u10 = this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition), d10 = this._context.viewModel.getViewLineData(n10.lineNumber), f10 = d10.tokens.findTokenIndexAtOffset(n10.column - 1), p10 = f10 === d10.tokens.findTokenIndexAtOffset(r10.column - 1), m10 = this._visibleTextArea.definePresentation(p10 ? d10.tokens.getPresentation(f10) : null);
        this.textArea.domNode.scrollTop = a10 * l10, this.textArea.domNode.scrollLeft = o10, this._doRender({ lastRenderPosition: null, top: i10, left: s10, width: c10, height: l10, useCover: false, color: (Pi.getColorMap() || [])[m10.foreground], italic: m10.italic, bold: m10.bold, underline: m10.underline, strikethrough: m10.strikethrough, fontSize: u10 });
      }
      return;
    }
    if (!this._primaryCursorVisibleRange) {
      this._renderAtTopLeft();
      return;
    }
    let e206 = this._contentLeft + this._primaryCursorVisibleRange.left - this._scrollLeft;
    if (e206 < this._contentLeft || e206 > this._contentLeft + this._contentWidth) {
      this._renderAtTopLeft();
      return;
    }
    let t10 = this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber) - this._scrollTop;
    if (t10 < 0 || t10 > this._contentHeight) {
      this._renderAtTopLeft();
      return;
    }
    if (Tt || this._accessibilitySupport === 2) {
      let n10 = this._primaryCursorPosition.lineNumber, r10 = this._context.viewLayout.getLineHeightForLineNumber(n10);
      this._doRender({ lastRenderPosition: this._primaryCursorPosition, top: t10, left: this._textAreaWrapping ? this._contentLeft : e206, width: this._textAreaWidth, height: r10, useCover: false }), this.textArea.domNode.scrollLeft = this._primaryCursorVisibleRange.left;
      let i10 = this._textAreaInput.textAreaState.newlineCountBeforeSelection ?? jw(this.textArea.domNode.value.substring(0, this.textArea.domNode.selectionStart));
      this.textArea.domNode.scrollTop = i10 * r10;
      return;
    }
    this._doRender({ lastRenderPosition: this._primaryCursorPosition, top: t10, left: this._textAreaWrapping ? this._contentLeft : e206, width: this._textAreaWidth, height: +!Nw, useCover: false });
  }
  _renderAtTopLeft() {
    this._doRender({ lastRenderPosition: null, top: 0, left: 0, width: this._textAreaWidth, height: +!Nw, useCover: true });
  }
  _doRender(e206) {
    this._lastRenderPosition = e206.lastRenderPosition;
    let t10 = this.textArea, n10 = this.textAreaCover;
    vu(t10, this._fontInfo), t10.setTop(e206.top), t10.setLeft(e206.left), t10.setWidth(e206.width), t10.setHeight(e206.height), t10.setLineHeight(e206.height), t10.setFontSize(e206.fontSize ?? this._fontInfo.fontSize), t10.setColor(e206.color ? Y.Format.CSS.formatHex(e206.color) : ``), t10.setFontStyle(e206.italic ? `italic` : ``), e206.bold && t10.setFontWeight(`bold`), t10.setTextDecoration(`${e206.underline ? ` underline` : ``}${e206.strikethrough ? ` line-through` : ``}`), n10.setTop(e206.useCover ? e206.top : 0), n10.setLeft(e206.useCover ? e206.left : 0), n10.setWidth(e206.useCover ? e206.width : 0), n10.setHeight(e206.useCover ? e206.height : 0);
    let r10 = this._context.configuration.options;
    r10.get(66) ? n10.setClassName(`monaco-editor-background textAreaCover ` + TC.OUTER_CLASS_NAME) : r10.get(76).renderType === 0 ? n10.setClassName(`monaco-editor-background textAreaCover`) : n10.setClassName(`monaco-editor-background textAreaCover ` + xC.CLASS_NAME);
  }
};
Pw = Qle([Mw(4, Dw), Mw(5, V)], Pw);
function eue(e206, t10, n10, r10) {
  if (t10.length === 0) return 0;
  let i10 = e206.createElement(`div`);
  i10.style.position = `absolute`, i10.style.top = `-50000px`, i10.style.width = `50000px`;
  let a10 = e206.createElement(`span`);
  vu(a10, n10), a10.style.whiteSpace = `pre`, a10.style.tabSize = `${r10 * n10.spaceWidth}px`, a10.append(t10), i10.appendChild(a10), e206.body.appendChild(i10);
  let o10 = a10.offsetWidth;
  return i10.remove(), o10;
}
var tue = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, nue = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Fw = class extends D {
  constructor(e206, t10, n10) {
    super(), this._domNode = t10, this._onFocusChange = n10, this._isFocused = false, this._isPaused = false, this._register(L(this._domNode, `focus`, () => {
      e206.trace(`NativeEditContext.focus`), !this._isPaused && this.refreshFocusState();
    })), this._register(L(this._domNode, `blur`, () => {
      e206.trace(`NativeEditContext.blur`), !this._isPaused && this._handleFocusedChanged(false);
    }));
  }
  pause() {
    this._isPaused = true;
  }
  resume() {
    this._isPaused = false, this.refreshFocusState();
  }
  _handleFocusedChanged(e206) {
    this._isFocused !== e206 && (this._isFocused = e206, this._onFocusChange(this._isFocused));
  }
  focus() {
    this._domNode.focus(), this.refreshFocusState();
  }
  refreshFocusState() {
    let e206 = Ol(this._domNode), t10 = e206 ? e206.activeElement : kl(), n10 = this._domNode === t10;
    this._handleFocusedChanged(n10);
  }
  get isFocused() {
    return this._isFocused;
  }
};
Fw = tue([nue(0, Ud)], Fw);
function Iw(e206, t10, n10, r10) {
  return e206.addEventListener(t10, n10, r10), { dispose() {
    e206.removeEventListener(t10, n10);
  } };
}
var rue = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, iue = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, aue = _f2(`richScreenReaderContent`, { createHTML: (e206) => e206 }), Lw = `data-line-number`, Rw = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._domNode = e206, this._context = t10, this._viewController = n10, this._accessibilityService = r10, this._selectionChangeListener = this._register(new Jt()), this._accessibilityPageSize = 1, this._ignoreSelectionChangeTime = 0, this._state = zw.NULL, this._strategy = new cue(), this._renderedLines = /* @__PURE__ */ new Map(), this._renderedSelection = new N(1, 1, 1, 1), this.onConfigurationChanged(this._context.configuration.options);
  }
  updateScreenReaderContent(e206) {
    let t10 = Nl().document.activeElement;
    if (!(!t10 || t10 !== this._domNode.domNode)) if (this._accessibilityService.isScreenReaderOptimized()) {
      let t11 = this._getScreenReaderContentLineIntervals(e206);
      this._state.equals(t11) || (this._state = t11, this._renderedLines = this._renderScreenReaderContent(t11)), this._renderedSelection.equalsSelection(e206) || (this._renderedSelection = e206, this._setSelectionOnScreenReaderContent(this._context, this._renderedLines, e206));
    } else this._state = zw.NULL, this._setIgnoreSelectionChangeTime(`setValue`), this._domNode.domNode.textContent = ``;
  }
  updateScrollTop(e206) {
    let t10 = this._state.intervals;
    if (!t10.length) return;
    let n10 = this._context.viewModel.viewLayout, r10 = t10[0].startLine, i10 = n10.getVerticalOffsetForLineNumber(r10), a10 = n10.getVerticalOffsetForLineNumber(e206.positionLineNumber);
    this._domNode.domNode.scrollTop = a10 - i10;
  }
  onFocusChange(e206) {
    e206 ? this._selectionChangeListener.value = this._setSelectionChangeListener() : this._selectionChangeListener.value = void 0;
  }
  onConfigurationChanged(e206) {
    this._accessibilityPageSize = e206.get(3);
  }
  onWillCut() {
    this._setIgnoreSelectionChangeTime(`onCut`);
  }
  onWillPaste() {
    this._setIgnoreSelectionChangeTime(`onWillPaste`);
  }
  _setIgnoreSelectionChangeTime(e206) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  _setSelectionChangeListener() {
    let e206 = 0;
    return L(this._domNode.domNode.ownerDocument, `selectionchange`, () => {
      if (Nl().document.activeElement !== this._domNode.domNode || !this._accessibilityService.isScreenReaderOptimized() || !Ew.enabled) return;
      let t10 = Date.now(), n10 = t10 - e206;
      if (e206 = t10, n10 < 5) return;
      let r10 = t10 - this._ignoreSelectionChangeTime;
      if (this._ignoreSelectionChangeTime = 0, r10 < 100) return;
      let i10 = this._getEditorSelectionFromDomRange();
      i10 && this._viewController.setSelection(i10);
    });
  }
  _renderScreenReaderContent(e206) {
    let t10 = [], n10 = /* @__PURE__ */ new Map();
    for (let r10 of e206.intervals) for (let e207 = r10.startLine; e207 <= r10.endLine; e207++) {
      let r11 = this._renderLine(e207);
      n10.set(e207, r11), t10.push(r11.domNode);
    }
    return this._setIgnoreSelectionChangeTime(`setValue`), this._domNode.domNode.replaceChildren(...t10), n10;
  }
  _renderLine(e206) {
    let t10 = this._context.viewModel, n10 = t10.getViewLineRenderingData(e206), r10 = this._context.configuration.options, i10 = r10.get(59), a10 = r10.get(133), o10 = r10.get(108), s10 = r10.get(60), c10 = r10.get(40), l10 = og.filter(n10.inlineDecorations, e206, n10.minColumn, n10.maxColumn), u10 = i10.isMonospace && !c10, d10 = s10 !== Gn.OFF, f10;
    f10 = r10.get(47) === `off` ? r10.get(113) : `none`;
    let p10 = new lg(u10, i10.canUseHalfwidthRightwardsArrow, n10.content, n10.continuesWithWrappedLine, n10.isBasicASCII, n10.containsRTL, n10.minColumn - 1, n10.tokens, l10, n10.tabSize, n10.startVisibleColumn, i10.spaceWidth, i10.middotWidth, i10.wsmiddotWidth, a10, f10, o10, d10, null, null, 0, true), m10 = new Ff(1e4), h10 = pg(p10, m10), g10 = m10.build(), _10 = aue?.createHTML(g10) ?? g10, v10 = t10.viewLayout.getLineHeightForLineNumber(e206) + `px`, y10 = document.createElement(`div`);
    return y10.innerHTML = _10, y10.style.lineHeight = v10, y10.style.height = v10, y10.setAttribute(Lw, e206.toString()), new oue(y10, h10.characterMapping);
  }
  _setSelectionOnScreenReaderContent(e206, t10, n10) {
    let r10 = Nl().document.getSelection();
    if (!r10) return;
    let i10 = n10.startLineNumber, a10 = n10.endLineNumber, o10 = t10.get(i10), s10 = t10.get(a10);
    if (!o10 || !s10) return;
    let c10 = e206.viewModel, l10 = c10.model, u10 = c10.coordinatesConverter, d10 = new M(i10, 1, i10, n10.selectionStartColumn), f10 = u10.convertViewRangeToModelRange(d10), p10 = l10.getCharacterCountInRange(f10), m10 = new M(a10, 1, a10, n10.positionColumn), h10 = u10.convertViewRangeToModelRange(m10), g10 = l10.getCharacterCountInRange(h10), _10 = o10.characterMapping.getDomPosition(p10), v10 = s10.characterMapping.getDomPosition(g10), y10 = o10.domNode.firstChild, b10 = s10.domNode.firstChild, x10 = y10.childNodes, S10 = b10.childNodes, ee2 = x10.item(_10.partIndex), te2 = S10.item(v10.partIndex);
    !ee2.firstChild || !te2.firstChild || (this._setIgnoreSelectionChangeTime(`setRange`), r10.setBaseAndExtent(ee2.firstChild, n10.startColumn === 1 ? 0 : _10.charIndex + 1, te2.firstChild, n10.endColumn === 1 ? 0 : v10.charIndex + 1));
  }
  _getScreenReaderContentLineIntervals(e206) {
    return this._strategy.fromEditorSelection(this._context.viewModel, e206, this._accessibilityPageSize);
  }
  _getEditorSelectionFromDomRange() {
    if (!this._renderedLines) return;
    let e206 = Nl().document.getSelection();
    if (!e206 || e206.rangeCount === 0) return;
    let t10 = e206.getRangeAt(0), n10 = t10.startContainer, r10 = t10.endContainer, i10 = n10.parentElement, a10 = r10.parentElement;
    if (!i10 || !Fl(i10) || !a10 || !Fl(a10)) return;
    let o10 = i10.parentElement?.parentElement, s10 = a10.parentElement?.parentElement;
    if (!o10 || !s10) return;
    let c10 = o10.getAttribute(Lw), l10 = s10.getAttribute(Lw);
    if (!c10 || !l10) return;
    let u10 = parseInt(c10), d10 = parseInt(l10), f10 = this._renderedLines.get(u10)?.characterMapping, p10 = this._renderedLines.get(d10)?.characterMapping;
    if (!f10 || !p10) return;
    let m10 = Hb(f10, i10, t10.startOffset), h10 = Hb(p10, a10, t10.endOffset);
    return e206.direction === `forward` ? new N(u10, m10, d10, h10) : new N(d10, h10, u10, m10);
  }
};
Rw = rue([iue(3, e_)], Rw);
var oue = class {
  constructor(e206, t10) {
    this.domNode = e206, this.characterMapping = t10;
  }
}, sue = class {
  constructor(e206, t10) {
    this.startLine = e206, this.endLine = t10;
  }
}, zw = class e97 {
  constructor(e206, t10) {
    this.intervals = t10;
    let n10 = ``;
    for (let r10 of t10) for (let t11 = r10.startLine; t11 <= r10.endLine; t11++) n10 += e206.getLineContent(t11) + `
`;
    this.value = n10;
  }
  equals(e206) {
    return this.value === e206.value;
  }
  static get NULL() {
    return new e97({ getLineContent: () => ``, getLineCount: () => 1, getLineMaxColumn: () => 1, getValueInRange: () => ``, getValueLengthInRange: () => 0, modifyPosition: (e206, t10) => e206 }, []);
  }
}, cue = class {
  constructor() {
  }
  _getPageOfLine(e206, t10) {
    return Math.floor((e206 - 1) / t10);
  }
  _getRangeForPage(e206, t10, n10) {
    let r10 = t10 * n10;
    return new sue(r10 + 1, Math.min(r10 + n10, e206.getLineCount()));
  }
  fromEditorSelection(e206, t10, n10) {
    let r10 = this._getPageOfLine(t10.startLineNumber, n10), i10 = this._getRangeForPage(e206, r10, n10), a10 = this._getPageOfLine(t10.endLineNumber, n10), o10 = this._getRangeForPage(e206, a10, n10), s10 = [{ startLine: i10.startLine, endLine: i10.endLine }];
    return r10 + 1 < a10 && s10.push({ startLine: o10.startLine, endLine: o10.endLine }), new zw(e206, s10);
  }
}, lue = class {
  constructor(e206) {
    this.replacements = e206;
    let t10 = -1;
    for (let n10 of e206) {
      if (!(n10.replaceRange.start >= t10)) throw new je(`Edits must be disjoint and sorted. Found ${n10} after ${t10}`);
      t10 = n10.replaceRange.endExclusive;
    }
  }
  toString() {
    return `[${this.replacements.map((e206) => e206.toString()).join(`, `)}]`;
  }
  normalize() {
    let e206 = [], t10;
    for (let n10 of this.replacements) if (!(n10.getNewLength() === 0 && n10.replaceRange.length === 0)) {
      if (t10 && t10.replaceRange.endExclusive === n10.replaceRange.start) {
        let e207 = t10.tryJoinTouching(n10);
        if (e207) {
          t10 = e207;
          continue;
        }
      }
      t10 && e206.push(t10), t10 = n10;
    }
    return t10 && e206.push(t10), this._createNew(e206);
  }
  compose(e206) {
    let t10 = this.normalize(), n10 = e206.normalize();
    if (t10.isEmpty()) return n10;
    if (n10.isEmpty()) return t10;
    let r10 = [...t10.replacements], i10 = [], a10 = 0;
    for (let e207 of n10.replacements) {
      for (; ; ) {
        let t12 = r10[0];
        if (!t12 || t12.replaceRange.start + a10 + t12.getNewLength() >= e207.replaceRange.start) break;
        r10.shift(), i10.push(t12), a10 += t12.getNewLength() - t12.replaceRange.length;
      }
      let t11 = a10, n11, o10;
      for (; ; ) {
        let t12 = r10[0];
        if (!t12 || t12.replaceRange.start + a10 > e207.replaceRange.endExclusive) break;
        n11 || (n11 = t12), o10 = t12, r10.shift(), a10 += t12.getNewLength() - t12.replaceRange.length;
      }
      if (!n11) i10.push(e207.delta(-a10));
      else {
        let s10 = Math.min(n11.replaceRange.start, e207.replaceRange.start - t11), c10 = e207.replaceRange.start - (n11.replaceRange.start + t11);
        if (c10 > 0) {
          let e208 = n11.slice(Tm.emptyAt(s10), new Tm(0, c10));
          i10.push(e208);
        }
        if (!o10) throw new je(`Invariant violation: lastIntersecting is undefined`);
        let l10 = o10.replaceRange.endExclusive + a10 - e207.replaceRange.endExclusive;
        if (l10 > 0) {
          let e208 = o10.slice(Tm.ofStartAndLength(o10.replaceRange.endExclusive, 0), new Tm(o10.getNewLength() - l10, o10.getNewLength()));
          r10.unshift(e208), a10 -= e208.getNewLength() - e208.replaceRange.length;
        }
        let u10 = new Tm(s10, e207.replaceRange.endExclusive - a10), d10 = e207.slice(u10, new Tm(0, e207.getNewLength()));
        i10.push(d10);
      }
    }
    for (; ; ) {
      let e207 = r10.shift();
      if (!e207) break;
      i10.push(e207);
    }
    return this._createNew(i10).normalize();
  }
  getNewRanges() {
    let e206 = [], t10 = 0;
    for (let n10 of this.replacements) e206.push(Tm.ofStartAndLength(n10.replaceRange.start + t10, n10.getNewLength())), t10 += n10.getLengthDelta();
    return e206;
  }
  isEmpty() {
    return this.replacements.length === 0;
  }
}, uue = class {
  constructor(e206) {
    this.replaceRange = e206;
  }
  delta(e206) {
    return this.slice(this.replaceRange.delta(e206), new Tm(0, this.getNewLength()));
  }
  getLengthDelta() {
    return this.getNewLength() - this.replaceRange.length;
  }
  toString() {
    return `{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`;
  }
  get isEmpty() {
    return this.getNewLength() === 0 && this.replaceRange.length === 0;
  }
  getRangeAfterReplace() {
    return new Tm(this.replaceRange.start, this.replaceRange.start + this.getNewLength());
  }
}, due = class extends lue {
  apply(e206) {
    let t10 = [], n10 = 0;
    for (let r10 of this.replacements) t10.push(e206.substring(n10, r10.replaceRange.start)), t10.push(r10.newText), n10 = r10.replaceRange.endExclusive;
    return t10.push(e206.substring(n10)), t10.join(``);
  }
}, fue = class extends uue {
  constructor(e206, t10) {
    super(e206), this.newText = t10;
  }
  getNewLength() {
    return this.newText.length;
  }
  toString() {
    return `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;
  }
  replace(e206) {
    return e206.substring(0, this.replaceRange.start) + this.newText + e206.substring(this.replaceRange.endExclusive);
  }
  removeCommonSuffixPrefix(e206) {
    let t10 = e206.substring(this.replaceRange.start, this.replaceRange.endExclusive), n10 = ro(t10, this.newText), r10 = Math.min(t10.length - n10, this.newText.length - n10, io(t10, this.newText));
    return new Vw(new Tm(this.replaceRange.start + n10, this.replaceRange.endExclusive - r10), this.newText.substring(n10, this.newText.length - r10));
  }
  removeCommonSuffixAndPrefix(e206) {
    return this.removeCommonSuffix(e206).removeCommonPrefix(e206);
  }
  removeCommonPrefix(e206) {
    let t10 = ro(this.replaceRange.substring(e206), this.newText);
    return t10 === 0 ? this : this.slice(this.replaceRange.deltaStart(t10), new Tm(t10, this.newText.length));
  }
  removeCommonSuffix(e206) {
    let t10 = io(this.replaceRange.substring(e206), this.newText);
    return t10 === 0 ? this : this.slice(this.replaceRange.deltaEnd(-t10), new Tm(0, this.newText.length - t10));
  }
  toJson() {
    return { txt: this.newText, pos: this.replaceRange.start, len: this.replaceRange.length };
  }
}, Bw = (_ta = class extends due {
  static compose(t10) {
    if (t10.length === 0) return _ta.empty;
    let n10 = t10[0];
    for (let e206 = 1; e206 < t10.length; e206++) n10 = n10.compose(t10[e206]);
    return n10;
  }
  constructor(e206) {
    super(e206);
  }
  _createNew(t10) {
    return new _ta(t10);
  }
}, _ta.empty = new _ta([]), _ta), Vw = class e98 extends fue {
  static insert(t10, n10) {
    return new e98(Tm.emptyAt(t10), n10);
  }
  static replace(t10, n10) {
    return new e98(t10, n10);
  }
  equals(e206) {
    return this.replaceRange.equals(e206.replaceRange) && this.newText === e206.newText;
  }
  tryJoinTouching(t10) {
    return new e98(this.replaceRange.joinRightTouching(t10.replaceRange), this.newText + t10.newText);
  }
  slice(t10, n10) {
    return new e98(t10, n10 ? n10.substring(this.newText) : this.newText);
  }
};
function Hw(e206, t10) {
  e206 = e206.slice();
  let n10 = [], r10 = 0;
  for (let i10 of t10.replacements) {
    for (; ; ) {
      let t12 = e206[0];
      if (!t12 || t12.endExclusive >= i10.replaceRange.start) break;
      e206.shift(), n10.push(t12.delta(r10));
    }
    let t11 = [];
    for (; ; ) {
      let n11 = e206[0];
      if (!n11 || !n11.intersectsOrTouches(i10.replaceRange)) break;
      e206.shift(), t11.push(n11);
    }
    for (let n11 = t11.length - 1; n11 >= 0; n11--) {
      let r11 = t11[n11], a10 = r11.intersect(i10.replaceRange).length;
      r11 = r11.deltaEnd(-a10 + (n11 === 0 ? i10.newText.length : 0));
      let o10 = r11.start - i10.replaceRange.start;
      o10 > 0 && (r11 = r11.delta(-o10)), n11 !== 0 && (r11 = r11.delta(i10.newText.length)), r11 = r11.delta(-(i10.newText.length - i10.replaceRange.length)), e206.unshift(r11);
    }
    r10 += i10.newText.length - i10.replaceRange.length;
  }
  for (; ; ) {
    let t11 = e206[0];
    if (!t11) break;
    e206.shift(), n10.push(t11.delta(r10));
  }
  return n10;
}
iie({ StringEdit: Bw, StringReplacement: Vw, TextReplacement: Ym, TextEdit: Jm, TextLength: Vm });
var pue = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, mue = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Uw = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._domNode = e206, this._context = t10, this._viewController = n10, this._accessibilityService = r10, this._selectionChangeListener = this._register(new Jt()), this._accessibilityPageSize = 1, this._ignoreSelectionChangeTime = 0, this._strategy = new kw(), this.onConfigurationChanged(this._context.configuration.options);
  }
  updateScreenReaderContent(e206) {
    let t10 = this._domNode.domNode, n10 = Nl().document.activeElement;
    if (!(!n10 || n10 !== t10)) if (this._accessibilityService.isScreenReaderOptimized()) {
      this._state = this._getScreenReaderContentState(e206), t10.textContent !== this._state.value && (this._setIgnoreSelectionChangeTime(`setValue`), t10.textContent = this._state.value);
      let n11 = Nl().document.getSelection();
      if (!n11) return;
      let r10 = this._getScreenReaderRange(this._state.selectionStart, this._state.selectionEnd);
      if (!r10) return;
      this._setIgnoreSelectionChangeTime(`setRange`), n11.setBaseAndExtent(r10.anchorNode, r10.anchorOffset, r10.focusNode, r10.focusOffset);
    } else this._state = void 0, this._setIgnoreSelectionChangeTime(`setValue`), this._domNode.domNode.textContent = ``;
  }
  updateScrollTop(e206) {
    if (!this._state) return;
    let t10 = this._context.viewModel.viewLayout, n10 = this._state.startPositionWithinEditor.lineNumber, r10 = t10.getVerticalOffsetForLineNumber(n10), i10 = t10.getVerticalOffsetForLineNumber(e206.positionLineNumber);
    this._domNode.domNode.scrollTop = i10 - r10;
  }
  onFocusChange(e206) {
    e206 ? this._selectionChangeListener.value = this._setSelectionChangeListener() : this._selectionChangeListener.value = void 0;
  }
  onConfigurationChanged(e206) {
    this._accessibilityPageSize = e206.get(3);
  }
  onWillCut() {
    this._setIgnoreSelectionChangeTime(`onCut`);
  }
  onWillPaste() {
    this._setIgnoreSelectionChangeTime(`onWillPaste`);
  }
  _setIgnoreSelectionChangeTime(e206) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  _setSelectionChangeListener() {
    let e206 = 0;
    return L(this._domNode.domNode.ownerDocument, `selectionchange`, () => {
      let t10 = this._accessibilityService.isScreenReaderOptimized();
      if (!this._state || !t10 || !Ew.enabled || Nl().document.activeElement !== this._domNode.domNode) return;
      let n10 = Nl().document.getSelection();
      if (!n10 || n10.rangeCount === 0) return;
      let r10 = n10.getRangeAt(0), i10 = Date.now(), a10 = i10 - e206;
      if (e206 = i10, a10 < 5) return;
      let o10 = i10 - this._ignoreSelectionChangeTime;
      this._ignoreSelectionChangeTime = 0, !(o10 < 100) && this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context, this._state, n10.direction, r10));
    });
  }
  _getScreenReaderContentState(e206) {
    let t10 = this._strategy.fromEditorSelection(this._context.viewModel, e206, this._accessibilityPageSize, this._accessibilityService.getAccessibilitySupport() === 0), n10 = this._context.viewModel.model.getPositionAt(1 / 0), r10 = t10.value;
    return n10.column === 1 && e206.getEndPosition().equals(n10) && (r10 += `
`), t10.value = r10, t10;
  }
  _getScreenReaderRange(e206, t10) {
    let n10 = this._domNode.domNode.firstChild;
    if (!n10) return;
    let r10 = new globalThis.Range();
    return r10.setStart(n10, e206), r10.setEnd(n10, t10), { anchorNode: n10, anchorOffset: e206, focusNode: n10, focusOffset: t10 };
  }
  _getEditorSelectionFromDomRange(e206, t10, n10, r10) {
    let i10 = e206.viewModel, a10 = i10.model, o10 = i10.coordinatesConverter.convertViewPositionToModelPosition(t10.startPositionWithinEditor), s10 = a10.getOffsetAt(o10), c10 = r10.startOffset + s10, l10 = r10.endOffset + s10;
    if (a10.getEndOfLineSequence() === 1) {
      let e207 = t10.value, n11 = new Wm(e207), i11 = n11.getPosition(r10.startOffset), a11 = n11.getPosition(r10.endOffset);
      c10 += i11.lineNumber - 1, l10 += a11.lineNumber - 1;
    }
    let u10 = a10.getPositionAt(c10), d10 = a10.getPositionAt(l10), f10 = n10 === `forward` ? u10 : d10, p10 = n10 === `forward` ? d10 : u10;
    return N.fromPositions(f10, p10);
  }
};
Uw = pue([mue(3, e_)], Uw);
var hue = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Ww = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Gw = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._domNode = e206, this._context = t10, this._viewController = n10, this._keybindingService = r10, this._accessibilityService = i10, this._contentLeft = 1, this._contentWidth = 1, this._contentHeight = 1, this._divWidth = 1, this._primarySelection = new N(1, 1, 1, 1), this._primaryCursorVisibleRange = null, this._state = this._register(new Jt()), this._instantiateScreenReaderContent(), this._updateConfigurationSettings(), this._updateDomAttributes();
  }
  onWillPaste() {
    this._state.value?.onWillPaste();
  }
  onWillCut() {
    this._state.value?.onWillCut();
  }
  handleFocusChange(e206) {
    this._state.value?.onFocusChange(e206), this.writeScreenReaderContent();
  }
  onConfigurationChanged(e206) {
    this._instantiateScreenReaderContent(), this._updateConfigurationSettings(), this._updateDomAttributes(), e206.hasChanged(2) && this.writeScreenReaderContent();
  }
  _instantiateScreenReaderContent() {
    let e206 = this._context.configuration.options.get(107);
    this._renderRichContent !== e206 && (this._renderRichContent = e206, this._state.value = this._createScreenReaderContent(e206));
  }
  _createScreenReaderContent(e206) {
    return e206 ? new Rw(this._domNode, this._context, this._viewController, this._accessibilityService) : new Uw(this._domNode, this._context, this._viewController, this._accessibilityService);
  }
  _updateConfigurationSettings() {
    let e206 = this._context.configuration.options, t10 = e206.get(165), n10 = t10.wrappingColumn;
    this._contentLeft = t10.contentLeft, this._contentWidth = t10.contentWidth, this._contentHeight = t10.height, this._fontInfo = e206.get(59), this._divWidth = Math.round(n10 * this._fontInfo.typicalHalfwidthCharacterWidth), this._state.value?.onConfigurationChanged(e206);
  }
  _updateDomAttributes() {
    let e206 = this._context.configuration.options;
    this._domNode.domNode.setAttribute(`role`, `textbox`), this._domNode.domNode.setAttribute(`aria-required`, e206.get(9) ? `true` : `false`), this._domNode.domNode.setAttribute(`aria-multiline`, `true`), this._domNode.domNode.setAttribute(`aria-autocomplete`, e206.get(104) ? `none` : `both`), this._domNode.domNode.setAttribute(`aria-roledescription`, C(60, `editor`)), this._domNode.domNode.setAttribute(`aria-label`, Aw(e206, this._keybindingService));
    let t10 = this._context.viewModel.model.getOptions().tabSize, n10 = e206.get(59).spaceWidth;
    this._domNode.domNode.style.tabSize = `${t10 * n10}px`;
    let r10 = e206.get(154), i10 = r10 === `inherit` ? e206.get(153) : r10, a10 = i10 === `inherit` ? e206.get(149) : i10;
    this._domNode.domNode.style.textWrap = a10 === `off` ? `nowrap` : `wrap`;
  }
  onCursorStateChanged(e206) {
    this._primarySelection = e206.selections[0] ?? new N(1, 1, 1, 1);
  }
  prepareRender(e206) {
    this.writeScreenReaderContent(), this._primaryCursorVisibleRange = e206.visibleRangeForPosition(this._primarySelection.getPosition());
  }
  render(e206) {
    if (!this._primaryCursorVisibleRange) {
      this._renderAtTopLeft();
      return;
    }
    let t10 = this._context.viewLayout.getCurrentScrollLeft(), n10 = this._contentLeft + this._primaryCursorVisibleRange.left - t10;
    if (n10 < this._contentLeft || n10 > this._contentLeft + this._contentWidth) {
      this._renderAtTopLeft();
      return;
    }
    let r10 = this._context.viewLayout.getCurrentScrollTop(), i10 = this._primarySelection.positionLineNumber, a10 = this._context.viewLayout.getVerticalOffsetForLineNumber(i10) - r10;
    if (a10 < 0 || a10 > this._contentHeight) {
      this._renderAtTopLeft();
      return;
    }
    let o10 = this._context.viewLayout.getLineHeightForLineNumber(i10);
    this._doRender(a10, this._contentLeft, this._divWidth, o10), this._state.value?.updateScrollTop(this._primarySelection);
  }
  _renderAtTopLeft() {
    this._doRender(0, 0, this._contentWidth, 1);
  }
  _doRender(e206, t10, n10, r10) {
    vu(this._domNode, this._fontInfo), this._domNode.setTop(e206), this._domNode.setLeft(t10), this._domNode.setWidth(n10), this._domNode.setHeight(r10), this._domNode.setLineHeight(r10);
  }
  setAriaOptions(e206) {
    e206.activeDescendant ? (this._domNode.setAttribute(`aria-haspopup`, `true`), this._domNode.setAttribute(`aria-autocomplete`, `list`), this._domNode.setAttribute(`aria-activedescendant`, e206.activeDescendant)) : (this._domNode.setAttribute(`aria-haspopup`, `false`), this._domNode.setAttribute(`aria-autocomplete`, `both`), this._domNode.removeAttribute(`aria-activedescendant`)), e206.role && this._domNode.setAttribute(`role`, e206.role);
  }
  writeScreenReaderContent() {
    this._state.value?.updateScreenReaderContent(this._primarySelection);
  }
};
Gw = hue([Ww(3, Dw), Ww(4, e_)], Gw);
var Kw;
(function(e206) {
  function t10(e207, t11) {
    return new e207.EditContext(t11);
  }
  e206.create = t10;
})(Kw || (Kw = {}));
var qw = new class {
  constructor() {
    this._nativeEditContextMapping = /* @__PURE__ */ new Map();
  }
  register(e206, t10) {
    return this._nativeEditContextMapping.set(e206, t10), { dispose: () => {
      this._nativeEditContextMapping.delete(e206);
    } };
  }
  get(e206) {
    return this._nativeEditContextMapping.get(e206);
  }
}(), gue = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Jw = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Yw;
(function(e206) {
  e206.NONE = `edit-context-composition-none`, e206.SECONDARY = `edit-context-composition-secondary`, e206.PRIMARY = `edit-context-composition-primary`;
})(Yw || (Yw = {}));
var Xw = class extends Ow {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(t10), this._viewController = r10, this._visibleRangeProvider = i10, this.logService = o10, this._previousEditContextSelection = new Tm(0, 0), this._editContextPrimarySelection = new N(1, 1, 1, 1), this._decorations = [], this._primarySelection = new N(1, 1, 1, 1), this._targetWindowId = -1, this._scrollTop = 0, this._scrollLeft = 0, this._linesVisibleRanges = null, this.domNode = new hu(document.createElement(`div`)), this.domNode.setClassName(`native-edit-context`), this._imeTextArea = new hu(document.createElement(`textarea`)), this._imeTextArea.setClassName(`ime-text-area`), this._imeTextArea.setAttribute(`readonly`, `true`), this._imeTextArea.setAttribute(`tabindex`, `-1`), this._imeTextArea.setAttribute(`aria-hidden`, `true`), this.domNode.setAttribute(`autocorrect`, `off`), this.domNode.setAttribute(`autocapitalize`, `off`), this.domNode.setAttribute(`autocomplete`, `off`), this.domNode.setAttribute(`spellcheck`, `false`), this._updateDomAttributes(), n10.appendChild(this.domNode), n10.appendChild(this._imeTextArea), this._parent = n10.domNode, this._focusTracker = this._register(new Fw(o10, this.domNode.domNode, (e207) => {
      o10.trace(`NativeEditContext#handleFocusChange : `, e207), this._screenReaderSupport.handleFocusChange(e207), this._context.viewModel.setHasFocus(e207);
    }));
    let s10 = Vc(this.domNode.domNode);
    this._editContext = Kw.create(s10), this.setEditContextOnDomNode(), this._screenReaderSupport = this._register(a10.createInstance(Gw, this.domNode, t10, this._viewController)), this._register(L(this.domNode.domNode, `copy`, (e207) => {
      this.logService.trace(`NativeEditContext#copy`), this._ensureClipboardGetsEditorSelection(e207);
    })), this._register(L(this.domNode.domNode, `cut`, (e207) => {
      this.logService.trace(`NativeEditContext#cut`), this._screenReaderSupport.onWillCut(), this._ensureClipboardGetsEditorSelection(e207), this.logService.trace(`NativeEditContext#cut (before viewController.cut)`), this._viewController.cut();
    })), this._register(L(this.domNode.domNode, `keyup`, (e207) => this._onKeyUp(e207))), this._register(L(this.domNode.domNode, `keydown`, async (e207) => this._onKeyDown(e207))), this._register(L(this._imeTextArea.domNode, `keyup`, (e207) => this._onKeyUp(e207))), this._register(L(this._imeTextArea.domNode, `keydown`, async (e207) => this._onKeyDown(e207))), this._register(L(this.domNode.domNode, `beforeinput`, async (e207) => {
      (e207.inputType === `insertParagraph` || e207.inputType === `insertLineBreak`) && this._onType(this._viewController, { text: `
`, replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 });
    })), this._register(L(this.domNode.domNode, `paste`, (e207) => {
      if (this.logService.trace(`NativeEditContext#paste`), e207.preventDefault(), !e207.clipboardData) return;
      let [t11, n11] = Cx.getTextData(e207.clipboardData);
      if (this.logService.trace(`NativeEditContext#paste with id : `, n11?.id, ` with text.length: `, t11.length), !t11) return;
      n11 || (n11 = xx.INSTANCE.get(t11));
      let r11 = false, i11 = null, a11 = null;
      n11 && (r11 = this._context.configuration.options.get(45) && !!n11.isFromEmptySelection, i11 = n11.multicursorText === void 0 ? null : n11.multicursorText, a11 = n11.mode), this.logService.trace(`NativeEditContext#paste (before viewController.paste)`), this._viewController.paste(t11, r11, i11, a11);
    })), this._register(Iw(this._editContext, `textformatupdate`, (e207) => this._handleTextFormatUpdate(e207))), this._register(Iw(this._editContext, `characterboundsupdate`, (e207) => this._updateCharacterBounds(e207)));
    let c10;
    this._register(Iw(this._editContext, `textupdate`, (e207) => {
      let t11 = e207.text;
      if (t11.length === 1) {
        let n11 = t11.charCodeAt(0);
        if (ao(n11)) {
          c10 = t11;
          return;
        }
        if (oo(n11) && c10) {
          let n12 = { text: c10 + t11, selectionEnd: e207.selectionEnd, selectionStart: e207.selectionStart, updateRangeStart: e207.updateRangeStart - 1, updateRangeEnd: e207.updateRangeEnd - 1 };
          c10 = void 0, this._emitTypeEvent(this._viewController, n12);
          return;
        }
      }
      this._emitTypeEvent(this._viewController, e207);
    })), this._register(Iw(this._editContext, `compositionstart`, (e207) => {
      this._updateEditContext(), this._viewController.compositionStart(), this._context.viewModel.onCompositionStart();
    })), this._register(Iw(this._editContext, `compositionend`, (e207) => {
      this._updateEditContext(), this._viewController.compositionEnd(), this._context.viewModel.onCompositionEnd();
    }));
    let l10 = false;
    this._register(Ew.onDidChange(() => {
      Ew.enabled && l10 && (this._focusTracker.resume(), this.domNode.focus(), l10 = false), !Ew.enabled && this.isFocused() && (this._focusTracker.pause(), this._imeTextArea.focus(), l10 = true);
    })), this._register(qw.register(e206, this));
  }
  dispose() {
    this.domNode.domNode.editContext = void 0, this.domNode.domNode.blur(), this.domNode.domNode.remove(), this._imeTextArea.domNode.remove(), super.dispose();
  }
  setAriaOptions(e206) {
    this._screenReaderSupport.setAriaOptions(e206);
  }
  getLastRenderData() {
    return this._primarySelection.getPosition();
  }
  prepareRender(e206) {
    this._screenReaderSupport.prepareRender(e206), this._updateSelectionAndControlBoundsData(e206);
  }
  onDidRender() {
    this._updateSelectionAndControlBoundsAfterRender();
  }
  render(e206) {
    this._screenReaderSupport.render(e206);
  }
  onCursorStateChanged(e206) {
    return this._primarySelection = e206.modelSelections[0] ?? new N(1, 1, 1, 1), this._screenReaderSupport.onCursorStateChanged(e206), this._updateEditContext(), true;
  }
  onConfigurationChanged(e206) {
    return this._screenReaderSupport.onConfigurationChanged(e206), this._updateDomAttributes(), true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return this._updateEditContextOnLineChange(e206.fromLineNumber, e206.fromLineNumber + e206.count - 1), true;
  }
  onLinesDeleted(e206) {
    return this._updateEditContextOnLineChange(e206.fromLineNumber, e206.toLineNumber), true;
  }
  onLinesInserted(e206) {
    return this._updateEditContextOnLineChange(e206.fromLineNumber, e206.toLineNumber), true;
  }
  _updateEditContextOnLineChange(e206, t10) {
    this._editContextPrimarySelection.endLineNumber < e206 || this._editContextPrimarySelection.startLineNumber > t10 || this._updateEditContext();
  }
  onScrollChanged(e206) {
    return this._scrollLeft = e206.scrollLeft, this._scrollTop = e206.scrollTop, true;
  }
  onZonesChanged(e206) {
    return true;
  }
  onWillPaste() {
    this.logService.trace(`NativeEditContext#onWillPaste`), this._onWillPaste();
  }
  _onWillPaste() {
    this._screenReaderSupport.onWillPaste();
  }
  onWillCopy() {
    this.logService.trace(`NativeEditContext#onWillCopy`), this.logService.trace(`NativeEditContext#isFocused : `, this.domNode.domNode === kl());
  }
  writeScreenReaderContent() {
    this._screenReaderSupport.writeScreenReaderContent();
  }
  isFocused() {
    return this._focusTracker.isFocused;
  }
  focus() {
    this._focusTracker.focus(), this.refreshFocusState();
  }
  refreshFocusState() {
    this._focusTracker.refreshFocusState();
  }
  setEditContextOnDomNode() {
    let e206 = Gc(Vc(this.domNode.domNode));
    this._targetWindowId !== e206 && (this.domNode.domNode.editContext = this._editContext, this._targetWindowId = e206);
  }
  _onKeyUp(e206) {
    this._viewController.emitKeyUp(new Jo(e206));
  }
  _onKeyDown(e206) {
    let t10 = new Jo(e206);
    t10.keyCode === 114 && t10.stopPropagation(), this._viewController.emitKeyDown(t10);
  }
  _updateDomAttributes() {
    let e206 = this._context.configuration.options;
    this.domNode.domNode.setAttribute(`tabindex`, String(e206.get(140)));
  }
  _updateEditContext() {
    let e206 = this._getNewEditContextState();
    e206 && (this._editContext.updateText(0, 2 ** 53 - 1, e206.text ?? ` `), this._editContext.updateSelection(e206.selectionStartOffset, e206.selectionEndOffset), this._editContextPrimarySelection = e206.editContextPrimarySelection, this._previousEditContextSelection = new Tm(e206.selectionStartOffset, e206.selectionEndOffset));
  }
  _emitTypeEvent(e206, t10) {
    if (!this._editContext) return;
    let n10 = this._previousEditContextSelection.endExclusive, r10 = this._previousEditContextSelection.start;
    this._previousEditContextSelection = new Tm(t10.selectionStart, t10.selectionEnd);
    let i10 = 0, a10 = 0;
    t10.updateRangeEnd > n10 && (i10 = t10.updateRangeEnd - n10), t10.updateRangeStart < r10 && (a10 = r10 - t10.updateRangeStart);
    let o10 = ``;
    r10 < t10.updateRangeStart && (o10 += this._editContext.text.substring(r10, t10.updateRangeStart)), o10 += t10.text, n10 > t10.updateRangeEnd && (o10 += this._editContext.text.substring(t10.updateRangeEnd, n10));
    let s10 = 0;
    t10.selectionStart === t10.selectionEnd && r10 === n10 && (s10 = t10.selectionStart - (t10.updateRangeStart + t10.text.length));
    let c10 = { text: o10, replacePrevCharCnt: a10, replaceNextCharCnt: i10, positionDelta: s10 };
    this._onType(e206, c10);
  }
  _onType(e206, t10) {
    t10.replacePrevCharCnt || t10.replaceNextCharCnt || t10.positionDelta ? e206.compositionType(t10.text, t10.replacePrevCharCnt, t10.replaceNextCharCnt, t10.positionDelta) : e206.type(t10.text);
  }
  _getNewEditContextState() {
    let e206 = this._primarySelection, t10 = this._context.viewModel.model;
    if (!t10.isValidRange(e206)) return;
    let n10 = e206.startLineNumber, r10 = e206.endLineNumber, i10 = t10.getLineMaxColumn(r10), a10 = new M(n10, 1, r10, i10), o10 = t10.getValueInRange(a10, 0);
    return { text: o10, selectionStartOffset: e206.startColumn - 1, selectionEndOffset: o10.length + e206.endColumn - i10, editContextPrimarySelection: e206 };
  }
  _editContextStartPosition() {
    return new j(this._editContextPrimarySelection.startLineNumber, 1);
  }
  _handleTextFormatUpdate(e206) {
    if (!this._editContext) return;
    let t10 = e206.getTextFormats(), n10 = this._editContextStartPosition(), r10 = [];
    t10.forEach((e207) => {
      let t11 = this._context.viewModel.model, i10 = t11.getOffsetAt(n10), a10 = t11.getPositionAt(i10 + e207.rangeStart), o10 = t11.getPositionAt(i10 + e207.rangeEnd), s10 = M.fromPositions(a10, o10), c10 = e207.underlineThickness.toLowerCase(), l10 = Yw.NONE;
      switch (c10) {
        case `thin`:
          l10 = Yw.SECONDARY;
          break;
        case `thick`:
          l10 = Yw.PRIMARY;
          break;
      }
      r10.push({ range: s10, options: { description: `textFormatDecoration`, inlineClassName: l10 } });
    }), this._decorations = this._context.viewModel.model.deltaDecorations(this._decorations, r10);
  }
  _updateSelectionAndControlBoundsData(e206) {
    let t10 = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection);
    this._primarySelection.isEmpty() ? this._linesVisibleRanges = e206.visibleRangeForPosition(t10.getStartPosition()) : this._linesVisibleRanges = null;
  }
  _updateSelectionAndControlBoundsAfterRender() {
    let e206 = this._context.configuration.options.get(165).contentLeft, t10 = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection), n10 = this._context.viewLayout.getVerticalOffsetForLineNumber(t10.startLineNumber), r10 = this._context.viewLayout.getVerticalOffsetAfterLineNumber(t10.endLineNumber), i10 = this._parent.getBoundingClientRect(), a10 = i10.top + n10 - this._scrollTop, o10 = r10 - n10, s10 = i10.left + e206 - this._scrollLeft, c10;
    this._primarySelection.isEmpty() ? (this._linesVisibleRanges && (s10 += this._linesVisibleRanges.left), c10 = 0) : c10 = i10.width - e206;
    let l10 = new DOMRect(s10, a10, c10, o10);
    this._editContext.updateSelectionBounds(l10), this._editContext.updateControlBounds(l10);
  }
  _updateCharacterBounds(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(59).typicalHalfwidthCharacterWidth, r10 = t10.get(165).contentLeft, i10 = this._parent.getBoundingClientRect(), a10 = [], o10 = new Wm(this._editContext.text);
    for (let t11 = e206.rangeStart; t11 < e206.rangeEnd; t11++) {
      let e207 = o10.getPosition(t11), s10 = new j(this._editContextPrimarySelection.startLineNumber - 1 + e207.lineNumber, e207.column), c10 = s10.delta(0, 1), l10 = M.fromPositions(s10, c10), u10 = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(l10), d10 = this._visibleRangeProvider.linesVisibleRangesForRange(u10, true) ?? [], f10 = u10.startLineNumber, p10 = this._context.viewLayout.getVerticalOffsetForLineNumber(f10), m10 = i10.top + p10 - this._scrollTop, h10 = 0, g10 = n10;
      if (d10.length > 0) for (let e208 of d10[0].ranges) {
        h10 = e208.left, g10 = e208.width;
        break;
      }
      let _10 = this._context.viewLayout.getLineHeightForLineNumber(f10);
      a10.push(new DOMRect(i10.left + r10 + h10 - this._scrollLeft, m10, g10, _10));
    }
    this._editContext.updateCharacterBounds(e206.rangeStart, a10);
  }
  _ensureClipboardGetsEditorSelection(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(45), r10 = t10.get(31), i10 = this._context.viewModel.getCursorStates().map((e207) => e207.modelState.selection), a10 = bx(this._context.viewModel, i10, n10, r10), o10;
    this.logService.getLevel() === Gd.Trace && (o10 = Tx());
    let s10 = { version: 1, id: o10, isFromEmptySelection: a10.isFromEmptySelection, multicursorText: a10.multicursorText, mode: a10.mode };
    xx.INSTANCE.set(Mo ? a10.text.replace(/\r\n/g, `
`) : a10.text, s10), e206.preventDefault(), e206.clipboardData && Cx.setTextData(e206.clipboardData, a10.text, a10.html, s10), this.logService.trace(`NativeEditContext#_ensureClipboardGetsEditorSelectios with id : `, o10, ` with text.length: `, a10.text.length);
  }
};
Xw = gue([Jw(5, V), Jw(6, Ud)], Xw);
var _ue = class extends Tb {
  constructor(e206, t10) {
    super(e206), this._viewGpuContext = t10, this._gpuShapes = [], this._register(hc((e207) => this._updateEntries(e207)));
  }
  onConfigurationChanged(e206) {
    return this._updateEntries(void 0), true;
  }
  prepareRender(e206) {
  }
  render(e206) {
  }
  _updateEntries(e206) {
    let t10 = this._context.configuration.options, n10 = t10.get(116), r10 = t10.get(59).typicalHalfwidthCharacterWidth, i10 = this._viewGpuContext.devicePixelRatio.read(e206);
    for (let e207 = 0, t11 = n10.length; e207 < t11; e207++) {
      let t12 = n10[e207], a10 = this._gpuShapes[e207], o10 = t12.color ? Y.fromHex(t12.color) : this._context.theme.getColor(sce) ?? Y.white, s10 = [t12.column * r10 * i10, 0, Math.max(1, Math.ceil(i10)), 2 ** 53 - 1, o10.rgba.r / 255, o10.rgba.g / 255, o10.rgba.b / 255, o10.rgba.a];
      a10 ? a10.setRaw(s10) : this._gpuShapes[e207] = this._viewGpuContext.rectangleRenderer.register(...s10);
    }
    for (; this._gpuShapes.length > n10.length; ) this._gpuShapes.splice(-1, 1)[0].dispose();
  }
}, vue = (_ua = class extends HS {
  constructor(e206, t10) {
    super(), this._viewGpuContext = t10, this._context = e206, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  onConfigurationChanged(e206) {
    return true;
  }
  onCursorStateChanged(e206) {
    return true;
  }
  onFlushed(e206) {
    return true;
  }
  onLinesChanged(e206) {
    return true;
  }
  onLinesDeleted(e206) {
    return true;
  }
  onLinesInserted(e206) {
    return true;
  }
  onScrollChanged(e206) {
    return e206.scrollTopChanged;
  }
  onZonesChanged(e206) {
    return true;
  }
  onDecorationsChanged(e206) {
    return true;
  }
  prepareRender(t10) {
    let n10 = t10.visibleRange.startLineNumber, r10 = t10.visibleRange.endLineNumber, i10 = t10.viewportData, a10 = new wC(this._context.configuration, this._context.theme.type), o10 = [];
    for (let t11 = n10; t11 <= r10; t11++) {
      let r11 = t11 - n10, s10 = this._viewGpuContext.canRenderDetailed(a10, i10, t11);
      o10[r11] = s10.length ? `<div class="${_ua.CLASS_NAME}" title="Cannot render on GPU: ${s10.join(`, `)}"></div>` : ``;
    }
    this._renderResult = o10;
  }
  render(e206, t10) {
    if (!this._renderResult) return ``;
    let n10 = t10 - e206;
    return n10 < 0 || n10 >= this._renderResult.length ? `` : this._renderResult[n10];
  }
}, _ua.CLASS_NAME = `gpu-mark`, _ua), yue = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, bue = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Zw = class extends wb {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(), this._instantiationService = c10, this._shouldRecomputeGlyphMarginLanes = false, this._ownerID = t10, this._widgetFocusTracker = this._register(new Sue(e206, s10)), this._register(this._widgetFocusTracker.onChange(() => {
      this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus());
    })), this._selections = [new N(1, 1, 1, 1)], this._renderAnimationFrame = null, this._overflowGuardContainer = _u(document.createElement(`div`)), Eb.write(this._overflowGuardContainer, 3), this._overflowGuardContainer.setClassName(`overflow-guard`), this._viewController = new Ise(r10, a10, o10, n10), this._context = new ble(r10, i10, a10), this._context.addEventHandler(this), this._viewParts = [], this._editContextEnabled = this._context.configuration.options.get(170), this._accessibilitySupport = this._context.configuration.options.get(2), this._editContext = this._instantiateEditContext(), this._viewParts.push(this._editContext), this._linesContent = _u(document.createElement(`div`)), this._linesContent.setClassName(`lines-content monaco-editor-background`), this._linesContent.setPosition(`absolute`), this.domNode = _u(document.createElement(`div`)), this.domNode.setClassName(this._getEditorClassName()), this.domNode.setAttribute(`role`, `code`), this._context.configuration.options.get(46) === `on` && (this._viewGpuContext = this._instantiationService.createInstance(vw, this._context)), this._scrollbar = new jce(this._context, this._linesContent, this.domNode, this._overflowGuardContainer), this._viewParts.push(this._scrollbar), this._viewLines = new Uce(this._context, this._viewGpuContext, this._linesContent), this._viewGpuContext && (this._viewLinesGpu = this._instantiationService.createInstance(Tw, this._context, this._viewGpuContext)), this._viewZones = new hle(this._context), this._viewParts.push(this._viewZones);
    let l10 = new ile(this._context);
    this._viewParts.push(l10);
    let u10 = new cle(this._context);
    this._viewParts.push(u10);
    let d10 = new zse(this._context);
    this._viewParts.push(d10), d10.addDynamicOverlay(new Oce(this._context)), d10.addDynamicOverlay(new ple(this._context)), d10.addDynamicOverlay(new zce(this._context)), d10.addDynamicOverlay(new Ace(this._context)), d10.addDynamicOverlay(new _le(this._context));
    let f10 = new Bse(this._context);
    this._viewParts.push(f10), f10.addDynamicOverlay(new kce(this._context)), f10.addDynamicOverlay(new Gce(this._context)), f10.addDynamicOverlay(new Wce(this._context)), f10.addDynamicOverlay(new xC(this._context)), this._viewGpuContext && f10.addDynamicOverlay(new vue(this._context, this._viewGpuContext)), this._glyphMarginWidgets = new Pce(this._context), this._viewParts.push(this._glyphMarginWidgets);
    let p10 = new TC(this._context);
    p10.getDomNode().appendChild(this._viewZones.marginDomNode), p10.getDomNode().appendChild(f10.getDomNode()), p10.getDomNode().appendChild(this._glyphMarginWidgets.domNode), this._viewParts.push(p10), this._contentWidgets = new Hse(this._context, this.domNode), this._viewParts.push(this._contentWidgets), this._viewCursors = new mle(this._context), this._viewParts.push(this._viewCursors), this._overlayWidgets = new nle(this._context, this.domNode), this._viewParts.push(this._overlayWidgets);
    let m10 = this._viewGpuContext ? new _ue(this._context, this._viewGpuContext) : new sle(this._context);
    this._viewParts.push(m10);
    let h10 = new Vse(this._context);
    this._viewParts.push(h10);
    let g10 = new ele(this._context);
    if (this._viewParts.push(g10), l10) {
      let e207 = this._scrollbar.getOverviewRulerLayoutInfo();
      e207.parent.insertBefore(l10.getDomNode(), e207.insertBefore);
    }
    this._linesContent.appendChild(d10.getDomNode()), `domNode` in m10 && this._linesContent.appendChild(m10.domNode), this._linesContent.appendChild(this._viewZones.domNode), this._linesContent.appendChild(this._viewLines.getDomNode()), this._linesContent.appendChild(this._contentWidgets.domNode), this._linesContent.appendChild(this._viewCursors.getDomNode()), this._overflowGuardContainer.appendChild(p10.getDomNode()), this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()), this._viewGpuContext && this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas), this._overflowGuardContainer.appendChild(u10.getDomNode()), this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()), this._overflowGuardContainer.appendChild(g10.getDomNode()), this._overflowGuardContainer.appendChild(h10.domNode), this.domNode.appendChild(this._overflowGuardContainer), s10 ? (s10.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode), s10.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)) : (this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode), this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)), this._applyLayout(), this._pointerHandler = this._register(new ase(this._context, this._viewController, this._createPointerHandlerHelper()));
  }
  _instantiateEditContext() {
    return this._context.configuration.options.get(170) ? this._instantiationService.createInstance(Xw, this._ownerID, this._context, this._overflowGuardContainer, this._viewController, this._createTextAreaHandlerHelper()) : this._instantiationService.createInstance(Pw, this._context, this._overflowGuardContainer, this._viewController, this._createTextAreaHandlerHelper());
  }
  _updateEditContext() {
    let e206 = this._context.configuration.options.get(170), t10 = this._context.configuration.options.get(2);
    if (this._editContextEnabled === e206 && this._accessibilitySupport === t10) return;
    this._editContextEnabled = e206, this._accessibilitySupport = t10;
    let n10 = this._editContext.isFocused(), r10 = this._viewParts.indexOf(this._editContext);
    this._editContext.dispose(), this._editContext = this._instantiateEditContext(), n10 && this._editContext.focus(), r10 !== -1 && this._viewParts.splice(r10, 1, this._editContext);
  }
  _computeGlyphMarginLanes() {
    let e206 = this._context.viewModel.model, t10 = this._context.viewModel.glyphLanes, n10 = [], r10 = 0;
    n10 = n10.concat(e206.getAllMarginDecorations().map((e207) => {
      let t11 = e207.options.glyphMargin?.position ?? $p.Center;
      return r10 = Math.max(r10, e207.range.endLineNumber), { range: e207.range, lane: t11, persist: e207.options.glyphMargin?.persistLane };
    })), n10 = n10.concat(this._glyphMarginWidgets.getWidgets().map((t11) => {
      let n11 = e206.validateRange(t11.preference.range);
      return r10 = Math.max(r10, n11.endLineNumber), { range: n11, lane: t11.preference.lane };
    })), n10.sort((e207, t11) => M.compareRangesUsingStarts(e207.range, t11.range)), t10.reset(r10);
    for (let e207 of n10) t10.push(e207.lane, e207.range, e207.persist);
    return t10;
  }
  _createPointerHandlerHelper() {
    return { viewDomNode: this.domNode.domNode, linesContentDomNode: this._linesContent.domNode, viewLinesDomNode: this._viewLines.getDomNode().domNode, viewLinesGpu: this._viewLinesGpu, focusTextArea: () => {
      this.focus();
    }, dispatchTextAreaEvent: (e206) => {
      this._editContext.domNode.domNode.dispatchEvent(e206);
    }, getLastRenderData: () => new koe(this._viewCursors.getLastRenderData() || [], this._editContext.getLastRenderData()), renderNow: () => {
      this.render(true, false);
    }, shouldSuppressMouseDownOnViewZone: (e206) => this._viewZones.shouldSuppressMouseDownOnViewZone(e206), shouldSuppressMouseDownOnWidget: (e206) => this._contentWidgets.shouldSuppressMouseDownOnWidget(e206), getPositionFromDOMInfo: (e206, t10) => (this._flushAccumulatedAndRenderNow(), this._viewLines.getPositionFromDOMInfo(e206, t10)), visibleRangeForPosition: (e206, t10) => {
      this._flushAccumulatedAndRenderNow();
      let n10 = new j(e206, t10);
      return this._viewLines.visibleRangeForPosition(n10) ?? this._viewLinesGpu?.visibleRangeForPosition(n10) ?? null;
    }, getLineWidth: (e206) => {
      if (this._flushAccumulatedAndRenderNow(), this._viewLinesGpu) {
        let t10 = this._viewLinesGpu.getLineWidth(e206);
        if (t10 !== void 0) return t10;
      }
      return this._viewLines.getLineWidth(e206);
    } };
  }
  _createTextAreaHandlerHelper() {
    return { visibleRangeForPosition: (e206) => (this._flushAccumulatedAndRenderNow(), this._viewLines.visibleRangeForPosition(e206)), linesVisibleRangesForRange: (e206, t10) => (this._flushAccumulatedAndRenderNow(), this._viewLines.linesVisibleRangesForRange(e206, t10)) };
  }
  _applyLayout() {
    let e206 = this._context.configuration.options.get(165);
    this.domNode.setWidth(e206.width), this.domNode.setHeight(e206.height), this._overflowGuardContainer.setWidth(e206.width), this._overflowGuardContainer.setHeight(e206.height), this._linesContent.setWidth(16777216), this._linesContent.setHeight(16777216);
  }
  _getEditorClassName() {
    let e206 = this._editContext.isFocused() ? ` focused` : ``;
    return this._context.configuration.options.get(162) + ` ` + GS(this._context.theme.type) + e206;
  }
  handleEvents(e206) {
    super.handleEvents(e206), this._scheduleRender();
  }
  onConfigurationChanged(e206) {
    return this.domNode.setClassName(this._getEditorClassName()), this._updateEditContext(), this._applyLayout(), false;
  }
  onCursorStateChanged(e206) {
    return this._selections = e206.selections, false;
  }
  onDecorationsChanged(e206) {
    return e206.affectsGlyphMargin && (this._shouldRecomputeGlyphMarginLanes = true), false;
  }
  onFocusChanged(e206) {
    return this.domNode.setClassName(this._getEditorClassName()), false;
  }
  onThemeChanged(e206) {
    return this._context.theme.update(e206.theme), this.domNode.setClassName(this._getEditorClassName()), false;
  }
  dispose() {
    this._renderAnimationFrame !== null && (this._renderAnimationFrame.dispose(), this._renderAnimationFrame = null), this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(), this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(), this._context.removeEventHandler(this), this._viewGpuContext?.dispose(), this._viewLines.dispose(), this._viewLinesGpu?.dispose();
    for (let e206 of this._viewParts) e206.dispose();
    super.dispose();
  }
  _scheduleRender() {
    if (this._store.isDisposed) throw new je();
    if (this._renderAnimationFrame === null) {
      this._editContext instanceof Xw && this._editContext.setEditContextOnDomNode();
      let e206 = this._createCoordinatedRendering();
      this._renderAnimationFrame = xue.INSTANCE.scheduleCoordinatedRendering({ window: Vc(this.domNode?.domNode), prepareRenderText: () => {
        if (this._store.isDisposed) throw new je();
        try {
          return e206.prepareRenderText();
        } finally {
          this._renderAnimationFrame = null;
        }
      }, renderText: () => {
        if (this._store.isDisposed) throw new je();
        return e206.renderText();
      }, prepareRender: (t10, n10) => {
        if (this._store.isDisposed) throw new je();
        return e206.prepareRender(t10, n10);
      }, render: (t10, n10) => {
        if (this._store.isDisposed) throw new je();
        return e206.render(t10, n10);
      } });
    }
  }
  _flushAccumulatedAndRenderNow() {
    let e206 = this._createCoordinatedRendering();
    Qw(() => e206.prepareRenderText());
    let t10 = Qw(() => e206.renderText());
    if (t10) {
      let [n10, r10] = t10;
      Qw(() => e206.prepareRender(n10, r10)), Qw(() => e206.render(n10, r10));
    }
  }
  _getViewPartsToRender() {
    let e206 = [], t10 = 0;
    for (let n10 of this._viewParts) n10.shouldRender() && (e206[t10++] = n10);
    return e206;
  }
  _createCoordinatedRendering() {
    return { prepareRenderText: () => {
      if (this._shouldRecomputeGlyphMarginLanes) {
        this._shouldRecomputeGlyphMarginLanes = false;
        let e206 = this._computeGlyphMarginLanes();
        this._context.configuration.setGlyphMarginDecorationLaneCount(e206.requiredLanes);
      }
      f_.onRenderStart();
    }, renderText: () => {
      if (!this.domNode.domNode.isConnected) return null;
      let e206 = this._getViewPartsToRender();
      if (!this._viewLines.shouldRender() && e206.length === 0) return null;
      let t10 = this._context.viewLayout.getLinesViewportData();
      this._context.viewModel.setViewport(t10.startLineNumber, t10.endLineNumber, t10.centeredLineNumber);
      let n10 = new vle(this._selections, t10, this._context.viewLayout.getWhitespaceViewportData(), this._context.viewModel);
      return this._contentWidgets.shouldRender() && this._contentWidgets.onBeforeRender(n10), this._viewLines.shouldRender() && (this._viewLines.renderText(n10), this._viewLines.onDidRender(), e206 = this._getViewPartsToRender()), this._viewLinesGpu?.shouldRender() && (this._viewLinesGpu.renderText(n10), this._viewLinesGpu.onDidRender()), [e206, new woe(this._context.viewLayout, n10, this._viewLines, this._viewLinesGpu)];
    }, prepareRender: (e206, t10) => {
      for (let n10 of e206) n10.prepareRender(t10);
    }, render: (e206, t10) => {
      for (let n10 of e206) n10.render(t10), n10.onDidRender();
    } };
  }
  delegateVerticalScrollbarPointerDown(e206) {
    this._scrollbar.delegateVerticalScrollbarPointerDown(e206);
  }
  delegateScrollFromMouseWheelEvent(e206) {
    this._scrollbar.delegateScrollFromMouseWheelEvent(e206);
  }
  restoreState(e206) {
    this._context.viewModel.viewLayout.setScrollPosition({ scrollTop: e206.scrollTop, scrollLeft: e206.scrollLeft }, 1), this._context.viewModel.visibleLinesStabilized();
  }
  getOffsetForColumn(e206, t10) {
    let n10 = this._context.viewModel.model.validatePosition({ lineNumber: e206, column: t10 }), r10 = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n10);
    this._flushAccumulatedAndRenderNow();
    let i10 = this._viewLines.visibleRangeForPosition(new j(r10.lineNumber, r10.column));
    return i10 ? i10.left : -1;
  }
  getTargetAtClientPoint(e206, t10) {
    let n10 = this._pointerHandler.getTargetAtClientPoint(e206, t10);
    return n10 ? LS.convertViewToModelMouseTarget(n10, this._context.viewModel.coordinatesConverter) : null;
  }
  createOverviewRuler(e206) {
    return new ole(this._context, e206);
  }
  change(e206) {
    this._viewZones.changeViewZones(e206), this._scheduleRender();
  }
  render(e206, t10) {
    if (t10) {
      this._viewLines.forceShouldRender();
      for (let e207 of this._viewParts) e207.forceShouldRender();
    }
    e206 ? this._flushAccumulatedAndRenderNow() : this._scheduleRender();
  }
  writeScreenReaderContent(e206) {
    this._editContext.writeScreenReaderContent(e206);
  }
  focus() {
    this._editContext.focus();
  }
  isFocused() {
    return this._editContext.isFocused();
  }
  isWidgetFocused() {
    return this._widgetFocusTracker.hasFocus();
  }
  setAriaOptions(e206) {
    this._editContext.setAriaOptions(e206);
  }
  addContentWidget(e206) {
    this._contentWidgets.addWidget(e206.widget), this.layoutContentWidget(e206), this._scheduleRender();
  }
  layoutContentWidget(e206) {
    this._contentWidgets.setWidgetPosition(e206.widget, e206.position?.position ?? null, e206.position?.secondaryPosition ?? null, e206.position?.preference ?? null, e206.position?.positionAffinity ?? null), this._scheduleRender();
  }
  removeContentWidget(e206) {
    this._contentWidgets.removeWidget(e206.widget), this._scheduleRender();
  }
  addOverlayWidget(e206) {
    this._overlayWidgets.addWidget(e206.widget), this.layoutOverlayWidget(e206), this._scheduleRender();
  }
  layoutOverlayWidget(e206) {
    this._overlayWidgets.setWidgetPosition(e206.widget, e206.position) && this._scheduleRender();
  }
  removeOverlayWidget(e206) {
    this._overlayWidgets.removeWidget(e206.widget), this._scheduleRender();
  }
  addGlyphMarginWidget(e206) {
    this._glyphMarginWidgets.addWidget(e206.widget), this._shouldRecomputeGlyphMarginLanes = true, this._scheduleRender();
  }
  layoutGlyphMarginWidget(e206) {
    let t10 = e206.position;
    this._glyphMarginWidgets.setWidgetPosition(e206.widget, t10) && (this._shouldRecomputeGlyphMarginLanes = true, this._scheduleRender());
  }
  removeGlyphMarginWidget(e206) {
    this._glyphMarginWidgets.removeWidget(e206.widget), this._shouldRecomputeGlyphMarginLanes = true, this._scheduleRender();
  }
};
Zw = yue([bue(8, V)], Zw);
function Qw(e206) {
  try {
    return e206();
  } catch (e207) {
    return be(e207), null;
  }
}
var xue = (_va = class {
  constructor() {
    this._coordinatedRenderings = [], this._animationFrameRunners = /* @__PURE__ */ new Map();
  }
  scheduleCoordinatedRendering(e206) {
    return this._coordinatedRenderings.push(e206), this._scheduleRender(e206.window), { dispose: () => {
      let t10 = this._coordinatedRenderings.indexOf(e206);
      if (t10 !== -1 && (this._coordinatedRenderings.splice(t10, 1), this._coordinatedRenderings.length === 0)) {
        for (let [e207, t11] of this._animationFrameRunners) t11.dispose();
        this._animationFrameRunners.clear();
      }
    } };
  }
  _scheduleRender(e206) {
    this._animationFrameRunners.has(e206) || this._animationFrameRunners.set(e206, sl(e206, () => {
      this._animationFrameRunners.delete(e206), this._onRenderScheduled();
    }, 100));
  }
  _onRenderScheduled() {
    let e206 = this._coordinatedRenderings.slice(0);
    this._coordinatedRenderings = [];
    for (let t11 of e206) Qw(() => t11.prepareRenderText());
    let t10 = [];
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
      let r11 = e206[n10];
      t10[n10] = Qw(() => r11.renderText());
    }
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
      let r11 = e206[n10], i10 = t10[n10];
      if (!i10) continue;
      let [a10, o10] = i10;
      Qw(() => r11.prepareRender(a10, o10));
    }
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
      let r11 = e206[n10], i10 = t10[n10];
      if (!i10) continue;
      let [a10, o10] = i10;
      Qw(() => r11.render(a10, o10));
    }
  }
}, _va.INSTANCE = new _va(), _va), Sue = class extends D {
  constructor(e206, t10) {
    super(), this._onChange = this._register(new k()), this.onChange = this._onChange.event, this._hadFocus = void 0, this._hasDomElementFocus = false, this._domFocusTracker = this._register(Gl(e206)), this._overflowWidgetsDomNodeHasFocus = false, this._register(this._domFocusTracker.onDidFocus(() => {
      this._hasDomElementFocus = true, this._update();
    })), this._register(this._domFocusTracker.onDidBlur(() => {
      this._hasDomElementFocus = false, this._update();
    })), t10 && (this._overflowWidgetsDomNode = this._register(Gl(t10)), this._register(this._overflowWidgetsDomNode.onDidFocus(() => {
      this._overflowWidgetsDomNodeHasFocus = true, this._update();
    })), this._register(this._overflowWidgetsDomNode.onDidBlur(() => {
      this._overflowWidgetsDomNodeHasFocus = false, this._update();
    })));
  }
  _update() {
    let e206 = this._hasDomElementFocus || this._overflowWidgetsDomNodeHasFocus;
    this._hadFocus !== e206 && (this._hadFocus = e206, this._onChange.fire(void 0));
  }
  hasFocus() {
    return this._hadFocus ?? false;
  }
}, $w = class {
  constructor(e206, t10, n10, r10, i10) {
    this.injectionOffsets = e206, this.injectionOptions = t10, this.breakOffsets = n10, this.breakOffsetsVisibleColumn = r10, this.wrappedTextIndentLength = i10;
  }
  getOutputLineCount() {
    return this.breakOffsets.length;
  }
  getMinOutputOffset(e206) {
    return e206 > 0 ? this.wrappedTextIndentLength : 0;
  }
  getLineLength(e206) {
    let t10 = e206 > 0 ? this.breakOffsets[e206 - 1] : 0, n10 = this.breakOffsets[e206] - t10;
    return e206 > 0 && (n10 += this.wrappedTextIndentLength), n10;
  }
  getMaxOutputOffset(e206) {
    return this.getLineLength(e206);
  }
  translateToInputOffset(e206, t10) {
    e206 > 0 && (t10 = Math.max(0, t10 - this.wrappedTextIndentLength));
    let n10 = e206 === 0 ? t10 : this.breakOffsets[e206 - 1] + t10;
    if (this.injectionOffsets !== null) for (let e207 = 0; e207 < this.injectionOffsets.length && n10 > this.injectionOffsets[e207]; e207++) n10 < this.injectionOffsets[e207] + this.injectionOptions[e207].content.length ? n10 = this.injectionOffsets[e207] : n10 -= this.injectionOptions[e207].content.length;
    return n10;
  }
  translateToOutputPosition(e206, t10 = 2) {
    let n10 = e206;
    if (this.injectionOffsets !== null) for (let r10 = 0; r10 < this.injectionOffsets.length && !(e206 < this.injectionOffsets[r10] || t10 !== 1 && e206 === this.injectionOffsets[r10]); r10++) n10 += this.injectionOptions[r10].content.length;
    return this.offsetInInputWithInjectionsToOutputPosition(n10, t10);
  }
  offsetInInputWithInjectionsToOutputPosition(e206, t10 = 2) {
    let n10 = 0, r10 = this.breakOffsets.length - 1, i10 = 0, a10 = 0;
    for (; n10 <= r10; ) {
      i10 = n10 + (r10 - n10) / 2 | 0;
      let o11 = this.breakOffsets[i10];
      if (a10 = i10 > 0 ? this.breakOffsets[i10 - 1] : 0, t10 === 0) if (e206 <= a10) r10 = i10 - 1;
      else if (e206 > o11) n10 = i10 + 1;
      else break;
      else if (e206 < a10) r10 = i10 - 1;
      else if (e206 >= o11) n10 = i10 + 1;
      else break;
    }
    let o10 = e206 - a10;
    return i10 > 0 && (o10 += this.wrappedTextIndentLength), new nT(i10, o10);
  }
  normalizeOutputPosition(e206, t10, n10) {
    if (this.injectionOffsets !== null) {
      let r10 = this.outputPositionToOffsetInInputWithInjections(e206, t10), i10 = this.normalizeOffsetInInputWithInjectionsAroundInjections(r10, n10);
      if (i10 !== r10) return this.offsetInInputWithInjectionsToOutputPosition(i10, n10);
    }
    if (n10 === 0) {
      if (e206 > 0 && t10 === this.getMinOutputOffset(e206)) return new nT(e206 - 1, this.getMaxOutputOffset(e206 - 1));
    } else if (n10 === 1 && e206 < this.getOutputLineCount() - 1 && t10 === this.getMaxOutputOffset(e206)) return new nT(e206 + 1, this.getMinOutputOffset(e206 + 1));
    return new nT(e206, t10);
  }
  outputPositionToOffsetInInputWithInjections(e206, t10) {
    return e206 > 0 && (t10 = Math.max(0, t10 - this.wrappedTextIndentLength)), (e206 > 0 ? this.breakOffsets[e206 - 1] : 0) + t10;
  }
  normalizeOffsetInInputWithInjectionsAroundInjections(e206, t10) {
    let n10 = this.getInjectedTextAtOffset(e206);
    if (!n10) return e206;
    if (t10 === 2) {
      if (e206 === n10.offsetInInputWithInjections + n10.length && eT(this.injectionOptions[n10.injectedTextIndex].cursorStops)) return n10.offsetInInputWithInjections + n10.length;
      {
        let e207 = n10.offsetInInputWithInjections;
        if (tT(this.injectionOptions[n10.injectedTextIndex].cursorStops)) return e207;
        let t11 = n10.injectedTextIndex - 1;
        for (; t11 >= 0 && this.injectionOffsets[t11] === this.injectionOffsets[n10.injectedTextIndex] && !(eT(this.injectionOptions[t11].cursorStops) || (e207 -= this.injectionOptions[t11].content.length, tT(this.injectionOptions[t11].cursorStops))); ) t11--;
        return e207;
      }
    } else if (t10 === 1 || t10 === 4) {
      let e207 = n10.offsetInInputWithInjections + n10.length, t11 = n10.injectedTextIndex;
      for (; t11 + 1 < this.injectionOffsets.length && this.injectionOffsets[t11 + 1] === this.injectionOffsets[t11]; ) e207 += this.injectionOptions[t11 + 1].content.length, t11++;
      return e207;
    } else if (t10 === 0 || t10 === 3) {
      let e207 = n10.offsetInInputWithInjections, t11 = n10.injectedTextIndex;
      for (; t11 - 1 >= 0 && this.injectionOffsets[t11 - 1] === this.injectionOffsets[t11]; ) e207 -= this.injectionOptions[t11 - 1].content.length, t11--;
      return e207;
    }
    Ne();
  }
  getInjectedText(e206, t10) {
    let n10 = this.outputPositionToOffsetInInputWithInjections(e206, t10), r10 = this.getInjectedTextAtOffset(n10);
    return r10 ? { options: this.injectionOptions[r10.injectedTextIndex] } : null;
  }
  getInjectedTextAtOffset(e206) {
    let t10 = this.injectionOffsets, n10 = this.injectionOptions;
    if (t10 !== null) {
      let r10 = 0;
      for (let i10 = 0; i10 < t10.length; i10++) {
        let a10 = n10[i10].content.length, o10 = t10[i10] + r10, s10 = t10[i10] + r10 + a10;
        if (o10 > e206) break;
        if (e206 <= s10) return { injectedTextIndex: i10, offsetInInputWithInjections: o10, length: a10 };
        r10 += a10;
      }
    }
  }
};
function eT(e206) {
  return e206 == null ? true : e206 === tm.Right || e206 === tm.Both;
}
function tT(e206) {
  return e206 == null ? true : e206 === tm.Left || e206 === tm.Both;
}
var nT = class {
  constructor(e206, t10) {
    this.outputLineIndex = e206, this.outputOffset = t10;
  }
  toString() {
    return `${this.outputLineIndex}:${this.outputOffset}`;
  }
  toPosition(e206) {
    return new j(e206 + this.outputLineIndex, this.outputOffset + 1);
  }
}, Cue = class {
  constructor() {
    this.changeType = 1;
  }
}, rT = class e99 {
  static applyInjectedText(e206, t10) {
    if (!t10 || t10.length === 0) return e206;
    let n10 = ``, r10 = 0;
    for (let i10 of t10) n10 += e206.substring(r10, i10.column - 1), r10 = i10.column - 1, n10 += i10.options.content;
    return n10 += e206.substring(r10), n10;
  }
  static fromDecorations(t10) {
    let n10 = [];
    for (let r10 of t10) r10.options.before && r10.options.before.content.length > 0 && n10.push(new e99(r10.ownerId, r10.range.startLineNumber, r10.range.startColumn, r10.options.before, 0)), r10.options.after && r10.options.after.content.length > 0 && n10.push(new e99(r10.ownerId, r10.range.endLineNumber, r10.range.endColumn, r10.options.after, 1));
    return n10.sort((e206, t11) => e206.lineNumber === t11.lineNumber ? e206.column === t11.column ? e206.order - t11.order : e206.column - t11.column : e206.lineNumber - t11.lineNumber), n10;
  }
  constructor(e206, t10, n10, r10, i10) {
    this.ownerId = e206, this.lineNumber = t10, this.column = n10, this.options = r10, this.order = i10;
  }
}, iT = class {
  constructor(e206, t10, n10) {
    this.changeType = 2, this.lineNumber = e206, this.detail = t10, this.injectedText = n10;
  }
}, wue = class {
  constructor(e206, t10, n10, r10) {
    this.ownerId = e206, this.decorationId = t10, this.lineNumber = n10, this.lineHeight = r10;
  }
}, Tue = class {
  constructor(e206, t10) {
    this.ownerId = e206, this.lineNumber = t10;
  }
}, Eue = class {
  constructor(e206, t10) {
    this.changeType = 3, this.fromLineNumber = e206, this.toLineNumber = t10;
  }
}, Due = class {
  constructor(e206, t10, n10, r10) {
    this.changeType = 4, this.injectedTexts = r10, this.fromLineNumber = e206, this.toLineNumber = t10, this.detail = n10;
  }
}, Oue = class {
  constructor() {
    this.changeType = 5;
  }
}, aT = class e100 {
  constructor(e206, t10, n10, r10) {
    this.changes = e206, this.versionId = t10, this.isUndoing = n10, this.isRedoing = r10, this.resultingSelection = null;
  }
  containsEvent(e206) {
    for (let t10 = 0, n10 = this.changes.length; t10 < n10; t10++) if (this.changes[t10].changeType === e206) return true;
    return false;
  }
  static merge(t10, n10) {
    let r10 = [].concat(t10.changes, n10.changes), i10 = n10.versionId;
    return new e100(r10, i10, t10.isUndoing || n10.isUndoing, t10.isRedoing || n10.isRedoing);
  }
}, oT = class {
  constructor(e206) {
    this.changes = e206;
  }
}, sT = class {
  constructor(e206) {
    this.changes = e206;
  }
}, cT = class {
  constructor(e206) {
    this.changes = e206;
  }
}, lT = class e101 {
  constructor(e206, t10) {
    this.rawContentChangedEvent = e206, this.contentChangedEvent = t10;
  }
  merge(t10) {
    return new e101(aT.merge(this.rawContentChangedEvent, t10.rawContentChangedEvent), e101._mergeChangeEvents(this.contentChangedEvent, t10.contentChangedEvent));
  }
  static _mergeChangeEvents(e206, t10) {
    let n10 = [].concat(e206.changes, t10.changes), r10 = t10.eol, i10 = t10.versionId, a10 = e206.isUndoing || t10.isUndoing, o10 = e206.isRedoing || t10.isRedoing, s10 = e206.isFlush || t10.isFlush;
    return { changes: n10, eol: r10, isEolChange: e206.isEolChange && t10.isEolChange, versionId: i10, isUndoing: a10, isRedoing: o10, isFlush: s10, detailedReasons: e206.detailedReasons.concat(t10.detailedReasons), detailedReasonsChangeLengths: e206.detailedReasonsChangeLengths.concat(t10.detailedReasonsChangeLengths) };
  }
}, kue = _f2(`domLineBreaksComputer`, { createHTML: (e206) => e206 }), Aue = class e102 {
  static create(t10) {
    return new e102(new WeakRef(t10));
  }
  constructor(e206) {
    this.targetWindow = e206;
  }
  createLineBreaksComputer(e206, t10, n10, r10, i10, a10) {
    let o10 = [], s10 = [];
    return { addRequest: (e207, t11, n11) => {
      o10.push(e207), s10.push(t11);
    }, finalize: () => jue(Ye(this.targetWindow.deref()), o10, e206, t10, n10, r10, i10, s10) };
  }
};
function jue(e206, t10, n10, r10, i10, a10, o10, s10) {
  function c10(e207) {
    let n11 = s10[e207];
    if (n11) {
      let r11 = rT.applyInjectedText(t10[e207], n11), i11 = n11.map((e208) => e208.options);
      return new $w(n11.map((e208) => e208.column - 1), i11, [r11.length], [], 0);
    } else return null;
  }
  if (i10 === -1) {
    let e207 = [];
    for (let n11 = 0, r11 = t10.length; n11 < r11; n11++) e207[n11] = c10(n11);
    return e207;
  }
  let l10 = Math.round(i10 * n10.typicalHalfwidthCharacterWidth), u10 = Math.round(r10 * (a10 === 3 ? 2 : +(a10 === 2))), d10 = Math.ceil(n10.spaceWidth * u10), f10 = document.createElement(`div`);
  vu(f10, n10);
  let p10 = new Ff(1e4), m10 = [], h10 = [], g10 = [], _10 = [], v10 = [];
  for (let e207 = 0; e207 < t10.length; e207++) {
    let i11 = rT.applyInjectedText(t10[e207], s10[e207]), o11 = 0, c11 = 0, u11 = l10;
    if (a10 !== 0) if (o11 = Ga(i11), o11 === -1) o11 = 0;
    else {
      for (let e209 = 0; e209 < o11; e209++) {
        let t11 = i11.charCodeAt(e209) === 9 ? r10 - c11 % r10 : 1;
        c11 += t11;
      }
      let e208 = Math.ceil(n10.spaceWidth * c11);
      e208 + n10.typicalFullwidthCharacterWidth > l10 ? (o11 = 0, c11 = 0) : u11 = l10 - e208;
    }
    let f11 = i11.substr(o11), y11 = Mue(f11, c11, r10, u11, p10, d10);
    m10[e207] = o11, h10[e207] = c11, g10[e207] = f11, _10[e207] = y11[0], v10[e207] = y11[1];
  }
  let y10 = p10.build();
  f10.innerHTML = kue?.createHTML(y10) ?? y10, f10.style.position = `absolute`, f10.style.top = `10000`, o10 === `keepAll` ? (f10.style.wordBreak = `keep-all`, f10.style.overflowWrap = `anywhere`) : (f10.style.wordBreak = `inherit`, f10.style.overflowWrap = `break-word`), e206.document.body.appendChild(f10);
  let b10 = document.createRange(), x10 = Array.prototype.slice.call(f10.children, 0), S10 = [];
  for (let e207 = 0; e207 < t10.length; e207++) {
    let t11 = x10[e207], n11 = Nue(b10, t11, g10[e207], _10[e207]);
    if (n11 === null) {
      S10[e207] = c10(e207);
      continue;
    }
    let r11 = m10[e207], i11 = h10[e207] + u10, a11 = v10[e207], o11 = [];
    for (let e208 = 0, t12 = n11.length; e208 < t12; e208++) o11[e208] = a11[n11[e208]];
    if (r11 !== 0) for (let e208 = 0, t12 = n11.length; e208 < t12; e208++) n11[e208] += r11;
    let l11, d11, f11 = s10[e207];
    f11 ? (l11 = f11.map((e208) => e208.options), d11 = f11.map((e208) => e208.column - 1)) : (l11 = null, d11 = null), S10[e207] = new $w(d11, l11, n11, o11, i11);
  }
  return f10.remove(), S10;
}
function Mue(e206, t10, n10, r10, i10, a10) {
  if (a10 !== 0) {
    let e207 = String(a10);
    i10.appendString(`<div style="text-indent: -`), i10.appendString(e207), i10.appendString(`px; padding-left: `), i10.appendString(e207), i10.appendString(`px; box-sizing: border-box; width:`);
  } else i10.appendString(`<div style="width:`);
  i10.appendString(String(r10)), i10.appendString(`px;">`);
  let o10 = e206.length, s10 = t10, c10 = 0, l10 = [], u10 = [], d10 = 0 < o10 ? e206.charCodeAt(0) : 0;
  i10.appendString(`<span>`);
  for (let t11 = 0; t11 < o10; t11++) {
    t11 !== 0 && t11 % 16384 == 0 && i10.appendString(`</span><span>`), l10[t11] = c10, u10[t11] = s10;
    let r11 = d10;
    d10 = t11 + 1 < o10 ? e206.charCodeAt(t11 + 1) : 0;
    let a11 = 1, f10 = 1;
    switch (r11) {
      case 9:
        a11 = n10 - s10 % n10, f10 = a11;
        for (let e207 = 1; e207 <= a11; e207++) e207 < a11 ? i10.appendCharCode(160) : i10.appendASCIICharCode(32);
        break;
      case 32:
        d10 === 32 ? i10.appendCharCode(160) : i10.appendASCIICharCode(32);
        break;
      case 60:
        i10.appendString(`&lt;`);
        break;
      case 62:
        i10.appendString(`&gt;`);
        break;
      case 38:
        i10.appendString(`&amp;`);
        break;
      case 0:
        i10.appendString(`&#00;`);
        break;
      case 65279:
      case 8232:
      case 8233:
      case 133:
        i10.appendCharCode(65533);
        break;
      default:
        yo(r11) && f10++, r11 < 32 ? i10.appendCharCode(9216 + r11) : i10.appendCharCode(r11);
    }
    c10 += a11, s10 += f10;
  }
  return i10.appendString(`</span>`), l10[e206.length] = c10, u10[e206.length] = s10, i10.appendString(`</div>`), [l10, u10];
}
function Nue(e206, t10, n10, r10) {
  if (n10.length <= 1) return null;
  let i10 = Array.prototype.slice.call(t10.children, 0), a10 = [];
  try {
    uT(e206, i10, r10, 0, null, n10.length - 1, null, a10);
  } catch (e207) {
    return console.log(e207), null;
  }
  return a10.length === 0 ? null : (a10.push(n10.length), a10);
}
function uT(e206, t10, n10, r10, i10, a10, o10, s10) {
  if (r10 === a10 || (i10 || (i10 = dT(e206, t10, n10[r10], n10[r10 + 1])), o10 || (o10 = dT(e206, t10, n10[a10], n10[a10 + 1])), Math.abs(i10[0].top - o10[0].top) <= 0.1)) return;
  if (r10 + 1 === a10) {
    s10.push(a10);
    return;
  }
  let c10 = r10 + (a10 - r10) / 2 | 0, l10 = dT(e206, t10, n10[c10], n10[c10 + 1]);
  uT(e206, t10, n10, r10, i10, c10, l10, s10), uT(e206, t10, n10, c10, l10, a10, o10, s10);
}
function dT(e206, t10, n10, r10) {
  return e206.setStart(t10[n10 / 16384 | 0].firstChild, n10 % 16384), e206.setEnd(t10[r10 / 16384 | 0].firstChild, r10 % 16384), e206.getClientRects();
}
var Pue = class extends D {
  constructor() {
    super(), this._editor = null, this._instantiationService = null, this._instances = this._register(new Xt()), this._pending = /* @__PURE__ */ new Map(), this._finishedInstantiation = [], this._finishedInstantiation[0] = false, this._finishedInstantiation[1] = false, this._finishedInstantiation[2] = false, this._finishedInstantiation[3] = false;
  }
  initialize(e206, t10, n10) {
    this._editor = e206, this._instantiationService = n10;
    for (let e207 of t10) {
      if (this._pending.has(e207.id)) {
        be(Error(`Cannot have two contributions with the same id ${e207.id}`));
        continue;
      }
      this._pending.set(e207.id, e207);
    }
    this._instantiateSome(0), this._register(al(Vc(this._editor.getDomNode()), () => {
      this._instantiateSome(1);
    })), this._register(al(Vc(this._editor.getDomNode()), () => {
      this._instantiateSome(2);
    })), this._register(al(Vc(this._editor.getDomNode()), () => {
      this._instantiateSome(3);
    }, 5e3));
  }
  saveViewState() {
    let e206 = {};
    for (let [t10, n10] of this._instances) typeof n10.saveViewState == `function` && (e206[t10] = n10.saveViewState());
    return e206;
  }
  restoreViewState(e206) {
    for (let [t10, n10] of this._instances) typeof n10.restoreViewState == `function` && n10.restoreViewState(e206[t10]);
  }
  get(e206) {
    return this._instantiateById(e206), this._instances.get(e206) || null;
  }
  onBeforeInteractionEvent() {
    this._instantiateSome(2);
  }
  onAfterModelAttached() {
    return al(Vc(this._editor?.getDomNode()), () => {
      this._instantiateSome(1);
    }, 50);
  }
  _instantiateSome(e206) {
    if (this._finishedInstantiation[e206]) return;
    this._finishedInstantiation[e206] = true;
    let t10 = this._findPendingContributionsByInstantiation(e206);
    for (let e207 of t10) this._instantiateById(e207.id);
  }
  _findPendingContributionsByInstantiation(e206) {
    let t10 = [];
    for (let [, n10] of this._pending) n10.instantiation === e206 && t10.push(n10);
    return t10;
  }
  _instantiateById(e206) {
    let t10 = this._pending.get(e206);
    if (t10) {
      if (this._pending.delete(e206), !this._instantiationService || !this._editor) throw Error(`Cannot instantiate contributions before being initialized!`);
      try {
        let e207 = this._instantiationService.createInstance(t10.ctor, this._editor);
        this._instances.set(t10.id, e207), typeof e207.restoreViewState == `function` && t10.instantiation !== 0 && console.warn(`Editor contribution '${t10.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`);
      } catch (e207) {
        be(e207);
      }
    }
  }
}, fT = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.id = e206, this.label = t10, this.alias = n10, this.metadata = r10, this._precondition = i10, this._run = a10, this._contextKeyService = o10;
  }
  isSupported() {
    return this._contextKeyService.contextMatchesRules(this._precondition);
  }
  run(e206) {
    return this.isSupported() ? this._run(e206) : Promise.resolve(void 0);
  }
};
function pT(e206) {
  let t10 = 0, n10 = 0, r10 = 0, i10 = 0;
  for (let a10 = 0, o10 = e206.length; a10 < o10; a10++) {
    let s10 = e206.charCodeAt(a10);
    s10 === 13 ? (t10 === 0 && (n10 = a10), t10++, a10 + 1 < o10 && e206.charCodeAt(a10 + 1) === 10 ? (i10 |= 2, a10++) : i10 |= 3, r10 = a10 + 1) : s10 === 10 && (i10 |= 1, t10 === 0 && (n10 = a10), t10++, r10 = a10 + 1);
  }
  return t10 === 0 && (n10 = e206.length), [t10, n10, e206.length - r10, i10];
}
var mT = class {
  constructor(e206, t10, n10, r10) {
    this.range = e206, this.nestingLevel = t10, this.nestingLevelOfEqualBracketType = n10, this.isInvalid = r10;
  }
}, Fue = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this.range = e206, this.openingBracketRange = t10, this.closingBracketRange = n10, this.nestingLevel = r10, this.nestingLevelOfEqualBracketType = i10, this.bracketPairNode = a10;
  }
  get openingBracketInfo() {
    return this.bracketPairNode.openingBracket.bracketInfo;
  }
}, Iue = class extends Fue {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(e206, t10, n10, r10, i10, a10), this.minVisibleColumnIndentation = o10;
  }
};
function Lue(e206, t10, n10, r10) {
  return e206 === n10 ? _T2(0, r10 - t10) : _T2(n10 - e206, r10);
}
function hT(e206) {
  return e206 === 0;
}
var gT = 2 ** 26;
function _T2(e206, t10) {
  return e206 * gT + t10;
}
function vT(e206) {
  let t10 = e206, n10 = Math.floor(t10 / gT);
  return new Vm(n10, t10 - n10 * gT);
}
function Rue(e206) {
  return Math.floor(e206 / gT);
}
function yT(e206) {
  return e206;
}
function bT(e206, t10) {
  let n10 = e206 + t10;
  return t10 >= gT && (n10 -= e206 % gT), n10;
}
function zue(e206, t10) {
  return e206.reduce((e207, n10) => bT(e207, t10(n10)), 0);
}
function xT(e206, t10) {
  return e206 === t10;
}
function ST(e206, t10) {
  let n10 = e206, r10 = t10;
  if (r10 - n10 <= 0) return 0;
  let i10 = Math.floor(n10 / gT), a10 = Math.floor(r10 / gT), o10 = r10 - a10 * gT;
  return i10 === a10 ? _T2(0, o10 - (n10 - i10 * gT)) : _T2(a10 - i10, o10);
}
function CT(e206, t10) {
  return e206 < t10;
}
function wT(e206, t10) {
  return e206 <= t10;
}
function TT(e206, t10) {
  return e206 >= t10;
}
function ET(e206) {
  return _T2(e206.lineNumber - 1, e206.column - 1);
}
function DT(e206, t10) {
  let n10 = e206, r10 = Math.floor(n10 / gT), i10 = n10 - r10 * gT, a10 = t10, o10 = Math.floor(a10 / gT), s10 = a10 - o10 * gT;
  return new M(r10 + 1, i10 + 1, o10 + 1, s10 + 1);
}
function Bue(e206) {
  let t10 = Wa(e206);
  return _T2(t10.length - 1, t10[t10.length - 1].length);
}
var OT = class e103 {
  static fromModelContentChanges(t10) {
    return t10.map((t11) => {
      let n10 = M.lift(t11.range);
      return new e103(ET(n10.getStartPosition()), ET(n10.getEndPosition()), Bue(t11.text));
    }).reverse();
  }
  constructor(e206, t10, n10) {
    this.startOffset = e206, this.endOffset = t10, this.newLength = n10;
  }
  toString() {
    return `[${vT(this.startOffset)}...${vT(this.endOffset)}) -> ${vT(this.newLength)}`;
  }
}, Vue = class {
  constructor(e206) {
    this.nextEditIdx = 0, this.deltaOldToNewLineCount = 0, this.deltaOldToNewColumnCount = 0, this.deltaLineIdxInOld = -1, this.edits = e206.map((e207) => Hue.from(e207));
  }
  getOffsetBeforeChange(e206) {
    return this.adjustNextEdit(e206), this.translateCurToOld(e206);
  }
  getDistanceToNextChange(e206) {
    this.adjustNextEdit(e206);
    let t10 = this.edits[this.nextEditIdx], n10 = t10 ? this.translateOldToCur(t10.offsetObj) : null;
    return n10 === null ? null : ST(e206, n10);
  }
  translateOldToCur(e206) {
    return e206.lineCount === this.deltaLineIdxInOld ? _T2(e206.lineCount + this.deltaOldToNewLineCount, e206.columnCount + this.deltaOldToNewColumnCount) : _T2(e206.lineCount + this.deltaOldToNewLineCount, e206.columnCount);
  }
  translateCurToOld(e206) {
    let t10 = vT(e206);
    return t10.lineCount - this.deltaOldToNewLineCount === this.deltaLineIdxInOld ? _T2(t10.lineCount - this.deltaOldToNewLineCount, t10.columnCount - this.deltaOldToNewColumnCount) : _T2(t10.lineCount - this.deltaOldToNewLineCount, t10.columnCount);
  }
  adjustNextEdit(e206) {
    for (; this.nextEditIdx < this.edits.length; ) {
      let t10 = this.edits[this.nextEditIdx], n10 = this.translateOldToCur(t10.endOffsetAfterObj);
      if (wT(n10, e206)) {
        this.nextEditIdx++;
        let e207 = vT(n10), r10 = vT(this.translateOldToCur(t10.endOffsetBeforeObj)), i10 = e207.lineCount - r10.lineCount;
        this.deltaOldToNewLineCount += i10, this.deltaOldToNewColumnCount = (this.deltaLineIdxInOld === t10.endOffsetBeforeObj.lineCount ? this.deltaOldToNewColumnCount : 0) + (e207.columnCount - r10.columnCount), this.deltaLineIdxInOld = t10.endOffsetBeforeObj.lineCount;
      } else break;
    }
  }
}, Hue = class e104 {
  static from(t10) {
    return new e104(t10.startOffset, t10.endOffset, t10.newLength);
  }
  constructor(e206, t10, n10) {
    this.endOffsetBeforeObj = vT(t10), this.endOffsetAfterObj = vT(bT(e206, n10)), this.offsetObj = vT(e206);
  }
}, kT = [], AT = (_wa = class {
  static create(t10, n10) {
    if (t10 <= 128 && n10.length === 0) {
      let r10 = _wa.cache[t10];
      return r10 || (r10 = new _wa(t10, n10), _wa.cache[t10] = r10), r10;
    }
    return new _wa(t10, n10);
  }
  static getEmpty() {
    return this.empty;
  }
  constructor(e206, t10) {
    this.items = e206, this.additionalItems = t10;
  }
  add(t10, n10) {
    let r10 = n10.getKey(t10), i10 = r10 >> 5;
    if (i10 === 0) {
      let t11 = 1 << r10 | this.items;
      return t11 === this.items ? this : _wa.create(t11, this.additionalItems);
    }
    i10--;
    let a10 = this.additionalItems.slice(0);
    for (; a10.length < i10; ) a10.push(0);
    return a10[i10] |= 1 << (r10 & 31), _wa.create(this.items, a10);
  }
  merge(t10) {
    let n10 = this.items | t10.items;
    if (this.additionalItems === kT && t10.additionalItems === kT) return n10 === this.items ? this : n10 === t10.items ? t10 : _wa.create(n10, kT);
    let r10 = [];
    for (let e206 = 0; e206 < Math.max(this.additionalItems.length, t10.additionalItems.length); e206++) {
      let n11 = this.additionalItems[e206] || 0, i10 = t10.additionalItems[e206] || 0;
      r10.push(n11 | i10);
    }
    return _wa.create(n10, r10);
  }
  intersects(e206) {
    if ((this.items & e206.items) !== 0) return true;
    for (let t10 = 0; t10 < Math.min(this.additionalItems.length, e206.additionalItems.length); t10++) if ((this.additionalItems[t10] & e206.additionalItems[t10]) !== 0) return true;
    return false;
  }
}, _wa.cache = Array(129), _wa.empty = _wa.create(0, kT), _wa), jT = { getKey(e206) {
  return e206;
} }, MT = class {
  constructor() {
    this.items = /* @__PURE__ */ new Map();
  }
  getKey(e206) {
    let t10 = this.items.get(e206);
    return t10 === void 0 && (t10 = this.items.size, this.items.set(e206, t10)), t10;
  }
}, NT = class {
  get length() {
    return this._length;
  }
  constructor(e206) {
    this._length = e206;
  }
}, PT = class e105 extends NT {
  static create(t10, n10, r10) {
    let i10 = t10.length;
    return n10 && (i10 = bT(i10, n10.length)), r10 && (i10 = bT(i10, r10.length)), new e105(i10, t10, n10, r10, n10 ? n10.missingOpeningBracketIds : AT.getEmpty());
  }
  get kind() {
    return 2;
  }
  get listHeight() {
    return 0;
  }
  get childrenLength() {
    return 3;
  }
  getChild(e206) {
    switch (e206) {
      case 0:
        return this.openingBracket;
      case 1:
        return this.child;
      case 2:
        return this.closingBracket;
    }
    throw Error(`Invalid child index`);
  }
  get children() {
    let e206 = [];
    return e206.push(this.openingBracket), this.child && e206.push(this.child), this.closingBracket && e206.push(this.closingBracket), e206;
  }
  constructor(e206, t10, n10, r10, i10) {
    super(e206), this.openingBracket = t10, this.child = n10, this.closingBracket = r10, this.missingOpeningBracketIds = i10;
  }
  canBeReused(e206) {
    return !(this.closingBracket === null || e206.intersects(this.missingOpeningBracketIds));
  }
  deepClone() {
    return new e105(this.length, this.openingBracket.deepClone(), this.child && this.child.deepClone(), this.closingBracket && this.closingBracket.deepClone(), this.missingOpeningBracketIds);
  }
  computeMinIndentation(e206, t10) {
    return this.child ? this.child.computeMinIndentation(bT(e206, this.openingBracket.length), t10) : 2 ** 53 - 1;
  }
}, FT = class extends NT {
  static create23(e206, t10, n10, r10 = false) {
    let i10 = e206.length, a10 = e206.missingOpeningBracketIds;
    if (e206.listHeight !== t10.listHeight) throw Error(`Invalid list heights`);
    if (i10 = bT(i10, t10.length), a10 = a10.merge(t10.missingOpeningBracketIds), n10) {
      if (e206.listHeight !== n10.listHeight) throw Error(`Invalid list heights`);
      i10 = bT(i10, n10.length), a10 = a10.merge(n10.missingOpeningBracketIds);
    }
    return r10 ? new Uue(i10, e206.listHeight + 1, e206, t10, n10, a10) : new IT(i10, e206.listHeight + 1, e206, t10, n10, a10);
  }
  static getEmpty() {
    return new Wue(0, 0, [], AT.getEmpty());
  }
  get kind() {
    return 4;
  }
  get missingOpeningBracketIds() {
    return this._missingOpeningBracketIds;
  }
  constructor(e206, t10, n10) {
    super(e206), this.listHeight = t10, this._missingOpeningBracketIds = n10, this.cachedMinIndentation = -1;
  }
  throwIfImmutable() {
  }
  makeLastElementMutable() {
    this.throwIfImmutable();
    let e206 = this.childrenLength;
    if (e206 === 0) return;
    let t10 = this.getChild(e206 - 1), n10 = t10.kind === 4 ? t10.toMutable() : t10;
    return t10 !== n10 && this.setChild(e206 - 1, n10), n10;
  }
  makeFirstElementMutable() {
    if (this.throwIfImmutable(), this.childrenLength === 0) return;
    let e206 = this.getChild(0), t10 = e206.kind === 4 ? e206.toMutable() : e206;
    return e206 !== t10 && this.setChild(0, t10), t10;
  }
  canBeReused(e206) {
    if (e206.intersects(this.missingOpeningBracketIds) || this.childrenLength === 0) return false;
    let t10 = this;
    for (; t10.kind === 4; ) {
      let e207 = t10.childrenLength;
      if (e207 === 0) throw new je();
      t10 = t10.getChild(e207 - 1);
    }
    return t10.canBeReused(e206);
  }
  handleChildrenChanged() {
    this.throwIfImmutable();
    let e206 = this.childrenLength, t10 = this.getChild(0).length, n10 = this.getChild(0).missingOpeningBracketIds;
    for (let r10 = 1; r10 < e206; r10++) {
      let e207 = this.getChild(r10);
      t10 = bT(t10, e207.length), n10 = n10.merge(e207.missingOpeningBracketIds);
    }
    this._length = t10, this._missingOpeningBracketIds = n10, this.cachedMinIndentation = -1;
  }
  computeMinIndentation(e206, t10) {
    if (this.cachedMinIndentation !== -1) return this.cachedMinIndentation;
    let n10 = 2 ** 53 - 1, r10 = e206;
    for (let e207 = 0; e207 < this.childrenLength; e207++) {
      let i10 = this.getChild(e207);
      i10 && (n10 = Math.min(n10, i10.computeMinIndentation(r10, t10)), r10 = bT(r10, i10.length));
    }
    return this.cachedMinIndentation = n10, n10;
  }
}, IT = class e106 extends FT {
  get childrenLength() {
    return this._item3 === null ? 2 : 3;
  }
  getChild(e206) {
    switch (e206) {
      case 0:
        return this._item1;
      case 1:
        return this._item2;
      case 2:
        return this._item3;
    }
    throw Error(`Invalid child index`);
  }
  setChild(e206, t10) {
    switch (e206) {
      case 0:
        this._item1 = t10;
        return;
      case 1:
        this._item2 = t10;
        return;
      case 2:
        this._item3 = t10;
        return;
    }
    throw Error(`Invalid child index`);
  }
  get children() {
    return this._item3 ? [this._item1, this._item2, this._item3] : [this._item1, this._item2];
  }
  get item1() {
    return this._item1;
  }
  get item2() {
    return this._item2;
  }
  get item3() {
    return this._item3;
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    super(e206, t10, a10), this._item1 = n10, this._item2 = r10, this._item3 = i10;
  }
  deepClone() {
    return new e106(this.length, this.listHeight, this._item1.deepClone(), this._item2.deepClone(), this._item3 ? this._item3.deepClone() : null, this.missingOpeningBracketIds);
  }
  appendChildOfSameHeight(e206) {
    if (this._item3) throw Error(`Cannot append to a full (2,3) tree node`);
    this.throwIfImmutable(), this._item3 = e206, this.handleChildrenChanged();
  }
  unappendChild() {
    if (!this._item3) throw Error(`Cannot remove from a non-full (2,3) tree node`);
    this.throwIfImmutable();
    let e206 = this._item3;
    return this._item3 = null, this.handleChildrenChanged(), e206;
  }
  prependChildOfSameHeight(e206) {
    if (this._item3) throw Error(`Cannot prepend to a full (2,3) tree node`);
    this.throwIfImmutable(), this._item3 = this._item2, this._item2 = this._item1, this._item1 = e206, this.handleChildrenChanged();
  }
  unprependChild() {
    if (!this._item3) throw Error(`Cannot remove from a non-full (2,3) tree node`);
    this.throwIfImmutable();
    let e206 = this._item1;
    return this._item1 = this._item2, this._item2 = this._item3, this._item3 = null, this.handleChildrenChanged(), e206;
  }
  toMutable() {
    return this;
  }
}, Uue = class extends IT {
  toMutable() {
    return new IT(this.length, this.listHeight, this.item1, this.item2, this.item3, this.missingOpeningBracketIds);
  }
  throwIfImmutable() {
    throw Error(`this instance is immutable`);
  }
}, LT = class e107 extends FT {
  get childrenLength() {
    return this._children.length;
  }
  getChild(e206) {
    return this._children[e206];
  }
  setChild(e206, t10) {
    this._children[e206] = t10;
  }
  get children() {
    return this._children;
  }
  constructor(e206, t10, n10, r10) {
    super(e206, t10, r10), this._children = n10;
  }
  deepClone() {
    let t10 = Array(this._children.length);
    for (let e206 = 0; e206 < this._children.length; e206++) t10[e206] = this._children[e206].deepClone();
    return new e107(this.length, this.listHeight, t10, this.missingOpeningBracketIds);
  }
  appendChildOfSameHeight(e206) {
    this.throwIfImmutable(), this._children.push(e206), this.handleChildrenChanged();
  }
  unappendChild() {
    this.throwIfImmutable();
    let e206 = this._children.pop();
    return this.handleChildrenChanged(), e206;
  }
  prependChildOfSameHeight(e206) {
    this.throwIfImmutable(), this._children.unshift(e206), this.handleChildrenChanged();
  }
  unprependChild() {
    this.throwIfImmutable();
    let e206 = this._children.shift();
    return this.handleChildrenChanged(), e206;
  }
  toMutable() {
    return this;
  }
}, Wue = class extends LT {
  toMutable() {
    return new LT(this.length, this.listHeight, [...this.children], this.missingOpeningBracketIds);
  }
  throwIfImmutable() {
    throw Error(`this instance is immutable`);
  }
}, Gue = [], RT = class extends NT {
  get listHeight() {
    return 0;
  }
  get childrenLength() {
    return 0;
  }
  getChild(e206) {
    return null;
  }
  get children() {
    return Gue;
  }
  deepClone() {
    return this;
  }
}, zT = class extends RT {
  get kind() {
    return 0;
  }
  get missingOpeningBracketIds() {
    return AT.getEmpty();
  }
  canBeReused(e206) {
    return true;
  }
  computeMinIndentation(e206, t10) {
    let n10 = vT(e206), r10 = (n10.columnCount === 0 ? n10.lineCount : n10.lineCount + 1) + 1, i10 = Rue(bT(e206, this.length)) + 1, a10 = 2 ** 53 - 1;
    for (let e207 = r10; e207 <= i10; e207++) {
      let n11 = t10.getLineFirstNonWhitespaceColumn(e207), r11 = t10.getLineContent(e207);
      if (n11 === 0) continue;
      let i11 = Ub.visibleColumnFromColumn(r11, n11, t10.getOptions().tabSize);
      a10 = Math.min(a10, i11);
    }
    return a10;
  }
}, BT = class e108 extends RT {
  static create(t10, n10, r10) {
    return new e108(t10, n10, r10);
  }
  get kind() {
    return 1;
  }
  get missingOpeningBracketIds() {
    return AT.getEmpty();
  }
  constructor(e206, t10, n10) {
    super(e206), this.bracketInfo = t10, this.bracketIds = n10;
  }
  get text() {
    return this.bracketInfo.bracketText;
  }
  get languageId() {
    return this.bracketInfo.languageId;
  }
  canBeReused(e206) {
    return false;
  }
  computeMinIndentation(e206, t10) {
    return 2 ** 53 - 1;
  }
}, Kue = class extends RT {
  get kind() {
    return 3;
  }
  constructor(e206, t10) {
    super(t10), this.missingOpeningBracketIds = e206;
  }
  canBeReused(e206) {
    return !e206.intersects(this.missingOpeningBracketIds);
  }
  computeMinIndentation(e206, t10) {
    return 2 ** 53 - 1;
  }
}, VT = class {
  constructor(e206, t10, n10, r10, i10) {
    this.length = e206, this.kind = t10, this.bracketId = n10, this.bracketIds = r10, this.astNode = i10;
  }
}, HT = class {
  constructor(e206, t10) {
    this.textModel = e206, this.bracketTokens = t10, this.reader = new que(this.textModel, this.bracketTokens), this._offset = 0, this.didPeek = false, this.peeked = null, this.textBufferLineCount = e206.getLineCount(), this.textBufferLastLineLength = e206.getLineLength(this.textBufferLineCount);
  }
  get offset() {
    return this._offset;
  }
  get length() {
    return _T2(this.textBufferLineCount - 1, this.textBufferLastLineLength);
  }
  skip(e206) {
    this.didPeek = false, this._offset = bT(this._offset, e206);
    let t10 = vT(this._offset);
    this.reader.setPosition(t10.lineCount, t10.columnCount);
  }
  read() {
    let e206;
    return this.peeked ? (this.didPeek = false, e206 = this.peeked) : e206 = this.reader.read(), e206 && (this._offset = bT(this._offset, e206.length)), e206;
  }
  peek() {
    return this.didPeek || (this.didPeek = (this.peeked = this.reader.read(), true)), this.peeked;
  }
}, que = class {
  constructor(e206, t10) {
    this.textModel = e206, this.bracketTokens = t10, this.lineIdx = 0, this.line = null, this.lineCharOffset = 0, this.lineTokens = null, this.lineTokenOffset = 0, this.peekedToken = null, this.textBufferLineCount = e206.getLineCount(), this.textBufferLastLineLength = e206.getLineLength(this.textBufferLineCount);
  }
  setPosition(e206, t10) {
    e206 === this.lineIdx ? (this.lineCharOffset = t10, this.line !== null && (this.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))) : (this.lineIdx = e206, this.lineCharOffset = t10, this.line = null), this.peekedToken = null;
  }
  read() {
    if (this.peekedToken) {
      let e207 = this.peekedToken;
      return this.peekedToken = null, this.lineCharOffset += yT(e207.length), e207;
    }
    if (this.lineIdx > this.textBufferLineCount - 1 || this.lineIdx === this.textBufferLineCount - 1 && this.lineCharOffset >= this.textBufferLastLineLength) return null;
    this.line === null && (this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1), this.line = this.lineTokens.getLineContent(), this.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));
    let e206 = this.lineIdx, t10 = this.lineCharOffset, n10 = 0;
    for (; ; ) {
      let r11 = this.lineTokens, i10 = r11.getCount(), a10 = null;
      if (this.lineTokenOffset < i10) {
        let o10 = r11.getMetadata(this.lineTokenOffset);
        for (; this.lineTokenOffset + 1 < i10 && o10 === r11.getMetadata(this.lineTokenOffset + 1); ) this.lineTokenOffset++;
        let s10 = ng.getTokenType(o10) === 0, c10 = ng.containsBalancedBrackets(o10), l10 = r11.getEndOffset(this.lineTokenOffset);
        if (c10 && s10 && this.lineCharOffset < l10) {
          let e207 = r11.getLanguageId(this.lineTokenOffset), t11 = this.line.substring(this.lineCharOffset, l10), n11 = this.bracketTokens.getSingleLanguageBracketTokens(e207), i11 = n11.regExpGlobal;
          if (i11) {
            i11.lastIndex = 0;
            let e208 = i11.exec(t11);
            e208 && (a10 = n11.getToken(e208[0]), a10 && (this.lineCharOffset += e208.index));
          }
        }
        if (n10 += l10 - this.lineCharOffset, a10) if (e206 !== this.lineIdx || t10 !== this.lineCharOffset) {
          this.peekedToken = a10;
          break;
        } else return this.lineCharOffset += yT(a10.length), a10;
        else this.lineTokenOffset++, this.lineCharOffset = l10;
      } else if (this.lineIdx === this.textBufferLineCount - 1 || (this.lineIdx++, this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1), this.lineTokenOffset = 0, this.line = this.lineTokens.getLineContent(), this.lineCharOffset = 0, n10 += 33, n10 > 1e3)) break;
      if (n10 > 1500) break;
    }
    let r10 = Lue(e206, t10, this.lineIdx, this.lineCharOffset);
    return new VT(r10, 0, -1, AT.getEmpty(), new zT(r10));
  }
}, Jue = class {
  constructor(e206, t10) {
    this.text = e206, this._offset = 0, this.idx = 0;
    let n10 = t10.getRegExpStr(), r10 = n10 ? RegExp(n10 + `|
`, `gi`) : null, i10 = [], a10, o10 = 0, s10 = 0, c10 = 0, l10 = 0, u10 = [];
    for (let e207 = 0; e207 < 60; e207++) u10.push(new VT(_T2(0, e207), 0, -1, AT.getEmpty(), new zT(_T2(0, e207))));
    let d10 = [];
    for (let e207 = 0; e207 < 60; e207++) d10.push(new VT(_T2(1, e207), 0, -1, AT.getEmpty(), new zT(_T2(1, e207))));
    if (r10) for (r10.lastIndex = 0; (a10 = r10.exec(e206)) !== null; ) {
      let e207 = a10.index, n11 = a10[0];
      if (n11 === `
`) o10++, s10 = e207 + 1;
      else {
        if (c10 !== e207) {
          let t11;
          if (l10 === o10) {
            let n12 = e207 - c10;
            if (n12 < u10.length) t11 = u10[n12];
            else {
              let e208 = _T2(0, n12);
              t11 = new VT(e208, 0, -1, AT.getEmpty(), new zT(e208));
            }
          } else {
            let n12 = o10 - l10, r11 = e207 - s10;
            if (n12 === 1 && r11 < d10.length) t11 = d10[r11];
            else {
              let e208 = _T2(n12, r11);
              t11 = new VT(e208, 0, -1, AT.getEmpty(), new zT(e208));
            }
          }
          i10.push(t11);
        }
        i10.push(t10.getToken(n11)), c10 = e207 + n11.length, l10 = o10;
      }
    }
    let f10 = e206.length;
    if (c10 !== f10) {
      let e207 = l10 === o10 ? _T2(0, f10 - c10) : _T2(o10 - l10, f10 - s10);
      i10.push(new VT(e207, 0, -1, AT.getEmpty(), new zT(e207)));
    }
    this.length = _T2(o10, f10 - s10), this.tokens = i10;
  }
  get offset() {
    return this._offset;
  }
  read() {
    return this.tokens[this.idx++] || null;
  }
  peek() {
    return this.tokens[this.idx] || null;
  }
  skip(e206) {
    throw new ke();
  }
}, Yue = class e109 {
  static createFromLanguage(t10, n10) {
    function r10(e206) {
      return n10.getKey(`${e206.languageId}:::${e206.bracketText}`);
    }
    let i10 = /* @__PURE__ */ new Map();
    for (let e206 of t10.bracketsNew.openingBrackets) {
      let t11 = _T2(0, e206.bracketText.length), n11 = r10(e206), a10 = AT.getEmpty().add(n11, jT);
      i10.set(e206.bracketText, new VT(t11, 1, n11, a10, BT.create(t11, e206, a10)));
    }
    for (let e206 of t10.bracketsNew.closingBrackets) {
      let t11 = _T2(0, e206.bracketText.length), n11 = AT.getEmpty(), a10 = e206.getOpeningBrackets();
      for (let e207 of a10) n11 = n11.add(r10(e207), jT);
      i10.set(e206.bracketText, new VT(t11, 2, r10(a10[0]), n11, BT.create(t11, e206, n11)));
    }
    return new e109(i10);
  }
  constructor(e206) {
    this.map = e206, this.hasRegExp = false, this._regExpGlobal = null;
  }
  getRegExpStr() {
    if (this.isEmpty) return null;
    {
      let e206 = [...this.map.keys()];
      return e206.sort(), e206.reverse(), e206.map((e207) => Xue(e207)).join(`|`);
    }
  }
  get regExpGlobal() {
    if (!this.hasRegExp) {
      let e206 = this.getRegExpStr();
      this._regExpGlobal = e206 ? new RegExp(e206, `gi`) : null, this.hasRegExp = true;
    }
    return this._regExpGlobal;
  }
  getToken(e206) {
    return this.map.get(e206.toLowerCase());
  }
  findClosingTokenText(e206) {
    for (let [t10, n10] of this.map) if (n10.kind === 2 && n10.bracketIds.intersects(e206)) return t10;
  }
  get isEmpty() {
    return this.map.size === 0;
  }
};
function Xue(e206) {
  let t10 = za(e206);
  return /^[\w ]+/.test(e206) && (t10 = `\\b${t10}`), /[\w ]+$/.test(e206) && (t10 = `${t10}\\b`), t10;
}
var UT = class {
  constructor(e206, t10) {
    this.denseKeyProvider = e206, this.getLanguageConfiguration = t10, this.languageIdToBracketTokens = /* @__PURE__ */ new Map();
  }
  didLanguageChange(e206) {
    return this.languageIdToBracketTokens.has(e206);
  }
  getSingleLanguageBracketTokens(e206) {
    let t10 = this.languageIdToBracketTokens.get(e206);
    return t10 || (t10 = Yue.createFromLanguage(this.getLanguageConfiguration(e206), this.denseKeyProvider), this.languageIdToBracketTokens.set(e206, t10)), t10;
  }
};
function Zue(e206) {
  if (e206.length === 0) return null;
  if (e206.length === 1) return e206[0];
  let t10 = 0;
  function n10() {
    if (t10 >= e206.length) return null;
    let n11 = t10, r11 = e206[n11].listHeight;
    for (t10++; t10 < e206.length && e206[t10].listHeight === r11; ) t10++;
    return t10 - n11 >= 2 ? WT(n11 === 0 && t10 === e206.length ? e206 : e206.slice(n11, t10), false) : e206[n11];
  }
  let r10 = n10(), i10 = n10();
  if (!i10) return r10;
  for (let e207 = n10(); e207; e207 = n10()) GT(r10, i10) <= GT(i10, e207) ? (r10 = KT(r10, i10), i10 = e207) : i10 = KT(i10, e207);
  return KT(r10, i10);
}
function WT(e206, t10 = false) {
  if (e206.length === 0) return null;
  if (e206.length === 1) return e206[0];
  let n10 = e206.length;
  for (; n10 > 3; ) {
    let r10 = n10 >> 1;
    for (let i10 = 0; i10 < r10; i10++) {
      let r11 = i10 << 1;
      e206[i10] = FT.create23(e206[r11], e206[r11 + 1], r11 + 3 === n10 ? e206[r11 + 2] : null, t10);
    }
    n10 = r10;
  }
  return FT.create23(e206[0], e206[1], n10 >= 3 ? e206[2] : null, t10);
}
function GT(e206, t10) {
  return Math.abs(e206.listHeight - t10.listHeight);
}
function KT(e206, t10) {
  return e206.listHeight === t10.listHeight ? FT.create23(e206, t10, null, false) : e206.listHeight > t10.listHeight ? Que(e206, t10) : $ue(t10, e206);
}
function Que(e206, t10) {
  e206 = e206.toMutable();
  let n10 = e206, r10 = [], i10;
  for (; ; ) {
    if (t10.listHeight === n10.listHeight) {
      i10 = t10;
      break;
    }
    if (n10.kind !== 4) throw Error(`unexpected`);
    r10.push(n10), n10 = n10.makeLastElementMutable();
  }
  for (let e207 = r10.length - 1; e207 >= 0; e207--) {
    let t11 = r10[e207];
    i10 ? t11.childrenLength >= 3 ? i10 = FT.create23(t11.unappendChild(), i10, null, false) : (t11.appendChildOfSameHeight(i10), i10 = void 0) : t11.handleChildrenChanged();
  }
  return i10 ? FT.create23(e206, i10, null, false) : e206;
}
function $ue(e206, t10) {
  e206 = e206.toMutable();
  let n10 = e206, r10 = [];
  for (; t10.listHeight !== n10.listHeight; ) {
    if (n10.kind !== 4) throw Error(`unexpected`);
    r10.push(n10), n10 = n10.makeFirstElementMutable();
  }
  let i10 = t10;
  for (let e207 = r10.length - 1; e207 >= 0; e207--) {
    let t11 = r10[e207];
    i10 ? t11.childrenLength >= 3 ? i10 = FT.create23(i10, t11.unprependChild(), null, false) : (t11.prependChildOfSameHeight(i10), i10 = void 0) : t11.handleChildrenChanged();
  }
  return i10 ? FT.create23(i10, e206, null, false) : e206;
}
var ede = class {
  constructor(e206) {
    this.lastOffset = 0, this.nextNodes = [e206], this.offsets = [0], this.idxs = [];
  }
  readLongestNodeAt(e206, t10) {
    if (CT(e206, this.lastOffset)) throw Error(`Invalid offset`);
    for (this.lastOffset = e206; ; ) {
      let n10 = JT(this.nextNodes);
      if (!n10) return;
      let r10 = JT(this.offsets);
      if (CT(e206, r10)) return;
      if (CT(r10, e206)) if (bT(r10, n10.length) <= e206) this.nextNodeAfterCurrent();
      else {
        let e207 = qT(n10);
        e207 === -1 ? this.nextNodeAfterCurrent() : (this.nextNodes.push(n10.getChild(e207)), this.offsets.push(r10), this.idxs.push(e207));
      }
      else if (t10(n10)) return this.nextNodeAfterCurrent(), n10;
      else {
        let e207 = qT(n10);
        if (e207 === -1) {
          this.nextNodeAfterCurrent();
          return;
        } else this.nextNodes.push(n10.getChild(e207)), this.offsets.push(r10), this.idxs.push(e207);
      }
    }
  }
  nextNodeAfterCurrent() {
    for (; ; ) {
      let e206 = JT(this.offsets), t10 = JT(this.nextNodes);
      if (this.nextNodes.pop(), this.offsets.pop(), this.idxs.length === 0) break;
      let n10 = JT(this.nextNodes), r10 = qT(n10, this.idxs[this.idxs.length - 1]);
      if (r10 !== -1) {
        this.nextNodes.push(n10.getChild(r10)), this.offsets.push(bT(e206, t10.length)), this.idxs[this.idxs.length - 1] = r10;
        break;
      } else this.idxs.pop();
    }
  }
};
function qT(e206, t10 = -1) {
  for (; ; ) {
    if (t10++, t10 >= e206.childrenLength) return -1;
    if (e206.getChild(t10)) return t10;
  }
}
function JT(e206) {
  return e206.length > 0 ? e206[e206.length - 1] : void 0;
}
function YT(e206, t10, n10, r10) {
  return new tde(e206, t10, n10, r10).parseDocument();
}
var tde = class {
  constructor(e206, t10, n10, r10) {
    if (this.tokenizer = e206, this.createImmutableLists = r10, this._itemsConstructed = 0, this._itemsFromCache = 0, n10 && r10) throw Error(`Not supported`);
    this.oldNodeReader = n10 ? new ede(n10) : void 0, this.positionMapper = new Vue(t10);
  }
  parseDocument() {
    this._itemsConstructed = 0, this._itemsFromCache = 0;
    let e206 = this.parseList(AT.getEmpty(), 0);
    return e206 || (e206 = FT.getEmpty()), e206;
  }
  parseList(e206, t10) {
    let n10 = [];
    for (; ; ) {
      let r10 = this.tryReadChildFromCache(e206);
      if (!r10) {
        let n11 = this.tokenizer.peek();
        if (!n11 || n11.kind === 2 && n11.bracketIds.intersects(e206)) break;
        r10 = this.parseChild(e206, t10 + 1);
      }
      r10.kind === 4 && r10.childrenLength === 0 || n10.push(r10);
    }
    return this.oldNodeReader ? Zue(n10) : WT(n10, this.createImmutableLists);
  }
  tryReadChildFromCache(e206) {
    if (this.oldNodeReader) {
      let t10 = this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);
      if (t10 === null || !hT(t10)) {
        let n10 = this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset), (n11) => t10 !== null && !CT(n11.length, t10) ? false : n11.canBeReused(e206));
        if (n10) return this._itemsFromCache++, this.tokenizer.skip(n10.length), n10;
      }
    }
  }
  parseChild(e206, t10) {
    this._itemsConstructed++;
    let n10 = this.tokenizer.read();
    switch (n10.kind) {
      case 2:
        return new Kue(n10.bracketIds, n10.length);
      case 0:
        return n10.astNode;
      case 1: {
        if (t10 > 300) return new zT(n10.length);
        let r10 = e206.merge(n10.bracketIds), i10 = this.parseList(r10, t10 + 1), a10 = this.tokenizer.peek();
        return a10 && a10.kind === 2 && (a10.bracketId === n10.bracketId || a10.bracketIds.intersects(n10.bracketIds)) ? (this.tokenizer.read(), PT.create(n10.astNode, i10, a10.astNode)) : PT.create(n10.astNode, i10, null);
      }
      default:
        throw Error(`unexpected`);
    }
  }
};
function XT(e206, t10) {
  if (e206.length === 0) return t10;
  if (t10.length === 0) return e206;
  let n10 = new me(QT(e206)), r10 = QT(t10);
  r10.push({ modified: false, lengthBefore: void 0, lengthAfter: void 0 });
  let i10 = n10.dequeue();
  function a10(e207) {
    if (e207 === void 0) {
      let e208 = n10.takeWhile((e209) => true) || [];
      return i10 && e208.unshift(i10), e208;
    }
    let t11 = [];
    for (; i10 && !hT(e207); ) {
      let [r11, a11] = i10.splitAt(e207);
      t11.push(r11), e207 = ST(r11.lengthAfter, e207), i10 = a11 ?? n10.dequeue();
    }
    return hT(e207) || t11.push(new ZT(false, e207, e207)), t11;
  }
  let o10 = [];
  function s10(e207, t11, n11) {
    if (o10.length > 0 && xT(o10[o10.length - 1].endOffset, e207)) {
      let e208 = o10[o10.length - 1];
      o10[o10.length - 1] = new OT(e208.startOffset, t11, bT(e208.newLength, n11));
    } else o10.push({ startOffset: e207, endOffset: t11, newLength: n11 });
  }
  let c10 = 0;
  for (let e207 of r10) {
    let t11 = a10(e207.lengthBefore);
    if (e207.modified) {
      let n11 = zue(t11, (e208) => e208.lengthBefore), r11 = bT(c10, n11);
      s10(c10, r11, e207.lengthAfter), c10 = r11;
    } else for (let e208 of t11) {
      let t12 = c10;
      c10 = bT(c10, e208.lengthBefore), e208.modified && s10(t12, c10, e208.lengthAfter);
    }
  }
  return o10;
}
var ZT = class e110 {
  constructor(e206, t10, n10) {
    this.modified = e206, this.lengthBefore = t10, this.lengthAfter = n10;
  }
  splitAt(t10) {
    let n10 = ST(t10, this.lengthAfter);
    return xT(n10, 0) ? [this, void 0] : this.modified ? [new e110(this.modified, this.lengthBefore, t10), new e110(this.modified, 0, n10)] : [new e110(this.modified, t10, t10), new e110(this.modified, n10, n10)];
  }
  toString() {
    return `${this.modified ? `M` : `U`}:${vT(this.lengthBefore)} -> ${vT(this.lengthAfter)}`;
  }
};
function QT(e206) {
  let t10 = [], n10 = 0;
  for (let r10 of e206) {
    let e207 = ST(n10, r10.startOffset);
    hT(e207) || t10.push(new ZT(false, e207, e207));
    let i10 = ST(r10.startOffset, r10.endOffset);
    t10.push(new ZT(true, i10, r10.newLength)), n10 = r10.endOffset;
  }
  return t10;
}
var nde = class extends D {
  didLanguageChange(e206) {
    return this.brackets.didLanguageChange(e206);
  }
  constructor(e206, t10) {
    if (super(), this.textModel = e206, this.getLanguageConfiguration = t10, this.didChangeEmitter = new k(), this.denseKeyProvider = new MT(), this.brackets = new UT(this.denseKeyProvider, this.getLanguageConfiguration), this.onDidChange = this.didChangeEmitter.event, this.queuedTextEditsForInitialAstWithoutTokens = [], this.queuedTextEdits = [], e206.tokenization.hasTokens) e206.tokenization.backgroundTokenizationState === 2 ? (this.initialAstWithoutTokens = void 0, this.astWithTokens = this.parseDocumentFromTextBuffer([], void 0, false)) : (this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer([], void 0, true), this.astWithTokens = this.initialAstWithoutTokens);
    else {
      let e207 = this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId());
      this.initialAstWithoutTokens = YT(new Jue(this.textModel.getValue(), e207), [], void 0, true), this.astWithTokens = this.initialAstWithoutTokens;
    }
  }
  handleDidChangeBackgroundTokenizationState() {
    if (this.textModel.tokenization.backgroundTokenizationState === 2) {
      let e206 = this.initialAstWithoutTokens === void 0;
      this.initialAstWithoutTokens = void 0, e206 || this.didChangeEmitter.fire();
    }
  }
  handleDidChangeTokens({ ranges: e206 }) {
    let t10 = e206.map((e207) => new OT(_T2(e207.fromLineNumber - 1, 0), _T2(e207.toLineNumber, 0), _T2(e207.toLineNumber - e207.fromLineNumber + 1, 0)));
    this.handleEdits(t10, true), this.initialAstWithoutTokens || this.didChangeEmitter.fire();
  }
  handleContentChanged(e206) {
    let t10 = OT.fromModelContentChanges(e206.changes);
    this.handleEdits(t10, false);
  }
  handleEdits(e206, t10) {
    this.queuedTextEdits = XT(this.queuedTextEdits, e206), this.initialAstWithoutTokens && !t10 && (this.queuedTextEditsForInitialAstWithoutTokens = XT(this.queuedTextEditsForInitialAstWithoutTokens, e206));
  }
  flushQueue() {
    this.queuedTextEdits.length > 0 && (this.astWithTokens = this.parseDocumentFromTextBuffer(this.queuedTextEdits, this.astWithTokens, false), this.queuedTextEdits = []), this.queuedTextEditsForInitialAstWithoutTokens.length > 0 && (this.initialAstWithoutTokens && (this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens, this.initialAstWithoutTokens, false)), this.queuedTextEditsForInitialAstWithoutTokens = []);
  }
  parseDocumentFromTextBuffer(e206, t10, n10) {
    let r10 = t10;
    return YT(new HT(this.textModel, this.brackets), e206, r10, n10);
  }
  getBracketsInRange(e206, t10) {
    this.flushQueue();
    let n10 = _T2(e206.startLineNumber - 1, e206.startColumn - 1), r10 = _T2(e206.endLineNumber - 1, e206.endColumn - 1);
    return new he((e207) => {
      let i10 = this.initialAstWithoutTokens || this.astWithTokens;
      tE(i10, 0, i10.length, n10, r10, e207, 0, 0, /* @__PURE__ */ new Map(), t10);
    });
  }
  getBracketPairsInRange(e206, t10) {
    this.flushQueue();
    let n10 = ET(e206.getStartPosition()), r10 = ET(e206.getEndPosition());
    return new he((e207) => {
      let i10 = this.initialAstWithoutTokens || this.astWithTokens, a10 = new rde(e207, t10, this.textModel);
      nE(i10, 0, i10.length, n10, r10, a10, 0, /* @__PURE__ */ new Map());
    });
  }
  getFirstBracketAfter(e206) {
    this.flushQueue();
    let t10 = this.initialAstWithoutTokens || this.astWithTokens;
    return eE(t10, 0, t10.length, ET(e206));
  }
  getFirstBracketBefore(e206) {
    this.flushQueue();
    let t10 = this.initialAstWithoutTokens || this.astWithTokens;
    return $T(t10, 0, t10.length, ET(e206));
  }
};
function $T(e206, t10, n10, r10) {
  if (e206.kind === 4 || e206.kind === 2) {
    let i10 = [];
    for (let r11 of e206.children) n10 = bT(t10, r11.length), i10.push({ nodeOffsetStart: t10, nodeOffsetEnd: n10 }), t10 = n10;
    for (let t11 = i10.length - 1; t11 >= 0; t11--) {
      let { nodeOffsetStart: n11, nodeOffsetEnd: a10 } = i10[t11];
      if (CT(n11, r10)) {
        let i11 = $T(e206.children[t11], n11, a10, r10);
        if (i11) return i11;
      }
    }
    return null;
  } else if (e206.kind === 3) return null;
  else if (e206.kind === 1) {
    let r11 = DT(t10, n10);
    return { bracketInfo: e206.bracketInfo, range: r11 };
  }
  return null;
}
function eE(e206, t10, n10, r10) {
  if (e206.kind === 4 || e206.kind === 2) {
    for (let i10 of e206.children) {
      if (n10 = bT(t10, i10.length), CT(r10, n10)) {
        let e207 = eE(i10, t10, n10, r10);
        if (e207) return e207;
      }
      t10 = n10;
    }
    return null;
  } else if (e206.kind === 3) return null;
  else if (e206.kind === 1) {
    let r11 = DT(t10, n10);
    return { bracketInfo: e206.bracketInfo, range: r11 };
  }
  return null;
}
function tE(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10 = false) {
  if (o10 > 200) return true;
  whileLoop: for (; ; ) switch (e206.kind) {
    case 4: {
      let s11 = e206.childrenLength;
      for (let u11 = 0; u11 < s11; u11++) {
        let s12 = e206.getChild(u11);
        if (s12) {
          if (n10 = bT(t10, s12.length), wT(t10, i10) && TT(n10, r10)) {
            if (TT(n10, i10)) {
              e206 = s12;
              continue whileLoop;
            }
            if (!tE(s12, t10, n10, r10, i10, a10, o10, 0, c10, l10)) return false;
          }
          t10 = n10;
        }
      }
      return true;
    }
    case 2: {
      let u11 = !l10 || !e206.closingBracket || e206.closingBracket.bracketInfo.closesColorized(e206.openingBracket.bracketInfo), d10 = 0;
      if (c10) {
        let t11 = c10.get(e206.openingBracket.text);
        t11 === void 0 && (t11 = 0), d10 = t11, u11 && (t11++, c10.set(e206.openingBracket.text, t11));
      }
      let f10 = e206.childrenLength;
      for (let p10 = 0; p10 < f10; p10++) {
        let f11 = e206.getChild(p10);
        if (f11) {
          if (n10 = bT(t10, f11.length), wT(t10, i10) && TT(n10, r10)) {
            if (TT(n10, i10) && f11.kind !== 1) {
              e206 = f11, u11 ? (o10++, s10 = d10 + 1) : s10 = d10;
              continue whileLoop;
            }
            if ((u11 || f11.kind !== 1 || !e206.closingBracket) && !tE(f11, t10, n10, r10, i10, a10, u11 ? o10 + 1 : o10, u11 ? d10 + 1 : d10, c10, l10, !e206.closingBracket)) return false;
          }
          t10 = n10;
        }
      }
      return c10?.set(e206.openingBracket.text, d10), true;
    }
    case 3:
      return a10(new mT(DT(t10, n10), o10 - 1, 0, true));
    case 1:
      return a10(new mT(DT(t10, n10), o10 - 1, s10 - 1, u10));
    case 0:
      return true;
  }
}
var rde = class {
  constructor(e206, t10, n10) {
    this.push = e206, this.includeMinIndentation = t10, this.textModel = n10;
  }
};
function nE(e206, t10, n10, r10, i10, a10, o10, s10) {
  if (o10 > 200) return true;
  let c10 = true;
  if (e206.kind === 2) {
    let l10 = 0;
    if (s10) {
      let t11 = s10.get(e206.openingBracket.text);
      t11 === void 0 && (t11 = 0), l10 = t11, t11++, s10.set(e206.openingBracket.text, t11);
    }
    let u10 = bT(t10, e206.openingBracket.length), d10 = -1;
    if (a10.includeMinIndentation && (d10 = e206.computeMinIndentation(t10, a10.textModel)), c10 = a10.push(new Iue(DT(t10, n10), DT(t10, u10), e206.closingBracket ? DT(bT(u10, e206.child?.length || 0), n10) : void 0, o10, l10, e206, d10)), t10 = u10, c10 && e206.child) {
      let l11 = e206.child;
      if (n10 = bT(t10, l11.length), wT(t10, i10) && TT(n10, r10) && (c10 = nE(l11, t10, n10, r10, i10, a10, o10 + 1, s10), !c10)) return false;
    }
    s10?.set(e206.openingBracket.text, l10);
  } else {
    let n11 = t10;
    for (let t11 of e206.children) {
      let e207 = n11;
      if (n11 = bT(n11, t11.length), wT(e207, i10) && wT(r10, n11) && (c10 = nE(t11, e207, n11, r10, i10, a10, o10, s10), !c10)) return false;
    }
  }
  return c10;
}
var rE = class extends D {
  get canBuildAST() {
    return this.textModel.getValueLength() <= 5e4 * 100;
  }
  constructor(e206, t10) {
    super(), this.textModel = e206, this.languageConfigurationService = t10, this.bracketPairsTree = this._register(new Jt()), this.onDidChangeEmitter = new k(), this.onDidChange = this.onDidChangeEmitter.event, this.bracketsRequested = false;
  }
  handleLanguageConfigurationServiceChange(e206) {
    (!e206.languageId || this.bracketPairsTree.value?.object.didLanguageChange(e206.languageId)) && (this.bracketPairsTree.clear(), this.updateBracketPairsTree());
  }
  handleDidChangeOptions(e206) {
    this.bracketPairsTree.clear(), this.updateBracketPairsTree();
  }
  handleDidChangeLanguage(e206) {
    this.bracketPairsTree.clear(), this.updateBracketPairsTree();
  }
  handleDidChangeContent(e206) {
    this.bracketPairsTree.value?.object.handleContentChanged(e206);
  }
  handleDidChangeBackgroundTokenizationState() {
    this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState();
  }
  handleDidChangeTokens(e206) {
    this.bracketPairsTree.value?.object.handleDidChangeTokens(e206);
  }
  updateBracketPairsTree() {
    if (this.bracketsRequested && this.canBuildAST) {
      if (!this.bracketPairsTree.value) {
        let e206 = new E();
        this.bracketPairsTree.value = iE(e206.add(new nde(this.textModel, (e207) => this.languageConfigurationService.getLanguageConfiguration(e207))), e206), e206.add(this.bracketPairsTree.value.object.onDidChange((e207) => this.onDidChangeEmitter.fire(e207))), this.onDidChangeEmitter.fire();
      }
    } else this.bracketPairsTree.value && (this.bracketPairsTree.clear(), this.onDidChangeEmitter.fire());
  }
  getBracketPairsInRange(e206) {
    return this.bracketsRequested = true, this.updateBracketPairsTree(), this.bracketPairsTree.value?.object.getBracketPairsInRange(e206, false) || he.empty;
  }
  getBracketPairsInRangeWithMinIndentation(e206) {
    return this.bracketsRequested = true, this.updateBracketPairsTree(), this.bracketPairsTree.value?.object.getBracketPairsInRange(e206, true) || he.empty;
  }
  getBracketsInRange(e206, t10 = false) {
    return this.bracketsRequested = true, this.updateBracketPairsTree(), this.bracketPairsTree.value?.object.getBracketsInRange(e206, t10) || he.empty;
  }
  findMatchingBracketUp(e206, t10, n10) {
    let r10 = this.textModel.validatePosition(t10), i10 = this.textModel.getLanguageIdAtPosition(r10.lineNumber, r10.column);
    if (this.canBuildAST) {
      let n11 = this.languageConfigurationService.getLanguageConfiguration(i10).bracketsNew.getClosingBracketInfo(e206);
      if (!n11) return null;
      let r11 = this.getBracketPairsInRange(M.fromPositions(t10, t10)).findLast((e207) => n11.closes(e207.openingBracketInfo));
      return r11 ? r11.openingBracketRange : null;
    } else {
      let t11 = e206.toLowerCase(), a10 = this.languageConfigurationService.getLanguageConfiguration(i10).brackets;
      if (!a10) return null;
      let o10 = a10.textIsBracket[t11];
      return o10 ? sE(this._findMatchingBracketUp(o10, r10, aE(n10))) : null;
    }
  }
  matchBracket(e206, t10) {
    if (this.canBuildAST) {
      let t11 = this.getBracketPairsInRange(M.fromPositions(e206, e206)).filter((t12) => t12.closingBracketRange !== void 0 && (t12.openingBracketRange.containsPosition(e206) || t12.closingBracketRange.containsPosition(e206))).findLastMaxBy(ce((t12) => t12.openingBracketRange.containsPosition(e206) ? t12.openingBracketRange : t12.closingBracketRange, M.compareRangesUsingStarts));
      return t11 ? [t11.openingBracketRange, t11.closingBracketRange] : null;
    } else {
      let n10 = aE(t10);
      return this._matchBracket(this.textModel.validatePosition(e206), n10);
    }
  }
  _establishBracketSearchOffsets(e206, t10, n10, r10) {
    let i10 = t10.getCount(), a10 = t10.getLanguageId(r10), o10 = Math.max(0, e206.column - 1 - n10.maxBracketLength);
    for (let e207 = r10 - 1; e207 >= 0; e207--) {
      let n11 = t10.getEndOffset(e207);
      if (n11 <= o10) break;
      if (Df(t10.getStandardTokenType(e207)) || t10.getLanguageId(e207) !== a10) {
        o10 = n11;
        break;
      }
    }
    let s10 = Math.min(t10.getLineContent().length, e206.column - 1 + n10.maxBracketLength);
    for (let e207 = r10 + 1; e207 < i10; e207++) {
      let n11 = t10.getStartOffset(e207);
      if (n11 >= s10) break;
      if (Df(t10.getStandardTokenType(e207)) || t10.getLanguageId(e207) !== a10) {
        s10 = n11;
        break;
      }
    }
    return { searchStartOffset: o10, searchEndOffset: s10 };
  }
  _matchBracket(e206, t10) {
    let n10 = e206.lineNumber, r10 = this.textModel.tokenization.getLineTokens(n10), i10 = this.textModel.getLineContent(n10), a10 = r10.findTokenIndexAtOffset(e206.column - 1);
    if (a10 < 0) return null;
    let o10 = this.languageConfigurationService.getLanguageConfiguration(r10.getLanguageId(a10)).brackets;
    if (o10 && !Df(r10.getStandardTokenType(a10))) {
      let { searchStartOffset: s10, searchEndOffset: c10 } = this._establishBracketSearchOffsets(e206, r10, o10, a10), l10 = null;
      for (; ; ) {
        let r11 = Vf.findNextBracketInRange(o10.forwardRegex, n10, i10, s10, c10);
        if (!r11) break;
        if (r11.startColumn <= e206.column && e206.column <= r11.endColumn) {
          let e207 = i10.substring(r11.startColumn - 1, r11.endColumn - 1).toLowerCase(), n11 = this._matchFoundBracket(r11, o10.textIsBracket[e207], o10.textIsOpenBracket[e207], t10);
          if (n11) {
            if (n11 instanceof oE) return null;
            l10 = n11;
          }
        }
        s10 = r11.endColumn - 1;
      }
      if (l10) return l10;
    }
    if (a10 > 0 && r10.getStartOffset(a10) === e206.column - 1) {
      let o11 = a10 - 1, s10 = this.languageConfigurationService.getLanguageConfiguration(r10.getLanguageId(o11)).brackets;
      if (s10 && !Df(r10.getStandardTokenType(o11))) {
        let { searchStartOffset: a11, searchEndOffset: c10 } = this._establishBracketSearchOffsets(e206, r10, s10, o11), l10 = Vf.findPrevBracketInRange(s10.reversedRegex, n10, i10, a11, c10);
        if (l10 && l10.startColumn <= e206.column && e206.column <= l10.endColumn) {
          let e207 = i10.substring(l10.startColumn - 1, l10.endColumn - 1).toLowerCase(), n11 = this._matchFoundBracket(l10, s10.textIsBracket[e207], s10.textIsOpenBracket[e207], t10);
          if (n11) return n11 instanceof oE ? null : n11;
        }
      }
    }
    return null;
  }
  _matchFoundBracket(e206, t10, n10, r10) {
    if (!t10) return null;
    let i10 = n10 ? this._findMatchingBracketDown(t10, e206.getEndPosition(), r10) : this._findMatchingBracketUp(t10, e206.getStartPosition(), r10);
    return i10 ? i10 instanceof oE ? i10 : [e206, i10] : null;
  }
  _findMatchingBracketUp(e206, t10, n10) {
    let r10 = e206.languageId, i10 = e206.reversedRegex, a10 = -1, o10 = 0, s10 = (t11, r11, s11, c10) => {
      for (; ; ) {
        if (n10 && ++o10 % 100 == 0 && !n10()) return oE.INSTANCE;
        let l10 = Vf.findPrevBracketInRange(i10, t11, r11, s11, c10);
        if (!l10) break;
        let u10 = r11.substring(l10.startColumn - 1, l10.endColumn - 1).toLowerCase();
        if (e206.isOpen(u10) ? a10++ : e206.isClose(u10) && a10--, a10 === 0) return l10;
        c10 = l10.startColumn - 1;
      }
      return null;
    };
    for (let e207 = t10.lineNumber; e207 >= 1; e207--) {
      let n11 = this.textModel.tokenization.getLineTokens(e207), i11 = n11.getCount(), a11 = this.textModel.getLineContent(e207), o11 = i11 - 1, c10 = a11.length, l10 = a11.length;
      e207 === t10.lineNumber && (o11 = n11.findTokenIndexAtOffset(t10.column - 1), c10 = t10.column - 1, l10 = t10.column - 1);
      let u10 = true;
      for (; o11 >= 0; o11--) {
        let t11 = n11.getLanguageId(o11) === r10 && !Df(n11.getStandardTokenType(o11));
        if (t11) u10 ? c10 = n11.getStartOffset(o11) : (c10 = n11.getStartOffset(o11), l10 = n11.getEndOffset(o11));
        else if (u10 && c10 !== l10) {
          let t12 = s10(e207, a11, c10, l10);
          if (t12) return t12;
        }
        u10 = t11;
      }
      if (u10 && c10 !== l10) {
        let t11 = s10(e207, a11, c10, l10);
        if (t11) return t11;
      }
    }
    return null;
  }
  _findMatchingBracketDown(e206, t10, n10) {
    let r10 = e206.languageId, i10 = e206.forwardRegex, a10 = 1, o10 = 0, s10 = (t11, r11, s11, c11) => {
      for (; ; ) {
        if (n10 && ++o10 % 100 == 0 && !n10()) return oE.INSTANCE;
        let l10 = Vf.findNextBracketInRange(i10, t11, r11, s11, c11);
        if (!l10) break;
        let u10 = r11.substring(l10.startColumn - 1, l10.endColumn - 1).toLowerCase();
        if (e206.isOpen(u10) ? a10++ : e206.isClose(u10) && a10--, a10 === 0) return l10;
        s11 = l10.endColumn - 1;
      }
      return null;
    }, c10 = this.textModel.getLineCount();
    for (let e207 = t10.lineNumber; e207 <= c10; e207++) {
      let n11 = this.textModel.tokenization.getLineTokens(e207), i11 = n11.getCount(), a11 = this.textModel.getLineContent(e207), o11 = 0, c11 = 0, l10 = 0;
      e207 === t10.lineNumber && (o11 = n11.findTokenIndexAtOffset(t10.column - 1), c11 = t10.column - 1, l10 = t10.column - 1);
      let u10 = true;
      for (; o11 < i11; o11++) {
        let t11 = n11.getLanguageId(o11) === r10 && !Df(n11.getStandardTokenType(o11));
        if (t11) u10 || (c11 = n11.getStartOffset(o11)), l10 = n11.getEndOffset(o11);
        else if (u10 && c11 !== l10) {
          let t12 = s10(e207, a11, c11, l10);
          if (t12) return t12;
        }
        u10 = t11;
      }
      if (u10 && c11 !== l10) {
        let t11 = s10(e207, a11, c11, l10);
        if (t11) return t11;
      }
    }
    return null;
  }
  findPrevBracket(e206) {
    let t10 = this.textModel.validatePosition(e206);
    if (this.canBuildAST) return this.bracketsRequested = true, this.updateBracketPairsTree(), this.bracketPairsTree.value?.object.getFirstBracketBefore(t10) || null;
    let n10 = null, r10 = null, i10 = null;
    for (let e207 = t10.lineNumber; e207 >= 1; e207--) {
      let a10 = this.textModel.tokenization.getLineTokens(e207), o10 = a10.getCount(), s10 = this.textModel.getLineContent(e207), c10 = o10 - 1, l10 = s10.length, u10 = s10.length;
      if (e207 === t10.lineNumber) {
        c10 = a10.findTokenIndexAtOffset(t10.column - 1), l10 = t10.column - 1, u10 = t10.column - 1;
        let e208 = a10.getLanguageId(c10);
        n10 !== e208 && (n10 = e208, r10 = this.languageConfigurationService.getLanguageConfiguration(n10).brackets, i10 = this.languageConfigurationService.getLanguageConfiguration(n10).bracketsNew);
      }
      let d10 = true;
      for (; c10 >= 0; c10--) {
        let t11 = a10.getLanguageId(c10);
        if (n10 !== t11) {
          if (r10 && i10 && d10 && l10 !== u10) {
            let t12 = Vf.findPrevBracketInRange(r10.reversedRegex, e207, s10, l10, u10);
            if (t12) return this._toFoundBracket(i10, t12);
            d10 = false;
          }
          n10 = t11, r10 = this.languageConfigurationService.getLanguageConfiguration(n10).brackets, i10 = this.languageConfigurationService.getLanguageConfiguration(n10).bracketsNew;
        }
        let o11 = !!r10 && !Df(a10.getStandardTokenType(c10));
        if (o11) d10 ? l10 = a10.getStartOffset(c10) : (l10 = a10.getStartOffset(c10), u10 = a10.getEndOffset(c10));
        else if (i10 && r10 && d10 && l10 !== u10) {
          let t12 = Vf.findPrevBracketInRange(r10.reversedRegex, e207, s10, l10, u10);
          if (t12) return this._toFoundBracket(i10, t12);
        }
        d10 = o11;
      }
      if (i10 && r10 && d10 && l10 !== u10) {
        let t11 = Vf.findPrevBracketInRange(r10.reversedRegex, e207, s10, l10, u10);
        if (t11) return this._toFoundBracket(i10, t11);
      }
    }
    return null;
  }
  findNextBracket(e206) {
    let t10 = this.textModel.validatePosition(e206);
    if (this.canBuildAST) return this.bracketsRequested = true, this.updateBracketPairsTree(), this.bracketPairsTree.value?.object.getFirstBracketAfter(t10) || null;
    let n10 = this.textModel.getLineCount(), r10 = null, i10 = null, a10 = null;
    for (let e207 = t10.lineNumber; e207 <= n10; e207++) {
      let n11 = this.textModel.tokenization.getLineTokens(e207), o10 = n11.getCount(), s10 = this.textModel.getLineContent(e207), c10 = 0, l10 = 0, u10 = 0;
      if (e207 === t10.lineNumber) {
        c10 = n11.findTokenIndexAtOffset(t10.column - 1), l10 = t10.column - 1, u10 = t10.column - 1;
        let e208 = n11.getLanguageId(c10);
        r10 !== e208 && (r10 = e208, i10 = this.languageConfigurationService.getLanguageConfiguration(r10).brackets, a10 = this.languageConfigurationService.getLanguageConfiguration(r10).bracketsNew);
      }
      let d10 = true;
      for (; c10 < o10; c10++) {
        let t11 = n11.getLanguageId(c10);
        if (r10 !== t11) {
          if (a10 && i10 && d10 && l10 !== u10) {
            let t12 = Vf.findNextBracketInRange(i10.forwardRegex, e207, s10, l10, u10);
            if (t12) return this._toFoundBracket(a10, t12);
            d10 = false;
          }
          r10 = t11, i10 = this.languageConfigurationService.getLanguageConfiguration(r10).brackets, a10 = this.languageConfigurationService.getLanguageConfiguration(r10).bracketsNew;
        }
        let o11 = !!i10 && !Df(n11.getStandardTokenType(c10));
        if (o11) d10 || (l10 = n11.getStartOffset(c10)), u10 = n11.getEndOffset(c10);
        else if (a10 && i10 && d10 && l10 !== u10) {
          let t12 = Vf.findNextBracketInRange(i10.forwardRegex, e207, s10, l10, u10);
          if (t12) return this._toFoundBracket(a10, t12);
        }
        d10 = o11;
      }
      if (a10 && i10 && d10 && l10 !== u10) {
        let t11 = Vf.findNextBracketInRange(i10.forwardRegex, e207, s10, l10, u10);
        if (t11) return this._toFoundBracket(a10, t11);
      }
    }
    return null;
  }
  findEnclosingBrackets(e206, t10) {
    let n10 = this.textModel.validatePosition(e206);
    if (this.canBuildAST) {
      let e207 = M.fromPositions(n10), t11 = this.getBracketPairsInRange(M.fromPositions(n10, n10)).findLast((t12) => t12.closingBracketRange !== void 0 && t12.range.strictContainsRange(e207));
      return t11 ? [t11.openingBracketRange, t11.closingBracketRange] : null;
    }
    let r10 = aE(t10), i10 = this.textModel.getLineCount(), a10 = /* @__PURE__ */ new Map(), o10 = [], s10 = (e207, t11) => {
      if (!a10.has(e207)) {
        let n11 = [];
        for (let e208 = 0, r11 = t11 ? t11.brackets.length : 0; e208 < r11; e208++) n11[e208] = 0;
        a10.set(e207, n11);
      }
      o10 = a10.get(e207);
    }, c10 = 0, l10 = (e207, t11, n11, i11, a11) => {
      for (; ; ) {
        if (r10 && ++c10 % 100 == 0 && !r10()) return oE.INSTANCE;
        let s11 = Vf.findNextBracketInRange(e207.forwardRegex, t11, n11, i11, a11);
        if (!s11) break;
        let l11 = n11.substring(s11.startColumn - 1, s11.endColumn - 1).toLowerCase(), u11 = e207.textIsBracket[l11];
        if (u11 && (u11.isOpen(l11) ? o10[u11.index]++ : u11.isClose(l11) && o10[u11.index]--, o10[u11.index] === -1)) return this._matchFoundBracket(s11, u11, false, r10);
        i11 = s11.endColumn - 1;
      }
      return null;
    }, u10 = null, d10 = null;
    for (let e207 = n10.lineNumber; e207 <= i10; e207++) {
      let t11 = this.textModel.tokenization.getLineTokens(e207), r11 = t11.getCount(), i11 = this.textModel.getLineContent(e207), a11 = 0, o11 = 0, c11 = 0;
      if (e207 === n10.lineNumber) {
        a11 = t11.findTokenIndexAtOffset(n10.column - 1), o11 = n10.column - 1, c11 = n10.column - 1;
        let e208 = t11.getLanguageId(a11);
        u10 !== e208 && (u10 = e208, d10 = this.languageConfigurationService.getLanguageConfiguration(u10).brackets, s10(u10, d10));
      }
      let f10 = true;
      for (; a11 < r11; a11++) {
        let n11 = t11.getLanguageId(a11);
        if (u10 !== n11) {
          if (d10 && f10 && o11 !== c11) {
            let t12 = l10(d10, e207, i11, o11, c11);
            if (t12) return sE(t12);
            f10 = false;
          }
          u10 = n11, d10 = this.languageConfigurationService.getLanguageConfiguration(u10).brackets, s10(u10, d10);
        }
        let r12 = !!d10 && !Df(t11.getStandardTokenType(a11));
        if (r12) f10 || (o11 = t11.getStartOffset(a11)), c11 = t11.getEndOffset(a11);
        else if (d10 && f10 && o11 !== c11) {
          let t12 = l10(d10, e207, i11, o11, c11);
          if (t12) return sE(t12);
        }
        f10 = r12;
      }
      if (d10 && f10 && o11 !== c11) {
        let t12 = l10(d10, e207, i11, o11, c11);
        if (t12) return sE(t12);
      }
    }
    return null;
  }
  _toFoundBracket(e206, t10) {
    if (!t10) return null;
    let n10 = this.textModel.getValueInRange(t10);
    n10 = n10.toLowerCase();
    let r10 = e206.getBracketInfo(n10);
    return r10 ? { range: t10, bracketInfo: r10 } : null;
  }
};
function iE(e206, t10) {
  return { object: e206, dispose: () => t10?.dispose() };
}
function aE(e206) {
  if (e206 === void 0) return () => true;
  {
    let t10 = Date.now();
    return () => Date.now() - t10 <= e206;
  }
}
var oE = (_xa = class {
  constructor() {
    this._searchCanceledBrand = void 0;
  }
}, _xa.INSTANCE = new _xa(), _xa);
function sE(e206) {
  return e206 instanceof oE ? null : e206;
}
var cE = class extends D {
  constructor(e206) {
    super(), this.textModel = e206, this.colorProvider = new lE(), this.onDidChangeEmitter = new k(), this.onDidChange = this.onDidChangeEmitter.event, this.colorizationOptions = e206.getOptions().bracketPairColorizationOptions, this._register(e206.bracketPairs.onDidChange((e207) => {
      this.onDidChangeEmitter.fire();
    }));
  }
  handleDidChangeOptions(e206) {
    this.colorizationOptions = this.textModel.getOptions().bracketPairColorizationOptions;
  }
  getDecorationsInRange(e206, t10, n10, r10) {
    return r10 || t10 === void 0 || !this.colorizationOptions.enabled ? [] : this.textModel.bracketPairs.getBracketsInRange(e206, true).map((e207) => ({ id: `bracket${e207.range.toString()}-${e207.nestingLevel}`, options: { description: `BracketPairColorization`, inlineClassName: this.colorProvider.getInlineClassName(e207, this.colorizationOptions.independentColorPoolPerBracketType) }, ownerId: 0, range: e207.range })).toArray();
  }
  getAllDecorations(e206, t10) {
    return e206 === void 0 || !this.colorizationOptions.enabled ? [] : this.getDecorationsInRange(new M(1, 1, this.textModel.getLineCount(), 1), e206, t10);
  }
}, lE = class {
  constructor() {
    this.unexpectedClosingBracketClassName = `unexpected-closing-bracket`;
  }
  getInlineClassName(e206, t10) {
    return e206.isInvalid ? this.unexpectedClosingBracketClassName : this.getInlineClassNameOfLevel(t10 ? e206.nestingLevelOfEqualBracketType : e206.nestingLevel);
  }
  getInlineClassNameOfLevel(e206) {
    return `bracket-highlighting-${e206 % 30}`;
  }
};
JS((e206, t10) => {
  let n10 = [aC, oC, sC, cC, lC, uC], r10 = new lE();
  t10.addRule(`.monaco-editor .${r10.unexpectedClosingBracketClassName} { color: ${e206.getColor(hce)}; }`);
  let i10 = n10.map((t11) => e206.getColor(t11)).filter((e207) => !!e207).filter((e207) => !e207.isTransparent());
  for (let e207 = 0; e207 < 30; e207++) {
    let n11 = i10[e207 % i10.length];
    t10.addRule(`.monaco-editor .${r10.getInlineClassNameOfLevel(e207)} { color: ${n11}; }`);
  }
});
function uE(e206) {
  return e206.replace(/\n/g, `\\n`).replace(/\r/g, `\\r`);
}
var dE = class e111 {
  get oldLength() {
    return this.oldText.length;
  }
  get oldEnd() {
    return this.oldPosition + this.oldText.length;
  }
  get newLength() {
    return this.newText.length;
  }
  get newEnd() {
    return this.newPosition + this.newText.length;
  }
  constructor(e206, t10, n10, r10) {
    this.oldPosition = e206, this.oldText = t10, this.newPosition = n10, this.newText = r10;
  }
  toString() {
    return this.oldText.length === 0 ? `(insert@${this.oldPosition} "${uE(this.newText)}")` : this.newText.length === 0 ? `(delete@${this.oldPosition} "${uE(this.oldText)}")` : `(replace@${this.oldPosition} "${uE(this.oldText)}" with "${uE(this.newText)}")`;
  }
  static _writeStringSize(e206) {
    return 4 + 2 * e206.length;
  }
  static _writeString(e206, t10, n10) {
    let r10 = t10.length;
    Ms(e206, r10, n10), n10 += 4;
    for (let i10 = 0; i10 < r10; i10++) Hte(e206, t10.charCodeAt(i10), n10), n10 += 2;
    return n10;
  }
  static _readString(e206, t10) {
    let n10 = js(e206, t10);
    return t10 += 4, Nf(e206, t10, n10);
  }
  writeSize() {
    return 8 + e111._writeStringSize(this.oldText) + e111._writeStringSize(this.newText);
  }
  write(t10, n10) {
    return Ms(t10, this.oldPosition, n10), n10 += 4, Ms(t10, this.newPosition, n10), n10 += 4, n10 = e111._writeString(t10, this.oldText, n10), n10 = e111._writeString(t10, this.newText, n10), n10;
  }
  static read(t10, n10, r10) {
    let i10 = js(t10, n10);
    n10 += 4;
    let a10 = js(t10, n10);
    n10 += 4;
    let o10 = e111._readString(t10, n10);
    n10 += e111._writeStringSize(o10);
    let s10 = e111._readString(t10, n10);
    return n10 += e111._writeStringSize(s10), r10.push(new e111(i10, o10, a10, s10)), n10;
  }
};
function ide(e206, t10) {
  return e206 === null || e206.length === 0 ? t10 : new ade(e206, t10).compress();
}
var ade = class e112 {
  constructor(e206, t10) {
    this._prevEdits = e206, this._currEdits = t10, this._result = [], this._resultLen = 0, this._prevLen = this._prevEdits.length, this._prevDeltaOffset = 0, this._currLen = this._currEdits.length, this._currDeltaOffset = 0;
  }
  compress() {
    let t10 = 0, n10 = 0, r10 = this._getPrev(t10), i10 = this._getCurr(n10);
    for (; t10 < this._prevLen || n10 < this._currLen; ) {
      if (r10 === null) {
        this._acceptCurr(i10), i10 = this._getCurr(++n10);
        continue;
      }
      if (i10 === null) {
        this._acceptPrev(r10), r10 = this._getPrev(++t10);
        continue;
      }
      if (i10.oldEnd <= r10.newPosition) {
        this._acceptCurr(i10), i10 = this._getCurr(++n10);
        continue;
      }
      if (r10.newEnd <= i10.oldPosition) {
        this._acceptPrev(r10), r10 = this._getPrev(++t10);
        continue;
      }
      if (i10.oldPosition < r10.newPosition) {
        let [t11, n11] = e112._splitCurr(i10, r10.newPosition - i10.oldPosition);
        this._acceptCurr(t11), i10 = n11;
        continue;
      }
      if (r10.newPosition < i10.oldPosition) {
        let [t11, n11] = e112._splitPrev(r10, i10.oldPosition - r10.newPosition);
        this._acceptPrev(t11), r10 = n11;
        continue;
      }
      let a11, o10;
      if (i10.oldEnd === r10.newEnd) a11 = r10, o10 = i10, r10 = this._getPrev(++t10), i10 = this._getCurr(++n10);
      else if (i10.oldEnd < r10.newEnd) {
        let [t11, s10] = e112._splitPrev(r10, i10.oldLength);
        a11 = t11, o10 = i10, r10 = s10, i10 = this._getCurr(++n10);
      } else {
        let [n11, s10] = e112._splitCurr(i10, r10.newLength);
        a11 = r10, o10 = n11, r10 = this._getPrev(++t10), i10 = s10;
      }
      this._result[this._resultLen++] = new dE(a11.oldPosition, a11.oldText, o10.newPosition, o10.newText), this._prevDeltaOffset += a11.newLength - a11.oldLength, this._currDeltaOffset += o10.newLength - o10.oldLength;
    }
    let a10 = e112._merge(this._result);
    return e112._removeNoOps(a10);
  }
  _acceptCurr(t10) {
    this._result[this._resultLen++] = e112._rebaseCurr(this._prevDeltaOffset, t10), this._currDeltaOffset += t10.newLength - t10.oldLength;
  }
  _getCurr(e206) {
    return e206 < this._currLen ? this._currEdits[e206] : null;
  }
  _acceptPrev(t10) {
    this._result[this._resultLen++] = e112._rebasePrev(this._currDeltaOffset, t10), this._prevDeltaOffset += t10.newLength - t10.oldLength;
  }
  _getPrev(e206) {
    return e206 < this._prevLen ? this._prevEdits[e206] : null;
  }
  static _rebaseCurr(e206, t10) {
    return new dE(t10.oldPosition - e206, t10.oldText, t10.newPosition, t10.newText);
  }
  static _rebasePrev(e206, t10) {
    return new dE(t10.oldPosition, t10.oldText, t10.newPosition + e206, t10.newText);
  }
  static _splitPrev(e206, t10) {
    let n10 = e206.newText.substr(0, t10), r10 = e206.newText.substr(t10);
    return [new dE(e206.oldPosition, e206.oldText, e206.newPosition, n10), new dE(e206.oldEnd, ``, e206.newPosition + t10, r10)];
  }
  static _splitCurr(e206, t10) {
    let n10 = e206.oldText.substr(0, t10), r10 = e206.oldText.substr(t10);
    return [new dE(e206.oldPosition, n10, e206.newPosition, e206.newText), new dE(e206.oldPosition + t10, r10, e206.newEnd, ``)];
  }
  static _merge(e206) {
    if (e206.length === 0) return e206;
    let t10 = [], n10 = 0, r10 = e206[0];
    for (let i10 = 1; i10 < e206.length; i10++) {
      let a10 = e206[i10];
      r10.oldEnd === a10.oldPosition ? r10 = new dE(r10.oldPosition, r10.oldText + a10.oldText, r10.newPosition, r10.newText + a10.newText) : (t10[n10++] = r10, r10 = a10);
    }
    return t10[n10++] = r10, t10;
  }
  static _removeNoOps(e206) {
    if (e206.length === 0) return e206;
    let t10 = [], n10 = 0;
    for (let r10 = 0; r10 < e206.length; r10++) {
      let i10 = e206[r10];
      i10.oldText !== i10.newText && (t10[n10++] = i10);
    }
    return t10;
  }
}, ode = /* @__PURE__ */ Symbol(`TextModelEditSource`), fE = class {
  constructor(e206, t10) {
    this.metadata = e206;
  }
  toString() {
    return `${this.metadata.source}`;
  }
  getType() {
    let e206 = this.metadata;
    switch (e206.source) {
      case `cursor`:
        return e206.kind;
      case `inlineCompletionAccept`:
        return e206.source + (e206.$nes ? `:nes` : ``);
      case `unknown`:
        return e206.name || `unknown`;
      default:
        return e206.source;
    }
  }
  toKey(e206, t10 = {}) {
    let n10 = this.metadata;
    return Object.entries(n10).filter(([n11, r10]) => {
      let i10 = t10[n11];
      return i10 === void 0 ? (n11.match(/\$/g) || []).length <= e206 && r10 != null && r10 !== `` : i10;
    }).map(([e207, t11]) => `${e207}:${t11}`).join(`-`);
  }
};
function pE(e206) {
  return new fE(e206, ode);
}
var mE = { unknown(e206) {
  return pE({ source: `unknown`, name: e206.name });
}, rename: () => pE({ source: `rename` }), chatApplyEdits(e206) {
  return pE({ source: `Chat.applyEdits`, $modelId: gE(e206.modelId), $extensionId: e206.extensionId?.extensionId, $extensionVersion: e206.extensionId?.version, $$languageId: e206.languageId, $$sessionId: e206.sessionId, $$requestId: e206.requestId, $$mode: e206.mode, $$codeBlockSuggestionId: e206.codeBlockSuggestionId });
}, chatUndoEdits: () => pE({ source: `Chat.undoEdits` }), chatReset: () => pE({ source: `Chat.reset` }), inlineCompletionAccept(e206) {
  return pE({ source: `inlineCompletionAccept`, $nes: e206.nes, ...hE(e206.providerId), $$requestUuid: e206.requestUuid, $$languageId: e206.languageId });
}, inlineCompletionPartialAccept(e206) {
  return pE({ source: `inlineCompletionPartialAccept`, type: e206.type, $nes: e206.nes, ...hE(e206.providerId), $$requestUuid: e206.requestUuid, $$languageId: e206.languageId });
}, inlineChatApplyEdit(e206) {
  return pE({ source: `inlineChat.applyEdits`, $modelId: gE(e206.modelId), $extensionId: e206.extensionId?.extensionId, $extensionVersion: e206.extensionId?.version, $$sessionId: e206.sessionId, $$requestId: e206.requestId, $$languageId: e206.languageId });
}, reloadFromDisk: () => pE({ source: `reloadFromDisk` }), cursor(e206) {
  return pE({ source: `cursor`, kind: e206.kind, detailedSource: e206.detailedSource });
}, setValue: () => pE({ source: `setValue` }), eolChange: () => pE({ source: `eolChange` }), applyEdits: () => pE({ source: `applyEdits` }), snippet: () => pE({ source: `snippet` }), suggest: (e206) => pE({ source: `suggest`, ...hE(e206.providerId) }), codeAction: (e206) => pE({ source: `codeAction`, $kind: e206.kind, ...hE(e206.providerId) }) };
function hE(e206) {
  return e206 ? { $extensionId: e206.extensionId, $extensionVersion: e206.extensionVersion, $providerId: e206.providerId } : {};
}
function gE(e206) {
  if (e206 !== void 0) return e206.replaceAll(`/`, `|`);
}
var _E2 = class e113 {
  static fromText(t10) {
    let n10 = Vm.ofText(t10).lineCount, r10 = t10.length;
    return new e113(n10, 0, r10, 0);
  }
  static tryCreate(t10, n10, r10, i10) {
    if (!(t10 === void 0 || n10 === void 0 || r10 === void 0 || i10 === void 0)) return new e113(t10, n10, r10, i10);
  }
  constructor(e206, t10, n10, r10) {
    this.linesAdded = e206, this.linesRemoved = t10, this.charsAdded = n10, this.charsRemoved = r10;
  }
}, sde;
(function(e206) {
  function t10(e207) {
    return cde(e207 ? e207(`sgt`) : Ex(`sgt`));
  }
  e206.newId = t10;
})(sde || (sde = {}));
function cde(e206) {
  return e206;
}
function vE(e206) {
  return e206.toString();
}
var yE = class e114 {
  static create(t10, n10) {
    let r10 = t10.getAlternativeVersionId(), i10 = xE(t10);
    return new e114(r10, r10, i10, i10, n10, n10, []);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.beforeVersionId = e206, this.afterVersionId = t10, this.beforeEOL = n10, this.afterEOL = r10, this.beforeCursorState = i10, this.afterCursorState = a10, this.changes = o10;
  }
  append(e206, t10, n10, r10, i10) {
    t10.length > 0 && (this.changes = ide(this.changes, t10)), this.afterEOL = n10, this.afterVersionId = r10, this.afterCursorState = i10;
  }
  static _writeSelectionsSize(e206) {
    return 4 + 16 * (e206 ? e206.length : 0);
  }
  static _writeSelections(e206, t10, n10) {
    if (Ms(e206, t10 ? t10.length : 0, n10), n10 += 4, t10) for (let r10 of t10) Ms(e206, r10.selectionStartLineNumber, n10), n10 += 4, Ms(e206, r10.selectionStartColumn, n10), n10 += 4, Ms(e206, r10.positionLineNumber, n10), n10 += 4, Ms(e206, r10.positionColumn, n10), n10 += 4;
    return n10;
  }
  static _readSelections(e206, t10, n10) {
    let r10 = js(e206, t10);
    t10 += 4;
    for (let i10 = 0; i10 < r10; i10++) {
      let r11 = js(e206, t10);
      t10 += 4;
      let i11 = js(e206, t10);
      t10 += 4;
      let a10 = js(e206, t10);
      t10 += 4;
      let o10 = js(e206, t10);
      t10 += 4, n10.push(new N(r11, i11, a10, o10));
    }
    return t10;
  }
  serialize() {
    let t10 = 10 + e114._writeSelectionsSize(this.beforeCursorState) + e114._writeSelectionsSize(this.afterCursorState) + 4;
    for (let e206 of this.changes) t10 += e206.writeSize();
    let n10 = new Uint8Array(t10), r10 = 0;
    Ms(n10, this.beforeVersionId, r10), r10 += 4, Ms(n10, this.afterVersionId, r10), r10 += 4, Ps(n10, this.beforeEOL, r10), r10 += 1, Ps(n10, this.afterEOL, r10), r10 += 1, r10 = e114._writeSelections(n10, this.beforeCursorState, r10), r10 = e114._writeSelections(n10, this.afterCursorState, r10), Ms(n10, this.changes.length, r10), r10 += 4;
    for (let e206 of this.changes) r10 = e206.write(n10, r10);
    return n10.buffer;
  }
  static deserialize(t10) {
    let n10 = new Uint8Array(t10), r10 = 0, i10 = js(n10, r10);
    r10 += 4;
    let a10 = js(n10, r10);
    r10 += 4;
    let o10 = Ns(n10, r10);
    r10 += 1;
    let s10 = Ns(n10, r10);
    r10 += 1;
    let c10 = [];
    r10 = e114._readSelections(n10, r10, c10);
    let l10 = [];
    r10 = e114._readSelections(n10, r10, l10);
    let u10 = js(n10, r10);
    r10 += 4;
    let d10 = [];
    for (let e206 = 0; e206 < u10; e206++) r10 = dE.read(n10, r10, d10);
    return new e114(i10, a10, o10, s10, c10, l10, d10);
  }
}, bE = class {
  get type() {
    return 0;
  }
  get resource() {
    return $r.isUri(this.model) ? this.model : this.model.uri;
  }
  constructor(e206, t10, n10, r10) {
    this.label = e206, this.code = t10, this.model = n10, this._data = yE.create(n10, r10);
  }
  toString() {
    return (this._data instanceof yE ? this._data : yE.deserialize(this._data)).changes.map((e206) => e206.toString()).join(`, `);
  }
  matchesResource(e206) {
    return ($r.isUri(this.model) ? this.model : this.model.uri).toString() === e206.toString();
  }
  setModel(e206) {
    this.model = e206;
  }
  canAppend(e206) {
    return this.model === e206 && this._data instanceof yE;
  }
  append(e206, t10, n10, r10, i10) {
    this._data instanceof yE && this._data.append(e206, t10, n10, r10, i10);
  }
  close() {
    this._data instanceof yE && (this._data = this._data.serialize());
  }
  open() {
    this._data instanceof yE || (this._data = yE.deserialize(this._data));
  }
  undo() {
    if ($r.isUri(this.model)) throw Error(`Invalid SingleModelEditStackElement`);
    this._data instanceof yE && (this._data = this._data.serialize());
    let e206 = yE.deserialize(this._data);
    this.model._applyUndo(e206.changes, e206.beforeEOL, e206.beforeVersionId, e206.beforeCursorState);
  }
  redo() {
    if ($r.isUri(this.model)) throw Error(`Invalid SingleModelEditStackElement`);
    this._data instanceof yE && (this._data = this._data.serialize());
    let e206 = yE.deserialize(this._data);
    this.model._applyRedo(e206.changes, e206.afterEOL, e206.afterVersionId, e206.afterCursorState);
  }
  heapSize() {
    return this._data instanceof yE && (this._data = this._data.serialize()), this._data.byteLength + 168;
  }
}, lde = class {
  get resources() {
    return this._editStackElementsArr.map((e206) => e206.resource);
  }
  constructor(e206, t10, n10) {
    this.label = e206, this.code = t10, this.type = 1, this._isOpen = true, this._editStackElementsArr = n10.slice(0), this._editStackElementsMap = /* @__PURE__ */ new Map();
    for (let e207 of this._editStackElementsArr) {
      let t11 = vE(e207.resource);
      this._editStackElementsMap.set(t11, e207);
    }
    this._delegate = null;
  }
  prepareUndoRedo() {
    if (this._delegate) return this._delegate.prepareUndoRedo(this);
  }
  matchesResource(e206) {
    let t10 = vE(e206);
    return this._editStackElementsMap.has(t10);
  }
  setModel(e206) {
    let t10 = vE($r.isUri(e206) ? e206 : e206.uri);
    this._editStackElementsMap.has(t10) && this._editStackElementsMap.get(t10).setModel(e206);
  }
  canAppend(e206) {
    if (!this._isOpen) return false;
    let t10 = vE(e206.uri);
    return this._editStackElementsMap.has(t10) ? this._editStackElementsMap.get(t10).canAppend(e206) : false;
  }
  append(e206, t10, n10, r10, i10) {
    let a10 = vE(e206.uri);
    this._editStackElementsMap.get(a10).append(e206, t10, n10, r10, i10);
  }
  close() {
    this._isOpen = false;
  }
  open() {
  }
  undo() {
    this._isOpen = false;
    for (let e206 of this._editStackElementsArr) e206.undo();
  }
  redo() {
    for (let e206 of this._editStackElementsArr) e206.redo();
  }
  heapSize(e206) {
    let t10 = vE(e206);
    return this._editStackElementsMap.has(t10) ? this._editStackElementsMap.get(t10).heapSize() : 0;
  }
  split() {
    return this._editStackElementsArr;
  }
  toString() {
    let e206 = [];
    for (let t10 of this._editStackElementsArr) e206.push(`${Id(t10.resource)}: ${t10}`);
    return `{${e206.join(`, `)}}`;
  }
};
function xE(e206) {
  return e206.getEOL() === `
` ? 0 : 1;
}
function SE(e206) {
  return e206 ? e206 instanceof bE || e206 instanceof lde : false;
}
var ude = class e115 {
  constructor(e206, t10) {
    this._model = e206, this._undoRedoService = t10;
  }
  pushStackElement() {
    let e206 = this._undoRedoService.getLastElement(this._model.uri);
    SE(e206) && e206.close();
  }
  popStackElement() {
    let e206 = this._undoRedoService.getLastElement(this._model.uri);
    SE(e206) && e206.open();
  }
  clear() {
    this._undoRedoService.removeElements(this._model.uri);
  }
  _getOrCreateEditStackElement(e206, t10) {
    let n10 = this._undoRedoService.getLastElement(this._model.uri);
    if (SE(n10) && n10.canAppend(this._model)) return n10;
    let r10 = new bE(C(785, `Typing`), `undoredo.textBufferEdit`, this._model, e206);
    return this._undoRedoService.pushElement(r10, t10), r10;
  }
  pushEOL(e206) {
    let t10 = this._getOrCreateEditStackElement(null, void 0);
    this._model.setEOL(e206), t10.append(this._model, [], xE(this._model), this._model.getAlternativeVersionId(), null);
  }
  pushEditOperation(t10, n10, r10, i10, a10 = mE.unknown({ name: `pushEditOperation` })) {
    let o10 = this._getOrCreateEditStackElement(t10, i10), s10 = this._model.applyEdits(n10, true, a10), c10 = e115._computeCursorState(r10, s10), l10 = s10.map((e206, t11) => ({ index: t11, textChange: e206.textChange }));
    return l10.sort((e206, t11) => e206.textChange.oldPosition === t11.textChange.oldPosition ? e206.index - t11.index : e206.textChange.oldPosition - t11.textChange.oldPosition), o10.append(this._model, l10.map((e206) => e206.textChange), xE(this._model), this._model.getAlternativeVersionId(), c10), c10;
  }
  static _computeCursorState(e206, t10) {
    try {
      return e206 ? e206(t10) : null;
    } catch (e207) {
      return be(e207), null;
    }
  }
}, dde = class {
  constructor() {
    this.spacesDiff = 0, this.looksLikeAlignment = false;
  }
};
function CE(e206, t10, n10, r10, i10) {
  i10.spacesDiff = 0, i10.looksLikeAlignment = false;
  let a10;
  for (a10 = 0; a10 < t10 && a10 < r10 && e206.charCodeAt(a10) === n10.charCodeAt(a10); a10++) ;
  let o10 = 0, s10 = 0;
  for (let n11 = a10; n11 < t10; n11++) e206.charCodeAt(n11) === 32 ? o10++ : s10++;
  let c10 = 0, l10 = 0;
  for (let e207 = a10; e207 < r10; e207++) n10.charCodeAt(e207) === 32 ? c10++ : l10++;
  if (o10 > 0 && s10 > 0 || c10 > 0 && l10 > 0) return;
  let u10 = Math.abs(s10 - l10), d10 = Math.abs(o10 - c10);
  if (u10 === 0) {
    i10.spacesDiff = d10, d10 > 0 && 0 <= c10 - 1 && c10 - 1 < e206.length && c10 < n10.length && n10.charCodeAt(c10) !== 32 && e206.charCodeAt(c10 - 1) === 32 && e206.charCodeAt(e206.length - 1) === 44 && (i10.looksLikeAlignment = true);
    return;
  }
  if (d10 % u10 === 0) {
    i10.spacesDiff = d10 / u10;
    return;
  }
}
function wE(e206, t10, n10) {
  let r10 = Math.min(e206.getLineCount(), 1e4), i10 = 0, a10 = 0, o10 = ``, s10 = 0, c10 = [2, 4, 6, 8, 3, 5, 7], l10 = [0, 0, 0, 0, 0, 0, 0, 0, 0], u10 = new dde();
  for (let c11 = 1; c11 <= r10; c11++) {
    let r11 = e206.getLineLength(c11), d11 = e206.getLineContent(c11), f11 = r11 <= 65536, p10 = false, m10 = 0, h10 = 0, g10 = 0;
    for (let t11 = 0, n11 = r11; t11 < n11; t11++) {
      let n12 = f11 ? d11.charCodeAt(t11) : e206.getLineCharCode(c11, t11);
      if (n12 === 9) g10++;
      else if (n12 === 32) h10++;
      else {
        p10 = true, m10 = t11;
        break;
      }
    }
    if (!p10 || (g10 > 0 ? i10++ : h10 > 1 && a10++, CE(o10, s10, d11, m10, u10), u10.looksLikeAlignment && !(n10 && t10 === u10.spacesDiff))) continue;
    let _10 = u10.spacesDiff;
    _10 <= 8 && l10[_10]++, o10 = d11, s10 = m10;
  }
  let d10 = n10;
  i10 !== a10 && (d10 = i10 < a10);
  let f10 = t10;
  if (d10) {
    let e207 = d10 ? 0 : 0.1 * r10;
    c10.forEach((t11) => {
      let n11 = l10[t11];
      n11 > e207 && (e207 = n11, f10 = t11);
    }), f10 === 4 && l10[4] > 0 && l10[2] > 0 && l10[2] >= l10[4] / 2 && (f10 = 2);
  }
  return { insertSpaces: d10, tabSize: f10 };
}
function TE(e206) {
  return (e206.metadata & 1) >>> 0;
}
function EE(e206, t10) {
  e206.metadata = e206.metadata & 254 | t10 << 0;
}
function DE(e206) {
  return (e206.metadata & 2) >>> 1 == 1;
}
function OE(e206, t10) {
  e206.metadata = e206.metadata & 253 | !!t10 << 1;
}
function kE(e206) {
  return (e206.metadata & 4) >>> 2 == 1;
}
function AE(e206, t10) {
  e206.metadata = e206.metadata & 251 | !!t10 << 2;
}
function jE(e206) {
  return (e206.metadata & 64) >>> 6 == 1;
}
function ME(e206, t10) {
  e206.metadata = e206.metadata & 191 | !!t10 << 6;
}
function NE(e206) {
  return (e206.metadata & 128) >>> 7 == 1;
}
function PE(e206, t10) {
  e206.metadata = e206.metadata & 127 | !!t10 << 7;
}
function FE(e206) {
  return (e206.metadata & 24) >>> 3;
}
function IE(e206, t10) {
  e206.metadata = e206.metadata & 231 | t10 << 3;
}
function LE(e206) {
  return (e206.metadata & 32) >>> 5 == 1;
}
function RE(e206, t10) {
  e206.metadata = e206.metadata & 223 | !!t10 << 5;
}
var zE = class {
  constructor(e206, t10, n10) {
    this.metadata = 0, this.parent = this, this.left = this, this.right = this, EE(this, 1), this.start = t10, this.end = n10, this.delta = 0, this.maxEnd = n10, this.id = e206, this.ownerId = 0, this.options = null, AE(this, false), ME(this, false), IE(this, 1), RE(this, false), PE(this, false), this.cachedVersionId = 0, this.cachedAbsoluteStart = t10, this.cachedAbsoluteEnd = n10, this.range = null, OE(this, false);
  }
  reset(e206, t10, n10, r10) {
    this.start = t10, this.end = n10, this.maxEnd = n10, this.cachedVersionId = e206, this.cachedAbsoluteStart = t10, this.cachedAbsoluteEnd = n10, this.range = r10;
  }
  setOptions(e206) {
    this.options = e206;
    let t10 = this.options.className;
    AE(this, t10 === `squiggly-error` || t10 === `squiggly-warning` || t10 === `squiggly-info`), ME(this, this.options.glyphMarginClassName !== null), IE(this, this.options.stickiness), RE(this, this.options.collapseOnReplaceEdit), PE(this, this.options.affectsFont ?? false);
  }
  setCachedOffsets(e206, t10, n10) {
    this.cachedVersionId !== n10 && (this.range = null), this.cachedVersionId = n10, this.cachedAbsoluteStart = e206, this.cachedAbsoluteEnd = t10;
  }
  detach() {
    this.parent = null, this.left = null, this.right = null;
  }
}, BE = new zE(null, 0, 0);
BE.parent = BE, BE.left = BE, BE.right = BE, EE(BE, 0);
var VE = class {
  constructor() {
    this.root = BE, this.requestNormalizeDelta = false;
  }
  intervalSearch(e206, t10, n10, r10, i10, a10, o10) {
    return this.root === BE ? [] : yde(this, e206, t10, n10, r10, i10, a10, o10);
  }
  search(e206, t10, n10, r10, i10) {
    return this.root === BE ? [] : vde(this, e206, t10, n10, r10, i10);
  }
  collectNodesFromOwner(e206) {
    return gde(this, e206);
  }
  collectNodesPostOrder() {
    return _de(this);
  }
  insert(e206) {
    UE(this, e206), this._normalizeDeltaIfNecessary();
  }
  delete(e206) {
    WE(this, e206), this._normalizeDeltaIfNecessary();
  }
  resolveNode(e206, t10) {
    let n10 = e206, r10 = 0;
    for (; e206 !== this.root; ) e206 === e206.parent.right && (r10 += e206.parent.delta), e206 = e206.parent;
    let i10 = n10.start + r10, a10 = n10.end + r10;
    n10.setCachedOffsets(i10, a10, t10);
  }
  acceptReplace(e206, t10, n10, r10) {
    let i10 = mde(this, e206, e206 + t10);
    for (let e207 = 0, t11 = i10.length; e207 < t11; e207++) {
      let t12 = i10[e207];
      WE(this, t12);
    }
    this._normalizeDeltaIfNecessary(), hde(this, e206, e206 + t10, n10), this._normalizeDeltaIfNecessary();
    for (let a10 = 0, o10 = i10.length; a10 < o10; a10++) {
      let o11 = i10[a10];
      o11.start = o11.cachedAbsoluteStart, o11.end = o11.cachedAbsoluteEnd, pde(o11, e206, e206 + t10, n10, r10), o11.maxEnd = o11.end, UE(this, o11);
    }
    this._normalizeDeltaIfNecessary();
  }
  _normalizeDeltaIfNecessary() {
    this.requestNormalizeDelta && (this.requestNormalizeDelta = false, fde(this));
  }
};
function fde(e206) {
  let t10 = e206.root, n10 = 0;
  for (; t10 !== BE; ) {
    if (t10.left !== BE && !DE(t10.left)) {
      t10 = t10.left;
      continue;
    }
    if (t10.right !== BE && !DE(t10.right)) {
      n10 += t10.delta, t10 = t10.right;
      continue;
    }
    t10.start = n10 + t10.start, t10.end = n10 + t10.end, t10.delta = 0, YE(t10), OE(t10, true), OE(t10.left, false), OE(t10.right, false), t10 === t10.parent.right && (n10 -= t10.parent.delta), t10 = t10.parent;
  }
  OE(e206.root, false);
}
function HE(e206, t10, n10, r10) {
  return e206 < n10 ? true : e206 > n10 || r10 === 1 ? false : r10 === 2 ? true : t10;
}
function pde(e206, t10, n10, r10, i10) {
  let a10 = FE(e206), o10 = a10 === 0 || a10 === 2, s10 = a10 === 1 || a10 === 2, c10 = n10 - t10, l10 = r10, u10 = Math.min(c10, l10), d10 = e206.start, f10 = false, p10 = e206.end, m10 = false;
  t10 <= d10 && p10 <= n10 && LE(e206) && (e206.start = t10, f10 = true, e206.end = t10, m10 = true);
  {
    let e207 = i10 ? 1 : c10 > 0 ? 2 : 0;
    !f10 && HE(d10, o10, t10, e207) && (f10 = true), !m10 && HE(p10, s10, t10, e207) && (m10 = true);
  }
  if (u10 > 0 && !i10) {
    let e207 = c10 > l10 ? 2 : 0;
    !f10 && HE(d10, o10, t10 + u10, e207) && (f10 = true), !m10 && HE(p10, s10, t10 + u10, e207) && (m10 = true);
  }
  {
    let r11 = +!!i10;
    !f10 && HE(d10, o10, n10, r11) && (e206.start = t10 + l10, f10 = true), !m10 && HE(p10, s10, n10, r11) && (e206.end = t10 + l10, m10 = true);
  }
  let h10 = l10 - c10;
  f10 || (e206.start = Math.max(0, d10 + h10)), m10 || (e206.end = Math.max(0, p10 + h10)), e206.start > e206.end && (e206.end = e206.start);
}
function mde(e206, t10, n10) {
  let r10 = e206.root, i10 = 0, a10 = 0, o10 = 0, s10 = 0, c10 = [], l10 = 0;
  for (; r10 !== BE; ) {
    if (DE(r10)) {
      OE(r10.left, false), OE(r10.right, false), r10 === r10.parent.right && (i10 -= r10.parent.delta), r10 = r10.parent;
      continue;
    }
    if (!DE(r10.left)) {
      if (a10 = i10 + r10.maxEnd, a10 < t10) {
        OE(r10, true);
        continue;
      }
      if (r10.left !== BE) {
        r10 = r10.left;
        continue;
      }
    }
    if (o10 = i10 + r10.start, o10 > n10) {
      OE(r10, true);
      continue;
    }
    if (s10 = i10 + r10.end, s10 >= t10 && (r10.setCachedOffsets(o10, s10, 0), c10[l10++] = r10), OE(r10, true), r10.right !== BE && !DE(r10.right)) {
      i10 += r10.delta, r10 = r10.right;
      continue;
    }
  }
  return OE(e206.root, false), c10;
}
function hde(e206, t10, n10, r10) {
  let i10 = e206.root, a10 = 0, o10 = 0, s10 = 0, c10 = r10 - (n10 - t10);
  for (; i10 !== BE; ) {
    if (DE(i10)) {
      OE(i10.left, false), OE(i10.right, false), i10 === i10.parent.right && (a10 -= i10.parent.delta), YE(i10), i10 = i10.parent;
      continue;
    }
    if (!DE(i10.left)) {
      if (o10 = a10 + i10.maxEnd, o10 < t10) {
        OE(i10, true);
        continue;
      }
      if (i10.left !== BE) {
        i10 = i10.left;
        continue;
      }
    }
    if (s10 = a10 + i10.start, s10 > n10) {
      i10.start += c10, i10.end += c10, i10.delta += c10, (i10.delta < -1073741824 || i10.delta > 1073741824) && (e206.requestNormalizeDelta = true), OE(i10, true);
      continue;
    }
    if (OE(i10, true), i10.right !== BE && !DE(i10.right)) {
      a10 += i10.delta, i10 = i10.right;
      continue;
    }
  }
  OE(e206.root, false);
}
function gde(e206, t10) {
  let n10 = e206.root, r10 = [], i10 = 0;
  for (; n10 !== BE; ) {
    if (DE(n10)) {
      OE(n10.left, false), OE(n10.right, false), n10 = n10.parent;
      continue;
    }
    if (n10.left !== BE && !DE(n10.left)) {
      n10 = n10.left;
      continue;
    }
    if (n10.ownerId === t10 && (r10[i10++] = n10), OE(n10, true), n10.right !== BE && !DE(n10.right)) {
      n10 = n10.right;
      continue;
    }
  }
  return OE(e206.root, false), r10;
}
function _de(e206) {
  let t10 = e206.root, n10 = [], r10 = 0;
  for (; t10 !== BE; ) {
    if (DE(t10)) {
      OE(t10.left, false), OE(t10.right, false), t10 = t10.parent;
      continue;
    }
    if (t10.left !== BE && !DE(t10.left)) {
      t10 = t10.left;
      continue;
    }
    if (t10.right !== BE && !DE(t10.right)) {
      t10 = t10.right;
      continue;
    }
    n10[r10++] = t10, OE(t10, true);
  }
  return OE(e206.root, false), n10;
}
function vde(e206, t10, n10, r10, i10, a10) {
  let o10 = e206.root, s10 = 0, c10 = 0, l10 = 0, u10 = [], d10 = 0;
  for (; o10 !== BE; ) {
    if (DE(o10)) {
      OE(o10.left, false), OE(o10.right, false), o10 === o10.parent.right && (s10 -= o10.parent.delta), o10 = o10.parent;
      continue;
    }
    if (o10.left !== BE && !DE(o10.left)) {
      o10 = o10.left;
      continue;
    }
    c10 = s10 + o10.start, l10 = s10 + o10.end, o10.setCachedOffsets(c10, l10, i10);
    let e207 = true;
    if (t10 && o10.ownerId && o10.ownerId !== t10 && (e207 = false), n10 && kE(o10) && (e207 = false), r10 && NE(o10) && (e207 = false), a10 && !jE(o10) && (e207 = false), e207 && (u10[d10++] = o10), OE(o10, true), o10.right !== BE && !DE(o10.right)) {
      s10 += o10.delta, o10 = o10.right;
      continue;
    }
  }
  return OE(e206.root, false), u10;
}
function yde(e206, t10, n10, r10, i10, a10, o10, s10) {
  let c10 = e206.root, l10 = 0, u10 = 0, d10 = 0, f10 = 0, p10 = [], m10 = 0;
  for (; c10 !== BE; ) {
    if (DE(c10)) {
      OE(c10.left, false), OE(c10.right, false), c10 === c10.parent.right && (l10 -= c10.parent.delta), c10 = c10.parent;
      continue;
    }
    if (!DE(c10.left)) {
      if (u10 = l10 + c10.maxEnd, u10 < t10) {
        OE(c10, true);
        continue;
      }
      if (c10.left !== BE) {
        c10 = c10.left;
        continue;
      }
    }
    if (d10 = l10 + c10.start, d10 > n10) {
      OE(c10, true);
      continue;
    }
    if (f10 = l10 + c10.end, f10 >= t10) {
      c10.setCachedOffsets(d10, f10, o10);
      let e207 = true;
      r10 && c10.ownerId && c10.ownerId !== r10 && (e207 = false), i10 && kE(c10) && (e207 = false), a10 && NE(c10) && (e207 = false), s10 && !jE(c10) && (e207 = false), e207 && (p10[m10++] = c10);
    }
    if (OE(c10, true), c10.right !== BE && !DE(c10.right)) {
      l10 += c10.delta, c10 = c10.right;
      continue;
    }
  }
  return OE(e206.root, false), p10;
}
function UE(e206, t10) {
  if (e206.root === BE) return t10.parent = BE, t10.left = BE, t10.right = BE, EE(t10, 0), e206.root = t10, e206.root;
  bde(e206, t10), XE(t10.parent);
  let n10 = t10;
  for (; n10 !== e206.root && TE(n10.parent) === 1; ) if (n10.parent === n10.parent.parent.left) {
    let t11 = n10.parent.parent.right;
    TE(t11) === 1 ? (EE(n10.parent, 0), EE(t11, 0), EE(n10.parent.parent, 1), n10 = n10.parent.parent) : (n10 === n10.parent.right && (n10 = n10.parent, KE(e206, n10)), EE(n10.parent, 0), EE(n10.parent.parent, 1), qE(e206, n10.parent.parent));
  } else {
    let t11 = n10.parent.parent.left;
    TE(t11) === 1 ? (EE(n10.parent, 0), EE(t11, 0), EE(n10.parent.parent, 1), n10 = n10.parent.parent) : (n10 === n10.parent.left && (n10 = n10.parent, qE(e206, n10)), EE(n10.parent, 0), EE(n10.parent.parent, 1), KE(e206, n10.parent.parent));
  }
  return EE(e206.root, 0), t10;
}
function bde(e206, t10) {
  let n10 = 0, r10 = e206.root, i10 = t10.start, a10 = t10.end;
  for (; ; ) if (Sde(i10, a10, r10.start + n10, r10.end + n10) < 0) if (r10.left === BE) {
    t10.start -= n10, t10.end -= n10, t10.maxEnd -= n10, r10.left = t10;
    break;
  } else r10 = r10.left;
  else if (r10.right === BE) {
    t10.start -= n10 + r10.delta, t10.end -= n10 + r10.delta, t10.maxEnd -= n10 + r10.delta, r10.right = t10;
    break;
  } else n10 += r10.delta, r10 = r10.right;
  t10.parent = r10, t10.left = BE, t10.right = BE, EE(t10, 1);
}
function WE(e206, t10) {
  let n10, r10;
  if (t10.left === BE ? (n10 = t10.right, r10 = t10, n10.delta += t10.delta, (n10.delta < -1073741824 || n10.delta > 1073741824) && (e206.requestNormalizeDelta = true), n10.start += t10.delta, n10.end += t10.delta) : t10.right === BE ? (n10 = t10.left, r10 = t10) : (r10 = xde(t10.right), n10 = r10.right, n10.start += r10.delta, n10.end += r10.delta, n10.delta += r10.delta, (n10.delta < -1073741824 || n10.delta > 1073741824) && (e206.requestNormalizeDelta = true), r10.start += t10.delta, r10.end += t10.delta, r10.delta = t10.delta, (r10.delta < -1073741824 || r10.delta > 1073741824) && (e206.requestNormalizeDelta = true)), r10 === e206.root) {
    e206.root = n10, EE(n10, 0), t10.detach(), GE(), YE(n10), e206.root.parent = BE;
    return;
  }
  let i10 = TE(r10) === 1;
  if (r10 === r10.parent.left ? r10.parent.left = n10 : r10.parent.right = n10, r10 === t10 ? n10.parent = r10.parent : (r10.parent === t10 ? n10.parent = r10 : n10.parent = r10.parent, r10.left = t10.left, r10.right = t10.right, r10.parent = t10.parent, EE(r10, TE(t10)), t10 === e206.root ? e206.root = r10 : t10 === t10.parent.left ? t10.parent.left = r10 : t10.parent.right = r10, r10.left !== BE && (r10.left.parent = r10), r10.right !== BE && (r10.right.parent = r10)), t10.detach(), i10) {
    XE(n10.parent), r10 !== t10 && (XE(r10), XE(r10.parent)), GE();
    return;
  }
  XE(n10), XE(n10.parent), r10 !== t10 && (XE(r10), XE(r10.parent));
  let a10;
  for (; n10 !== e206.root && TE(n10) === 0; ) n10 === n10.parent.left ? (a10 = n10.parent.right, TE(a10) === 1 && (EE(a10, 0), EE(n10.parent, 1), KE(e206, n10.parent), a10 = n10.parent.right), TE(a10.left) === 0 && TE(a10.right) === 0 ? (EE(a10, 1), n10 = n10.parent) : (TE(a10.right) === 0 && (EE(a10.left, 0), EE(a10, 1), qE(e206, a10), a10 = n10.parent.right), EE(a10, TE(n10.parent)), EE(n10.parent, 0), EE(a10.right, 0), KE(e206, n10.parent), n10 = e206.root)) : (a10 = n10.parent.left, TE(a10) === 1 && (EE(a10, 0), EE(n10.parent, 1), qE(e206, n10.parent), a10 = n10.parent.left), TE(a10.left) === 0 && TE(a10.right) === 0 ? (EE(a10, 1), n10 = n10.parent) : (TE(a10.left) === 0 && (EE(a10.right, 0), EE(a10, 1), KE(e206, a10), a10 = n10.parent.left), EE(a10, TE(n10.parent)), EE(n10.parent, 0), EE(a10.left, 0), qE(e206, n10.parent), n10 = e206.root));
  EE(n10, 0), GE();
}
function xde(e206) {
  for (; e206.left !== BE; ) e206 = e206.left;
  return e206;
}
function GE() {
  BE.parent = BE, BE.delta = 0, BE.start = 0, BE.end = 0;
}
function KE(e206, t10) {
  let n10 = t10.right;
  n10.delta += t10.delta, (n10.delta < -1073741824 || n10.delta > 1073741824) && (e206.requestNormalizeDelta = true), n10.start += t10.delta, n10.end += t10.delta, t10.right = n10.left, n10.left !== BE && (n10.left.parent = t10), n10.parent = t10.parent, t10.parent === BE ? e206.root = n10 : t10 === t10.parent.left ? t10.parent.left = n10 : t10.parent.right = n10, n10.left = t10, t10.parent = n10, YE(t10), YE(n10);
}
function qE(e206, t10) {
  let n10 = t10.left;
  t10.delta -= n10.delta, (t10.delta < -1073741824 || t10.delta > 1073741824) && (e206.requestNormalizeDelta = true), t10.start -= n10.delta, t10.end -= n10.delta, t10.left = n10.right, n10.right !== BE && (n10.right.parent = t10), n10.parent = t10.parent, t10.parent === BE ? e206.root = n10 : t10 === t10.parent.right ? t10.parent.right = n10 : t10.parent.left = n10, n10.right = t10, t10.parent = n10, YE(t10), YE(n10);
}
function JE(e206) {
  let t10 = e206.end;
  if (e206.left !== BE) {
    let n10 = e206.left.maxEnd;
    n10 > t10 && (t10 = n10);
  }
  if (e206.right !== BE) {
    let n10 = e206.right.maxEnd + e206.delta;
    n10 > t10 && (t10 = n10);
  }
  return t10;
}
function YE(e206) {
  e206.maxEnd = JE(e206);
}
function XE(e206) {
  for (; e206 !== BE; ) {
    let t10 = JE(e206);
    if (e206.maxEnd === t10) return;
    e206.maxEnd = t10, e206 = e206.parent;
  }
}
function Sde(e206, t10, n10, r10) {
  return e206 === n10 ? t10 - r10 : e206 - n10;
}
var ZE = class {
  constructor(e206, t10) {
    this.piece = e206, this.color = t10, this.size_left = 0, this.lf_left = 0, this.parent = this, this.left = this, this.right = this;
  }
  next() {
    if (this.right !== QE) return $E(this.right);
    let e206 = this;
    for (; e206.parent !== QE && e206.parent.left !== e206; ) e206 = e206.parent;
    return e206.parent === QE ? QE : e206.parent;
  }
  prev() {
    if (this.left !== QE) return eD(this.left);
    let e206 = this;
    for (; e206.parent !== QE && e206.parent.right !== e206; ) e206 = e206.parent;
    return e206.parent === QE ? QE : e206.parent;
  }
  detach() {
    this.parent = null, this.left = null, this.right = null;
  }
}, QE = new ZE(null, 0);
QE.parent = QE, QE.left = QE, QE.right = QE, QE.color = 0;
function $E(e206) {
  for (; e206.left !== QE; ) e206 = e206.left;
  return e206;
}
function eD(e206) {
  for (; e206.right !== QE; ) e206 = e206.right;
  return e206;
}
function tD(e206) {
  return e206 === QE ? 0 : e206.size_left + e206.piece.length + tD(e206.right);
}
function nD(e206) {
  return e206 === QE ? 0 : e206.lf_left + e206.piece.lineFeedCnt + nD(e206.right);
}
function rD() {
  QE.parent = QE;
}
function iD(e206, t10) {
  let n10 = t10.right;
  n10.size_left += t10.size_left + (t10.piece ? t10.piece.length : 0), n10.lf_left += t10.lf_left + (t10.piece ? t10.piece.lineFeedCnt : 0), t10.right = n10.left, n10.left !== QE && (n10.left.parent = t10), n10.parent = t10.parent, t10.parent === QE ? e206.root = n10 : t10.parent.left === t10 ? t10.parent.left = n10 : t10.parent.right = n10, n10.left = t10, t10.parent = n10;
}
function aD(e206, t10) {
  let n10 = t10.left;
  t10.left = n10.right, n10.right !== QE && (n10.right.parent = t10), n10.parent = t10.parent, t10.size_left -= n10.size_left + (n10.piece ? n10.piece.length : 0), t10.lf_left -= n10.lf_left + (n10.piece ? n10.piece.lineFeedCnt : 0), t10.parent === QE ? e206.root = n10 : t10 === t10.parent.right ? t10.parent.right = n10 : t10.parent.left = n10, n10.right = t10, t10.parent = n10;
}
function oD(e206, t10) {
  let n10, r10;
  if (t10.left === QE ? (r10 = t10, n10 = r10.right) : t10.right === QE ? (r10 = t10, n10 = r10.left) : (r10 = $E(t10.right), n10 = r10.right), r10 === e206.root) {
    e206.root = n10, n10.color = 0, t10.detach(), rD(), e206.root.parent = QE;
    return;
  }
  let i10 = r10.color === 1;
  if (r10 === r10.parent.left ? r10.parent.left = n10 : r10.parent.right = n10, r10 === t10 ? (n10.parent = r10.parent, lD(e206, n10)) : (r10.parent === t10 ? n10.parent = r10 : n10.parent = r10.parent, lD(e206, n10), r10.left = t10.left, r10.right = t10.right, r10.parent = t10.parent, r10.color = t10.color, t10 === e206.root ? e206.root = r10 : t10 === t10.parent.left ? t10.parent.left = r10 : t10.parent.right = r10, r10.left !== QE && (r10.left.parent = r10), r10.right !== QE && (r10.right.parent = r10), r10.size_left = t10.size_left, r10.lf_left = t10.lf_left, lD(e206, r10)), t10.detach(), n10.parent.left === n10) {
    let t11 = tD(n10), r11 = nD(n10);
    if (t11 !== n10.parent.size_left || r11 !== n10.parent.lf_left) {
      let i11 = t11 - n10.parent.size_left, a11 = r11 - n10.parent.lf_left;
      n10.parent.size_left = t11, n10.parent.lf_left = r11, cD(e206, n10.parent, i11, a11);
    }
  }
  if (lD(e206, n10.parent), i10) {
    rD();
    return;
  }
  let a10;
  for (; n10 !== e206.root && n10.color === 0; ) n10 === n10.parent.left ? (a10 = n10.parent.right, a10.color === 1 && (a10.color = 0, n10.parent.color = 1, iD(e206, n10.parent), a10 = n10.parent.right), a10.left.color === 0 && a10.right.color === 0 ? (a10.color = 1, n10 = n10.parent) : (a10.right.color === 0 && (a10.left.color = 0, a10.color = 1, aD(e206, a10), a10 = n10.parent.right), a10.color = n10.parent.color, n10.parent.color = 0, a10.right.color = 0, iD(e206, n10.parent), n10 = e206.root)) : (a10 = n10.parent.left, a10.color === 1 && (a10.color = 0, n10.parent.color = 1, aD(e206, n10.parent), a10 = n10.parent.left), a10.left.color === 0 && a10.right.color === 0 ? (a10.color = 1, n10 = n10.parent) : (a10.left.color === 0 && (a10.right.color = 0, a10.color = 1, iD(e206, a10), a10 = n10.parent.left), a10.color = n10.parent.color, n10.parent.color = 0, a10.left.color = 0, aD(e206, n10.parent), n10 = e206.root));
  n10.color = 0, rD();
}
function sD(e206, t10) {
  for (lD(e206, t10); t10 !== e206.root && t10.parent.color === 1; ) if (t10.parent === t10.parent.parent.left) {
    let n10 = t10.parent.parent.right;
    n10.color === 1 ? (t10.parent.color = 0, n10.color = 0, t10.parent.parent.color = 1, t10 = t10.parent.parent) : (t10 === t10.parent.right && (t10 = t10.parent, iD(e206, t10)), t10.parent.color = 0, t10.parent.parent.color = 1, aD(e206, t10.parent.parent));
  } else {
    let n10 = t10.parent.parent.left;
    n10.color === 1 ? (t10.parent.color = 0, n10.color = 0, t10.parent.parent.color = 1, t10 = t10.parent.parent) : (t10 === t10.parent.left && (t10 = t10.parent, aD(e206, t10)), t10.parent.color = 0, t10.parent.parent.color = 1, iD(e206, t10.parent.parent));
  }
  e206.root.color = 0;
}
function cD(e206, t10, n10, r10) {
  for (; t10 !== e206.root && t10 !== QE; ) t10.parent.left === t10 && (t10.parent.size_left += n10, t10.parent.lf_left += r10), t10 = t10.parent;
}
function lD(e206, t10) {
  let n10 = 0, r10 = 0;
  if (t10 !== e206.root) {
    for (; t10 !== e206.root && t10 === t10.parent.right; ) t10 = t10.parent;
    if (t10 !== e206.root) for (t10 = t10.parent, n10 = tD(t10.left) - t10.size_left, r10 = nD(t10.left) - t10.lf_left, t10.size_left += n10, t10.lf_left += r10; t10 !== e206.root && (n10 !== 0 || r10 !== 0); ) t10.parent.left === t10 && (t10.parent.size_left += n10, t10.parent.lf_left += r10), t10 = t10.parent;
  }
}
var uD = 65535;
function dD(e206) {
  let t10;
  return t10 = e206[e206.length - 1] < 65536 ? new Uint16Array(e206.length) : new Uint32Array(e206.length), t10.set(e206, 0), t10;
}
var Cde = class {
  constructor(e206, t10, n10, r10, i10) {
    this.lineStarts = e206, this.cr = t10, this.lf = n10, this.crlf = r10, this.isBasicASCII = i10;
  }
};
function fD(e206, t10 = true) {
  let n10 = [0], r10 = 1;
  for (let t11 = 0, i10 = e206.length; t11 < i10; t11++) {
    let a10 = e206.charCodeAt(t11);
    a10 === 13 ? t11 + 1 < i10 && e206.charCodeAt(t11 + 1) === 10 ? (n10[r10++] = t11 + 2, t11++) : n10[r10++] = t11 + 1 : a10 === 10 && (n10[r10++] = t11 + 1);
  }
  return t10 ? dD(n10) : n10;
}
function wde(e206, t10) {
  e206.length = 0, e206[0] = 0;
  let n10 = 1, r10 = 0, i10 = 0, a10 = 0, o10 = true;
  for (let s11 = 0, c10 = t10.length; s11 < c10; s11++) {
    let l10 = t10.charCodeAt(s11);
    l10 === 13 ? s11 + 1 < c10 && t10.charCodeAt(s11 + 1) === 10 ? (a10++, e206[n10++] = s11 + 2, s11++) : (r10++, e206[n10++] = s11 + 1) : l10 === 10 ? (i10++, e206[n10++] = s11 + 1) : o10 && l10 !== 9 && (l10 < 32 || l10 > 126) && (o10 = false);
  }
  let s10 = new Cde(dD(e206), r10, i10, a10, o10);
  return e206.length = 0, s10;
}
var pD = class {
  constructor(e206, t10, n10, r10, i10) {
    this.bufferIndex = e206, this.start = t10, this.end = n10, this.lineFeedCnt = r10, this.length = i10;
  }
}, mD = class {
  constructor(e206, t10) {
    this.buffer = e206, this.lineStarts = t10;
  }
}, Tde = class {
  constructor(e206, t10) {
    this._pieces = [], this._tree = e206, this._BOM = t10, this._index = 0, e206.root !== QE && e206.iterate(e206.root, (e207) => (e207 !== QE && this._pieces.push(e207.piece), true));
  }
  read() {
    return this._pieces.length === 0 ? this._index === 0 ? (this._index++, this._BOM) : null : this._index > this._pieces.length - 1 ? null : this._index === 0 ? this._BOM + this._tree.getPieceContent(this._pieces[this._index++]) : this._tree.getPieceContent(this._pieces[this._index++]);
  }
}, Ede = class {
  constructor(e206) {
    this._limit = e206, this._cache = [];
  }
  get(e206) {
    for (let t10 = this._cache.length - 1; t10 >= 0; t10--) {
      let n10 = this._cache[t10];
      if (n10.nodeStartOffset <= e206 && n10.nodeStartOffset + n10.node.piece.length >= e206) return n10;
    }
    return null;
  }
  get2(e206) {
    for (let t10 = this._cache.length - 1; t10 >= 0; t10--) {
      let n10 = this._cache[t10];
      if (n10.nodeStartLineNumber && n10.nodeStartLineNumber < e206 && n10.nodeStartLineNumber + n10.node.piece.lineFeedCnt >= e206) return n10;
    }
    return null;
  }
  set(e206) {
    this._cache.length >= this._limit && this._cache.shift(), this._cache.push(e206);
  }
  validate(e206) {
    let t10 = false, n10 = this._cache;
    for (let r10 = 0; r10 < n10.length; r10++) {
      let i10 = n10[r10];
      if (i10.node.parent === null || i10.nodeStartOffset >= e206) {
        n10[r10] = null, t10 = true;
        continue;
      }
    }
    if (t10) {
      let e207 = [];
      for (let t11 of n10) t11 !== null && e207.push(t11);
      this._cache = e207;
    }
  }
}, Dde = class {
  constructor(e206, t10, n10) {
    this.create(e206, t10, n10);
  }
  create(e206, t10, n10) {
    this._buffers = [new mD(``, [0])], this._lastChangeBufferPos = { line: 0, column: 0 }, this.root = QE, this._lineCnt = 1, this._length = 0, this._EOL = t10, this._EOLLength = t10.length, this._EOLNormalized = n10;
    let r10 = null;
    for (let t11 = 0, n11 = e206.length; t11 < n11; t11++) if (e206[t11].buffer.length > 0) {
      e206[t11].lineStarts || (e206[t11].lineStarts = fD(e206[t11].buffer));
      let n12 = new pD(t11 + 1, { line: 0, column: 0 }, { line: e206[t11].lineStarts.length - 1, column: e206[t11].buffer.length - e206[t11].lineStarts[e206[t11].lineStarts.length - 1] }, e206[t11].lineStarts.length - 1, e206[t11].buffer.length);
      this._buffers.push(e206[t11]), r10 = this.rbInsertRight(r10, n12);
    }
    this._searchCache = new Ede(1), this._lastVisitedLine = { lineNumber: 0, value: `` }, this.computeBufferMetadata();
  }
  normalizeEOL(e206) {
    let t10 = uD, n10 = t10 - Math.floor(t10 / 3), r10 = n10 * 2, i10 = ``, a10 = 0, o10 = [];
    if (this.iterate(this.root, (t11) => {
      let s10 = this.getNodeContent(t11), c10 = s10.length;
      if (a10 <= n10 || a10 + c10 < r10) return i10 += s10, a10 += c10, true;
      let l10 = i10.replace(/\r\n|\r|\n/g, e206);
      return o10.push(new mD(l10, fD(l10))), i10 = s10, a10 = c10, true;
    }), a10 > 0) {
      let t11 = i10.replace(/\r\n|\r|\n/g, e206);
      o10.push(new mD(t11, fD(t11)));
    }
    this.create(o10, e206, true);
  }
  getEOL() {
    return this._EOL;
  }
  setEOL(e206) {
    this._EOL = e206, this._EOLLength = this._EOL.length, this.normalizeEOL(e206);
  }
  createSnapshot(e206) {
    return new Tde(this, e206);
  }
  getOffsetAt(e206, t10) {
    let n10 = 0, r10 = this.root;
    for (; r10 !== QE; ) if (r10.left !== QE && r10.lf_left + 1 >= e206) r10 = r10.left;
    else if (r10.lf_left + r10.piece.lineFeedCnt + 1 >= e206) {
      n10 += r10.size_left;
      let i10 = this.getAccumulatedValue(r10, e206 - r10.lf_left - 2);
      return n10 += i10 + t10 - 1;
    } else e206 -= r10.lf_left + r10.piece.lineFeedCnt, n10 += r10.size_left + r10.piece.length, r10 = r10.right;
    return n10;
  }
  getPositionAt(e206) {
    e206 = Math.floor(e206), e206 = Math.max(0, e206);
    let t10 = this.root, n10 = 0, r10 = e206;
    for (; t10 !== QE; ) if (t10.size_left !== 0 && t10.size_left >= e206) t10 = t10.left;
    else if (t10.size_left + t10.piece.length >= e206) {
      let i10 = this.getIndexOf(t10, e206 - t10.size_left);
      if (n10 += t10.lf_left + i10.index, i10.index === 0) {
        let e207 = r10 - this.getOffsetAt(n10 + 1, 1);
        return new j(n10 + 1, e207 + 1);
      }
      return new j(n10 + 1, i10.remainder + 1);
    } else if (e206 -= t10.size_left + t10.piece.length, n10 += t10.lf_left + t10.piece.lineFeedCnt, t10.right === QE) {
      let t11 = this.getOffsetAt(n10 + 1, 1), i10 = r10 - e206 - t11;
      return new j(n10 + 1, i10 + 1);
    } else t10 = t10.right;
    return new j(1, 1);
  }
  getValueInRange(e206, t10) {
    if (e206.startLineNumber === e206.endLineNumber && e206.startColumn === e206.endColumn) return ``;
    let n10 = this.nodeAt2(e206.startLineNumber, e206.startColumn), r10 = this.nodeAt2(e206.endLineNumber, e206.endColumn), i10 = this.getValueInRange2(n10, r10);
    return t10 ? t10 !== this._EOL || !this._EOLNormalized ? i10.replace(/\r\n|\r|\n/g, t10) : t10 === this.getEOL() && this._EOLNormalized ? i10 : i10.replace(/\r\n|\r|\n/g, t10) : i10;
  }
  getValueInRange2(e206, t10) {
    if (e206.node === t10.node) {
      let n11 = e206.node, r11 = this._buffers[n11.piece.bufferIndex].buffer, i11 = this.offsetInBuffer(n11.piece.bufferIndex, n11.piece.start);
      return r11.substring(i11 + e206.remainder, i11 + t10.remainder);
    }
    let n10 = e206.node, r10 = this._buffers[n10.piece.bufferIndex].buffer, i10 = this.offsetInBuffer(n10.piece.bufferIndex, n10.piece.start), a10 = r10.substring(i10 + e206.remainder, i10 + n10.piece.length);
    for (n10 = n10.next(); n10 !== QE; ) {
      let e207 = this._buffers[n10.piece.bufferIndex].buffer, r11 = this.offsetInBuffer(n10.piece.bufferIndex, n10.piece.start);
      if (n10 === t10.node) {
        a10 += e207.substring(r11, r11 + t10.remainder);
        break;
      } else a10 += e207.substr(r11, n10.piece.length);
      n10 = n10.next();
    }
    return a10;
  }
  getLinesContent() {
    let e206 = [], t10 = 0, n10 = ``, r10 = false;
    return this.iterate(this.root, (i10) => {
      if (i10 === QE) return true;
      let a10 = i10.piece, o10 = a10.length;
      if (o10 === 0) return true;
      let s10 = this._buffers[a10.bufferIndex].buffer, c10 = this._buffers[a10.bufferIndex].lineStarts, l10 = a10.start.line, u10 = a10.end.line, d10 = c10[l10] + a10.start.column;
      if (r10 && (s10.charCodeAt(d10) === 10 && (d10++, o10--), e206[t10++] = n10, n10 = ``, r10 = false, o10 === 0)) return true;
      if (l10 === u10) return !this._EOLNormalized && s10.charCodeAt(d10 + o10 - 1) === 13 ? (r10 = true, n10 += s10.substr(d10, o10 - 1)) : n10 += s10.substr(d10, o10), true;
      n10 += this._EOLNormalized ? s10.substring(d10, Math.max(d10, c10[l10 + 1] - this._EOLLength)) : s10.substring(d10, c10[l10 + 1]).replace(/(\r\n|\r|\n)$/, ``), e206[t10++] = n10;
      for (let r11 = l10 + 1; r11 < u10; r11++) n10 = this._EOLNormalized ? s10.substring(c10[r11], c10[r11 + 1] - this._EOLLength) : s10.substring(c10[r11], c10[r11 + 1]).replace(/(\r\n|\r|\n)$/, ``), e206[t10++] = n10;
      return !this._EOLNormalized && s10.charCodeAt(c10[u10] + a10.end.column - 1) === 13 ? (r10 = true, a10.end.column === 0 ? t10-- : n10 = s10.substr(c10[u10], a10.end.column - 1)) : n10 = s10.substr(c10[u10], a10.end.column), true;
    }), r10 && (e206[t10++] = n10, n10 = ``), e206[t10++] = n10, e206;
  }
  getLength() {
    return this._length;
  }
  getLineCount() {
    return this._lineCnt;
  }
  getLineContent(e206) {
    return this._lastVisitedLine.lineNumber === e206 ? this._lastVisitedLine.value : (this._lastVisitedLine.lineNumber = e206, e206 === this._lineCnt ? this._lastVisitedLine.value = this.getLineRawContent(e206) : this._EOLNormalized ? this._lastVisitedLine.value = this.getLineRawContent(e206, this._EOLLength) : this._lastVisitedLine.value = this.getLineRawContent(e206).replace(/(\r\n|\r|\n)$/, ``), this._lastVisitedLine.value);
  }
  _getCharCode(e206) {
    if (e206.remainder === e206.node.piece.length) {
      let t10 = e206.node.next();
      if (!t10) return 0;
      let n10 = this._buffers[t10.piece.bufferIndex], r10 = this.offsetInBuffer(t10.piece.bufferIndex, t10.piece.start);
      return n10.buffer.charCodeAt(r10);
    } else {
      let t10 = this._buffers[e206.node.piece.bufferIndex], n10 = this.offsetInBuffer(e206.node.piece.bufferIndex, e206.node.piece.start) + e206.remainder;
      return t10.buffer.charCodeAt(n10);
    }
  }
  getLineCharCode(e206, t10) {
    let n10 = this.nodeAt2(e206, t10 + 1);
    return this._getCharCode(n10);
  }
  getLineLength(e206) {
    if (e206 === this.getLineCount()) {
      let t10 = this.getOffsetAt(e206, 1);
      return this.getLength() - t10;
    }
    return this.getOffsetAt(e206 + 1, 1) - this.getOffsetAt(e206, 1) - this._EOLLength;
  }
  getNearestChunk(e206) {
    let t10 = this.nodeAt(e206);
    if (t10.remainder === t10.node.piece.length) {
      let e207 = t10.node.next();
      if (!e207 || e207 === QE) return ``;
      let n10 = this._buffers[e207.piece.bufferIndex], r10 = this.offsetInBuffer(e207.piece.bufferIndex, e207.piece.start);
      return n10.buffer.substring(r10, r10 + e207.piece.length);
    } else {
      let e207 = this._buffers[t10.node.piece.bufferIndex], n10 = this.offsetInBuffer(t10.node.piece.bufferIndex, t10.node.piece.start), r10 = n10 + t10.remainder, i10 = n10 + t10.node.piece.length;
      return e207.buffer.substring(r10, i10);
    }
  }
  findMatchesInNode(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    let d10 = this._buffers[e206.piece.bufferIndex], f10 = this.offsetInBuffer(e206.piece.bufferIndex, e206.piece.start), p10 = this.offsetInBuffer(e206.piece.bufferIndex, i10), m10 = this.offsetInBuffer(e206.piece.bufferIndex, a10), h10, g10 = { line: 0, column: 0 }, _10, v10;
    t10._wordSeparators ? (_10 = d10.buffer.substring(p10, m10), v10 = (e207) => e207 + p10, t10.reset(0)) : (_10 = d10.buffer, v10 = (e207) => e207, t10.reset(p10));
    do
      if (h10 = t10.next(_10), h10) {
        if (v10(h10.index) >= m10) return l10;
        this.positionInBuffer(e206, v10(h10.index) - f10, g10);
        let t11 = this.getLineFeedCnt(e206.piece.bufferIndex, i10, g10), a11 = g10.line === i10.line ? g10.column - i10.column + r10 : g10.column + 1, o11 = a11 + h10[0].length;
        if (u10[l10++] = fm(new M(n10 + t11, a11, n10 + t11, o11), h10, s10), v10(h10.index) + h10[0].length >= m10 || l10 >= c10) return l10;
      }
    while (h10);
    return l10;
  }
  findMatchesLineByLine(e206, t10, n10, r10) {
    let i10 = [], a10 = 0, o10 = new vm(t10.wordSeparators, t10.regex), s10 = this.nodeAt2(e206.startLineNumber, e206.startColumn);
    if (s10 === null) return [];
    let c10 = this.nodeAt2(e206.endLineNumber, e206.endColumn);
    if (c10 === null) return [];
    let l10 = this.positionInBuffer(s10.node, s10.remainder), u10 = this.positionInBuffer(c10.node, c10.remainder);
    if (s10.node === c10.node) return this.findMatchesInNode(s10.node, o10, e206.startLineNumber, e206.startColumn, l10, u10, t10, n10, r10, a10, i10), i10;
    let d10 = e206.startLineNumber, f10 = s10.node;
    for (; f10 !== c10.node; ) {
      let c11 = this.getLineFeedCnt(f10.piece.bufferIndex, l10, f10.piece.end);
      if (c11 >= 1) {
        let s11 = this._buffers[f10.piece.bufferIndex].lineStarts, u12 = this.offsetInBuffer(f10.piece.bufferIndex, f10.piece.start), p11 = s11[l10.line + c11], m10 = d10 === e206.startLineNumber ? e206.startColumn : 1;
        if (a10 = this.findMatchesInNode(f10, o10, d10, m10, l10, this.positionInBuffer(f10, p11 - u12), t10, n10, r10, a10, i10), a10 >= r10) return i10;
        d10 += c11;
      }
      let u11 = d10 === e206.startLineNumber ? e206.startColumn - 1 : 0;
      if (d10 === e206.endLineNumber) {
        let s11 = this.getLineContent(d10).substring(u11, e206.endColumn - 1);
        return a10 = this._findMatchesInLine(t10, o10, s11, e206.endLineNumber, u11, a10, i10, n10, r10), i10;
      }
      if (a10 = this._findMatchesInLine(t10, o10, this.getLineContent(d10).substr(u11), d10, u11, a10, i10, n10, r10), a10 >= r10) return i10;
      d10++, s10 = this.nodeAt2(d10, 1), f10 = s10.node, l10 = this.positionInBuffer(s10.node, s10.remainder);
    }
    if (d10 === e206.endLineNumber) {
      let s11 = d10 === e206.startLineNumber ? e206.startColumn - 1 : 0, c11 = this.getLineContent(d10).substring(s11, e206.endColumn - 1);
      return a10 = this._findMatchesInLine(t10, o10, c11, e206.endLineNumber, s11, a10, i10, n10, r10), i10;
    }
    let p10 = d10 === e206.startLineNumber ? e206.startColumn : 1;
    return a10 = this.findMatchesInNode(c10.node, o10, d10, p10, l10, u10, t10, n10, r10, a10, i10), i10;
  }
  _findMatchesInLine(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let l10 = e206.wordSeparators;
    if (!s10 && e206.simpleSearch) {
      let t11 = e206.simpleSearch, s11 = t11.length, u11 = n10.length, d10 = -s11;
      for (; (d10 = n10.indexOf(t11, d10 + s11)) !== -1; ) if ((!l10 || _m2(l10, n10, u11, d10, s11)) && (o10[a10++] = new rm(new M(r10, d10 + 1 + i10, r10, d10 + 1 + s11 + i10), null), a10 >= c10)) return a10;
      return a10;
    }
    let u10;
    t10.reset(0);
    do
      if (u10 = t10.next(n10), u10 && (o10[a10++] = fm(new M(r10, u10.index + 1 + i10, r10, u10.index + 1 + u10[0].length + i10), u10, s10), a10 >= c10)) return a10;
    while (u10);
    return a10;
  }
  insert(e206, t10, n10 = false) {
    if (this._EOLNormalized = this._EOLNormalized && n10, this._lastVisitedLine.lineNumber = 0, this._lastVisitedLine.value = ``, this.root !== QE) {
      let { node: n11, remainder: r10, nodeStartOffset: i10 } = this.nodeAt(e206), a10 = n11.piece, o10 = a10.bufferIndex, s10 = this.positionInBuffer(n11, r10);
      if (n11.piece.bufferIndex === 0 && a10.end.line === this._lastChangeBufferPos.line && a10.end.column === this._lastChangeBufferPos.column && i10 + a10.length === e206 && t10.length < uD) {
        this.appendToNode(n11, t10), this.computeBufferMetadata();
        return;
      }
      if (i10 === e206) this.insertContentToNodeLeft(t10, n11), this._searchCache.validate(e206);
      else if (i10 + n11.piece.length > e206) {
        let e207 = [], i11 = new pD(a10.bufferIndex, s10, a10.end, this.getLineFeedCnt(a10.bufferIndex, s10, a10.end), this.offsetInBuffer(o10, a10.end) - this.offsetInBuffer(o10, s10));
        if (this.shouldCheckCRLF() && this.endWithCR(t10) && this.nodeCharCodeAt(n11, r10) === 10) {
          let e208 = { line: i11.start.line + 1, column: 0 };
          i11 = new pD(i11.bufferIndex, e208, i11.end, this.getLineFeedCnt(i11.bufferIndex, e208, i11.end), i11.length - 1), t10 += `
`;
        }
        if (this.shouldCheckCRLF() && this.startWithLF(t10)) if (this.nodeCharCodeAt(n11, r10 - 1) === 13) {
          let i12 = this.positionInBuffer(n11, r10 - 1);
          this.deleteNodeTail(n11, i12), t10 = `\r` + t10, n11.piece.length === 0 && e207.push(n11);
        } else this.deleteNodeTail(n11, s10);
        else this.deleteNodeTail(n11, s10);
        let c10 = this.createNewPieces(t10);
        i11.length > 0 && this.rbInsertRight(n11, i11);
        let l10 = n11;
        for (let e208 = 0; e208 < c10.length; e208++) l10 = this.rbInsertRight(l10, c10[e208]);
        this.deleteNodes(e207);
      } else this.insertContentToNodeRight(t10, n11);
    } else {
      let e207 = this.createNewPieces(t10), n11 = this.rbInsertLeft(null, e207[0]);
      for (let t11 = 1; t11 < e207.length; t11++) n11 = this.rbInsertRight(n11, e207[t11]);
    }
    this.computeBufferMetadata();
  }
  delete(e206, t10) {
    if (this._lastVisitedLine.lineNumber = 0, this._lastVisitedLine.value = ``, t10 <= 0 || this.root === QE) return;
    let n10 = this.nodeAt(e206), r10 = this.nodeAt(e206 + t10), i10 = n10.node, a10 = r10.node;
    if (i10 === a10) {
      let a11 = this.positionInBuffer(i10, n10.remainder), o11 = this.positionInBuffer(i10, r10.remainder);
      if (n10.nodeStartOffset === e206) {
        if (t10 === i10.piece.length) {
          let e207 = i10.next();
          oD(this, i10), this.validateCRLFWithPrevNode(e207), this.computeBufferMetadata();
          return;
        }
        this.deleteNodeHead(i10, o11), this._searchCache.validate(e206), this.validateCRLFWithPrevNode(i10), this.computeBufferMetadata();
        return;
      }
      if (n10.nodeStartOffset + i10.piece.length === e206 + t10) {
        this.deleteNodeTail(i10, a11), this.validateCRLFWithNextNode(i10), this.computeBufferMetadata();
        return;
      }
      this.shrinkNode(i10, a11, o11), this.computeBufferMetadata();
      return;
    }
    let o10 = [], s10 = this.positionInBuffer(i10, n10.remainder);
    this.deleteNodeTail(i10, s10), this._searchCache.validate(e206), i10.piece.length === 0 && o10.push(i10);
    let c10 = this.positionInBuffer(a10, r10.remainder);
    this.deleteNodeHead(a10, c10), a10.piece.length === 0 && o10.push(a10);
    let l10 = i10.next();
    for (let e207 = l10; e207 !== QE && e207 !== a10; e207 = e207.next()) o10.push(e207);
    let u10 = i10.piece.length === 0 ? i10.prev() : i10;
    this.deleteNodes(o10), this.validateCRLFWithNextNode(u10), this.computeBufferMetadata();
  }
  insertContentToNodeLeft(e206, t10) {
    let n10 = [];
    if (this.shouldCheckCRLF() && this.endWithCR(e206) && this.startWithLF(t10)) {
      let r11 = t10.piece, i11 = { line: r11.start.line + 1, column: 0 };
      t10.piece = new pD(r11.bufferIndex, i11, r11.end, this.getLineFeedCnt(r11.bufferIndex, i11, r11.end), r11.length - 1), e206 += `
`, cD(this, t10, -1, -1), t10.piece.length === 0 && n10.push(t10);
    }
    let r10 = this.createNewPieces(e206), i10 = this.rbInsertLeft(t10, r10[r10.length - 1]);
    for (let e207 = r10.length - 2; e207 >= 0; e207--) i10 = this.rbInsertLeft(i10, r10[e207]);
    this.validateCRLFWithPrevNode(i10), this.deleteNodes(n10);
  }
  insertContentToNodeRight(e206, t10) {
    this.adjustCarriageReturnFromNext(e206, t10) && (e206 += `
`);
    let n10 = this.createNewPieces(e206), r10 = this.rbInsertRight(t10, n10[0]), i10 = r10;
    for (let e207 = 1; e207 < n10.length; e207++) i10 = this.rbInsertRight(i10, n10[e207]);
    this.validateCRLFWithPrevNode(r10);
  }
  positionInBuffer(e206, t10, n10) {
    let r10 = e206.piece, i10 = e206.piece.bufferIndex, a10 = this._buffers[i10].lineStarts, o10 = a10[r10.start.line] + r10.start.column + t10, s10 = r10.start.line, c10 = r10.end.line, l10 = 0, u10 = 0, d10 = 0;
    for (; s10 <= c10 && (l10 = s10 + (c10 - s10) / 2 | 0, d10 = a10[l10], l10 !== c10); ) if (u10 = a10[l10 + 1], o10 < d10) c10 = l10 - 1;
    else if (o10 >= u10) s10 = l10 + 1;
    else break;
    return n10 ? (n10.line = l10, n10.column = o10 - d10, null) : { line: l10, column: o10 - d10 };
  }
  getLineFeedCnt(e206, t10, n10) {
    if (n10.column === 0) return n10.line - t10.line;
    let r10 = this._buffers[e206].lineStarts;
    if (n10.line === r10.length - 1) return n10.line - t10.line;
    let i10 = r10[n10.line + 1], a10 = r10[n10.line] + n10.column;
    if (i10 > a10 + 1) return n10.line - t10.line;
    let o10 = a10 - 1;
    return this._buffers[e206].buffer.charCodeAt(o10) === 13 ? n10.line - t10.line + 1 : n10.line - t10.line;
  }
  offsetInBuffer(e206, t10) {
    return this._buffers[e206].lineStarts[t10.line] + t10.column;
  }
  deleteNodes(e206) {
    for (let t10 = 0; t10 < e206.length; t10++) oD(this, e206[t10]);
  }
  createNewPieces(e206) {
    if (e206.length > uD) {
      let t11 = [];
      for (; e206.length > uD; ) {
        let n12 = e206.charCodeAt(uD - 1), r11;
        n12 === 13 || n12 >= 55296 && n12 <= 56319 ? (r11 = e206.substring(0, uD - 1), e206 = e206.substring(uD - 1)) : (r11 = e206.substring(0, uD), e206 = e206.substring(uD));
        let i11 = fD(r11);
        t11.push(new pD(this._buffers.length, { line: 0, column: 0 }, { line: i11.length - 1, column: r11.length - i11[i11.length - 1] }, i11.length - 1, r11.length)), this._buffers.push(new mD(r11, i11));
      }
      let n11 = fD(e206);
      return t11.push(new pD(this._buffers.length, { line: 0, column: 0 }, { line: n11.length - 1, column: e206.length - n11[n11.length - 1] }, n11.length - 1, e206.length)), this._buffers.push(new mD(e206, n11)), t11;
    }
    let t10 = this._buffers[0].buffer.length, n10 = fD(e206, false), r10 = this._lastChangeBufferPos;
    if (this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 1] === t10 && t10 !== 0 && this.startWithLF(e206) && this.endWithCR(this._buffers[0].buffer)) {
      this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line, column: this._lastChangeBufferPos.column + 1 }, r10 = this._lastChangeBufferPos;
      for (let e207 = 0; e207 < n10.length; e207++) n10[e207] += t10 + 1;
      this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(n10.slice(1)), this._buffers[0].buffer += `_` + e206, t10 += 1;
    } else {
      if (t10 !== 0) for (let e207 = 0; e207 < n10.length; e207++) n10[e207] += t10;
      this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(n10.slice(1)), this._buffers[0].buffer += e206;
    }
    let i10 = this._buffers[0].buffer.length, a10 = this._buffers[0].lineStarts.length - 1, o10 = { line: a10, column: i10 - this._buffers[0].lineStarts[a10] }, s10 = new pD(0, r10, o10, this.getLineFeedCnt(0, r10, o10), i10 - t10);
    return this._lastChangeBufferPos = o10, [s10];
  }
  getLineRawContent(e206, t10 = 0) {
    let n10 = this.root, r10 = ``, i10 = this._searchCache.get2(e206);
    if (i10) {
      n10 = i10.node;
      let a10 = this.getAccumulatedValue(n10, e206 - i10.nodeStartLineNumber - 1), o10 = this._buffers[n10.piece.bufferIndex].buffer, s10 = this.offsetInBuffer(n10.piece.bufferIndex, n10.piece.start);
      if (i10.nodeStartLineNumber + n10.piece.lineFeedCnt === e206) r10 = o10.substring(s10 + a10, s10 + n10.piece.length);
      else {
        let r11 = this.getAccumulatedValue(n10, e206 - i10.nodeStartLineNumber);
        return o10.substring(s10 + a10, s10 + r11 - t10);
      }
    } else {
      let i11 = 0, a10 = e206;
      for (; n10 !== QE; ) if (n10.left !== QE && n10.lf_left >= e206 - 1) n10 = n10.left;
      else if (n10.lf_left + n10.piece.lineFeedCnt > e206 - 1) {
        let r11 = this.getAccumulatedValue(n10, e206 - n10.lf_left - 2), o10 = this.getAccumulatedValue(n10, e206 - n10.lf_left - 1), s10 = this._buffers[n10.piece.bufferIndex].buffer, c10 = this.offsetInBuffer(n10.piece.bufferIndex, n10.piece.start);
        return i11 += n10.size_left, this._searchCache.set({ node: n10, nodeStartOffset: i11, nodeStartLineNumber: a10 - (e206 - 1 - n10.lf_left) }), s10.substring(c10 + r11, c10 + o10 - t10);
      } else if (n10.lf_left + n10.piece.lineFeedCnt === e206 - 1) {
        let t11 = this.getAccumulatedValue(n10, e206 - n10.lf_left - 2), i12 = this._buffers[n10.piece.bufferIndex].buffer, a11 = this.offsetInBuffer(n10.piece.bufferIndex, n10.piece.start);
        r10 = i12.substring(a11 + t11, a11 + n10.piece.length);
        break;
      } else e206 -= n10.lf_left + n10.piece.lineFeedCnt, i11 += n10.size_left + n10.piece.length, n10 = n10.right;
    }
    for (n10 = n10.next(); n10 !== QE; ) {
      let e207 = this._buffers[n10.piece.bufferIndex].buffer;
      if (n10.piece.lineFeedCnt > 0) {
        let i11 = this.getAccumulatedValue(n10, 0), a10 = this.offsetInBuffer(n10.piece.bufferIndex, n10.piece.start);
        return r10 += e207.substring(a10, a10 + i11 - t10), r10;
      } else {
        let t11 = this.offsetInBuffer(n10.piece.bufferIndex, n10.piece.start);
        r10 += e207.substr(t11, n10.piece.length);
      }
      n10 = n10.next();
    }
    return r10;
  }
  computeBufferMetadata() {
    let e206 = this.root, t10 = 1, n10 = 0;
    for (; e206 !== QE; ) t10 += e206.lf_left + e206.piece.lineFeedCnt, n10 += e206.size_left + e206.piece.length, e206 = e206.right;
    this._lineCnt = t10, this._length = n10, this._searchCache.validate(this._length);
  }
  getIndexOf(e206, t10) {
    let n10 = e206.piece, r10 = this.positionInBuffer(e206, t10), i10 = r10.line - n10.start.line;
    if (this.offsetInBuffer(n10.bufferIndex, n10.end) - this.offsetInBuffer(n10.bufferIndex, n10.start) === t10) {
      let t11 = this.getLineFeedCnt(e206.piece.bufferIndex, n10.start, r10);
      if (t11 !== i10) return { index: t11, remainder: 0 };
    }
    return { index: i10, remainder: r10.column };
  }
  getAccumulatedValue(e206, t10) {
    if (t10 < 0) return 0;
    let n10 = e206.piece, r10 = this._buffers[n10.bufferIndex].lineStarts, i10 = n10.start.line + t10 + 1;
    return i10 > n10.end.line ? r10[n10.end.line] + n10.end.column - r10[n10.start.line] - n10.start.column : r10[i10] - r10[n10.start.line] - n10.start.column;
  }
  deleteNodeTail(e206, t10) {
    let n10 = e206.piece, r10 = n10.lineFeedCnt, i10 = this.offsetInBuffer(n10.bufferIndex, n10.end), a10 = t10, o10 = this.offsetInBuffer(n10.bufferIndex, a10), s10 = this.getLineFeedCnt(n10.bufferIndex, n10.start, a10), c10 = s10 - r10, l10 = o10 - i10, u10 = n10.length + l10;
    e206.piece = new pD(n10.bufferIndex, n10.start, a10, s10, u10), cD(this, e206, l10, c10);
  }
  deleteNodeHead(e206, t10) {
    let n10 = e206.piece, r10 = n10.lineFeedCnt, i10 = this.offsetInBuffer(n10.bufferIndex, n10.start), a10 = t10, o10 = this.getLineFeedCnt(n10.bufferIndex, a10, n10.end), s10 = this.offsetInBuffer(n10.bufferIndex, a10), c10 = o10 - r10, l10 = i10 - s10, u10 = n10.length + l10;
    e206.piece = new pD(n10.bufferIndex, a10, n10.end, o10, u10), cD(this, e206, l10, c10);
  }
  shrinkNode(e206, t10, n10) {
    let r10 = e206.piece, i10 = r10.start, a10 = r10.end, o10 = r10.length, s10 = r10.lineFeedCnt, c10 = t10, l10 = this.getLineFeedCnt(r10.bufferIndex, r10.start, c10), u10 = this.offsetInBuffer(r10.bufferIndex, t10) - this.offsetInBuffer(r10.bufferIndex, i10);
    e206.piece = new pD(r10.bufferIndex, r10.start, c10, l10, u10), cD(this, e206, u10 - o10, l10 - s10);
    let d10 = new pD(r10.bufferIndex, n10, a10, this.getLineFeedCnt(r10.bufferIndex, n10, a10), this.offsetInBuffer(r10.bufferIndex, a10) - this.offsetInBuffer(r10.bufferIndex, n10)), f10 = this.rbInsertRight(e206, d10);
    this.validateCRLFWithPrevNode(f10);
  }
  appendToNode(e206, t10) {
    this.adjustCarriageReturnFromNext(t10, e206) && (t10 += `
`);
    let n10 = this.shouldCheckCRLF() && this.startWithLF(t10) && this.endWithCR(e206), r10 = this._buffers[0].buffer.length;
    this._buffers[0].buffer += t10;
    let i10 = fD(t10, false);
    for (let e207 = 0; e207 < i10.length; e207++) i10[e207] += r10;
    if (n10) {
      let e207 = this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 2];
      this._buffers[0].lineStarts.pop(), this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line - 1, column: r10 - e207 };
    }
    this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(i10.slice(1));
    let a10 = this._buffers[0].lineStarts.length - 1, o10 = { line: a10, column: this._buffers[0].buffer.length - this._buffers[0].lineStarts[a10] }, s10 = e206.piece.length + t10.length, c10 = e206.piece.lineFeedCnt, l10 = this.getLineFeedCnt(0, e206.piece.start, o10), u10 = l10 - c10;
    e206.piece = new pD(e206.piece.bufferIndex, e206.piece.start, o10, l10, s10), this._lastChangeBufferPos = o10, cD(this, e206, t10.length, u10);
  }
  nodeAt(e206) {
    let t10 = this.root, n10 = this._searchCache.get(e206);
    if (n10) return { node: n10.node, nodeStartOffset: n10.nodeStartOffset, remainder: e206 - n10.nodeStartOffset };
    let r10 = 0;
    for (; t10 !== QE; ) if (t10.size_left > e206) t10 = t10.left;
    else if (t10.size_left + t10.piece.length >= e206) {
      r10 += t10.size_left;
      let n11 = { node: t10, remainder: e206 - t10.size_left, nodeStartOffset: r10 };
      return this._searchCache.set(n11), n11;
    } else e206 -= t10.size_left + t10.piece.length, r10 += t10.size_left + t10.piece.length, t10 = t10.right;
    return null;
  }
  nodeAt2(e206, t10) {
    let n10 = this.root, r10 = 0;
    for (; n10 !== QE; ) if (n10.left !== QE && n10.lf_left >= e206 - 1) n10 = n10.left;
    else if (n10.lf_left + n10.piece.lineFeedCnt > e206 - 1) {
      let i10 = this.getAccumulatedValue(n10, e206 - n10.lf_left - 2), a10 = this.getAccumulatedValue(n10, e206 - n10.lf_left - 1);
      return r10 += n10.size_left, { node: n10, remainder: Math.min(i10 + t10 - 1, a10), nodeStartOffset: r10 };
    } else if (n10.lf_left + n10.piece.lineFeedCnt === e206 - 1) {
      let i10 = this.getAccumulatedValue(n10, e206 - n10.lf_left - 2);
      if (i10 + t10 - 1 <= n10.piece.length) return { node: n10, remainder: i10 + t10 - 1, nodeStartOffset: r10 };
      t10 -= n10.piece.length - i10;
      break;
    } else e206 -= n10.lf_left + n10.piece.lineFeedCnt, r10 += n10.size_left + n10.piece.length, n10 = n10.right;
    for (n10 = n10.next(); n10 !== QE; ) {
      if (n10.piece.lineFeedCnt > 0) {
        let e207 = this.getAccumulatedValue(n10, 0), r11 = this.offsetOfNode(n10);
        return { node: n10, remainder: Math.min(t10 - 1, e207), nodeStartOffset: r11 };
      } else if (n10.piece.length >= t10 - 1) {
        let e207 = this.offsetOfNode(n10);
        return { node: n10, remainder: t10 - 1, nodeStartOffset: e207 };
      } else t10 -= n10.piece.length;
      n10 = n10.next();
    }
    return null;
  }
  nodeCharCodeAt(e206, t10) {
    if (e206.piece.lineFeedCnt < 1) return -1;
    let n10 = this._buffers[e206.piece.bufferIndex], r10 = this.offsetInBuffer(e206.piece.bufferIndex, e206.piece.start) + t10;
    return n10.buffer.charCodeAt(r10);
  }
  offsetOfNode(e206) {
    if (!e206) return 0;
    let t10 = e206.size_left;
    for (; e206 !== this.root; ) e206.parent.right === e206 && (t10 += e206.parent.size_left + e206.parent.piece.length), e206 = e206.parent;
    return t10;
  }
  shouldCheckCRLF() {
    return !(this._EOLNormalized && this._EOL === `
`);
  }
  startWithLF(e206) {
    if (typeof e206 == `string`) return e206.charCodeAt(0) === 10;
    if (e206 === QE || e206.piece.lineFeedCnt === 0) return false;
    let t10 = e206.piece, n10 = this._buffers[t10.bufferIndex].lineStarts, r10 = t10.start.line, i10 = n10[r10] + t10.start.column;
    return r10 === n10.length - 1 || n10[r10 + 1] > i10 + 1 ? false : this._buffers[t10.bufferIndex].buffer.charCodeAt(i10) === 10;
  }
  endWithCR(e206) {
    return typeof e206 == `string` ? e206.charCodeAt(e206.length - 1) === 13 : e206 === QE || e206.piece.lineFeedCnt === 0 ? false : this.nodeCharCodeAt(e206, e206.piece.length - 1) === 13;
  }
  validateCRLFWithPrevNode(e206) {
    if (this.shouldCheckCRLF() && this.startWithLF(e206)) {
      let t10 = e206.prev();
      this.endWithCR(t10) && this.fixCRLF(t10, e206);
    }
  }
  validateCRLFWithNextNode(e206) {
    if (this.shouldCheckCRLF() && this.endWithCR(e206)) {
      let t10 = e206.next();
      this.startWithLF(t10) && this.fixCRLF(e206, t10);
    }
  }
  fixCRLF(e206, t10) {
    let n10 = [], r10 = this._buffers[e206.piece.bufferIndex].lineStarts, i10;
    i10 = e206.piece.end.column === 0 ? { line: e206.piece.end.line - 1, column: r10[e206.piece.end.line] - r10[e206.piece.end.line - 1] - 1 } : { line: e206.piece.end.line, column: e206.piece.end.column - 1 };
    let a10 = e206.piece.length - 1, o10 = e206.piece.lineFeedCnt - 1;
    e206.piece = new pD(e206.piece.bufferIndex, e206.piece.start, i10, o10, a10), cD(this, e206, -1, -1), e206.piece.length === 0 && n10.push(e206);
    let s10 = { line: t10.piece.start.line + 1, column: 0 }, c10 = t10.piece.length - 1, l10 = this.getLineFeedCnt(t10.piece.bufferIndex, s10, t10.piece.end);
    t10.piece = new pD(t10.piece.bufferIndex, s10, t10.piece.end, l10, c10), cD(this, t10, -1, -1), t10.piece.length === 0 && n10.push(t10);
    let u10 = this.createNewPieces(`\r
`);
    this.rbInsertRight(e206, u10[0]);
    for (let e207 = 0; e207 < n10.length; e207++) oD(this, n10[e207]);
  }
  adjustCarriageReturnFromNext(e206, t10) {
    if (this.shouldCheckCRLF() && this.endWithCR(e206)) {
      let n10 = t10.next();
      if (this.startWithLF(n10)) {
        if (e206 += `
`, n10.piece.length === 1) oD(this, n10);
        else {
          let e207 = n10.piece, t11 = { line: e207.start.line + 1, column: 0 }, r10 = e207.length - 1, i10 = this.getLineFeedCnt(e207.bufferIndex, t11, e207.end);
          n10.piece = new pD(e207.bufferIndex, t11, e207.end, i10, r10), cD(this, n10, -1, -1);
        }
        return true;
      }
    }
    return false;
  }
  iterate(e206, t10) {
    return e206 === QE ? t10(QE) : this.iterate(e206.left, t10) && t10(e206) && this.iterate(e206.right, t10);
  }
  getNodeContent(e206) {
    if (e206 === QE) return ``;
    let t10 = this._buffers[e206.piece.bufferIndex], n10 = e206.piece, r10 = this.offsetInBuffer(n10.bufferIndex, n10.start), i10 = this.offsetInBuffer(n10.bufferIndex, n10.end);
    return t10.buffer.substring(r10, i10);
  }
  getPieceContent(e206) {
    let t10 = this._buffers[e206.bufferIndex], n10 = this.offsetInBuffer(e206.bufferIndex, e206.start), r10 = this.offsetInBuffer(e206.bufferIndex, e206.end);
    return t10.buffer.substring(n10, r10);
  }
  rbInsertRight(e206, t10) {
    let n10 = new ZE(t10, 1);
    if (n10.left = QE, n10.right = QE, n10.parent = QE, n10.size_left = 0, n10.lf_left = 0, this.root === QE) this.root = n10, n10.color = 0;
    else if (e206.right === QE) e206.right = n10, n10.parent = e206;
    else {
      let t11 = $E(e206.right);
      t11.left = n10, n10.parent = t11;
    }
    return sD(this, n10), n10;
  }
  rbInsertLeft(e206, t10) {
    let n10 = new ZE(t10, 1);
    if (n10.left = QE, n10.right = QE, n10.parent = QE, n10.size_left = 0, n10.lf_left = 0, this.root === QE) this.root = n10, n10.color = 0;
    else if (e206.left === QE) e206.left = n10, n10.parent = e206;
    else {
      let t11 = eD(e206.left);
      t11.right = n10, n10.parent = t11;
    }
    return sD(this, n10), n10;
  }
}, hD = class e116 extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this._onDidChangeContent = this._register(new k()), this._BOM = t10, this._mightContainNonBasicASCII = !a10, this._mightContainRTL = r10, this._mightContainUnusualLineTerminators = i10, this._pieceTree = new Dde(e206, n10, o10);
  }
  mightContainRTL() {
    return this._mightContainRTL;
  }
  mightContainUnusualLineTerminators() {
    return this._mightContainUnusualLineTerminators;
  }
  resetMightContainUnusualLineTerminators() {
    this._mightContainUnusualLineTerminators = false;
  }
  mightContainNonBasicASCII() {
    return this._mightContainNonBasicASCII;
  }
  getBOM() {
    return this._BOM;
  }
  getEOL() {
    return this._pieceTree.getEOL();
  }
  createSnapshot(e206) {
    return this._pieceTree.createSnapshot(e206 ? this._BOM : ``);
  }
  getOffsetAt(e206, t10) {
    return this._pieceTree.getOffsetAt(e206, t10);
  }
  getPositionAt(e206) {
    return this._pieceTree.getPositionAt(e206);
  }
  getRangeAt(e206, t10) {
    let n10 = e206 + t10, r10 = this.getPositionAt(e206), i10 = this.getPositionAt(n10);
    return new M(r10.lineNumber, r10.column, i10.lineNumber, i10.column);
  }
  getValueInRange(e206, t10 = 0) {
    if (e206.isEmpty()) return ``;
    let n10 = this._getEndOfLine(t10);
    return this._pieceTree.getValueInRange(e206, n10);
  }
  getValueLengthInRange(e206, t10 = 0) {
    if (e206.isEmpty()) return 0;
    if (e206.startLineNumber === e206.endLineNumber) return e206.endColumn - e206.startColumn;
    let n10 = this.getOffsetAt(e206.startLineNumber, e206.startColumn), r10 = this.getOffsetAt(e206.endLineNumber, e206.endColumn), i10 = 0, a10 = this._getEndOfLine(t10), o10 = this.getEOL();
    return a10.length !== o10.length && (i10 = (a10.length - o10.length) * (e206.endLineNumber - e206.startLineNumber)), r10 - n10 + i10;
  }
  getCharacterCountInRange(e206, t10 = 0) {
    if (this._mightContainNonBasicASCII) {
      let n10 = 0, r10 = e206.startLineNumber, i10 = e206.endLineNumber;
      for (let t11 = r10; t11 <= i10; t11++) {
        let a10 = this.getLineContent(t11), o10 = t11 === r10 ? e206.startColumn - 1 : 0, s10 = t11 === i10 ? e206.endColumn - 1 : a10.length;
        for (let e207 = o10; e207 < s10; e207++) ao(a10.charCodeAt(e207)) ? (n10 += 1, e207 += 1) : n10 += 1;
      }
      return n10 += this._getEndOfLine(t10).length * (i10 - r10), n10;
    }
    return this.getValueLengthInRange(e206, t10);
  }
  getNearestChunk(e206) {
    return this._pieceTree.getNearestChunk(e206);
  }
  getLength() {
    return this._pieceTree.getLength();
  }
  getLineCount() {
    return this._pieceTree.getLineCount();
  }
  getLinesContent() {
    return this._pieceTree.getLinesContent();
  }
  getLineContent(e206) {
    return this._pieceTree.getLineContent(e206);
  }
  getLineCharCode(e206, t10) {
    return this._pieceTree.getLineCharCode(e206, t10);
  }
  getLineLength(e206) {
    return this._pieceTree.getLineLength(e206);
  }
  getLineFirstNonWhitespaceColumn(e206) {
    let t10 = Ga(this.getLineContent(e206));
    return t10 === -1 ? 0 : t10 + 1;
  }
  getLineLastNonWhitespaceColumn(e206) {
    let t10 = qa(this.getLineContent(e206));
    return t10 === -1 ? 0 : t10 + 2;
  }
  _getEndOfLine(e206) {
    switch (e206) {
      case 1:
        return `
`;
      case 2:
        return `\r
`;
      case 0:
        return this.getEOL();
      default:
        throw Error(`Unknown EOL preference`);
    }
  }
  setEOL(e206) {
    this._pieceTree.setEOL(e206);
  }
  applyEdits(t10, n10, r10) {
    let i10 = this._mightContainRTL, a10 = this._mightContainUnusualLineTerminators, o10 = this._mightContainNonBasicASCII, s10 = true, c10 = [];
    for (let e206 = 0; e206 < t10.length; e206++) {
      let n11 = t10[e206];
      s10 && n11._isTracked && (s10 = false);
      let r11 = n11.range;
      if (n11.text) {
        let e207 = true;
        o10 || (o10 = (e207 = !go(n11.text), e207)), !i10 && e207 && (i10 = ho(n11.text)), !a10 && e207 && (a10 = vo(n11.text));
      }
      let l11 = ``, u11 = 0, d11 = 0, f11 = 0;
      if (n11.text) {
        let e207;
        [u11, d11, f11, e207] = pT(n11.text);
        let t11 = this.getEOL();
        l11 = e207 === 0 || e207 === (t11 === `\r
` ? 2 : 1) ? n11.text : n11.text.replace(/\r\n|\r|\n/g, t11);
      }
      c10[e206] = { sortIndex: e206, identifier: n11.identifier || null, range: r11, rangeOffset: this.getOffsetAt(r11.startLineNumber, r11.startColumn), rangeLength: this.getValueLengthInRange(r11), text: l11, eolCount: u11, firstLineLength: d11, lastLineLength: f11, forceMoveMarkers: !!n11.forceMoveMarkers, isAutoWhitespaceEdit: n11.isAutoWhitespaceEdit || false };
    }
    c10.sort(e116._sortOpsAscending);
    let l10 = false;
    for (let e206 = 0, t11 = c10.length - 1; e206 < t11; e206++) {
      let t12 = c10[e206].range.getEndPosition(), n11 = c10[e206 + 1].range.getStartPosition();
      if (n11.isBeforeOrEqual(t12)) {
        if (n11.isBefore(t12)) throw Error(`Overlapping ranges are not allowed!`);
        l10 = true;
      }
    }
    s10 && (c10 = this._reduceOperations(c10));
    let u10 = r10 || n10 ? e116._getInverseEditRanges(c10) : [], d10 = [];
    if (n10) for (let e206 = 0; e206 < c10.length; e206++) {
      let t11 = c10[e206], n11 = u10[e206];
      if (t11.isAutoWhitespaceEdit && t11.range.isEmpty()) for (let e207 = n11.startLineNumber; e207 <= n11.endLineNumber; e207++) {
        let r11 = ``;
        e207 === n11.startLineNumber && (r11 = this.getLineContent(t11.range.startLineNumber), Ga(r11) !== -1) || d10.push({ lineNumber: e207, oldContent: r11 });
      }
    }
    let f10 = null;
    if (r10) {
      let e206 = 0;
      f10 = [];
      for (let t11 = 0; t11 < c10.length; t11++) {
        let n11 = c10[t11], r11 = u10[t11], i11 = this.getValueInRange(n11.range), a11 = n11.rangeOffset + e206;
        e206 += n11.text.length - i11.length, f10[t11] = { sortIndex: n11.sortIndex, identifier: n11.identifier, range: r11, text: i11, textChange: new dE(n11.rangeOffset, i11, a11, n11.text) };
      }
      l10 || f10.sort((e207, t11) => e207.sortIndex - t11.sortIndex);
    }
    this._mightContainRTL = i10, this._mightContainUnusualLineTerminators = a10, this._mightContainNonBasicASCII = o10;
    let p10 = this._doApplyEdits(c10), m10 = null;
    if (n10 && d10.length > 0) {
      d10.sort((e206, t11) => t11.lineNumber - e206.lineNumber), m10 = [];
      for (let e206 = 0, t11 = d10.length; e206 < t11; e206++) {
        let t12 = d10[e206].lineNumber;
        if (e206 > 0 && d10[e206 - 1].lineNumber === t12) continue;
        let n11 = d10[e206].oldContent, r11 = this.getLineContent(t12);
        r11.length === 0 || r11 === n11 || Ga(r11) !== -1 || m10.push(t12);
      }
    }
    return this._onDidChangeContent.fire(), new sm(f10, p10, m10);
  }
  _reduceOperations(e206) {
    return e206.length < 1e3 ? e206 : [this._toSingleEditOperation(e206)];
  }
  _toSingleEditOperation(e206) {
    let t10 = false, n10 = e206[0].range, r10 = e206[e206.length - 1].range, i10 = new M(n10.startLineNumber, n10.startColumn, r10.endLineNumber, r10.endColumn), a10 = n10.startLineNumber, o10 = n10.startColumn, s10 = [];
    for (let n11 = 0, r11 = e206.length; n11 < r11; n11++) {
      let r12 = e206[n11], i11 = r12.range;
      t10 || (t10 = r12.forceMoveMarkers), s10.push(this.getValueInRange(new M(a10, o10, i11.startLineNumber, i11.startColumn))), r12.text.length > 0 && s10.push(r12.text), a10 = i11.endLineNumber, o10 = i11.endColumn;
    }
    let c10 = s10.join(``), [l10, u10, d10] = pT(c10);
    return { sortIndex: 0, identifier: e206[0].identifier, range: i10, rangeOffset: this.getOffsetAt(i10.startLineNumber, i10.startColumn), rangeLength: this.getValueLengthInRange(i10, 0), text: c10, eolCount: l10, firstLineLength: u10, lastLineLength: d10, forceMoveMarkers: t10, isAutoWhitespaceEdit: false };
  }
  _doApplyEdits(t10) {
    t10.sort(e116._sortOpsDescending);
    let n10 = [];
    for (let e206 = 0; e206 < t10.length; e206++) {
      let r10 = t10[e206], i10 = r10.range.startLineNumber, a10 = r10.range.startColumn, o10 = r10.range.endLineNumber, s10 = r10.range.endColumn;
      if (i10 === o10 && a10 === s10 && r10.text.length === 0) continue;
      r10.text ? (this._pieceTree.delete(r10.rangeOffset, r10.rangeLength), this._pieceTree.insert(r10.rangeOffset, r10.text, true)) : this._pieceTree.delete(r10.rangeOffset, r10.rangeLength);
      let c10 = new M(i10, a10, o10, s10);
      n10.push({ range: c10, rangeLength: r10.rangeLength, text: r10.text, rangeOffset: r10.rangeOffset, forceMoveMarkers: r10.forceMoveMarkers });
    }
    return n10;
  }
  findMatchesLineByLine(e206, t10, n10, r10) {
    return this._pieceTree.findMatchesLineByLine(e206, t10, n10, r10);
  }
  static _getInverseEditRanges(e206) {
    let t10 = [], n10 = 0, r10 = 0, i10 = null;
    for (let a10 = 0, o10 = e206.length; a10 < o10; a10++) {
      let o11 = e206[a10], s10, c10;
      i10 ? i10.range.endLineNumber === o11.range.startLineNumber ? (s10 = n10, c10 = r10 + (o11.range.startColumn - i10.range.endColumn)) : (s10 = n10 + (o11.range.startLineNumber - i10.range.endLineNumber), c10 = o11.range.startColumn) : (s10 = o11.range.startLineNumber, c10 = o11.range.startColumn);
      let l10;
      if (o11.text.length > 0) {
        let e207 = o11.eolCount + 1;
        l10 = e207 === 1 ? new M(s10, c10, s10, c10 + o11.firstLineLength) : new M(s10, c10, s10 + e207 - 1, o11.lastLineLength + 1);
      } else l10 = new M(s10, c10, s10, c10);
      n10 = l10.endLineNumber, r10 = l10.endColumn, t10.push(l10), i10 = o11;
    }
    return t10;
  }
  static _sortOpsAscending(e206, t10) {
    let n10 = M.compareRangesUsingEnds(e206.range, t10.range);
    return n10 === 0 ? e206.sortIndex - t10.sortIndex : n10;
  }
  static _sortOpsDescending(e206, t10) {
    let n10 = M.compareRangesUsingEnds(e206.range, t10.range);
    return n10 === 0 ? t10.sortIndex - e206.sortIndex : -n10;
  }
}, Ode = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    this._chunks = e206, this._bom = t10, this._cr = n10, this._lf = r10, this._crlf = i10, this._containsRTL = a10, this._containsUnusualLineTerminators = o10, this._isBasicASCII = s10, this._normalizeEOL = c10;
  }
  _getEOL(e206) {
    let t10 = this._cr + this._lf + this._crlf, n10 = this._cr + this._crlf;
    return t10 === 0 ? e206 === 1 ? `
` : `\r
` : n10 > t10 / 2 ? `\r
` : `
`;
  }
  create(e206) {
    let t10 = this._getEOL(e206), n10 = this._chunks;
    if (this._normalizeEOL && (t10 === `\r
` && (this._cr > 0 || this._lf > 0) || t10 === `
` && (this._cr > 0 || this._crlf > 0))) for (let e207 = 0, r11 = n10.length; e207 < r11; e207++) {
      let r12 = n10[e207].buffer.replace(/\r\n|\r|\n/g, t10);
      n10[e207] = new mD(r12, fD(r12));
    }
    let r10 = new hD(n10, this._bom, t10, this._containsRTL, this._containsUnusualLineTerminators, this._isBasicASCII, this._normalizeEOL);
    return { textBuffer: r10, disposable: r10 };
  }
}, gD = class {
  constructor() {
    this.chunks = [], this.BOM = ``, this._hasPreviousChar = false, this._previousChar = 0, this._tmpLineStarts = [], this.cr = 0, this.lf = 0, this.crlf = 0, this.containsRTL = false, this.containsUnusualLineTerminators = false, this.isBasicASCII = true;
  }
  acceptChunk(e206) {
    if (e206.length === 0) return;
    this.chunks.length === 0 && xo(e206) && (this.BOM = `\uFEFF`, e206 = e206.substr(1));
    let t10 = e206.charCodeAt(e206.length - 1);
    t10 === 13 || t10 >= 55296 && t10 <= 56319 ? (this._acceptChunk1(e206.substr(0, e206.length - 1), false), this._hasPreviousChar = true, this._previousChar = t10) : (this._acceptChunk1(e206, false), this._hasPreviousChar = false, this._previousChar = t10);
  }
  _acceptChunk1(e206, t10) {
    !t10 && e206.length === 0 || (this._hasPreviousChar ? this._acceptChunk2(String.fromCharCode(this._previousChar) + e206) : this._acceptChunk2(e206));
  }
  _acceptChunk2(e206) {
    let t10 = wde(this._tmpLineStarts, e206);
    this.chunks.push(new mD(e206, t10.lineStarts)), this.cr += t10.cr, this.lf += t10.lf, this.crlf += t10.crlf, t10.isBasicASCII || (this.isBasicASCII = false, this.containsRTL || (this.containsRTL = ho(e206)), this.containsUnusualLineTerminators || (this.containsUnusualLineTerminators = vo(e206)));
  }
  finish(e206 = true) {
    return this._finish(), new Ode(this.chunks, this.BOM, this.cr, this.lf, this.crlf, this.containsRTL, this.containsUnusualLineTerminators, this.isBasicASCII, e206);
  }
  _finish() {
    if (this.chunks.length === 0 && this._acceptChunk1(``, true), this._hasPreviousChar) {
      this._hasPreviousChar = false;
      let e206 = this.chunks[this.chunks.length - 1];
      e206.buffer += String.fromCharCode(this._previousChar), e206.lineStarts = fD(e206.buffer), this._previousChar === 13 && this.cr++;
    }
  }
};
function _D2(e206, t10 = Gs.ofCaller()) {
  return typeof e206 == `string` ? new vD(e206, void 0, t10) : new vD(void 0, e206, t10);
}
var vD = class extends sc {
  get debugName() {
    return new Zs(this._owner, this._debugName, void 0).getDebugName(this) ?? `Observable Signal`;
  }
  toString() {
    return this.debugName;
  }
  constructor(e206, t10, n10) {
    super(n10), this._debugName = e206, this._owner = t10;
  }
  trigger(e206, t10) {
    if (!e206) {
      bc((e207) => {
        this.trigger(e207, t10);
      }, () => `Trigger signal ${this.debugName}`);
      return;
    }
    for (let n10 of this._observers) e206.updateObserver(n10, this), n10.handleChange(this, t10);
  }
  get() {
  }
}, kde = class extends sc {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? `LazyObservableValue`;
  }
  constructor(e206, t10, n10, r10) {
    super(r10), this._debugNameData = e206, this._equalityComparator = n10, this._isUpToDate = true, this._deltas = [], this._updateCounter = 0, this._value = t10;
  }
  get() {
    return this._update(), this._value;
  }
  _update() {
    if (!this._isUpToDate) if (this._isUpToDate = true, this._deltas.length > 0) {
      for (let e206 of this._deltas) {
        Us()?.handleObservableUpdated(this, { change: e206, didChange: true, oldValue: `(unknown)`, newValue: this._value, hadValue: true });
        for (let t10 of this._observers) t10.handleChange(this, e206);
      }
      this._deltas.length = 0;
    } else {
      Us()?.handleObservableUpdated(this, { change: void 0, didChange: true, oldValue: `(unknown)`, newValue: this._value, hadValue: true });
      for (let e206 of this._observers) e206.handleChange(this, void 0);
    }
  }
  _beginUpdate() {
    if (this._updateCounter++, this._updateCounter === 1) for (let e206 of this._observers) e206.beginUpdate(this);
  }
  _endUpdate() {
    if (this._updateCounter--, this._updateCounter === 0) {
      this._update();
      let e206 = [...this._observers];
      for (let t10 of e206) t10.endUpdate(this);
    }
  }
  addObserver(e206) {
    let t10 = !this._observers.has(e206) && this._updateCounter > 0;
    super.addObserver(e206), t10 && e206.beginUpdate(this);
  }
  removeObserver(e206) {
    let t10 = this._observers.has(e206) && this._updateCounter > 0;
    super.removeObserver(e206), t10 && e206.endUpdate(this);
  }
  set(e206, t10, n10) {
    if (n10 === void 0 && this._equalityComparator(this._value, e206)) return;
    let r10;
    t10 || (t10 = r10 = new wc(() => {
    }, () => `Setting ${this.debugName}`));
    try {
      if (this._isUpToDate = false, this._setValue(e206), n10 !== void 0 && this._deltas.push(n10), t10.updateObserver({ beginUpdate: () => this._beginUpdate(), endUpdate: () => this._endUpdate(), handleChange: (e207, t11) => {
      }, handlePossibleChange: (e207) => {
      } }, this), this._updateCounter > 1) for (let e207 of this._observers) e207.handlePossibleChange(this);
    } finally {
      r10 && r10.finish();
    }
  }
  toString() {
    return `${this.debugName}: ${this._value}`;
  }
  _setValue(e206) {
    this._value = e206;
  }
};
function yD(e206, t10, n10 = Gs.ofCaller()) {
  return e206.lazy ? new kde(new Zs(e206.owner, e206.debugName, void 0), t10, e206.equalsFn ?? Ks, n10) : new Lc(new Zs(e206.owner, e206.debugName, void 0), t10, e206.equalsFn ?? Ks, n10);
}
var Ade = class {
  constructor() {
    this._onDidChangeVisibleRanges = new k(), this.onDidChangeVisibleRanges = this._onDidChangeVisibleRanges.event, this._views = /* @__PURE__ */ new Set(), this._viewsChanged = _D2(this), this.visibleLineRanges = dc({ owner: this, equalsFn: qs(Js()) }, (e206) => (this._viewsChanged.read(e206), zm.joinMany([...this._views].map((t10) => t10.state.read(e206)?.visibleLineRanges ?? []))));
  }
  attachView() {
    let e206 = new bD((t10) => {
      this._onDidChangeVisibleRanges.fire({ view: e206, state: t10 });
    });
    return this._views.add(e206), this._viewsChanged.trigger(void 0), e206;
  }
  detachView(e206) {
    this._views.delete(e206), this._onDidChangeVisibleRanges.fire({ view: e206, state: void 0 }), this._viewsChanged.trigger(void 0);
  }
}, jde = class {
  constructor(e206, t10) {
    this.visibleLineRanges = e206, this.stabilized = t10;
  }
  equals(e206) {
    return this === e206 ? true : !(!o(this.visibleLineRanges, e206.visibleLineRanges, (e207, t10) => e207.equals(t10)) || this.stabilized !== e206.stabilized);
  }
}, bD = class {
  get state() {
    return this._state;
  }
  constructor(e206) {
    this.handleStateChange = e206, this._state = yD({ owner: this, equalsFn: Ys((e207, t10) => e207.equals(t10)) }, void 0);
  }
  setVisibleLines(e206, t10) {
    let n10 = new jde(e206.map((e207) => new zm(e207.startLineNumber, e207.endLineNumber + 1)), t10);
    this._state.set(n10, void 0, void 0), this.handleStateChange(n10);
  }
}, xD = class extends D {
  get lineRanges() {
    return this._lineRanges;
  }
  constructor(e206) {
    super(), this._refreshTokens = e206, this.runner = this._register(new us(() => this.update(), 50)), this._computedLineRanges = [], this._lineRanges = [];
  }
  update() {
    o(this._computedLineRanges, this._lineRanges, (e206, t10) => e206.equals(t10)) || (this._computedLineRanges = this._lineRanges, this._refreshTokens());
  }
  handleStateChange(e206) {
    this._lineRanges = e206.visibleLineRanges, e206.stabilized ? (this.runner.cancel(), this.update()) : this.runner.schedule();
  }
}, SD = class extends D {
  get backgroundTokenizationState() {
    return this._backgroundTokenizationState;
  }
  constructor(e206, t10) {
    super(), this._languageIdCodec = e206, this._textModel = t10, this._onDidChangeTokens = this._register(new k()), this.onDidChangeTokens = this._onDidChangeTokens.event;
  }
  tokenizeIfCheap(e206) {
    this.isCheapToTokenize(e206) && this.forceTokenization(e206);
  }
};
function CD(e206, t10) {
  let n10 = e206.gotoNextSibling(), r10 = t10.gotoNextSibling();
  if (n10 !== r10) throw Error(`Trees are out of sync`);
  return n10 && r10;
}
function wD(e206, t10) {
  let n10 = e206.gotoParent(), r10 = t10.gotoParent();
  if (n10 !== r10) throw Error(`Trees are out of sync`);
  return n10 && r10;
}
function TD(e206, t10, n10) {
  let r10 = e206.gotoFirstChild(), i10 = t10.gotoFirstChild();
  if (r10 !== i10) throw Error(`Trees are out of sync`);
  if (n10 === 0) return r10 && i10;
  for (let r11 = 1; r11 <= n10; r11++) {
    let n11 = e206.gotoNextSibling(), r12 = t10.gotoNextSibling();
    if (n11 !== r12) throw Error(`Trees are out of sync`);
    if (!n11 || !r12) return false;
  }
  return r10 && i10;
}
function ED(e206, t10) {
  do {
    if (e206.currentNode.nextSibling) return CD(e206, t10);
    e206.currentNode.parent && wD(e206, t10);
  } while (e206.currentNode.nextSibling || e206.currentNode.parent);
  return false;
}
function DD(e206, t10) {
  let n10 = t10.walk();
  n10.resetTo(e206);
  let r10 = e206.currentNode;
  do
    if (n10.currentNode.previousSibling && n10.currentNode.endIndex - n10.currentNode.startIndex !== 0) n10.gotoPreviousSibling();
    else {
      for (; !n10.currentNode.previousSibling && n10.currentNode.parent; ) n10.gotoParent();
      n10.gotoPreviousSibling();
    }
  while (n10.currentNode.endIndex > r10.startIndex && (n10.currentNode.parent || n10.currentNode.previousSibling) && n10.currentNode.id !== r10.id);
  if (n10.currentNode.id !== r10.id && n10.currentNode.endIndex <= r10.startIndex) return n10.currentNode;
}
var OD = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, kD = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, AD = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this.languageId = e206, this._ranges = t10, this._parser = n10, this._parserClass = r10, this.textModel = i10, this._logService = a10, this._telemetryService = o10, this._tree = Ic(this, void 0), this.tree = this._tree, this._treeLastParsedVersion = Ic(this, -1), this.treeLastParsedVersion = this._treeLastParsedVersion, this._onDidChangeContentQueue = new ss(), this._tree = Ic(this, void 0), this.tree = this._tree, this._register(T(() => {
      this._tree.get()?.delete(), this._lastFullyParsed?.delete(), this._lastFullyParsedWithEdits?.delete(), this._parser.delete();
    })), this.handleContentChange(void 0, this._ranges);
  }
  handleContentChange(e206, t10) {
    let n10 = this.textModel.getVersionId(), r10 = [];
    t10 && (r10 = this._setRanges(t10)), e206 && this._applyEdits(e206.changes), this._onDidChangeContentQueue.clearPending(), this._onDidChangeContentQueue.schedule(async () => {
      if (this._store.isDisposed) return;
      let e207 = this._lastFullyParsed, t11;
      this._lastFullyParsedWithEdits && this._lastFullyParsed && (t11 = this._findChangedNodes(this._lastFullyParsedWithEdits, this._lastFullyParsed));
      let i10 = await this._parseAndUpdateTree(n10);
      if (i10) {
        let a10;
        t11 ? e207 && t11 && (a10 = this._findTreeChanges(i10, t11, r10)) : this._ranges && (a10 = this._ranges.map((e208) => ({ newRange: new M(e208.startPosition.row + 1, e208.startPosition.column + 1, e208.endPosition.row + 1, e208.endPosition.column + 1), oldRangeLength: e208.endIndex - e208.startIndex, newRangeStartOffset: e208.startIndex, newRangeEndOffset: e208.endIndex }))), a10 || (a10 = [{ newRange: this.textModel.getFullModelRange(), newRangeStartOffset: 0, newRangeEndOffset: this.textModel.getValueLength() }]);
        let o10 = this._tree.get();
        bc((e208) => {
          this._tree.set(i10, e208, { ranges: a10, versionId: n10 }), this._treeLastParsedVersion.set(n10, e208);
        }), o10?.delete();
      }
    });
  }
  _applyEdits(e206) {
    for (let t10 of e206) {
      let e207 = Vm.ofRange(M.lift(t10.range)), n10 = Vm.ofText(t10.text), r10 = t10.text.length === 0 ? n10 : e207.add(n10), i10 = { startIndex: t10.rangeOffset, oldEndIndex: t10.rangeOffset + t10.rangeLength, newEndIndex: t10.rangeOffset + t10.text.length, startPosition: { row: t10.range.startLineNumber - 1, column: t10.range.startColumn - 1 }, oldEndPosition: { row: t10.range.endLineNumber - 1, column: t10.range.endColumn - 1 }, newEndPosition: { row: t10.range.startLineNumber + r10.lineCount - 1, column: r10.lineCount ? r10.columnCount : t10.range.endColumn + r10.columnCount } };
      this._tree.get()?.edit(i10), this._lastFullyParsedWithEdits?.edit(i10);
    }
  }
  _findChangedNodes(e206, t10) {
    if (this._ranges && this._ranges.every((t11) => t11.startPosition.row !== e206.rootNode.startPosition.row) || e206.rootNode.startPosition.row !== 0) return [];
    let n10 = e206.walk(), r10 = t10.walk(), i10 = [], a10 = true;
    do
      if (n10.currentNode.hasChanges) {
        let t11 = n10.currentNode.children, o10 = [], s10 = t11.filter((e207, t12) => e207?.hasChanges || r10.currentNode.children.length <= t12 ? (o10.push(t12), true) : false);
        if (s10.length === 0 || n10.currentNode.hasError !== r10.currentNode.hasError) {
          for (; n10.currentNode.parent && a10 && !n10.currentNode.isNamed; ) a10 = wD(n10, r10);
          let t12 = n10.currentNode, o11 = DD(n10, e206) ?? t12;
          i10.push({ startIndex: o11.startIndex, endIndex: t12.endIndex, startPosition: o11.startPosition, endPosition: t12.endPosition }), a10 = ED(n10, r10);
        } else s10.length >= 1 && (a10 = TD(n10, r10, o10[0]));
      } else a10 = ED(n10, r10);
    while (a10);
    return n10.delete(), r10.delete(), i10;
  }
  _findTreeChanges(e206, t10, n10) {
    let r10 = 0, i10 = [];
    for (let a10 = 0; a10 < t10.length; a10++) {
      let o10 = t10[a10];
      if (i10.length > 0 && o10.startIndex >= i10[i10.length - 1].newRangeStartOffset && o10.endIndex <= i10[i10.length - 1].newRangeEndOffset) continue;
      let s10 = e206.walk(), c10 = () => s10.startIndex < o10.startIndex && s10.endIndex > o10.endIndex;
      for (; c10(); ) {
        let e207 = s10.gotoFirstChild(), t11 = false;
        for (; e207; ) if (c10() && s10.currentNode.isNamed) {
          t11 = true;
          break;
        } else e207 = s10.gotoNextSibling();
        if (!t11) {
          s10.gotoParent();
          break;
        }
        if (s10.currentNode.childCount === 0) break;
      }
      let l10 = s10.currentNode.startPosition, u10 = s10.currentNode.endPosition, d10 = s10.currentNode.startIndex, f10 = s10.currentNode.endIndex, p10 = { newRange: new M(l10.row + 1, l10.column + 1, u10.row + 1, u10.column + 1), newRangeStartOffset: d10, newRangeEndOffset: f10 };
      r10 < n10.length && ND(n10[r10], { startIndex: d10, endIndex: f10 }) ? (n10[r10].startIndex < p10.newRangeStartOffset && (p10.newRange = p10.newRange.setStartPosition(n10[r10].startPosition.row + 1, n10[r10].startPosition.column + 1), p10.newRangeStartOffset = n10[r10].startIndex), n10[r10].endIndex > p10.newRangeEndOffset && (p10.newRange = p10.newRange.setEndPosition(n10[r10].endPosition.row + 1, n10[r10].endPosition.column + 1), p10.newRangeEndOffset = n10[r10].endIndex), r10++) : r10 < n10.length && n10[r10].endIndex < p10.newRangeStartOffset && i10.push({ newRange: new M(n10[r10].startPosition.row + 1, n10[r10].startPosition.column + 1, n10[r10].endPosition.row + 1, n10[r10].endPosition.column + 1), newRangeStartOffset: n10[r10].startIndex, newRangeEndOffset: n10[r10].endIndex }), i10.length > 0 && i10[i10.length - 1].newRangeEndOffset >= p10.newRangeStartOffset ? (i10[i10.length - 1].newRange = M.fromPositions(i10[i10.length - 1].newRange.getStartPosition(), p10.newRange.getEndPosition()), i10[i10.length - 1].newRangeEndOffset = p10.newRangeEndOffset) : i10.push(p10);
    }
    return this._constrainRanges(i10);
  }
  _constrainRanges(e206) {
    if (!this._ranges) return e206;
    let t10 = [], n10 = 0, r10 = 0;
    for (; n10 < e206.length && r10 < this._ranges.length; ) {
      let i10 = e206[n10], a10 = this._ranges[r10];
      if (i10.newRangeEndOffset < a10.startIndex) n10++;
      else if (i10.newRangeStartOffset > a10.endIndex) r10++;
      else {
        let e207 = Math.max(i10.newRangeStartOffset, a10.startIndex), r11 = Math.min(i10.newRangeEndOffset, a10.endIndex), o10 = i10.newRange.intersectRanges(new M(a10.startPosition.row + 1, a10.startPosition.column + 1, a10.endPosition.row + 1, a10.endPosition.column + 1));
        t10.push({ newRange: o10, newRangeEndOffset: r11, newRangeStartOffset: e207 }), r11 < i10.newRangeEndOffset ? (i10.newRange = M.fromPositions(o10.getEndPosition(), i10.newRange.getEndPosition()), i10.newRangeStartOffset = r11 + 1) : n10++;
      }
    }
    return t10;
  }
  async _parseAndUpdateTree(e206) {
    let t10 = await this._parse();
    if (t10) return this._lastFullyParsed?.delete(), this._lastFullyParsed = t10.copy(), this._lastFullyParsedWithEdits?.delete(), this._lastFullyParsedWithEdits = t10.copy(), t10;
    this._tree.get() || this._parser.reset();
  }
  _parse() {
    let e206 = `fullParse`;
    return this._tree.get() && (e206 = `incrementalParse`), this._parseAndYield(e206);
  }
  async _parseAndYield(e206) {
    let t10 = 0, n10 = 0, r10 = this.textModel.getVersionId(), i10, a10 = jD();
    do {
      let e207 = performance.now();
      i10 = this._parser.parse((e208, t11) => this._parseCallback(e208), this._tree.get(), { progressCallback: a10, includedRanges: this._ranges }), t10 += performance.now() - e207, n10++, await new Promise((e208) => Nt(e208));
    } while (!this._store.isDisposed && !i10 && r10 === this.textModel.getVersionId());
    return this._sendParseTimeTelemetry(e206, t10, n10), i10 && r10 === this.textModel.getVersionId() ? i10 : void 0;
  }
  _parseCallback(e206) {
    try {
      return this.textModel.getTextBuffer().getNearestChunk(e206);
    } catch (e207) {
      this._logService.debug(`Error getting chunk for tree-sitter parsing`, e207);
    }
  }
  _setRanges(e206) {
    let t10 = [];
    if (this._ranges) for (let n10 of e206) {
      let e207 = false;
      for (let t11 = 0; t11 < this._ranges.length; t11++) {
        let r10 = this._ranges[t11];
        if (MD(r10, n10) || ND(r10, n10)) {
          e207 = true;
          break;
        }
      }
      e207 || t10.push(n10);
    }
    else t10.push(...e206);
    return this._ranges = e206, t10;
  }
  _sendParseTimeTelemetry(e206, t10, n10) {
    this._logService.debug(`Tree parsing (${e206}) took ${t10} ms and ${n10} passes.`), e206 === `fullParse` ? this._telemetryService.publicLog2(`treeSitter.fullParse`, { languageId: this.languageId, time: t10, passes: n10 }) : this._telemetryService.publicLog2(`treeSitter.incrementalParse`, { languageId: this.languageId, time: t10, passes: n10 });
  }
  createParsedTreeSync(e206) {
    let t10 = new this._parserClass();
    t10.setLanguage(this._parser.language);
    let n10 = t10.parse(e206);
    return t10.delete(), n10 ?? void 0;
  }
};
AD = OD([kD(5, Ud), kD(6, bd)], AD);
function jD() {
  let e206 = performance.now();
  return function(t10) {
    let n10 = performance.now();
    return n10 - e206 > 50 ? (e206 = n10, true) : false;
  };
}
function MD(e206, t10) {
  return e206.startPosition.row === t10.startPosition.row && e206.startPosition.column === t10.startPosition.column && e206.endPosition.row === t10.endPosition.row && e206.endPosition.column === t10.endPosition.column && e206.startIndex === t10.startIndex && e206.endIndex === t10.endIndex;
}
function ND(e206, t10) {
  return e206.startIndex <= t10.startIndex && e206.endIndex >= t10.startIndex || t10.startIndex <= e206.startIndex && t10.endIndex >= e206.startIndex;
}
var PD = class {
  constructor(e206) {
    this._default = e206, this._store = [];
  }
  get(e206) {
    return e206 < this._store.length ? this._store[e206] : this._default;
  }
  set(e206, t10) {
    for (; e206 >= this._store.length; ) this._store[this._store.length] = this._default;
    this._store[e206] = t10;
  }
  replace(e206, t10, n10) {
    if (e206 >= this._store.length) return;
    if (t10 === 0) {
      this.insert(e206, n10);
      return;
    } else if (n10 === 0) {
      this.delete(e206, t10);
      return;
    }
    let r10 = this._store.slice(0, e206), i10 = this._store.slice(e206 + t10), a10 = FD(n10, this._default);
    this._store = r10.concat(a10, i10);
  }
  delete(e206, t10) {
    t10 === 0 || e206 >= this._store.length || this._store.splice(e206, t10);
  }
  insert(e206, t10) {
    if (t10 === 0 || e206 >= this._store.length) return;
    let n10 = [];
    for (let e207 = 0; e207 < t10; e207++) n10[e207] = this._default;
    this._store = x(this._store, e206, n10);
  }
};
function FD(e206, t10) {
  let n10 = [];
  for (let r10 = 0; r10 < e206; r10++) n10[r10] = t10;
  return n10;
}
var ID = class {
  get startLineNumber() {
    return this._startLineNumber;
  }
  get endLineNumber() {
    return this._startLineNumber + this._tokens.length - 1;
  }
  constructor(e206, t10) {
    this._startLineNumber = e206, this._tokens = t10;
  }
  getLineTokens(e206) {
    return this._tokens[e206 - this._startLineNumber];
  }
  appendLineTokens(e206) {
    this._tokens.push(e206);
  }
}, LD = class {
  constructor() {
    this._tokens = [];
  }
  add(e206, t10) {
    if (this._tokens.length > 0) {
      let n10 = this._tokens[this._tokens.length - 1];
      if (n10.endLineNumber + 1 === e206) {
        n10.appendLineTokens(t10);
        return;
      }
    }
    this._tokens.push(new ID(e206, [t10]));
  }
  finalize() {
    return this._tokens;
  }
}, RD = class {
  constructor(e206, t10) {
    this.tokenizationSupport = t10, this.initialState = this.tokenizationSupport.getInitialState(), this.store = new VD(e206);
  }
  getStartState(e206) {
    return this.store.getStartState(e206, this.initialState);
  }
  getFirstInvalidLine() {
    return this.store.getFirstInvalidLine(this.initialState);
  }
}, zD = class extends RD {
  constructor(e206, t10, n10, r10) {
    super(e206, t10), this._textModel = n10, this._languageIdCodec = r10;
  }
  updateTokensUntilLine(e206, t10) {
    let n10 = this._textModel.getLanguageId();
    for (; ; ) {
      let r10 = this.getFirstInvalidLine();
      if (!r10 || r10.lineNumber > t10) break;
      let i10 = this._textModel.getLineContent(r10.lineNumber), a10 = WD(this._languageIdCodec, n10, this.tokenizationSupport, i10, true, r10.startState);
      e206.add(r10.lineNumber, a10.tokens), this.store.setEndState(r10.lineNumber, a10.endState);
    }
  }
  getTokenTypeIfInsertingCharacter(e206, t10) {
    let n10 = this.getStartState(e206.lineNumber);
    if (!n10) return 0;
    let r10 = this._textModel.getLanguageId(), i10 = this._textModel.getLineContent(e206.lineNumber), a10 = i10.substring(0, e206.column - 1) + t10 + i10.substring(e206.column - 1), o10 = new rg(WD(this._languageIdCodec, r10, this.tokenizationSupport, a10, true, n10).tokens, a10, this._languageIdCodec);
    if (o10.getCount() === 0) return 0;
    let s10 = o10.findTokenIndexAtOffset(e206.column - 1);
    return o10.getStandardTokenType(s10);
  }
  tokenizeLinesAt(e206, t10) {
    let n10 = this.getStartState(e206);
    if (!n10) return null;
    let r10 = this._textModel.getLanguageId(), i10 = [], a10 = n10;
    for (let e207 of t10) {
      let t11 = WD(this._languageIdCodec, r10, this.tokenizationSupport, e207, true, a10);
      i10.push(new rg(t11.tokens, e207, this._languageIdCodec)), a10 = t11.endState;
    }
    return i10;
  }
  hasAccurateTokensForLine(e206) {
    return e206 < this.store.getFirstInvalidEndStateLineNumberOrMax();
  }
  isCheapToTokenize(e206) {
    let t10 = this.store.getFirstInvalidEndStateLineNumberOrMax();
    return e206 < t10 || e206 === t10 && this._textModel.getLineLength(e206) < 2048;
  }
  tokenizeHeuristically(e206, t10, n10) {
    if (n10 <= this.store.getFirstInvalidEndStateLineNumberOrMax()) return { heuristicTokens: false };
    if (t10 <= this.store.getFirstInvalidEndStateLineNumberOrMax()) return this.updateTokensUntilLine(e206, n10), { heuristicTokens: false };
    let r10 = this.guessStartState(t10), i10 = this._textModel.getLanguageId();
    for (let a10 = t10; a10 <= n10; a10++) {
      let t11 = this._textModel.getLineContent(a10), n11 = WD(this._languageIdCodec, i10, this.tokenizationSupport, t11, true, r10);
      e206.add(a10, n11.tokens), r10 = n11.endState;
    }
    return { heuristicTokens: true };
  }
  guessStartState(e206) {
    let { likelyRelevantLines: t10, initialState: n10 } = BD(this._textModel, e206, this);
    n10 || (n10 = this.tokenizationSupport.getInitialState());
    let r10 = this._textModel.getLanguageId(), i10 = n10;
    for (let e207 of t10) i10 = WD(this._languageIdCodec, r10, this.tokenizationSupport, e207, false, i10).endState;
    return i10;
  }
};
function BD(e206, t10, n10) {
  let r10 = e206.getLineFirstNonWhitespaceColumn(t10), i10 = [], a10 = null;
  for (let o10 = t10 - 1; r10 > 1 && o10 >= 1; o10--) {
    let t11 = e206.getLineFirstNonWhitespaceColumn(o10);
    if (t11 !== 0 && t11 < r10 && (i10.push(e206.getLineContent(o10)), r10 = t11, a10 = n10?.getStartState(o10), a10)) break;
  }
  return i10.reverse(), { likelyRelevantLines: i10, initialState: a10 ?? void 0 };
}
var VD = class {
  constructor(e206) {
    this.lineCount = e206, this._tokenizationStateStore = new HD(), this._invalidEndStatesLineNumbers = new UD(), this._invalidEndStatesLineNumbers.addRange(new Tm(1, e206 + 1));
  }
  getEndState(e206) {
    return this._tokenizationStateStore.getEndState(e206);
  }
  setEndState(e206, t10) {
    if (!t10) throw new je(`Cannot set null/undefined state`);
    this._invalidEndStatesLineNumbers.delete(e206);
    let n10 = this._tokenizationStateStore.setEndState(e206, t10);
    return n10 && e206 < this.lineCount && this._invalidEndStatesLineNumbers.addRange(new Tm(e206 + 1, e206 + 2)), n10;
  }
  acceptChange(e206, t10) {
    this.lineCount += t10 - e206.length, this._tokenizationStateStore.acceptChange(e206, t10), this._invalidEndStatesLineNumbers.addRangeAndResize(new Tm(e206.startLineNumber, e206.endLineNumberExclusive), t10);
  }
  acceptChanges(e206) {
    for (let t10 of e206) {
      let [e207] = pT(t10.text);
      this.acceptChange(new zm(t10.range.startLineNumber, t10.range.endLineNumber + 1), e207 + 1);
    }
  }
  invalidateEndStateRange(e206) {
    this._invalidEndStatesLineNumbers.addRange(new Tm(e206.startLineNumber, e206.endLineNumberExclusive));
  }
  getFirstInvalidEndStateLineNumber() {
    return this._invalidEndStatesLineNumbers.min;
  }
  getFirstInvalidEndStateLineNumberOrMax() {
    return this.getFirstInvalidEndStateLineNumber() || 2 ** 53 - 1;
  }
  allStatesValid() {
    return this._invalidEndStatesLineNumbers.min === null;
  }
  getStartState(e206, t10) {
    return e206 === 1 ? t10 : this.getEndState(e206 - 1);
  }
  getFirstInvalidLine(e206) {
    let t10 = this.getFirstInvalidEndStateLineNumber();
    if (t10 === null) return null;
    let n10 = this.getStartState(t10, e206);
    if (!n10) throw new je(`Start state must be defined`);
    return { lineNumber: t10, startState: n10 };
  }
}, HD = class {
  constructor() {
    this._lineEndStates = new PD(null);
  }
  getEndState(e206) {
    return this._lineEndStates.get(e206);
  }
  setEndState(e206, t10) {
    let n10 = this._lineEndStates.get(e206);
    return n10 && n10.equals(t10) ? false : (this._lineEndStates.set(e206, t10), true);
  }
  acceptChange(e206, t10) {
    let n10 = e206.length;
    t10 > 0 && n10 > 0 && (n10--, t10--), this._lineEndStates.replace(e206.startLineNumber, n10, t10);
  }
}, UD = class {
  constructor() {
    this._ranges = [];
  }
  get min() {
    return this._ranges.length === 0 ? null : this._ranges[0].start;
  }
  delete(e206) {
    let t10 = this._ranges.findIndex((t11) => t11.contains(e206));
    if (t10 !== -1) {
      let n10 = this._ranges[t10];
      n10.start === e206 ? n10.endExclusive === e206 + 1 ? this._ranges.splice(t10, 1) : this._ranges[t10] = new Tm(e206 + 1, n10.endExclusive) : n10.endExclusive === e206 + 1 ? this._ranges[t10] = new Tm(n10.start, e206) : this._ranges.splice(t10, 1, new Tm(n10.start, e206), new Tm(e206 + 1, n10.endExclusive));
    }
  }
  addRange(e206) {
    Tm.addRange(e206, this._ranges);
  }
  addRangeAndResize(e206, t10) {
    let n10 = 0;
    for (; !(n10 >= this._ranges.length || e206.start <= this._ranges[n10].endExclusive); ) n10++;
    let r10 = n10;
    for (; !(r10 >= this._ranges.length || e206.endExclusive < this._ranges[r10].start); ) r10++;
    let i10 = t10 - e206.length;
    for (let e207 = r10; e207 < this._ranges.length; e207++) this._ranges[e207] = this._ranges[e207].delta(i10);
    if (n10 === r10) {
      let r11 = new Tm(e206.start, e206.start + t10);
      r11.isEmpty || this._ranges.splice(n10, 0, r11);
    } else {
      let t11 = new Tm(Math.min(e206.start, this._ranges[n10].start), Math.max(e206.endExclusive, this._ranges[r10 - 1].endExclusive) + i10);
      t11.isEmpty ? this._ranges.splice(n10, r10 - n10) : this._ranges.splice(n10, r10 - n10, t11);
    }
  }
  toString() {
    return this._ranges.map((e206) => e206.toString()).join(` + `);
  }
};
function WD(e206, t10, n10, r10, i10, a10) {
  let o10 = null;
  if (n10) try {
    o10 = n10.tokenizeEncoded(r10, i10, a10.clone());
  } catch (e207) {
    be(e207);
  }
  return o10 || (o10 = tg(e206.encodeLanguageId(t10), a10)), rg.convertToEndOffset(o10.tokens, r10.length), o10;
}
var GD = class {
  constructor(e206, t10) {
    this._tokenizerWithStateStore = e206, this._backgroundTokenStore = t10, this._isDisposed = false, this._isScheduled = false;
  }
  dispose() {
    this._isDisposed = true;
  }
  handleChanges() {
    this._beginBackgroundTokenization();
  }
  _beginBackgroundTokenization() {
    this._isScheduled || !this._tokenizerWithStateStore._textModel.isAttachedToEditor() || !this._hasLinesToTokenize() || (this._isScheduled = true, ds((e206) => {
      this._isScheduled = false, this._backgroundTokenizeWithDeadline(e206);
    }));
  }
  _backgroundTokenizeWithDeadline(e206) {
    let t10 = Date.now() + e206.timeRemaining(), n10 = () => {
      this._isDisposed || !this._tokenizerWithStateStore._textModel.isAttachedToEditor() || !this._hasLinesToTokenize() || (this._backgroundTokenizeForAtLeast1ms(), Date.now() < t10 ? Nt(n10) : this._beginBackgroundTokenization());
    };
    n10();
  }
  _backgroundTokenizeForAtLeast1ms() {
    let e206 = this._tokenizerWithStateStore._textModel.getLineCount(), t10 = new LD(), n10 = $t.create(false);
    do
      if (n10.elapsed() > 1 || this._tokenizeOneInvalidLine(t10) >= e206) break;
    while (this._hasLinesToTokenize());
    this._backgroundTokenStore.setTokens(t10.finalize()), this.checkFinished();
  }
  _hasLinesToTokenize() {
    return this._tokenizerWithStateStore ? !this._tokenizerWithStateStore.store.allStatesValid() : false;
  }
  _tokenizeOneInvalidLine(e206) {
    let t10 = this._tokenizerWithStateStore?.getFirstInvalidLine();
    return t10 ? (this._tokenizerWithStateStore.updateTokensUntilLine(e206, t10.lineNumber), t10.lineNumber) : this._tokenizerWithStateStore._textModel.getLineCount() + 1;
  }
  checkFinished() {
    this._isDisposed || this._tokenizerWithStateStore.store.allStatesValid() && this._backgroundTokenStore.backgroundTokenizationFinished();
  }
  requestTokens(e206, t10) {
    this._tokenizerWithStateStore.store.invalidateEndStateRange(new zm(e206, t10));
  }
}, KD = class e117 {
  get children() {
    return this._children;
  }
  get length() {
    return this._length;
  }
  constructor(e206) {
    this.height = e206, this._children = [], this._length = 0;
  }
  static create(t10, n10) {
    let r10 = new e117(t10.height + 1);
    return r10.appendChild(t10), r10.appendChild(n10), r10;
  }
  canAppendChild() {
    return this._children.length < 3;
  }
  appendChild(e206) {
    if (!this.canAppendChild()) throw Error(`Cannot insert more than 3 children in a ListNode`);
    this._children.push(e206), this._length += e206.length, this._updateParentLength(e206.length), JD(e206) || (e206.parent = this);
  }
  _updateParentLength(e206) {
    let t10 = this.parent;
    for (; t10; ) t10._length += e206, t10 = t10.parent;
  }
  unappendChild() {
    let e206 = this._children.pop();
    return this._length -= e206.length, this._updateParentLength(-e206.length), e206;
  }
  prependChild(e206) {
    if (this._children.length >= 3) throw Error(`Cannot prepend more than 3 children in a ListNode`);
    this._children.unshift(e206), this._length += e206.length, this._updateParentLength(e206.length), JD(e206) || (e206.parent = this);
  }
  unprependChild() {
    let e206 = this._children.shift();
    return this._length -= e206.length, this._updateParentLength(-e206.length), e206;
  }
  lastChild() {
    return this._children[this._children.length - 1];
  }
  dispose() {
    this._children.splice(0, this._children.length);
  }
}, qD;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.ViewportGuess = 1] = `ViewportGuess`, e206[e206.EditGuess = 2] = `EditGuess`, e206[e206.Accurate = 3] = `Accurate`;
})(qD || (qD = {}));
function JD(e206) {
  return e206.token !== void 0;
}
function YD(e206, t10) {
  let n10 = e206, r10 = [], i10;
  for (; ; ) {
    if (t10.height === n10.height) {
      i10 = t10;
      break;
    }
    if (JD(n10)) throw Error(`unexpected`);
    r10.push(n10), n10 = n10.lastChild();
  }
  for (let e207 = r10.length - 1; e207 >= 0; e207--) {
    let t11 = r10[e207];
    i10 && (t11.children.length >= 3 ? i10 = KD.create(t11.unappendChild(), i10) : (t11.appendChild(i10), i10 = void 0));
  }
  if (i10) {
    let t11 = new KD(i10.height + 1);
    return t11.appendChild(e206), t11.appendChild(i10), t11;
  } else return e206;
}
function XD(e206, t10) {
  let n10 = e206, r10 = [];
  for (; t10.height !== n10.height; ) {
    if (JD(n10)) throw Error(`unexpected`);
    r10.push(n10), n10 = n10.children[0];
  }
  let i10 = t10;
  for (let e207 = r10.length - 1; e207 >= 0; e207--) {
    let t11 = r10[e207];
    i10 && (t11.children.length >= 3 ? i10 = KD.create(i10, t11.unprependChild()) : (t11.prependChild(i10), i10 = void 0));
  }
  return i10 ? KD.create(i10, e206) : e206;
}
function ZD(e206, t10) {
  return e206.height === t10.height ? KD.create(e206, t10) : e206.height > t10.height ? YD(e206, t10) : XD(t10, e206);
}
var QD = class {
  constructor(e206) {
    this._textModel = e206, this._root = this.createEmptyRoot();
  }
  createEmptyRoot() {
    return { length: this._textModel.getValueLength(), token: 0, height: 0, tokenQuality: qD.None };
  }
  buildStore(e206, t10) {
    this._root = this.createFromUpdates(e206, t10);
  }
  createFromUpdates(e206, t10) {
    if (e206.length === 0) return this.createEmptyRoot();
    let n10 = { length: e206[0].length, token: e206[0].token, height: 0, tokenQuality: t10 };
    for (let r10 = 1; r10 < e206.length; r10++) n10 = YD(n10, { length: e206[r10].length, token: e206[r10].token, height: 0, tokenQuality: t10 });
    return n10;
  }
  update(e206, t10, n10) {
    t10.length !== 0 && this.replace(e206, t10[0].startOffsetInclusive, t10, n10);
  }
  delete(e206, t10) {
    this.replace(e206, t10, [], qD.EditGuess);
  }
  replace(e206, t10, n10, r10) {
    let i10 = t10 + e206, a10 = [], o10 = [], s10 = [{ node: this._root, offset: 0 }];
    for (; s10.length > 0; ) {
      let e207 = s10.pop(), n11 = e207.offset;
      if (n11 < t10 && n11 + e207.node.length <= t10) {
        JD(e207.node) || (e207.node.parent = void 0), a10.push(e207.node);
        continue;
      } else JD(e207.node) && n11 < t10 && a10.push({ length: t10 - n11, token: e207.node.token, height: 0, tokenQuality: e207.node.tokenQuality });
      if (!(t10 <= n11 && n11 + e207.node.length <= i10)) {
        if (n11 >= i10) {
          JD(e207.node) || (e207.node.parent = void 0), o10.push(e207.node);
          continue;
        } else if (JD(e207.node) && n11 + e207.node.length > i10) {
          o10.push({ length: n11 + e207.node.length - i10, token: e207.node.token, height: 0, tokenQuality: e207.node.tokenQuality });
          continue;
        }
        if (!JD(e207.node)) {
          let t11 = n11 + e207.node.length;
          for (let n12 = e207.node.children.length - 1; n12 >= 0; n12--) t11 -= e207.node.children[n12].length, s10.push({ node: e207.node.children[n12], offset: t11 });
        }
      }
    }
    let c10;
    c10 = n10.length > 0 ? a10.concat(this.createFromUpdates(n10, r10), o10) : a10.concat(o10);
    let l10 = c10[0];
    for (let e207 = 1; e207 < c10.length; e207++) l10 = ZD(l10, c10[e207]);
    this._root = l10 ?? this.createEmptyRoot();
  }
  traverseInOrderInRange(e206, t10, n10) {
    let r10 = [{ node: this._root, offset: 0 }];
    for (; r10.length > 0; ) {
      let { node: i10, offset: a10 } = r10.pop();
      if (!(a10 + i10.length <= e206 || a10 >= t10)) {
        if (n10(i10, a10)) return;
        if (!JD(i10)) {
          let e207 = a10 + i10.length;
          for (let t11 = i10.children.length - 1; t11 >= 0; t11--) e207 -= i10.children[t11].length, r10.push({ node: i10.children[t11], offset: e207 });
        }
      }
    }
  }
  getTokenAt(e206) {
    let t10;
    return this.traverseInOrderInRange(e206, this._root.length, (e207, n10) => JD(e207) ? (t10 = { token: e207.token, startOffsetInclusive: n10, length: e207.length }, true) : false), t10;
  }
  getTokensInRange(e206, t10) {
    let n10 = [];
    return this.traverseInOrderInRange(e206, t10, (r10, i10) => {
      if (JD(r10)) {
        let a10 = r10.length, o10 = i10;
        i10 < e206 && i10 + r10.length > t10 ? (o10 = e206, a10 = t10 - e206) : i10 < e206 ? (a10 -= e206 - i10, o10 = e206) : i10 + r10.length > t10 && (a10 -= i10 + r10.length - t10), n10.push({ token: r10.token, startOffsetInclusive: o10, length: a10 });
      }
      return false;
    }), n10;
  }
  markForRefresh(e206, t10) {
    this.traverseInOrderInRange(e206, t10, (e207) => (JD(e207) && (e207.tokenQuality = qD.None), false));
  }
  rangeHasTokens(e206, t10, n10) {
    let r10 = true;
    return this.traverseInOrderInRange(e206, t10, (e207) => (JD(e207) && e207.tokenQuality < n10 && (r10 = false), false)), r10;
  }
  rangeNeedsRefresh(e206, t10) {
    let n10 = false;
    return this.traverseInOrderInRange(e206, t10, (e207) => (JD(e207) && e207.tokenQuality !== qD.Accurate && (n10 = true), false)), n10;
  }
  getNeedsRefresh() {
    let e206 = [];
    return this.traverseInOrderInRange(0, this._textModel.getValueLength(), (t10, n10) => (JD(t10) && t10.tokenQuality !== qD.Accurate && (e206.length > 0 && e206[e206.length - 1].endOffset === n10 ? e206[e206.length - 1].endOffset += t10.length : e206.push({ startOffset: n10, endOffset: n10 + t10.length })), false)), e206;
  }
  dispose() {
    let e206 = [[this._root, false]];
    for (; e206.length > 0; ) {
      let [t10, n10] = e206.pop();
      if (!JD(t10)) if (n10) t10.dispose(), t10.parent = void 0;
      else {
        e206.push([t10, true]);
        for (let n11 = t10.children.length - 1; n11 >= 0; n11--) e206.push([t10.children[n11], false]);
      }
    }
    this._root = void 0;
  }
}, $D = xu(`treeSitterThemeService`);
function eO(e206) {
  return { createChangeSummary: (e207) => ({ changes: [] }), handleChange(t10, n10) {
    for (let r10 in e206) t10.didChange(e206[r10]) && n10.changes.push({ key: r10, change: t10.change });
    return true;
  }, beforeUpdate(t10, n10) {
    for (let r10 in e206) {
      if (r10 === `changes`) throw new je(`property name "changes" is reserved for change tracking`);
      n10[r10] = e206[r10].read(t10);
    }
  } };
}
function tO(e206) {
  let t10;
  return { createChangeSummary: (e207) => ({ changes: [] }), handleChange(n10, r10) {
    t10 || (t10 = e206());
    for (let e207 in t10) n10.didChange(t10[e207]) && r10.changes.push({ key: e207, change: n10.change });
    return true;
  }, beforeUpdate(n10, r10) {
    t10 || (t10 = e206());
    for (let e207 in t10) {
      if (e207 === `changes`) throw new je(`property name "changes" is reserved for change tracking`);
      r10[e207] = t10[e207].read(n10);
    }
  } };
}
var nO = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, rO = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, iO = class extends D {
  get _textModel() {
    return this._tree.textModel;
  }
  constructor(e206, t10, n10, r10, i10) {
    super(), this._tree = e206, this._highlightingQueries = t10, this._languageIdCodec = n10, this._visibleLineRanges = r10, this._treeSitterThemeService = i10, this._onDidChangeTokens = this._register(new k()), this.onDidChangeTokens = this._onDidChangeTokens.event, this._onDidCompleteBackgroundTokenization = this._register(new k()), this.onDidChangeBackgroundTokenization = this._onDidCompleteBackgroundTokenization.event, this._encodedLanguageId = this._languageIdCodec.encodeLanguageId(this._tree.languageId), this._register(mw(this._treeSitterThemeService.onChange, () => {
      this._updateTheme();
    })), this._tokenStore = this._register(new QD(this._textModel)), this._accurateVersion = this._textModel.getVersionId(), this._guessVersion = this._textModel.getVersionId(), this._tokenStore.buildStore(this._createEmptyTokens(), qD.None), this._register(hc((e207) => {
      let t11 = this._visibleLineRanges.read(e207);
      this._parseAndTokenizeViewPort(t11);
    })), this._register(_c({ owner: this, changeTracker: eO({ tree: this._tree.tree }) }, (e207, t11) => {
      let n11 = t11.changes.at(0)?.change;
      if (t11.changes.length > 1) throw new je(`The tree changed twice in one transaction. This is currently not supported and should not happen.`);
      if (!n11) t11.tree && this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(e207));
      else {
        if (this.hasTokens()) for (let e208 of n11.ranges) this._markForRefresh(e208.newRange);
        this.hasTokens() ? this._handleTreeUpdate(n11.ranges, n11.versionId) : this._firstTreeUpdate(n11.versionId);
      }
    }));
  }
  handleContentChanged(e206) {
    this._guessVersion = e206.versionId;
    for (let t10 of e206.changes) if (t10.text.length > t10.rangeLength) {
      let e207 = t10.rangeOffset > 0 ? t10.rangeOffset - 1 : t10.rangeOffset, n10 = this._tokenStore.getTokenAt(e207), r10;
      n10 ? (r10 = { startOffsetInclusive: n10.startOffsetInclusive, length: n10.length + t10.text.length - t10.rangeLength, token: n10.token }, this._tokenStore.markForRefresh(e207, t10.rangeOffset + (t10.text.length > t10.rangeLength ? t10.text.length : t10.rangeLength))) : r10 = { startOffsetInclusive: e207, length: t10.text.length, token: 0 }, this._tokenStore.update(n10?.length ?? 0, [r10], qD.EditGuess);
    } else if (t10.text.length < t10.rangeLength) {
      let e207 = t10.rangeLength - t10.text.length;
      this._tokenStore.delete(e207, t10.rangeOffset);
    }
  }
  getLineTokens(e206) {
    let t10 = this._textModel.getLineContent(e206);
    return new rg(this.getTokens(e206), t10, this._languageIdCodec);
  }
  _createEmptyTokens() {
    let e206 = this._emptyToken(), t10 = this._textModel.getValueLength();
    return [this._emptyTokensForOffsetAndLength(0, t10, e206)];
  }
  _emptyToken() {
    return this._treeSitterThemeService.findMetadata([], this._encodedLanguageId, false, void 0);
  }
  _emptyTokensForOffsetAndLength(e206, t10, n10) {
    return { token: n10, length: e206 + t10, startOffsetInclusive: 0 };
  }
  hasAccurateTokensForLine(e206) {
    return this.hasTokens(new M(e206, 1, e206, this._textModel.getLineMaxColumn(e206)));
  }
  tokenizeLinesAt(e206, t10) {
    let n10 = this._guessTokensForLinesContent(e206, t10), r10 = [];
    if (!n10) return null;
    for (let e207 = 0; e207 < n10.length; e207++) r10.push(new rg(n10[e207], t10[e207], this._languageIdCodec));
    return r10;
  }
  _rangeHasTokens(e206, t10) {
    return this._tokenStore.rangeHasTokens(this._textModel.getOffsetAt(e206.getStartPosition()), this._textModel.getOffsetAt(e206.getEndPosition()), t10);
  }
  hasTokens(e206) {
    return !e206 || this._guessVersion === this._accurateVersion ? true : !this._tokenStore.rangeNeedsRefresh(this._textModel.getOffsetAt(e206.getStartPosition()), this._textModel.getOffsetAt(e206.getEndPosition()));
  }
  getTokens(e206) {
    let t10 = this._textModel.getOffsetAt({ lineNumber: e206, column: 1 }), n10 = this._textModel.getOffsetAt({ lineNumber: e206, column: this._textModel.getLineLength(e206) + 1 }), r10 = this._tokenStore.getTokensInRange(t10, n10), i10 = new Uint32Array(r10.length * 2);
    for (let e207 = 0; e207 < r10.length; e207++) i10[e207 * 2] = r10[e207].startOffsetInclusive - t10 + r10[e207].length, i10[e207 * 2 + 1] = r10[e207].token;
    return i10;
  }
  getTokensInRange(e206, t10, n10, r10) {
    let i10 = r10 ? this._tokenizeCapturesWithMetadata(r10, t10, n10) : this._tokenize(e206, t10, n10);
    if (i10?.endOffsetsAndMetadata) return this._rangeTokensAsUpdates(t10, i10.endOffsetsAndMetadata);
  }
  _updateTokensInStore(e206, t10, n10) {
    this._accurateVersion = e206;
    for (let r10 of t10) {
      let t11 = r10.newTokens.length > 0 ? r10.newTokens[r10.newTokens.length - 1] : void 0, i10;
      i10 = t11 && this._guessVersion >= e206 ? t11.startOffsetInclusive + t11.length - r10.newTokens[0].startOffsetInclusive : r10.oldRangeLength ? r10.oldRangeLength : 0, this._tokenStore.update(i10, r10.newTokens, n10);
    }
  }
  _markForRefresh(e206) {
    this._tokenStore.markForRefresh(this._textModel.getOffsetAt(e206.getStartPosition()), this._textModel.getOffsetAt(e206.getEndPosition()));
  }
  _getNeedsRefresh() {
    let e206 = this._tokenStore.getNeedsRefresh();
    return e206 ? e206.map((e207) => ({ range: M.fromPositions(this._textModel.getPositionAt(e207.startOffset), this._textModel.getPositionAt(e207.endOffset)), startOffset: e207.startOffset, endOffset: e207.endOffset })) : [];
  }
  _parseAndTokenizeViewPort(e206) {
    let t10 = e206.map((e207) => e207.toInclusiveRange()).filter(Ke);
    for (let e207 of t10) {
      let t11 = this._textModel.getOffsetAt(e207.getStartPosition()), n10 = this._textModel.getOffsetAt(e207.getEndPosition()), r10 = this._textModel.getVersionId();
      if (this._rangeHasTokens(e207, qD.ViewportGuess)) continue;
      let i10 = this._textModel.getValueInRange(e207), a10 = this._forceParseAndTokenizeContent(e207, t11, n10, i10, true);
      if (!a10 || this._rangeHasTokens(e207, qD.ViewportGuess) || a10.length === 0) continue;
      let o10 = a10[a10.length - 1], s10 = o10.startOffsetInclusive + o10.length - a10[0].startOffsetInclusive;
      this._updateTokensInStore(r10, [{ newTokens: a10, oldRangeLength: s10 }], qD.ViewportGuess), this._onDidChangeTokens.fire({ changes: { semanticTokensApplied: false, ranges: [{ fromLineNumber: e207.startLineNumber, toLineNumber: e207.endLineNumber }] } });
    }
  }
  _guessTokensForLinesContent(e206, t10) {
    if (t10.length === 0) return;
    let n10 = t10.join(this._textModel.getEOL()), r10 = new M(1, 1, e206 + t10.length, t10[t10.length - 1].length + 1), i10 = this._textModel.getOffsetAt({ lineNumber: e206, column: 1 }), a10 = this._forceParseAndTokenizeContent(r10, i10, i10 + n10.length, n10, false);
    if (!a10) return;
    let o10 = Array(t10.length), s10 = 0, c10 = 0, l10 = 0;
    for (let e207 = 0; e207 < t10.length; e207++) {
      let n11 = [], r11 = false;
      for (let i11 = s10; !r11 && i11 < a10.length; i11++) {
        let o11 = a10[i11], u10 = o11.endOffset - l10, d10 = c10 - l10;
        if (u10 <= t10[e207].length) n11.push({ endOffset: u10, metadata: o11.metadata }), s10++;
        else if (d10 < t10[e207].length) {
          let i12 = { endOffset: t10[e207].length, metadata: o11.metadata };
          n11.push(i12), r11 = true;
        } else r11 = true;
        c10 = o11.endOffset;
      }
      o10[e207] = this._endOffsetTokensToUint32Array(n11), l10 += t10[e207].length + this._textModel.getEOL().length;
    }
    return o10;
  }
  _forceParseAndTokenizeContent(e206, t10, n10, r10, i10) {
    let a10 = BD(this._textModel, e206.startLineNumber).likelyRelevantLines, o10 = a10.join(this._textModel.getEOL()), s10 = this._tree.createParsedTreeSync(`${o10}${r10}`);
    if (!s10) return;
    let c10 = new M(1, 1, e206.endLineNumber - e206.startLineNumber + 1 + a10.length, e206.endColumn), l10 = this.captureAtRange(c10), u10 = this._tokenizeCapturesWithMetadata(l10, o10.length, n10 - t10 + o10.length);
    if (s10.delete(), u10) return i10 ? this._rangeTokensAsUpdates(t10, u10.endOffsetsAndMetadata, o10.length) : u10.endOffsetsAndMetadata;
  }
  _firstTreeUpdate(e206) {
    return this._setViewPortTokens(e206);
  }
  _setViewPortTokens(e206) {
    let t10 = this._visibleLineRanges.get().map((e207) => {
      let t11 = e207.toInclusiveRange();
      if (!t11) return;
      let n10 = this._textModel.getOffsetAt(t11.getStartPosition());
      return { newRange: t11, newRangeEndOffset: this._textModel.getOffsetAt(t11.getEndPosition()), newRangeStartOffset: n10 };
    }).filter(Ke);
    return this._handleTreeUpdate(t10, e206);
  }
  _handleTreeUpdate(e206, t10) {
    let n10 = [], r10 = 1e3;
    for (let t11 = 0; t11 < e206.length; t11++) if (e206[t11].newRange.endLineNumber - e206[t11].newRange.startLineNumber > r10) {
      let i11 = e206[t11].newRange.endLineNumber, a10 = e206[t11].newRange.startLineNumber, o10 = e206[t11].newRange.startColumn, s10 = a10 + r10;
      do {
        let c10 = new j(a10, o10), l10 = s10 === e206[t11].newRange.endLineNumber ? e206[t11].newRange.endColumn : this._textModel.getLineMaxColumn(s10), u10 = new j(s10, l10), d10 = M.fromPositions(c10, u10);
        n10.push({ range: d10, startOffset: this._textModel.getOffsetAt(d10.getStartPosition()), endOffset: this._textModel.getOffsetAt(d10.getEndPosition()) }), a10 = s10 + 1, o10 = 1, s10 < i11 && s10 + r10 > i11 ? s10 = i11 : s10 += r10;
      } while (s10 <= i11);
    } else if (t11 === 0 || n10[t11 - 1].endOffset < e206[t11].newRangeStartOffset) n10.push({ range: e206[t11].newRange, startOffset: e206[t11].newRangeStartOffset, endOffset: e206[t11].newRangeEndOffset });
    else if (n10[t11 - 1].endOffset < e206[t11].newRangeEndOffset) {
      let r11 = this._textModel.getPositionAt(n10[t11 - 1].endOffset + 1), i11 = new M(r11.lineNumber, r11.column, e206[t11].newRange.endLineNumber, e206[t11].newRange.endColumn);
      n10.push({ range: i11, startOffset: n10[t11 - 1].endOffset + 1, endOffset: e206[t11].newRangeEndOffset });
    }
    let i10 = n10.map((e207) => this._getCaptures(e207.range));
    return this._updateTreeForRanges(n10, t10, i10).then(() => {
      !this._textModel.isDisposed() && this._tree.treeLastParsedVersion.get() === this._textModel.getVersionId() && this._refreshNeedsRefresh(t10);
    });
  }
  async _updateTreeForRanges(e206, t10, n10) {
    let r10;
    for (let i10 = 0; i10 < e206.length && !(!this._textModel.isDisposed() && t10 !== this._textModel.getVersionId()); i10++) {
      let a10 = n10[i10], o10 = e206[i10], s10 = this.getTokensInRange(o10.range, o10.startOffset, o10.endOffset, a10);
      r10 = s10 ? { newTokens: s10 } : { newTokens: [] }, this._updateTokensInStore(t10, [r10], qD.Accurate), this._onDidChangeTokens.fire({ changes: { semanticTokensApplied: false, ranges: [{ fromLineNumber: o10.range.getStartPosition().lineNumber, toLineNumber: o10.range.getEndPosition().lineNumber }] } }), await new Promise((e207) => Nt(e207));
    }
    this._onDidCompleteBackgroundTokenization.fire();
  }
  _refreshNeedsRefresh(e206) {
    let t10 = this._getNeedsRefresh();
    if (t10.length === 0) return;
    let n10 = Array(t10.length);
    for (let e207 = 0; e207 < t10.length; e207++) {
      let r10 = t10[e207];
      n10[e207] = { newRange: r10.range, newRangeStartOffset: r10.startOffset, newRangeEndOffset: r10.endOffset };
    }
    this._handleTreeUpdate(n10, e206);
  }
  _rangeTokensAsUpdates(e206, t10, n10) {
    let r10 = [], i10 = 0;
    for (let a10 of t10) {
      if (a10.endOffset <= i10 || n10 && a10.endOffset < n10) continue;
      let t11;
      t11 = n10 && i10 < n10 ? { startOffsetInclusive: e206 + n10, length: a10.endOffset - n10, token: a10.metadata } : { startOffsetInclusive: e206 + i10, length: a10.endOffset - i10, token: a10.metadata }, r10.push(t11), i10 = a10.endOffset;
    }
    return r10;
  }
  _updateTheme() {
    let e206 = this._textModel.getFullModelRange();
    this._markForRefresh(e206), this._parseAndTokenizeViewPort(this._visibleLineRanges.get());
  }
  captureAtRange(e206) {
    let t10 = this._tree.tree.get();
    return t10 ? this._highlightingQueries.captures(t10.rootNode, { startPosition: { row: e206.startLineNumber - 1, column: e206.startColumn - 1 }, endPosition: { row: e206.endLineNumber - 1, column: e206.endColumn - 1 } }).map((e207) => ({ name: e207.name, text: e207.node.text, node: { startIndex: e207.node.startIndex, endIndex: e207.node.endIndex, startPosition: { lineNumber: e207.node.startPosition.row + 1, column: e207.node.startPosition.column + 1 }, endPosition: { lineNumber: e207.node.endPosition.row + 1, column: e207.node.endPosition.column + 1 } }, encodedLanguageId: this._encodedLanguageId })) : [];
  }
  captureAtRangeWithInjections(e206) {
    let t10 = this.captureAtRange(e206);
    for (let n10 = 0; n10 < t10.length; n10++) {
      let r10 = t10[n10], i10 = r10.node.startPosition.lineNumber, a10 = r10.node.endPosition.lineNumber, o10 = r10.node.startPosition.column, s10 = r10.node.endPosition.column, c10 = i10 > e206.startLineNumber && i10 < e206.endLineNumber ? i10 : e206.startLineNumber, l10 = a10 > e206.startLineNumber && a10 < e206.endLineNumber ? a10 : e206.endLineNumber, u10 = new M(c10, i10 === e206.startLineNumber ? o10 < e206.startColumn ? e206.startColumn : o10 : i10 < e206.startLineNumber ? e206.startColumn : o10, l10, a10 === e206.endLineNumber ? s10 > e206.endColumn ? e206.endColumn : s10 : a10 > e206.endLineNumber ? e206.endColumn : s10), d10 = this._getInjectionCaptures(r10, u10);
      d10 && d10.length > 0 && (t10.splice(n10 + 1, 0, ...d10), n10 += d10.length);
    }
    return t10;
  }
  tokenizeEncoded(e206) {
    let t10 = this._tokenizeEncoded(e206);
    if (!t10) return;
    let n10 = this._rangeTokensAsUpdates(this._textModel.getOffsetAt({ lineNumber: e206, column: 1 }), t10.result);
    t10.versionId === this._textModel.getVersionId() && this._updateTokensInStore(t10.versionId, [{ newTokens: n10, oldRangeLength: this._textModel.getLineLength(e206) }], qD.Accurate);
  }
  _getCaptures(e206) {
    return this.captureAtRangeWithInjections(e206);
  }
  _tokenize(e206, t10, n10) {
    let r10 = this._getCaptures(e206), i10 = this._tokenizeCapturesWithMetadata(r10, t10, n10);
    if (i10) return { ...i10, versionId: this._tree.treeLastParsedVersion.get() };
  }
  _createTokensFromCaptures(e206, t10, n10) {
    let r10 = this._tree.tree.get(), i10 = $t.create(), a10 = n10 - t10, o10 = this._languageIdCodec.encodeLanguageId(this._tree.languageId), s10 = aO[this._tree.languageId] || `source`;
    if (e206.length === 0) return r10 ? (i10.stop(), { endOffsets: [{ endOffset: a10, scopes: [], encodedLanguageId: o10 }], captureTime: i10.elapsed() }) : void 0;
    let c10 = Array(e206.length);
    c10.fill({ endOffset: 0, scopes: [s10], encodedLanguageId: o10 });
    let l10 = 0, u10 = () => {
      c10.push({ endOffset: 0, scopes: [s10], encodedLanguageId: o10 });
    }, d10 = (e207, t11) => e207.name.includes(`punctuation`) && e207.text ? Array.from(e207.text.matchAll(oO)).map((e208) => t11 + e208.index) : void 0, f10 = (e207, t11, n11, r11) => {
      if (r11 !== void 0) {
        let i11 = c10[r11].scopes, a11 = c10[r11].bracket;
        if ((r11 > 0 ? c10[r11 - 1].endOffset : 0) !== t11) {
          let o11;
          if (a11 && a11.length > 0) {
            o11 = [];
            let e208 = [];
            for (let r12 = 0; r12 < a11.length; r12++) {
              let i12 = a11[r12];
              i12 < t11 ? o11.push(i12) : i12 > n11 && e208.push(i12);
            }
            o11.length === 0 && (o11 = void 0), a11 = e208.length === 0 ? void 0 : e208;
          }
          c10.splice(r11, 0, { endOffset: t11, scopes: [...i11], bracket: o11, encodedLanguageId: e207.encodedLanguageId }), r11++, u10(), l10++;
        }
        c10.splice(r11, 0, { endOffset: n11, scopes: [...i11, e207.name], bracket: d10(e207, t11), encodedLanguageId: e207.encodedLanguageId }), c10[l10].bracket = a11;
      } else c10[l10] = { endOffset: n11, scopes: [s10, e207.name], bracket: d10(e207, t11), encodedLanguageId: e207.encodedLanguageId };
      l10++;
    };
    for (let r11 = 0; r11 < e206.length; r11++) {
      let i11 = e206[r11], a11 = i11.node.endIndex < n10 ? i11.node.endIndex < t10 ? t10 : i11.node.endIndex : n10, o11 = i11.node.startIndex < t10 ? t10 : i11.node.startIndex, p10 = a11 - t10, m10, h10 = a11 - o11;
      m10 = r11 > 0 ? c10[l10 - 1].endOffset : o11 - t10 - 1;
      let g10 = p10 - h10;
      if (m10 >= 0 && m10 < g10 && (c10[l10] = { endOffset: g10, scopes: [s10], encodedLanguageId: this._encodedLanguageId }, l10++, u10()), !(h10 < 0)) if (m10 >= p10) {
        let e207 = l10 - 1, t11 = c10[e207].endOffset, n11 = e207 >= 2 ? c10[e207 - 1].endOffset : 0;
        do {
          if (n11 + h10 === t11) {
            if (n11 === g10) {
              c10[e207].scopes.push(i11.name);
              let t12 = c10[e207].bracket;
              c10[e207].bracket = t12 && t12.length > 0 ? t12 : d10(i11, g10);
            }
          } else if (n11 <= g10) {
            f10(i11, g10, p10, e207);
            break;
          }
          e207--, n11 = e207 >= 1 ? c10[e207 - 1].endOffset : 0, t11 = e207 >= 0 ? c10[e207].endOffset : 0;
        } while (t11 > g10);
      } else f10(i11, g10, p10);
    }
    c10[l10 - 1].endOffset < a10 && a10 - c10[l10 - 1].endOffset > 0 && (u10(), c10[l10] = { endOffset: a10, scopes: c10[l10].scopes, encodedLanguageId: this._encodedLanguageId }, l10++);
    for (let e207 = 0; e207 < c10.length; e207++) if (c10[e207].endOffset === 0 && e207 !== 0) {
      c10.splice(e207, c10.length - e207);
      break;
    }
    return { endOffsets: c10, captureTime: i10.elapsed() };
  }
  _getInjectionCaptures(e206, t10) {
    return [];
  }
  _tokenizeCapturesWithMetadata(e206, t10, n10) {
    let r10 = $t.create(), i10 = this._createTokensFromCaptures(e206, t10, n10);
    if (!i10) return;
    let a10 = i10.endOffsets;
    for (let e207 = 0; e207 < a10.length; e207++) {
      let t11 = a10[e207];
      t11.metadata = this._treeSitterThemeService.findMetadata(t11.scopes, t11.encodedLanguageId, !!t11.bracket && t11.bracket.length > 0, void 0);
    }
    let o10 = r10.elapsed();
    return { endOffsetsAndMetadata: a10, captureTime: i10.captureTime, metadataTime: o10 };
  }
  _tokenizeEncoded(e206) {
    let t10 = this._textModel.getOffsetAt({ lineNumber: e206, column: 1 }), n10 = this._textModel.getLineCount(), r10 = e206 + 1 <= n10 ? this._textModel.getOffsetAt({ lineNumber: e206 + 1, column: 1 }) : this._textModel.getValueLength(), i10 = r10 - t10, a10 = this._tokenize(new M(e206, 1, e206, i10 + 1), t10, r10);
    if (a10) return { result: a10.endOffsetsAndMetadata, captureTime: a10.captureTime, metadataTime: a10.metadataTime, versionId: a10.versionId };
  }
  _endOffsetTokensToUint32Array(e206) {
    let t10 = new Uint32Array(e206.length * 2);
    for (let n10 = 0; n10 < e206.length; n10++) t10[n10 * 2] = e206[n10].endOffset, t10[n10 * 2 + 1] = e206[n10].metadata;
    return t10;
  }
};
iO = nO([rO(4, $D)], iO);
var aO = { css: `source.css`, typescript: `source.ts`, ini: `source.ini`, regex: `source.regex` }, oO = /[\{\}\[\]\<\>\(\)]/g, sO = xu(`treeSitterLibraryService`), cO = class {
  constructor(e206) {
    this._value = Ic(this, void 0), this.promiseResult = this._value, this.promise = e206.then((e207) => (bc((t10) => {
      this._value.set(new lO(e207, void 0), t10);
    }), e207), (e207) => {
      throw bc((t10) => {
        this._value.set(new lO(void 0, e207), t10);
      }), e207;
    });
  }
}, lO = class {
  constructor(e206, t10) {
    this.data = e206, this.error = t10;
  }
  getDataOrThrow() {
    if (this.error) throw this.error;
    return this.data;
  }
}, uO = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, dO = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, fO = class extends SD {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(t10, n10), this._languageIdObs = e206, this._treeSitterLibraryService = i10, this._instantiationService = a10, this._backgroundTokenizationState = 1, this._onDidChangeBackgroundTokenizationState = this._register(new k()), this.onDidChangeBackgroundTokenizationState = this._onDidChangeBackgroundTokenizationState.event;
    let o10 = new cO(this._treeSitterLibraryService.getParserClass()), s10 = I(this, (e207) => o10.promiseResult?.read(e207)?.getDataOrThrow());
    this._tree = I(this, (e207) => {
      let t11 = s10.read(e207);
      if (!t11) return;
      let n11 = this._languageIdObs.read(e207), r11 = this._treeSitterLibraryService.getLanguage(n11, false, e207);
      if (!r11) return;
      let i11 = new t11();
      if (e207.store.add(T(() => {
        i11.delete();
      })), i11.setLanguage(r11), this._treeSitterLibraryService.getInjectionQueries(n11, e207) !== void 0) return e207.store.add(this._instantiationService.createInstance(AD, n11, void 0, i11, t11, this._textModel));
    }), this._tokenizationImpl = I(this, (e207) => {
      let t11 = this._tree.read(e207);
      if (!t11) return;
      let n11 = this._treeSitterLibraryService.getHighlightingQueries(t11.languageId, e207);
      if (n11) return e207.store.add(this._instantiationService.createInstance(iO, t11, n11, this._languageIdCodec, r10));
    }), this._register(hc((e207) => {
      let t11 = this._tokenizationImpl.read(e207);
      t11 && (e207.store.add(t11.onDidChangeTokens((e208) => {
        this._onDidChangeTokens.fire(e208.changes);
      })), e207.store.add(t11.onDidChangeBackgroundTokenization((e208) => {
        this._backgroundTokenizationState = 2, this._onDidChangeBackgroundTokenizationState.fire();
      })));
    }));
  }
  getLineTokens(e206) {
    let t10 = this._tokenizationImpl.get();
    if (!t10) {
      let t11 = this._textModel.getLineContent(e206);
      return rg.createEmpty(t11, this._languageIdCodec);
    }
    return t10.getLineTokens(e206);
  }
  todo_resetTokenization(e206 = true) {
    e206 && this._onDidChangeTokens.fire({ semanticTokensApplied: false, ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }] });
  }
  handleDidChangeAttached() {
  }
  handleDidChangeContent(e206) {
    e206.isFlush ? this.todo_resetTokenization(false) : this._tokenizationImpl.get()?.handleContentChanged(e206), this._tree.get()?.handleContentChange(e206);
  }
  forceTokenization(e206) {
    let t10 = this._tokenizationImpl.get();
    t10 && (t10.hasAccurateTokensForLine(e206) || t10.tokenizeEncoded(e206));
  }
  hasAccurateTokensForLine(e206) {
    let t10 = this._tokenizationImpl.get();
    return t10 ? t10.hasAccurateTokensForLine(e206) : false;
  }
  isCheapToTokenize(e206) {
    return true;
  }
  getTokenTypeIfInsertingCharacter(e206, t10, n10) {
    return 0;
  }
  tokenizeLinesAt(e206, t10) {
    let n10 = this._tokenizationImpl.get();
    return n10 ? n10.tokenizeLinesAt(e206, t10) : null;
  }
  get hasTokens() {
    let e206 = this._tokenizationImpl.get();
    return e206 ? e206.hasTokens() : false;
  }
};
fO = uO([dO(4, sO), dO(5, V)], fO);
var pO = class e118 {
  constructor(e206) {
    this._pieces = [], this._isComplete = false, this._languageIdCodec = e206;
  }
  flush() {
    this._pieces = [], this._isComplete = false;
  }
  isEmpty() {
    return this._pieces.length === 0;
  }
  set(e206, t10, n10 = void 0) {
    if (this._pieces = e206 || [], this._isComplete = t10, n10) for (let e207 of this._pieces) e207.reportIfInvalid(n10);
  }
  setPartial(e206, t10) {
    let n10 = e206;
    if (t10.length > 0) {
      let r11 = t10[0].getRange(), i10 = t10[t10.length - 1].getRange();
      if (!r11 || !i10) return e206;
      n10 = e206.plusRange(r11).plusRange(i10);
    }
    let r10 = null;
    for (let e207 = 0, t11 = this._pieces.length; e207 < t11; e207++) {
      let i10 = this._pieces[e207];
      if (i10.endLineNumber < n10.startLineNumber) continue;
      if (i10.startLineNumber > n10.endLineNumber) {
        r10 || (r10 = { index: e207 });
        break;
      }
      if (i10.removeTokens(n10), i10.isEmpty()) {
        this._pieces.splice(e207, 1), e207--, t11--;
        continue;
      }
      if (i10.endLineNumber < n10.startLineNumber) continue;
      if (i10.startLineNumber > n10.endLineNumber) {
        r10 || (r10 = { index: e207 });
        continue;
      }
      let [a10, o10] = i10.split(n10);
      if (a10.isEmpty()) {
        r10 || (r10 = { index: e207 });
        continue;
      }
      o10.isEmpty() || (this._pieces.splice(e207, 1, a10, o10), e207++, t11++, r10 || (r10 = { index: e207 }));
    }
    return r10 || (r10 = { index: this._pieces.length }), t10.length > 0 && (this._pieces = x(this._pieces, r10.index, t10)), n10;
  }
  isComplete() {
    return this._isComplete;
  }
  addSparseTokens(t10, n10) {
    if (n10.getTextLength() === 0) return n10;
    let r10 = this._pieces;
    if (r10.length === 0) return n10;
    let i10 = r10[e118._findFirstPieceWithLine(r10, t10)].getLineTokens(t10);
    if (!i10) return n10;
    let a10 = n10.getCount(), o10 = i10.getCount(), s10 = 0, c10 = [], l10 = 0, u10 = 0, d10 = (e206, t11) => {
      e206 !== u10 && (u10 = e206, c10[l10++] = e206, c10[l10++] = t11);
    };
    for (let e206 = 0; e206 < o10; e206++) {
      let t11 = Math.min(i10.getStartCharacter(e206), n10.getTextLength()), r11 = Math.min(i10.getEndCharacter(e206), n10.getTextLength()), o11 = i10.getMetadata(e206), c11 = ((o11 & 1 ? 2048 : 0) | (o11 & 2 ? 4096 : 0) | (o11 & 4 ? 8192 : 0) | (o11 & 8 ? 16384 : 0) | (o11 & 16 ? 16744448 : 0) | (o11 & 32 ? 4278190080 : 0)) >>> 0, l11 = ~c11 >>> 0;
      for (; s10 < a10 && n10.getEndOffset(s10) <= t11; ) d10(n10.getEndOffset(s10), n10.getMetadata(s10)), s10++;
      for (s10 < a10 && n10.getStartOffset(s10) < t11 && d10(t11, n10.getMetadata(s10)); s10 < a10 && n10.getEndOffset(s10) < r11; ) d10(n10.getEndOffset(s10), n10.getMetadata(s10) & l11 | o11 & c11), s10++;
      if (s10 < a10) d10(r11, n10.getMetadata(s10) & l11 | o11 & c11), n10.getEndOffset(s10) === r11 && s10++;
      else {
        let e207 = Math.min(Math.max(0, s10 - 1), a10 - 1);
        d10(r11, n10.getMetadata(e207) & l11 | o11 & c11);
      }
    }
    for (; s10 < a10; ) d10(n10.getEndOffset(s10), n10.getMetadata(s10)), s10++;
    return new rg(new Uint32Array(c10), n10.getLineContent(), this._languageIdCodec);
  }
  static _findFirstPieceWithLine(e206, t10) {
    let n10 = 0, r10 = e206.length - 1;
    for (; n10 < r10; ) {
      let i10 = n10 + Math.floor((r10 - n10) / 2);
      if (e206[i10].endLineNumber < t10) n10 = i10 + 1;
      else if (e206[i10].startLineNumber > t10) r10 = i10 - 1;
      else {
        for (; i10 > n10 && e206[i10 - 1].startLineNumber <= t10 && t10 <= e206[i10 - 1].endLineNumber; ) i10--;
        return i10;
      }
    }
    return n10;
  }
  acceptEdit(e206, t10, n10, r10, i10) {
    for (let a10 = 0; a10 < this._pieces.length; a10++) {
      let o10 = this._pieces[a10];
      o10.acceptEdit(e206, t10, n10, r10, i10), o10.isEmpty() && (this._pieces.splice(a10, 1), a10--);
    }
  }
}, mO = new Uint32Array().buffer, hO = class e119 {
  static deleteBeginning(t10, n10) {
    return t10 === null || t10 === mO ? t10 : e119.delete(t10, 0, n10);
  }
  static deleteEnding(t10, n10) {
    if (t10 === null || t10 === mO) return t10;
    let r10 = gO(t10), i10 = r10[r10.length - 2];
    return e119.delete(t10, n10, i10);
  }
  static delete(e206, t10, n10) {
    if (e206 === null || e206 === mO || t10 === n10) return e206;
    let r10 = gO(e206), i10 = r10.length >>> 1;
    if (t10 === 0 && r10[r10.length - 2] === n10) return mO;
    let a10 = rg.findIndexInTokensArray(r10, t10), o10 = a10 > 0 ? r10[a10 - 1 << 1] : 0;
    if (n10 < r10[a10 << 1]) {
      let o11 = n10 - t10;
      for (let e207 = a10; e207 < i10; e207++) r10[e207 << 1] -= o11;
      return e206;
    }
    let s10, c10;
    o10 === t10 ? (s10 = a10 << 1, c10 = o10) : (r10[a10 << 1] = t10, s10 = a10 + 1 << 1, c10 = t10);
    let l10 = n10 - t10;
    for (let e207 = a10 + 1; e207 < i10; e207++) {
      let t11 = r10[e207 << 1] - l10;
      t11 > c10 && (r10[s10++] = t11, r10[s10++] = r10[(e207 << 1) + 1], c10 = t11);
    }
    if (s10 === r10.length) return e206;
    let u10 = new Uint32Array(s10);
    return u10.set(r10.subarray(0, s10), 0), u10.buffer;
  }
  static append(e206, t10) {
    if (t10 === mO) return e206;
    if (e206 === mO) return t10;
    if (e206 === null) return e206;
    if (t10 === null) return null;
    let n10 = gO(e206), r10 = gO(t10), i10 = r10.length >>> 1, a10 = new Uint32Array(n10.length + r10.length);
    a10.set(n10, 0);
    let o10 = n10.length, s10 = n10[n10.length - 2];
    for (let e207 = 0; e207 < i10; e207++) a10[o10++] = r10[e207 << 1] + s10, a10[o10++] = r10[(e207 << 1) + 1];
    return a10.buffer;
  }
  static insert(e206, t10, n10) {
    if (e206 === null || e206 === mO) return e206;
    let r10 = gO(e206), i10 = r10.length >>> 1, a10 = rg.findIndexInTokensArray(r10, t10);
    a10 > 0 && r10[a10 - 1 << 1] === t10 && a10--;
    for (let e207 = a10; e207 < i10; e207++) r10[e207 << 1] += n10;
    return e206;
  }
};
function gO(e206) {
  return e206 instanceof Uint32Array ? e206 : new Uint32Array(e206);
}
var _O2 = class e120 {
  constructor(e206) {
    this._lineTokens = [], this._len = 0, this._languageIdCodec = e206;
  }
  flush() {
    this._lineTokens = [], this._len = 0;
  }
  get hasTokens() {
    return this._lineTokens.length > 0;
  }
  getTokens(e206, t10, n10) {
    let r10 = null;
    if (t10 < this._len && (r10 = this._lineTokens[t10]), r10 !== null && r10 !== mO) return new rg(gO(r10), n10, this._languageIdCodec);
    let i10 = new Uint32Array(2);
    return i10[0] = n10.length, i10[1] = vO(this._languageIdCodec.encodeLanguageId(e206)), new rg(i10, n10, this._languageIdCodec);
  }
  static _massageTokens(e206, t10, n10) {
    let r10 = n10 ? gO(n10) : null;
    if (t10 === 0) {
      let t11 = false;
      if (r10 && r10.length > 1 && (t11 = ng.getLanguageId(r10[1]) !== e206), !t11) return mO;
    }
    if (!r10 || r10.length === 0) {
      let n11 = new Uint32Array(2);
      return n11[0] = t10, n11[1] = vO(e206), n11.buffer;
    }
    return r10[r10.length - 2] = t10, r10.byteOffset === 0 && r10.byteLength === r10.buffer.byteLength ? r10.buffer : r10;
  }
  _ensureLine(e206) {
    for (; e206 >= this._len; ) this._lineTokens[this._len] = null, this._len++;
  }
  _deleteLines(e206, t10) {
    t10 !== 0 && (e206 + t10 > this._len && (t10 = this._len - e206), this._lineTokens.splice(e206, t10), this._len -= t10);
  }
  _insertLines(e206, t10) {
    if (t10 === 0) return;
    let n10 = [];
    for (let e207 = 0; e207 < t10; e207++) n10[e207] = null;
    this._lineTokens = x(this._lineTokens, e206, n10), this._len += t10;
  }
  setTokens(t10, n10, r10, i10, a10) {
    let o10 = e120._massageTokens(this._languageIdCodec.encodeLanguageId(t10), r10, i10);
    this._ensureLine(n10);
    let s10 = this._lineTokens[n10];
    return this._lineTokens[n10] = o10, a10 ? !e120._equals(s10, o10) : false;
  }
  static _equals(e206, t10) {
    if (!e206 || !t10) return !e206 && !t10;
    let n10 = gO(e206), r10 = gO(t10);
    if (n10.length !== r10.length) return false;
    for (let e207 = 0, t11 = n10.length; e207 < t11; e207++) if (n10[e207] !== r10[e207]) return false;
    return true;
  }
  acceptEdit(e206, t10, n10) {
    this._acceptDeleteRange(e206), this._acceptInsertText(new j(e206.startLineNumber, e206.startColumn), t10, n10);
  }
  _acceptDeleteRange(e206) {
    let t10 = e206.startLineNumber - 1;
    if (t10 >= this._len) return;
    if (e206.startLineNumber === e206.endLineNumber) {
      if (e206.startColumn === e206.endColumn) return;
      this._lineTokens[t10] = hO.delete(this._lineTokens[t10], e206.startColumn - 1, e206.endColumn - 1);
      return;
    }
    this._lineTokens[t10] = hO.deleteEnding(this._lineTokens[t10], e206.startColumn - 1);
    let n10 = e206.endLineNumber - 1, r10 = null;
    n10 < this._len && (r10 = hO.deleteBeginning(this._lineTokens[n10], e206.endColumn - 1)), this._lineTokens[t10] = hO.append(this._lineTokens[t10], r10), this._deleteLines(e206.startLineNumber, e206.endLineNumber - e206.startLineNumber);
  }
  _acceptInsertText(e206, t10, n10) {
    if (t10 === 0 && n10 === 0) return;
    let r10 = e206.lineNumber - 1;
    if (!(r10 >= this._len)) {
      if (t10 === 0) {
        this._lineTokens[r10] = hO.insert(this._lineTokens[r10], e206.column - 1, n10);
        return;
      }
      this._lineTokens[r10] = hO.deleteEnding(this._lineTokens[r10], e206.column - 1), this._lineTokens[r10] = hO.insert(this._lineTokens[r10], e206.column - 1, n10), this._insertLines(e206.lineNumber, t10);
    }
  }
  setMultilineTokens(e206, t10) {
    if (e206.length === 0) return { changes: [] };
    let n10 = [];
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
      let i11 = e206[r10], a10 = 0, o10 = 0, s10 = false;
      for (let e207 = i11.startLineNumber; e207 <= i11.endLineNumber; e207++) s10 ? (this.setTokens(t10.getLanguageId(), e207 - 1, t10.getLineLength(e207), i11.getLineTokens(e207), false), o10 = e207) : this.setTokens(t10.getLanguageId(), e207 - 1, t10.getLineLength(e207), i11.getLineTokens(e207), true) && (s10 = true, a10 = e207, o10 = e207);
      s10 && n10.push({ fromLineNumber: a10, toLineNumber: o10 });
    }
    return { changes: n10 };
  }
};
function vO(e206) {
  return (e206 << 0 | 33588224) >>> 0;
}
var yO = class extends SD {
  constructor(e206, t10, n10, r10) {
    super(e206, t10), this.getLanguageId = n10, this._tokenizer = null, this._backgroundTokenizationState = 1, this._onDidChangeBackgroundTokenizationState = this._register(new k()), this.onDidChangeBackgroundTokenizationState = this._onDidChangeBackgroundTokenizationState.event, this._defaultBackgroundTokenizer = null, this._backgroundTokenizer = this._register(new Jt()), this._tokens = new _O2(this._languageIdCodec), this._debugBackgroundTokenizer = this._register(new Jt()), this._attachedViewStates = this._register(new Xt()), this._register(Pi.onDidChange((e207) => {
      let t11 = this.getLanguageId();
      e207.changedLanguages.indexOf(t11) !== -1 && this.todo_resetTokenization();
    })), this.todo_resetTokenization(), this._register(r10.onDidChangeVisibleRanges(({ view: e207, state: t11 }) => {
      if (t11) {
        let n11 = this._attachedViewStates.get(e207);
        n11 || (n11 = new xD(() => this.refreshRanges(n11.lineRanges)), this._attachedViewStates.set(e207, n11)), n11.handleStateChange(t11);
      } else this._attachedViewStates.deleteAndDispose(e207);
    }));
  }
  todo_resetTokenization(e206 = true) {
    this._tokens.flush(), this._debugBackgroundTokens?.flush(), this._debugBackgroundStates && (this._debugBackgroundStates = new VD(this._textModel.getLineCount())), e206 && this._onDidChangeTokens.fire({ semanticTokensApplied: false, ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }] });
    let [t10, n10] = (() => {
      if (this._textModel.isTooLargeForTokenization()) return [null, null];
      let e207 = Pi.get(this.getLanguageId());
      if (!e207) return [null, null];
      let t11;
      try {
        t11 = e207.getInitialState();
      } catch (e208) {
        return be(e208), [null, null];
      }
      return [e207, t11];
    })();
    if (t10 && n10 ? this._tokenizer = new zD(this._textModel.getLineCount(), t10, this._textModel, this._languageIdCodec) : this._tokenizer = null, this._backgroundTokenizer.clear(), this._defaultBackgroundTokenizer = null, this._tokenizer) {
      let e207 = { setTokens: (e208) => {
        this.setTokens(e208);
      }, backgroundTokenizationFinished: () => {
        this._backgroundTokenizationState !== 2 && (this._backgroundTokenizationState = 2, this._onDidChangeBackgroundTokenizationState.fire());
      }, setEndState: (e208, t11) => {
        if (!this._tokenizer) return;
        let n11 = this._tokenizer.store.getFirstInvalidEndStateLineNumber();
        n11 !== null && e208 >= n11 && this._tokenizer?.store.setEndState(e208, t11);
      } };
      t10 && t10.createBackgroundTokenizer && !t10.backgroundTokenizerShouldOnlyVerifyTokens && (this._backgroundTokenizer.value = t10.createBackgroundTokenizer(this._textModel, e207)), !this._backgroundTokenizer.value && !this._textModel.isTooLargeForTokenization() && (this._backgroundTokenizer.value = this._defaultBackgroundTokenizer = new GD(this._tokenizer, e207), this._defaultBackgroundTokenizer.handleChanges()), t10?.backgroundTokenizerShouldOnlyVerifyTokens && t10.createBackgroundTokenizer ? (this._debugBackgroundTokens = new _O2(this._languageIdCodec), this._debugBackgroundStates = new VD(this._textModel.getLineCount()), this._debugBackgroundTokenizer.clear(), this._debugBackgroundTokenizer.value = t10.createBackgroundTokenizer(this._textModel, { setTokens: (e208) => {
        this._debugBackgroundTokens?.setMultilineTokens(e208, this._textModel);
      }, backgroundTokenizationFinished() {
      }, setEndState: (e208, t11) => {
        this._debugBackgroundStates?.setEndState(e208, t11);
      } })) : (this._debugBackgroundTokens = void 0, this._debugBackgroundStates = void 0, this._debugBackgroundTokenizer.value = void 0);
    }
    this.refreshAllVisibleLineTokens();
  }
  handleDidChangeAttached() {
    this._defaultBackgroundTokenizer?.handleChanges();
  }
  handleDidChangeContent(e206) {
    if (e206.isFlush) this.todo_resetTokenization(false);
    else if (!e206.isEolChange) {
      for (let t10 of e206.changes) {
        let [e207, n10] = pT(t10.text);
        this._tokens.acceptEdit(t10.range, e207, n10), this._debugBackgroundTokens?.acceptEdit(t10.range, e207, n10);
      }
      this._debugBackgroundStates?.acceptChanges(e206.changes), this._tokenizer && this._tokenizer.store.acceptChanges(e206.changes), this._defaultBackgroundTokenizer?.handleChanges();
    }
  }
  setTokens(e206) {
    let { changes: t10 } = this._tokens.setMultilineTokens(e206, this._textModel);
    return t10.length > 0 && this._onDidChangeTokens.fire({ semanticTokensApplied: false, ranges: t10 }), { changes: t10 };
  }
  refreshAllVisibleLineTokens() {
    let e206 = zm.joinMany([...this._attachedViewStates].map(([e207, t10]) => t10.lineRanges));
    this.refreshRanges(e206);
  }
  refreshRanges(e206) {
    for (let t10 of e206) this.refreshRange(t10.startLineNumber, t10.endLineNumberExclusive - 1);
  }
  refreshRange(e206, t10) {
    if (!this._tokenizer) return;
    e206 = Math.max(1, Math.min(this._textModel.getLineCount(), e206)), t10 = Math.min(this._textModel.getLineCount(), t10);
    let n10 = new LD(), { heuristicTokens: r10 } = this._tokenizer.tokenizeHeuristically(n10, e206, t10), i10 = this.setTokens(n10.finalize());
    if (r10) for (let e207 of i10.changes) this._backgroundTokenizer.value?.requestTokens(e207.fromLineNumber, e207.toLineNumber + 1);
    this._defaultBackgroundTokenizer?.checkFinished();
  }
  forceTokenization(e206) {
    let t10 = new LD();
    this._tokenizer?.updateTokensUntilLine(t10, e206), this.setTokens(t10.finalize()), this._defaultBackgroundTokenizer?.checkFinished();
  }
  hasAccurateTokensForLine(e206) {
    return this._tokenizer ? this._tokenizer.hasAccurateTokensForLine(e206) : true;
  }
  isCheapToTokenize(e206) {
    return this._tokenizer ? this._tokenizer.isCheapToTokenize(e206) : true;
  }
  getLineTokens(e206) {
    let t10 = this._textModel.getLineContent(e206), n10 = this._tokens.getTokens(this._textModel.getLanguageId(), e206 - 1, t10);
    if (this._debugBackgroundTokens && this._debugBackgroundStates && this._tokenizer && this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax() > e206 && this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax() > e206) {
      let r10 = this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(), e206 - 1, t10);
      !n10.equals(r10) && this._debugBackgroundTokenizer.value?.reportMismatchingTokens && this._debugBackgroundTokenizer.value.reportMismatchingTokens(e206);
    }
    return n10;
  }
  getTokenTypeIfInsertingCharacter(e206, t10, n10) {
    if (!this._tokenizer) return 0;
    let r10 = this._textModel.validatePosition(new j(e206, t10));
    return this.forceTokenization(r10.lineNumber), this._tokenizer.getTokenTypeIfInsertingCharacter(r10, n10);
  }
  tokenizeLinesAt(e206, t10) {
    return this._tokenizer ? (this.forceTokenization(e206), this._tokenizer.tokenizeLinesAt(e206, t10)) : null;
  }
  get hasTokens() {
    return this._tokens.hasTokens;
  }
}, bO = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, xO = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, SO, CO = SO = class extends mC {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(), this._textModel = e206, this._bracketPairsTextModelPart = t10, this._languageId = n10, this._attachedViews = r10, this._languageService = i10, this._languageConfigurationService = a10, this._instantiationService = o10, this._treeSitterLibraryService = s10, this._languageIdObs = Ic(this, this._languageId), this._useTreeSitter = I(this, (e207) => {
      let t11 = this._languageIdObs.read(e207);
      return this._treeSitterLibraryService.supportsLanguage(t11, e207);
    }), this.tokens = I(this, (e207) => {
      let t11;
      return t11 = this._useTreeSitter.read(e207) ? e207.store.add(this._instantiationService.createInstance(fO, this._languageIdObs, this._languageService.languageIdCodec, this._textModel, this._attachedViews.visibleLineRanges)) : e207.store.add(new yO(this._languageService.languageIdCodec, this._textModel, () => this._languageId, this._attachedViews)), e207.store.add(t11.onDidChangeTokens((e208) => {
        this._emitModelTokensChangedEvent(e208);
      })), e207.store.add(t11.onDidChangeBackgroundTokenizationState((e208) => {
        this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState();
      })), t11;
    });
    let c10 = false;
    this.tokens.recomputeInitiallyAndOnChange(this._store, (e207) => {
      c10 && e207.todo_resetTokenization(), c10 = true;
    }), this._semanticTokens = new pO(this._languageService.languageIdCodec), this._onDidChangeLanguage = this._register(new k()), this.onDidChangeLanguage = this._onDidChangeLanguage.event, this._onDidChangeLanguageConfiguration = this._register(new k()), this.onDidChangeLanguageConfiguration = this._onDidChangeLanguageConfiguration.event, this._onDidChangeTokens = this._register(new k()), this.onDidChangeTokens = this._onDidChangeTokens.event;
  }
  handleLanguageConfigurationServiceChange(e206) {
    e206.affects(this._languageId) && this._onDidChangeLanguageConfiguration.fire({});
  }
  handleDidChangeContent(e206) {
    if (e206.isFlush) this._semanticTokens.flush();
    else if (!e206.isEolChange) for (let t10 of e206.changes) {
      let [e207, n10, r10] = pT(t10.text);
      this._semanticTokens.acceptEdit(t10.range, e207, n10, r10, t10.text.length > 0 ? t10.text.charCodeAt(0) : 0);
    }
    this.tokens.get().handleDidChangeContent(e206);
  }
  handleDidChangeAttached() {
    this.tokens.get().handleDidChangeAttached();
  }
  getLineTokens(e206) {
    this.validateLineNumber(e206);
    let t10 = this.tokens.get().getLineTokens(e206);
    return this._semanticTokens.addSparseTokens(e206, t10);
  }
  _emitModelTokensChangedEvent(e206) {
    this._textModel._isDisposing() || (this._bracketPairsTextModelPart.handleDidChangeTokens(e206), this._onDidChangeTokens.fire(e206));
  }
  validateLineNumber(e206) {
    if (e206 < 1 || e206 > this._textModel.getLineCount()) throw new je(`Illegal value for lineNumber`);
  }
  get hasTokens() {
    return this.tokens.get().hasTokens;
  }
  resetTokenization() {
    this.tokens.get().todo_resetTokenization();
  }
  get backgroundTokenizationState() {
    return this.tokens.get().backgroundTokenizationState;
  }
  forceTokenization(e206) {
    this.validateLineNumber(e206), this.tokens.get().forceTokenization(e206);
  }
  hasAccurateTokensForLine(e206) {
    return this.validateLineNumber(e206), this.tokens.get().hasAccurateTokensForLine(e206);
  }
  isCheapToTokenize(e206) {
    return this.validateLineNumber(e206), this.tokens.get().isCheapToTokenize(e206);
  }
  tokenizeIfCheap(e206) {
    this.validateLineNumber(e206), this.tokens.get().tokenizeIfCheap(e206);
  }
  getTokenTypeIfInsertingCharacter(e206, t10, n10) {
    return this.tokens.get().getTokenTypeIfInsertingCharacter(e206, t10, n10);
  }
  tokenizeLinesAt(e206, t10) {
    return this.tokens.get().tokenizeLinesAt(e206, t10);
  }
  setSemanticTokens(e206, t10) {
    this._semanticTokens.set(e206, t10, this._textModel), this._emitModelTokensChangedEvent({ semanticTokensApplied: e206 !== null, ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }] });
  }
  hasCompleteSemanticTokens() {
    return this._semanticTokens.isComplete();
  }
  hasSomeSemanticTokens() {
    return !this._semanticTokens.isEmpty();
  }
  setPartialSemanticTokens(e206, t10) {
    if (this.hasCompleteSemanticTokens()) return;
    let n10 = this._textModel.validateRange(this._semanticTokens.setPartial(e206, t10));
    this._emitModelTokensChangedEvent({ semanticTokensApplied: true, ranges: [{ fromLineNumber: n10.startLineNumber, toLineNumber: n10.endLineNumber }] });
  }
  getWordAtPosition(e206) {
    this.assertNotDisposed();
    let t10 = this._textModel.validatePosition(e206), n10 = this._textModel.getLineContent(t10.lineNumber), r10 = this.getLineTokens(t10.lineNumber), i10 = r10.findTokenIndexAtOffset(t10.column - 1), [a10, o10] = SO._findLanguageBoundaries(r10, i10), s10 = wn(t10.column, this.getLanguageConfiguration(r10.getLanguageId(i10)).getWordDefinition(), n10.substring(a10, o10), a10);
    if (s10 && s10.startColumn <= e206.column && e206.column <= s10.endColumn) return s10;
    if (i10 > 0 && a10 === t10.column - 1) {
      let [a11, o11] = SO._findLanguageBoundaries(r10, i10 - 1), s11 = wn(t10.column, this.getLanguageConfiguration(r10.getLanguageId(i10 - 1)).getWordDefinition(), n10.substring(a11, o11), a11);
      if (s11 && s11.startColumn <= e206.column && e206.column <= s11.endColumn) return s11;
    }
    return null;
  }
  getLanguageConfiguration(e206) {
    return this._languageConfigurationService.getLanguageConfiguration(e206);
  }
  static _findLanguageBoundaries(e206, t10) {
    let n10 = e206.getLanguageId(t10), r10 = 0;
    for (let i11 = t10; i11 >= 0 && e206.getLanguageId(i11) === n10; i11--) r10 = e206.getStartOffset(i11);
    let i10 = e206.getLineContent().length;
    for (let r11 = t10, a10 = e206.getCount(); r11 < a10 && e206.getLanguageId(r11) === n10; r11++) i10 = e206.getEndOffset(r11);
    return [r10, i10];
  }
  getWordUntilPosition(e206) {
    let t10 = this.getWordAtPosition(e206);
    return t10 ? { word: t10.word.substr(0, e206.column - t10.startColumn), startColumn: t10.startColumn, endColumn: e206.column } : { word: ``, startColumn: e206.column, endColumn: e206.column };
  }
  getLanguageId() {
    return this._languageId;
  }
  getLanguageIdAtPosition(e206, t10) {
    let n10 = this._textModel.validatePosition(new j(e206, t10)), r10 = this.getLineTokens(n10.lineNumber);
    return r10.getLanguageId(r10.findTokenIndexAtOffset(n10.column - 1));
  }
  setLanguageId(e206, t10 = `api`) {
    if (this._languageId === e206) return;
    let n10 = { oldLanguage: this._languageId, newLanguage: e206, source: t10 };
    this._languageId = e206, this._languageIdObs.set(e206, void 0), this._bracketPairsTextModelPart.handleDidChangeLanguage(n10), this._onDidChangeLanguage.fire(n10), this._onDidChangeLanguageConfiguration.fire({});
  }
};
CO = SO = bO([xO(4, Jf), xO(5, bp), xO(6, V), xO(7, sO)], CO);
var wO = xu(`undoRedoService`), TO = class {
  constructor(e206, t10) {
    this.resource = e206, this.elements = t10;
  }
}, Mde = (_ya = class {
  constructor() {
    this.id = _ya._ID++, this.order = 1;
  }
  nextOrder() {
    return this.id === 0 ? 0 : this.order++;
  }
}, _ya._ID = 0, _ya.None = new _ya(), _ya), EO = (_za = class {
  constructor() {
    this.id = _za._ID++, this.order = 1;
  }
  nextOrder() {
    return this.id === 0 ? 0 : this.order++;
  }
}, _za._ID = 0, _za.None = new _za(), _za), DO;
function Nde(e206, t10) {
  let n10 = /* @__PURE__ */ new Map();
  for (let r10 of e206) {
    let e207 = t10(r10), i10 = n10.get(e207);
    i10 || (i10 = [], n10.set(e207, i10)), i10.push(r10);
  }
  return n10;
}
function Pde(e206, t10) {
  let n10 = [], r10 = [];
  for (let r11 of e206) t10.has(r11) || n10.push(r11);
  for (let n11 of t10) e206.has(n11) || r10.push(n11);
  return { removed: n10, added: r10 };
}
function OO(e206, t10) {
  let n10 = /* @__PURE__ */ new Set();
  for (let r10 of t10) e206.has(r10) && n10.add(r10);
  return n10;
}
var kO = (_Aa = class {
  constructor(e206, t10) {
    this.toKey = t10, this._map = /* @__PURE__ */ new Map(), this[DO] = `SetWithKey`;
    for (let t11 of e206) this.add(t11);
  }
  get size() {
    return this._map.size;
  }
  add(e206) {
    let t10 = this.toKey(e206);
    return this._map.set(t10, e206), this;
  }
  delete(e206) {
    return this._map.delete(this.toKey(e206));
  }
  has(e206) {
    return this._map.has(this.toKey(e206));
  }
  *entries() {
    for (let e206 of this._map.values()) yield [e206, e206];
  }
  keys() {
    return this.values();
  }
  *values() {
    for (let e206 of this._map.values()) yield e206;
  }
  clear() {
    this._map.clear();
  }
  forEach(e206, t10) {
    this._map.forEach((n10) => e206.call(t10, n10, n10, this));
  }
  [Symbol.iterator]() {
    return this.values();
  }
}, DO = Symbol.toStringTag, _Aa), Fde = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, AO = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, jO;
function Ide(e206) {
  let t10 = new gD();
  return t10.acceptChunk(e206), t10.finish();
}
function Lde(e206) {
  let t10 = new gD(), n10;
  for (; typeof (n10 = e206.read()) == `string`; ) t10.acceptChunk(n10);
  return t10.finish();
}
function MO(e206, t10) {
  let n10;
  return n10 = typeof e206 == `string` ? Ide(e206) : im(e206) ? Lde(e206) : e206, n10.create(t10);
}
var NO = 0, Rde = 999, zde = 1e4, Bde = 300, Vde = class {
  constructor(e206) {
    this._source = e206, this._eos = false;
  }
  read() {
    if (this._eos) return null;
    let e206 = [], t10 = 0, n10 = 0;
    do {
      let r10 = this._source.read();
      if (r10 === null) return this._eos = true, t10 === 0 ? null : e206.join(``);
      if (r10.length > 0 && (e206[t10++] = r10, n10 += r10.length), n10 >= 64 * 1024) return e206.join(``);
    } while (true);
  }
}, PO = () => {
  throw Error(`Invalid change accessor`);
}, FO = (_Ba = class extends D {
  static resolveOptions(e206, t10) {
    if (t10.detectIndentation) {
      let n10 = wE(e206, t10.tabSize, t10.insertSpaces);
      return new nm({ tabSize: n10.tabSize, indentSize: `tabSize`, insertSpaces: n10.insertSpaces, trimAutoWhitespace: t10.trimAutoWhitespace, defaultEOL: t10.defaultEOL, bracketPairColorizationOptions: t10.bracketPairColorizationOptions });
    }
    return new nm(t10);
  }
  get onDidChangeLanguage() {
    return this._tokenizationTextModelPart.onDidChangeLanguage;
  }
  get onDidChangeLanguageConfiguration() {
    return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration;
  }
  get onDidChangeTokens() {
    return this._tokenizationTextModelPart.onDidChangeTokens;
  }
  get onDidChangeOptions() {
    return this._onDidChangeOptions.event;
  }
  get onDidChangeAttached() {
    return this._onDidChangeAttached.event;
  }
  get onDidChangeLineHeight() {
    return this._onDidChangeLineHeight.event;
  }
  get onDidChangeFont() {
    return this._onDidChangeFont.event;
  }
  onDidChangeContent(e206) {
    return this._eventEmitter.slowEvent((t10) => e206(t10.contentChangedEvent));
  }
  onDidChangeContentOrInjectedText(e206) {
    return qt(this._eventEmitter.fastEvent((t10) => e206(t10)), this._onDidChangeInjectedText.event((t10) => e206(t10)));
  }
  _isDisposing() {
    return this.__isDisposing;
  }
  get tokenization() {
    return this._tokenizationTextModelPart;
  }
  get bracketPairs() {
    return this._bracketPairs;
  }
  get guides() {
    return this._guidesTextModelPart;
  }
  constructor(e206, t10, n10, r10 = null, i10, a10, o10, s10) {
    super(), this._undoRedoService = i10, this._languageService = a10, this._languageConfigurationService = o10, this.instantiationService = s10, this._onWillDispose = this._register(new k()), this.onWillDispose = this._onWillDispose.event, this._onDidChangeDecorations = this._register(new Kde((e207, t11, n11) => this.handleBeforeFireDecorationsChangedEvent(e207, t11, n11))), this.onDidChangeDecorations = this._onDidChangeDecorations.event, this._onDidChangeOptions = this._register(new k()), this._onDidChangeAttached = this._register(new k()), this._onDidChangeInjectedText = this._register(new k()), this._onDidChangeLineHeight = this._register(new k()), this._onDidChangeFont = this._register(new k()), this._eventEmitter = this._register(new qde()), this._languageSelectionListener = this._register(new Jt()), this._deltaDecorationCallCnt = 0, this._attachedViews = new Ade(), NO++, this.id = `$model` + NO, this.isForSimpleWidget = n10.isForSimpleWidget, r10 == null ? this._associatedResource = $r.parse(`inmemory://model/` + NO) : this._associatedResource = r10, this._attachedEditorCount = 0;
    let { textBuffer: c10, disposable: l10 } = MO(e206, n10.defaultEOL);
    this._buffer = c10, this._bufferDisposable = l10;
    let u10 = this._buffer.getLineCount(), d10 = this._buffer.getValueLengthInRange(new M(1, 1, u10, this._buffer.getLineLength(u10) + 1), 0);
    n10.largeFileOptimizations ? (this._isTooLargeForTokenization = d10 > jO.LARGE_FILE_SIZE_THRESHOLD || u10 > jO.LARGE_FILE_LINE_COUNT_THRESHOLD, this._isTooLargeForHeapOperation = d10 > jO.LARGE_FILE_HEAP_OPERATION_THRESHOLD) : (this._isTooLargeForTokenization = false, this._isTooLargeForHeapOperation = false), this._options = jO.resolveOptions(this._buffer, n10);
    let f10 = typeof t10 == `string` ? t10 : t10.languageId;
    typeof t10 != `string` && (this._languageSelectionListener.value = t10.onDidChange(() => this._setLanguage(t10.languageId))), this._bracketPairs = this._register(new rE(this, this._languageConfigurationService)), this._guidesTextModelPart = this._register(new Rce(this, this._languageConfigurationService)), this._decorationProvider = this._register(new cE(this)), this._tokenizationTextModelPart = this.instantiationService.createInstance(CO, this, this._bracketPairs, f10, this._attachedViews), this._isTooLargeForSyncing = d10 > jO._MODEL_SYNC_LIMIT, this._versionId = 1, this._alternativeVersionId = 1, this._initialUndoRedoSnapshot = null, this._isDisposed = false, this.__isDisposing = false, this._instanceId = So(NO), this._lastDecorationId = 0, this._decorations = /* @__PURE__ */ Object.create(null), this._decorationsTree = new zO(), this._commandManager = new ude(this, this._undoRedoService), this._isUndoing = false, this._isRedoing = false, this._trimAutoWhitespaceLines = null, this._register(this._decorationProvider.onDidChange(() => {
      this._onDidChangeDecorations.beginDeferredEmit(), this._onDidChangeDecorations.fire(), this._onDidChangeDecorations.endDeferredEmit();
    })), this._languageService.requestRichLanguageFeatures(f10), this._register(this._languageConfigurationService.onDidChange((e207) => {
      this._bracketPairs.handleLanguageConfigurationServiceChange(e207), this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(e207);
    }));
  }
  dispose() {
    this.__isDisposing = true, this._onWillDispose.fire(), this._tokenizationTextModelPart.dispose(), this._isDisposed = true, super.dispose(), this._bufferDisposable.dispose(), this.__isDisposing = false;
    let e206 = new hD([], ``, `
`, false, false, true, true);
    e206.dispose(), this._buffer = e206, this._bufferDisposable = D.None;
  }
  _assertNotDisposed() {
    if (this._isDisposed) throw new je(`Model is disposed!`);
  }
  getTextBuffer() {
    return this._assertNotDisposed(), this._buffer;
  }
  _emitContentChangedEvent(e206, t10) {
    this.__isDisposing || (this._tokenizationTextModelPart.handleDidChangeContent(t10), this._bracketPairs.handleDidChangeContent(t10), this._eventEmitter.fire(new lT(e206, t10)));
  }
  setValue(e206, t10 = mE.setValue()) {
    if (this._assertNotDisposed(), e206 == null) throw De();
    let { textBuffer: n10, disposable: r10 } = MO(e206, this._options.defaultEOL);
    this._setValueFromTextBuffer(n10, r10, t10);
  }
  _createContentChanged2(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    return { changes: [{ range: e206, rangeOffset: t10, rangeLength: n10, text: i10 }], eol: this._buffer.getEOL(), isEolChange: c10, versionId: this.getVersionId(), isUndoing: a10, isRedoing: o10, isFlush: s10, detailedReasons: [l10], detailedReasonsChangeLengths: [1] };
  }
  _setValueFromTextBuffer(e206, t10, n10) {
    this._assertNotDisposed();
    let r10 = this.getFullModelRange(), i10 = this.getValueLengthInRange(r10), a10 = this.getLineCount(), o10 = this.getLineMaxColumn(a10);
    this._buffer = e206, this._bufferDisposable.dispose(), this._bufferDisposable = t10, this._increaseVersionId(), this._decorations = /* @__PURE__ */ Object.create(null), this._decorationsTree = new zO(), this._commandManager.clear(), this._trimAutoWhitespaceLines = null, this._emitContentChangedEvent(new aT([new Cue()], this._versionId, false, false), this._createContentChanged2(new M(1, 1, a10, o10), 0, i10, new j(a10, o10), this.getValue(), false, false, true, false, n10));
  }
  setEOL(e206) {
    this._assertNotDisposed();
    let t10 = e206 === 1 ? `\r
` : `
`;
    if (this._buffer.getEOL() === t10) return;
    let n10 = this.getFullModelRange(), r10 = this.getValueLengthInRange(n10), i10 = this.getLineCount(), a10 = this.getLineMaxColumn(i10);
    this._onBeforeEOLChange(), this._buffer.setEOL(t10), this._increaseVersionId(), this._onAfterEOLChange(), this._emitContentChangedEvent(new aT([new Oue()], this._versionId, false, false), this._createContentChanged2(new M(1, 1, i10, a10), 0, r10, new j(i10, a10), this.getValue(), false, false, false, true, mE.eolChange()));
  }
  _onBeforeEOLChange() {
    this._decorationsTree.ensureAllNodesHaveRanges(this);
  }
  _onAfterEOLChange() {
    let e206 = this.getVersionId(), t10 = this._decorationsTree.collectNodesPostOrder();
    for (let n10 = 0, r10 = t10.length; n10 < r10; n10++) {
      let r11 = t10[n10], i10 = r11.range, a10 = r11.cachedAbsoluteStart - r11.start, o10 = this._buffer.getOffsetAt(i10.startLineNumber, i10.startColumn), s10 = this._buffer.getOffsetAt(i10.endLineNumber, i10.endColumn);
      r11.cachedAbsoluteStart = o10, r11.cachedAbsoluteEnd = s10, r11.cachedVersionId = e206, r11.start = o10 - a10, r11.end = s10 - a10, YE(r11);
    }
  }
  onBeforeAttached() {
    return this._attachedEditorCount++, this._attachedEditorCount === 1 && (this._tokenizationTextModelPart.handleDidChangeAttached(), this._onDidChangeAttached.fire(void 0)), this._attachedViews.attachView();
  }
  onBeforeDetached(e206) {
    this._attachedEditorCount--, this._attachedEditorCount === 0 && (this._tokenizationTextModelPart.handleDidChangeAttached(), this._onDidChangeAttached.fire(void 0)), this._attachedViews.detachView(e206);
  }
  isAttachedToEditor() {
    return this._attachedEditorCount > 0;
  }
  getAttachedEditorCount() {
    return this._attachedEditorCount;
  }
  isTooLargeForSyncing() {
    return this._isTooLargeForSyncing;
  }
  isTooLargeForTokenization() {
    return this._isTooLargeForTokenization;
  }
  isTooLargeForHeapOperation() {
    return this._isTooLargeForHeapOperation;
  }
  isDisposed() {
    return this._isDisposed;
  }
  isDominatedByLongLines() {
    if (this._assertNotDisposed(), this.isTooLargeForTokenization()) return false;
    let e206 = 0, t10 = 0, n10 = this._buffer.getLineCount();
    for (let r10 = 1; r10 <= n10; r10++) {
      let n11 = this._buffer.getLineLength(r10);
      n11 >= zde ? t10 += n11 : e206 += n11;
    }
    return t10 > e206;
  }
  get uri() {
    return this._associatedResource;
  }
  getOptions() {
    return this._assertNotDisposed(), this._options;
  }
  getFormattingOptions() {
    return { tabSize: this._options.indentSize, insertSpaces: this._options.insertSpaces };
  }
  updateOptions(e206) {
    this._assertNotDisposed();
    let t10 = e206.tabSize === void 0 ? this._options.tabSize : e206.tabSize, n10 = e206.indentSize === void 0 ? this._options.originalIndentSize : e206.indentSize, r10 = e206.insertSpaces === void 0 ? this._options.insertSpaces : e206.insertSpaces, i10 = e206.trimAutoWhitespace === void 0 ? this._options.trimAutoWhitespace : e206.trimAutoWhitespace, a10 = e206.bracketColorizationOptions === void 0 ? this._options.bracketPairColorizationOptions : e206.bracketColorizationOptions, o10 = new nm({ tabSize: t10, indentSize: n10, insertSpaces: r10, defaultEOL: this._options.defaultEOL, trimAutoWhitespace: i10, bracketPairColorizationOptions: a10 });
    if (this._options.equals(o10)) return;
    let s10 = this._options.createChangeEvent(o10);
    this._options = o10, this._bracketPairs.handleDidChangeOptions(s10), this._decorationProvider.handleDidChangeOptions(s10), this._onDidChangeOptions.fire(s10);
  }
  detectIndentation(e206, t10) {
    this._assertNotDisposed();
    let n10 = wE(this._buffer, t10, e206);
    this.updateOptions({ insertSpaces: n10.insertSpaces, tabSize: n10.tabSize, indentSize: n10.tabSize });
  }
  normalizeIndentation(e206) {
    return this._assertNotDisposed(), Ax(e206, this._options.indentSize, this._options.insertSpaces);
  }
  getVersionId() {
    return this._assertNotDisposed(), this._versionId;
  }
  mightContainRTL() {
    return this._buffer.mightContainRTL();
  }
  mightContainUnusualLineTerminators() {
    return this._buffer.mightContainUnusualLineTerminators();
  }
  removeUnusualLineTerminators(e206 = null) {
    let t10 = this.findMatches(_o.source, false, true, false, null, false, 1073741824);
    this._buffer.resetMightContainUnusualLineTerminators(), this.pushEditOperations(e206, t10.map((e207) => ({ range: e207.range, text: null })), () => null);
  }
  mightContainNonBasicASCII() {
    return this._buffer.mightContainNonBasicASCII();
  }
  getAlternativeVersionId() {
    return this._assertNotDisposed(), this._alternativeVersionId;
  }
  getInitialUndoRedoSnapshot() {
    return this._assertNotDisposed(), this._initialUndoRedoSnapshot;
  }
  getOffsetAt(e206) {
    this._assertNotDisposed();
    let t10 = this._validatePosition(e206.lineNumber, e206.column, 0);
    return this._buffer.getOffsetAt(t10.lineNumber, t10.column);
  }
  getPositionAt(e206) {
    this._assertNotDisposed();
    let t10 = Math.min(this._buffer.getLength(), Math.max(0, e206));
    return this._buffer.getPositionAt(t10);
  }
  _increaseVersionId() {
    this._versionId += 1, this._alternativeVersionId = this._versionId;
  }
  _overwriteVersionId(e206) {
    this._versionId = e206;
  }
  _overwriteAlternativeVersionId(e206) {
    this._alternativeVersionId = e206;
  }
  _overwriteInitialUndoRedoSnapshot(e206) {
    this._initialUndoRedoSnapshot = e206;
  }
  getValue(e206, t10 = false) {
    if (this._assertNotDisposed(), this.isTooLargeForHeapOperation()) throw new je(`Operation would exceed heap memory limits`);
    let n10 = this.getFullModelRange(), r10 = this.getValueInRange(n10, e206);
    return t10 ? this._buffer.getBOM() + r10 : r10;
  }
  createSnapshot(e206 = false) {
    return new Vde(this._buffer.createSnapshot(e206));
  }
  getValueLength(e206, t10 = false) {
    this._assertNotDisposed();
    let n10 = this.getFullModelRange(), r10 = this.getValueLengthInRange(n10, e206);
    return t10 ? this._buffer.getBOM().length + r10 : r10;
  }
  getValueInRange(e206, t10 = 0) {
    return this._assertNotDisposed(), this._buffer.getValueInRange(this.validateRange(e206), t10);
  }
  getValueLengthInRange(e206, t10 = 0) {
    return this._assertNotDisposed(), this._buffer.getValueLengthInRange(this.validateRange(e206), t10);
  }
  getCharacterCountInRange(e206, t10 = 0) {
    return this._assertNotDisposed(), this._buffer.getCharacterCountInRange(this.validateRange(e206), t10);
  }
  getLineCount() {
    return this._assertNotDisposed(), this._buffer.getLineCount();
  }
  getLineContent(e206) {
    if (this._assertNotDisposed(), e206 < 1 || e206 > this.getLineCount()) throw new je(`Illegal value for lineNumber`);
    return this._buffer.getLineContent(e206);
  }
  getLineLength(e206) {
    if (this._assertNotDisposed(), e206 < 1 || e206 > this.getLineCount()) throw new je(`Illegal value for lineNumber`);
    return this._buffer.getLineLength(e206);
  }
  getLinesContent() {
    if (this._assertNotDisposed(), this.isTooLargeForHeapOperation()) throw new je(`Operation would exceed heap memory limits`);
    return this._buffer.getLinesContent();
  }
  getEOL() {
    return this._assertNotDisposed(), this._buffer.getEOL();
  }
  getEndOfLineSequence() {
    return this._assertNotDisposed(), this._buffer.getEOL() === `
` ? 0 : 1;
  }
  getLineMinColumn(e206) {
    return this._assertNotDisposed(), 1;
  }
  getLineMaxColumn(e206) {
    if (this._assertNotDisposed(), e206 < 1 || e206 > this.getLineCount()) throw new je(`Illegal value for lineNumber`);
    return this._buffer.getLineLength(e206) + 1;
  }
  getLineFirstNonWhitespaceColumn(e206) {
    if (this._assertNotDisposed(), e206 < 1 || e206 > this.getLineCount()) throw new je(`Illegal value for lineNumber`);
    return this._buffer.getLineFirstNonWhitespaceColumn(e206);
  }
  getLineLastNonWhitespaceColumn(e206) {
    if (this._assertNotDisposed(), e206 < 1 || e206 > this.getLineCount()) throw new je(`Illegal value for lineNumber`);
    return this._buffer.getLineLastNonWhitespaceColumn(e206);
  }
  _validateRangeRelaxedNoAllocations(e206) {
    let t10 = this._buffer.getLineCount(), n10 = e206.startLineNumber, r10 = e206.startColumn, i10 = Math.floor(typeof n10 == `number` && !isNaN(n10) ? n10 : 1), a10 = Math.floor(typeof r10 == `number` && !isNaN(r10) ? r10 : 1);
    if (i10 < 1) i10 = 1, a10 = 1;
    else if (i10 > t10) i10 = t10, a10 = this.getLineMaxColumn(i10);
    else if (a10 <= 1) a10 = 1;
    else {
      let e207 = this.getLineMaxColumn(i10);
      a10 >= e207 && (a10 = e207);
    }
    let o10 = e206.endLineNumber, s10 = e206.endColumn, c10 = Math.floor(typeof o10 == `number` && !isNaN(o10) ? o10 : 1), l10 = Math.floor(typeof s10 == `number` && !isNaN(s10) ? s10 : 1);
    if (c10 < 1) c10 = 1, l10 = 1;
    else if (c10 > t10) c10 = t10, l10 = this.getLineMaxColumn(c10);
    else if (l10 <= 1) l10 = 1;
    else {
      let e207 = this.getLineMaxColumn(c10);
      l10 >= e207 && (l10 = e207);
    }
    return n10 === i10 && r10 === a10 && o10 === c10 && s10 === l10 && e206 instanceof M && !(e206 instanceof N) ? e206 : new M(i10, a10, c10, l10);
  }
  _isValidPosition(e206, t10, n10) {
    return typeof e206 != `number` || typeof t10 != `number` || isNaN(e206) || isNaN(t10) || e206 < 1 || t10 < 1 || (e206 | 0) !== e206 || (t10 | 0) !== t10 || e206 > this._buffer.getLineCount() ? false : t10 === 1 ? true : !(t10 > this.getLineMaxColumn(e206) || n10 === 1 && ao(this._buffer.getLineCharCode(e206, t10 - 2)));
  }
  _validatePosition(e206, t10, n10) {
    let r10 = Math.floor(typeof e206 == `number` && !isNaN(e206) ? e206 : 1), i10 = Math.floor(typeof t10 == `number` && !isNaN(t10) ? t10 : 1), a10 = this._buffer.getLineCount();
    if (r10 < 1) return new j(1, 1);
    if (r10 > a10) return new j(a10, this.getLineMaxColumn(a10));
    if (i10 <= 1) return new j(r10, 1);
    let o10 = this.getLineMaxColumn(r10);
    return i10 >= o10 ? new j(r10, o10) : n10 === 1 && ao(this._buffer.getLineCharCode(r10, i10 - 2)) ? new j(r10, i10 - 1) : new j(r10, i10);
  }
  validatePosition(e206) {
    return this._assertNotDisposed(), e206 instanceof j && this._isValidPosition(e206.lineNumber, e206.column, 1) ? e206 : this._validatePosition(e206.lineNumber, e206.column, 1);
  }
  isValidRange(e206) {
    return this._isValidRange(e206, 1);
  }
  _isValidRange(e206, t10) {
    let n10 = e206.startLineNumber, r10 = e206.startColumn, i10 = e206.endLineNumber, a10 = e206.endColumn;
    if (!this._isValidPosition(n10, r10, 0) || !this._isValidPosition(i10, a10, 0)) return false;
    if (t10 === 1) {
      let e207 = r10 > 1 ? this._buffer.getLineCharCode(n10, r10 - 2) : 0, t11 = a10 > 1 && a10 <= this._buffer.getLineLength(i10) ? this._buffer.getLineCharCode(i10, a10 - 2) : 0, o10 = ao(e207), s10 = ao(t11);
      return !o10 && !s10;
    }
    return true;
  }
  validateRange(e206) {
    if (this._assertNotDisposed(), e206 instanceof M && !(e206 instanceof N) && this._isValidRange(e206, 1)) return e206;
    let t10 = this._validatePosition(e206.startLineNumber, e206.startColumn, 0), n10 = this._validatePosition(e206.endLineNumber, e206.endColumn, 0), r10 = t10.lineNumber, i10 = t10.column, a10 = n10.lineNumber, o10 = n10.column;
    {
      let e207 = i10 > 1 ? this._buffer.getLineCharCode(r10, i10 - 2) : 0, t11 = o10 > 1 && o10 <= this._buffer.getLineLength(a10) ? this._buffer.getLineCharCode(a10, o10 - 2) : 0, n11 = ao(e207), s10 = ao(t11);
      return !n11 && !s10 ? new M(r10, i10, a10, o10) : r10 === a10 && i10 === o10 ? new M(r10, i10 - 1, a10, o10 - 1) : n11 && s10 ? new M(r10, i10 - 1, a10, o10 + 1) : n11 ? new M(r10, i10 - 1, a10, o10) : new M(r10, i10, a10, o10 + 1);
    }
  }
  modifyPosition(e206, t10) {
    this._assertNotDisposed();
    let n10 = this.getOffsetAt(e206) + t10;
    return this.getPositionAt(Math.min(this._buffer.getLength(), Math.max(0, n10)));
  }
  getFullModelRange() {
    this._assertNotDisposed();
    let e206 = this.getLineCount();
    return new M(1, 1, e206, this.getLineMaxColumn(e206));
  }
  findMatchesLineByLine(e206, t10, n10, r10) {
    return this._buffer.findMatchesLineByLine(e206, t10, n10, r10);
  }
  findMatches(e206, t10, n10, r10, i10, a10, o10 = Rde) {
    this._assertNotDisposed();
    let s10 = null;
    t10 !== null && typeof t10 != `boolean` && (Array.isArray(t10) || (t10 = [t10]), t10.every((e207) => M.isIRange(e207)) && (s10 = t10.map((e207) => this.validateRange(e207)))), s10 === null && (s10 = [this.getFullModelRange()]), s10 = s10.sort((e207, t11) => e207.startLineNumber - t11.startLineNumber || e207.startColumn - t11.startColumn);
    let c10 = [];
    c10.push(s10.reduce((e207, t11) => M.areIntersecting(e207, t11) ? e207.plusRange(t11) : (c10.push(e207), t11)));
    let l10;
    if (!n10 && e206.indexOf(`
`) < 0) {
      let t11 = new um(e206, n10, r10, i10).parseSearchRequest();
      if (!t11) return [];
      l10 = (e207) => this.findMatchesLineByLine(e207, t11, a10, o10);
    } else l10 = (t11) => mm.findMatches(this, new um(e206, n10, r10, i10), t11, a10, o10);
    return c10.map(l10).reduce((e207, t11) => e207.concat(t11), []);
  }
  findNextMatch(e206, t10, n10, r10, i10, a10) {
    this._assertNotDisposed();
    let o10 = this.validatePosition(t10);
    if (!n10 && e206.indexOf(`
`) < 0) {
      let t11 = new um(e206, n10, r10, i10).parseSearchRequest();
      if (!t11) return null;
      let s10 = this.getLineCount(), c10 = new M(o10.lineNumber, o10.column, s10, this.getLineMaxColumn(s10)), l10 = this.findMatchesLineByLine(c10, t11, a10, 1);
      return mm.findNextMatch(this, new um(e206, n10, r10, i10), o10, a10), l10.length > 0 || (c10 = new M(1, 1, o10.lineNumber, this.getLineMaxColumn(o10.lineNumber)), l10 = this.findMatchesLineByLine(c10, t11, a10, 1), l10.length > 0) ? l10[0] : null;
    }
    return mm.findNextMatch(this, new um(e206, n10, r10, i10), o10, a10);
  }
  findPreviousMatch(e206, t10, n10, r10, i10, a10) {
    this._assertNotDisposed();
    let o10 = this.validatePosition(t10);
    return mm.findPreviousMatch(this, new um(e206, n10, r10, i10), o10, a10);
  }
  pushStackElement() {
    this._commandManager.pushStackElement();
  }
  popStackElement() {
    this._commandManager.popStackElement();
  }
  pushEOL(e206) {
    if ((this.getEOL() === `
` ? 0 : 1) !== e206) try {
      this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit(), this._initialUndoRedoSnapshot === null && (this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri)), this._commandManager.pushEOL(e206);
    } finally {
      this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _validateEditOperation(e206) {
    return e206 instanceof am ? e206 : new am(e206.identifier || null, this.validateRange(e206.range), e206.text, e206.forceMoveMarkers || false, e206.isAutoWhitespaceEdit || false, e206._isTracked || false);
  }
  _validateEditOperations(e206) {
    let t10 = [];
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) t10[n10] = this._validateEditOperation(e206[n10]);
    return t10;
  }
  pushEditOperations(e206, t10, n10, r10, i10) {
    try {
      return this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit(), this._pushEditOperations(e206, this._validateEditOperations(t10), n10, r10, i10);
    } finally {
      this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _pushEditOperations(e206, t10, n10, r10, i10) {
    if (this._options.trimAutoWhitespace && this._trimAutoWhitespaceLines) {
      let n11 = t10.map((e207) => ({ range: this.validateRange(e207.range), text: e207.text })), r11 = true;
      if (e206) for (let t11 = 0, i11 = e206.length; t11 < i11; t11++) {
        let i12 = e206[t11], a10 = false;
        for (let e207 = 0, t12 = n11.length; e207 < t12; e207++) {
          let t13 = n11[e207].range, r12 = t13.startLineNumber > i12.endLineNumber, o10 = i12.startLineNumber > t13.endLineNumber;
          if (!r12 && !o10) {
            a10 = true;
            break;
          }
        }
        if (!a10) {
          r11 = false;
          break;
        }
      }
      if (r11) for (let e207 = 0, r12 = this._trimAutoWhitespaceLines.length; e207 < r12; e207++) {
        let r13 = this._trimAutoWhitespaceLines[e207], i11 = this.getLineMaxColumn(r13), a10 = true;
        for (let e208 = 0, t11 = n11.length; e208 < t11; e208++) {
          let t12 = n11[e208].range, o10 = n11[e208].text;
          if (!(r13 < t12.startLineNumber || r13 > t12.endLineNumber) && !(r13 === t12.startLineNumber && t12.startColumn === i11 && t12.isEmpty() && o10 && o10.length > 0 && o10.charAt(0) === `
`) && !(r13 === t12.startLineNumber && t12.startColumn === 1 && t12.isEmpty() && o10 && o10.length > 0 && o10.charAt(o10.length - 1) === `
`)) {
            a10 = false;
            break;
          }
        }
        if (a10) {
          let e208 = new M(r13, 1, r13, i11);
          t10.push(new am(null, e208, null, false, false, false));
        }
      }
      this._trimAutoWhitespaceLines = null;
    }
    return this._initialUndoRedoSnapshot === null && (this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri)), this._commandManager.pushEditOperation(e206, t10, n10, r10, i10);
  }
  _applyUndo(e206, t10, n10, r10) {
    let i10 = e206.map((e207) => {
      let t11 = this.getPositionAt(e207.newPosition), n11 = this.getPositionAt(e207.newEnd);
      return { range: new M(t11.lineNumber, t11.column, n11.lineNumber, n11.column), text: e207.oldText };
    });
    this._applyUndoRedoEdits(i10, t10, true, false, n10, r10);
  }
  _applyRedo(e206, t10, n10, r10) {
    let i10 = e206.map((e207) => {
      let t11 = this.getPositionAt(e207.oldPosition), n11 = this.getPositionAt(e207.oldEnd);
      return { range: new M(t11.lineNumber, t11.column, n11.lineNumber, n11.column), text: e207.newText };
    });
    this._applyUndoRedoEdits(i10, t10, false, true, n10, r10);
  }
  _applyUndoRedoEdits(e206, t10, n10, r10, i10, a10) {
    try {
      this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit(), this._isUndoing = n10, this._isRedoing = r10, this.applyEdits(e206, false), this.setEOL(t10), this._overwriteAlternativeVersionId(i10);
    } finally {
      this._isUndoing = false, this._isRedoing = false, this._eventEmitter.endDeferredEmit(a10), this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  applyEdits(e206, t10, n10) {
    try {
      this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit();
      let r10 = this._validateEditOperations(e206);
      return this._doApplyEdits(r10, t10 ?? false, n10 ?? mE.applyEdits());
    } finally {
      this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _doApplyEdits(e206, t10, n10) {
    let r10 = this._buffer.getLineCount(), i10 = this._buffer.applyEdits(e206, this._options.trimAutoWhitespace, t10), a10 = this._buffer.getLineCount(), o10 = i10.changes;
    if (this._trimAutoWhitespaceLines = i10.trimAutoWhitespaceLineNumbers, o10.length !== 0) {
      for (let e208 = 0, t12 = o10.length; e208 < t12; e208++) {
        let t13 = o10[e208];
        this._decorationsTree.acceptReplace(t13.rangeOffset, t13.rangeLength, t13.text.length, t13.forceMoveMarkers);
      }
      let e207 = [];
      this._increaseVersionId();
      let t11 = r10;
      for (let n11 = 0, r11 = o10.length; n11 < r11; n11++) {
        let r12 = o10[n11], [i11] = pT(r12.text);
        this._onDidChangeDecorations.fire();
        let s10 = r12.range.startLineNumber, c10 = r12.range.endLineNumber, l10 = c10 - s10, u10 = i11, d10 = Math.min(l10, u10), f10 = u10 - l10, p10 = a10 - t11 - f10 + s10, m10 = p10, h10 = p10 + u10, g10 = this._decorationsTree.getInjectedTextInInterval(this, this.getOffsetAt(new j(m10, 1)), this.getOffsetAt(new j(h10, this.getLineMaxColumn(h10))), 0), _10 = rT.fromDecorations(g10), v10 = new me(_10);
        for (let t12 = d10; t12 >= 0; t12--) {
          let n12 = s10 + t12, r13 = p10 + t12;
          v10.takeFromEndWhile((e208) => e208.lineNumber > r13);
          let i12 = v10.takeFromEndWhile((e208) => e208.lineNumber === r13);
          e207.push(new iT(n12, this.getLineContent(r13), i12));
        }
        if (d10 < l10) {
          let t12 = s10 + d10;
          e207.push(new Eue(t12 + 1, c10));
        }
        if (d10 < u10) {
          let n12 = new me(_10), r13 = s10 + d10, i12 = u10 - d10, o11 = a10 - t11 - i12 + r13 + 1, c11 = [], l11 = [];
          for (let e208 = 0; e208 < i12; e208++) {
            let t12 = o11 + e208;
            l11[e208] = this.getLineContent(t12), n12.takeWhile((e209) => e209.lineNumber < t12), c11[e208] = n12.takeWhile((e209) => e209.lineNumber === t12);
          }
          e207.push(new Due(r13 + 1, s10 + u10, l11, c11));
        }
        t11 += f10;
      }
      this._emitContentChangedEvent(new aT(e207, this.getVersionId(), this._isUndoing, this._isRedoing), { changes: o10, eol: this._buffer.getEOL(), isEolChange: false, versionId: this.getVersionId(), isUndoing: this._isUndoing, isRedoing: this._isRedoing, isFlush: false, detailedReasons: [n10], detailedReasonsChangeLengths: [o10.length] });
    }
    return i10.reverseEdits === null ? void 0 : i10.reverseEdits;
  }
  undo() {
    return this._undoRedoService.undo(this.uri);
  }
  canUndo() {
    return this._undoRedoService.canUndo(this.uri);
  }
  redo() {
    return this._undoRedoService.redo(this.uri);
  }
  canRedo() {
    return this._undoRedoService.canRedo(this.uri);
  }
  handleBeforeFireDecorationsChangedEvent(e206, t10, n10) {
    if (e206 && e206.size > 0) {
      let t11 = Array.from(e206).map((e207) => new iT(e207, this.getLineContent(e207), this._getInjectedTextInLine(e207)));
      this._onDidChangeInjectedText.fire(new oT(t11));
    }
    if (t10 && t10.size > 0) {
      let e207 = Array.from(t10).map((e208) => new wue(e208.ownerId, e208.decorationId, e208.lineNumber, e208.lineHeight));
      this._onDidChangeLineHeight.fire(new sT(e207));
    }
    if (n10 && n10.size > 0) {
      let e207 = Array.from(n10).map((e208) => new Tue(e208.ownerId, e208.lineNumber));
      this._onDidChangeFont.fire(new cT(e207));
    }
  }
  changeDecorations(e206, t10 = 0) {
    this._assertNotDisposed();
    try {
      return this._onDidChangeDecorations.beginDeferredEmit(), this._changeDecorations(t10, e206);
    } finally {
      this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _changeDecorations(e206, t10) {
    let n10 = { addDecoration: (t11, n11) => this._deltaDecorationsImpl(e206, [], [{ range: t11, options: n11 }])[0], changeDecoration: (t11, n11) => {
      this._changeDecorationImpl(e206, t11, n11);
    }, changeDecorationOptions: (t11, n11) => {
      this._changeDecorationOptionsImpl(e206, t11, GO(n11));
    }, removeDecoration: (t11) => {
      this._deltaDecorationsImpl(e206, [t11], []);
    }, deltaDecorations: (t11, n11) => t11.length === 0 && n11.length === 0 ? [] : this._deltaDecorationsImpl(e206, t11, n11) }, r10 = null;
    try {
      r10 = t10(n10);
    } catch (e207) {
      be(e207);
    }
    return n10.addDecoration = PO, n10.changeDecoration = PO, n10.changeDecorationOptions = PO, n10.removeDecoration = PO, n10.deltaDecorations = PO, r10;
  }
  deltaDecorations(e206, t10, n10 = 0) {
    if (this._assertNotDisposed(), e206 || (e206 = []), e206.length === 0 && t10.length === 0) return [];
    try {
      return this._deltaDecorationCallCnt++, this._deltaDecorationCallCnt > 1 && (console.warn(`Invoking deltaDecorations recursively could lead to leaking decorations.`), be(Error(`Invoking deltaDecorations recursively could lead to leaking decorations.`))), this._onDidChangeDecorations.beginDeferredEmit(), this._deltaDecorationsImpl(n10, e206, t10);
    } finally {
      this._onDidChangeDecorations.endDeferredEmit(), this._deltaDecorationCallCnt--;
    }
  }
  _getTrackedRange(e206) {
    return this.getDecorationRange(e206);
  }
  _setTrackedRange(e206, t10, n10) {
    let r10 = e206 ? this._decorations[e206] : null;
    if (!r10) return t10 ? this._deltaDecorationsImpl(0, [], [{ range: t10, options: WO[n10] }], true)[0] : null;
    if (!t10) return this._decorationsTree.delete(r10), delete this._decorations[r10.id], null;
    let i10 = this._validateRangeRelaxedNoAllocations(t10), a10 = this._buffer.getOffsetAt(i10.startLineNumber, i10.startColumn), o10 = this._buffer.getOffsetAt(i10.endLineNumber, i10.endColumn);
    return this._decorationsTree.delete(r10), r10.reset(this.getVersionId(), a10, o10, i10), r10.setOptions(WO[n10]), this._decorationsTree.insert(r10), r10.id;
  }
  removeAllDecorationsWithOwnerId(e206) {
    if (this._isDisposed) return;
    let t10 = this._decorationsTree.collectNodesFromOwner(e206);
    for (let e207 = 0, n10 = t10.length; e207 < n10; e207++) {
      let n11 = t10[e207];
      this._decorationsTree.delete(n11), delete this._decorations[n11.id];
    }
  }
  getDecorationOptions(e206) {
    let t10 = this._decorations[e206];
    return t10 ? t10.options : null;
  }
  getDecorationRange(e206) {
    let t10 = this._decorations[e206];
    return t10 ? this._decorationsTree.getNodeRange(this, t10) : null;
  }
  getLineDecorations(e206, t10 = 0, n10 = false, r10 = false) {
    return e206 < 1 || e206 > this.getLineCount() ? [] : this.getLinesDecorations(e206, e206, t10, n10, r10);
  }
  getLinesDecorations(e206, t10, n10 = 0, r10 = false, i10 = false, a10 = false) {
    let o10 = this.getLineCount(), s10 = Math.min(o10, Math.max(1, e206)), c10 = Math.min(o10, Math.max(1, t10)), l10 = new M(s10, 1, c10, this.getLineMaxColumn(c10)), u10 = this._getDecorationsInRange(l10, n10, r10, i10, a10);
    return te(u10, this._decorationProvider.getDecorationsInRange(l10, n10, r10)), u10;
  }
  getDecorationsInRange(e206, t10 = 0, n10 = false, r10 = false, i10 = false, a10 = false) {
    let o10 = this.validateRange(e206), s10 = this._getDecorationsInRange(o10, t10, n10, r10, a10);
    return te(s10, this._decorationProvider.getDecorationsInRange(o10, t10, n10, i10)), s10;
  }
  getOverviewRulerDecorations(e206 = 0, t10 = false, n10 = false) {
    return this._decorationsTree.getAll(this, e206, t10, n10, true, false);
  }
  getInjectedTextDecorations(e206 = 0) {
    return this._decorationsTree.getAllInjectedText(this, e206);
  }
  getCustomLineHeightsDecorations(e206 = 0) {
    return this._decorationsTree.getAllCustomLineHeights(this, e206);
  }
  _getInjectedTextInLine(e206) {
    let t10 = this._buffer.getOffsetAt(e206, 1), n10 = t10 + this._buffer.getLineLength(e206), r10 = this._decorationsTree.getInjectedTextInInterval(this, t10, n10, 0);
    return rT.fromDecorations(r10).filter((t11) => t11.lineNumber === e206);
  }
  getFontDecorationsInRange(e206, t10 = 0) {
    let n10 = this._buffer.getOffsetAt(e206.startLineNumber, e206.startColumn), r10 = this._buffer.getOffsetAt(e206.endLineNumber, e206.endColumn);
    return this._decorationsTree.getFontDecorationsInInterval(this, n10, r10, t10);
  }
  getAllDecorations(e206 = 0, t10 = false, n10 = false) {
    let r10 = this._decorationsTree.getAll(this, e206, t10, n10, false, false);
    return r10 = r10.concat(this._decorationProvider.getAllDecorations(e206, t10)), r10;
  }
  getAllMarginDecorations(e206 = 0) {
    return this._decorationsTree.getAll(this, e206, false, false, false, true);
  }
  _getDecorationsInRange(e206, t10, n10, r10, i10) {
    let a10 = this._buffer.getOffsetAt(e206.startLineNumber, e206.startColumn), o10 = this._buffer.getOffsetAt(e206.endLineNumber, e206.endColumn);
    return this._decorationsTree.getAllInInterval(this, a10, o10, t10, n10, r10, i10);
  }
  getRangeAt(e206, t10) {
    return this._buffer.getRangeAt(e206, t10 - e206);
  }
  _changeDecorationImpl(e206, t10, n10) {
    let r10 = this._decorations[t10];
    if (!r10) return;
    if (r10.options.after) {
      let e207 = this.getDecorationRange(t10);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e207.endLineNumber);
    }
    if (r10.options.before) {
      let e207 = this.getDecorationRange(t10);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e207.startLineNumber);
    }
    if (r10.options.lineHeight !== null) {
      let n11 = this.getDecorationRange(t10);
      this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e206, t10, n11.startLineNumber, null);
    }
    if (r10.options.affectsFont) {
      let n11 = this.getDecorationRange(t10);
      this._onDidChangeDecorations.recordLineAffectedByFontChange(e206, r10.id, n11.startLineNumber);
    }
    let i10 = this._validateRangeRelaxedNoAllocations(n10), a10 = this._buffer.getOffsetAt(i10.startLineNumber, i10.startColumn), o10 = this._buffer.getOffsetAt(i10.endLineNumber, i10.endColumn);
    this._decorationsTree.delete(r10), r10.reset(this.getVersionId(), a10, o10, i10), this._decorationsTree.insert(r10), this._onDidChangeDecorations.checkAffectedAndFire(r10.options), r10.options.after && this._onDidChangeDecorations.recordLineAffectedByInjectedText(i10.endLineNumber), r10.options.before && this._onDidChangeDecorations.recordLineAffectedByInjectedText(i10.startLineNumber), r10.options.lineHeight !== null && this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e206, t10, i10.startLineNumber, r10.options.lineHeight), r10.options.affectsFont && this._onDidChangeDecorations.recordLineAffectedByFontChange(e206, r10.id, i10.startLineNumber);
  }
  _changeDecorationOptionsImpl(e206, t10, n10) {
    let r10 = this._decorations[t10];
    if (!r10) return;
    let i10 = !!(r10.options.overviewRuler && r10.options.overviewRuler.color), a10 = !!(n10.overviewRuler && n10.overviewRuler.color);
    if (this._onDidChangeDecorations.checkAffectedAndFire(r10.options), this._onDidChangeDecorations.checkAffectedAndFire(n10), r10.options.after || n10.after) {
      let e207 = this._decorationsTree.getNodeRange(this, r10);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e207.endLineNumber);
    }
    if (r10.options.before || n10.before) {
      let e207 = this._decorationsTree.getNodeRange(this, r10);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e207.startLineNumber);
    }
    if (r10.options.lineHeight !== null || n10.lineHeight !== null) {
      let i11 = this._decorationsTree.getNodeRange(this, r10);
      this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e206, t10, i11.startLineNumber, n10.lineHeight);
    }
    if (r10.options.affectsFont || n10.affectsFont) {
      let n11 = this._decorationsTree.getNodeRange(this, r10);
      this._onDidChangeDecorations.recordLineAffectedByFontChange(e206, t10, n11.startLineNumber);
    }
    let o10 = i10 !== a10, s10 = Hde(n10) !== RO(r10);
    o10 || s10 ? (this._decorationsTree.delete(r10), r10.setOptions(n10), this._decorationsTree.insert(r10)) : r10.setOptions(n10);
  }
  _deltaDecorationsImpl(e206, t10, n10, r10 = false) {
    let i10 = this.getVersionId(), a10 = t10.length, o10 = 0, s10 = n10.length, c10 = 0;
    this._onDidChangeDecorations.beginDeferredEmit();
    try {
      let l10 = Array(s10);
      for (; o10 < a10 || c10 < s10; ) {
        let u10 = null;
        if (o10 < a10) {
          let n11;
          do
            n11 = t10[o10++], u10 = this._decorations[n11];
          while (!u10 && o10 < a10);
          if (u10) {
            if (u10.options.after) {
              let e207 = this._decorationsTree.getNodeRange(this, u10);
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(e207.endLineNumber);
            }
            if (u10.options.before) {
              let e207 = this._decorationsTree.getNodeRange(this, u10);
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(e207.startLineNumber);
            }
            if (u10.options.lineHeight !== null) {
              let t11 = this._decorationsTree.getNodeRange(this, u10);
              this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e206, n11, t11.startLineNumber, null);
            }
            if (u10.options.affectsFont) {
              let t11 = this._decorationsTree.getNodeRange(this, u10);
              this._onDidChangeDecorations.recordLineAffectedByFontChange(e206, n11, t11.startLineNumber);
            }
            this._decorationsTree.delete(u10), r10 || this._onDidChangeDecorations.checkAffectedAndFire(u10.options);
          }
        }
        if (c10 < s10) {
          if (!u10) {
            let e207 = ++this._lastDecorationId, t12 = `${this._instanceId};${e207}`;
            u10 = new zE(t12, 0, 0), this._decorations[t12] = u10;
          }
          let t11 = n10[c10], a11 = this._validateRangeRelaxedNoAllocations(t11.range), o11 = GO(t11.options), s11 = this._buffer.getOffsetAt(a11.startLineNumber, a11.startColumn), d10 = this._buffer.getOffsetAt(a11.endLineNumber, a11.endColumn);
          u10.ownerId = e206, u10.reset(i10, s11, d10, a11), u10.setOptions(o11), u10.options.after && this._onDidChangeDecorations.recordLineAffectedByInjectedText(a11.endLineNumber), u10.options.before && this._onDidChangeDecorations.recordLineAffectedByInjectedText(a11.startLineNumber), u10.options.lineHeight !== null && this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e206, u10.id, a11.startLineNumber, u10.options.lineHeight), u10.options.affectsFont && this._onDidChangeDecorations.recordLineAffectedByFontChange(e206, u10.id, a11.startLineNumber), r10 || this._onDidChangeDecorations.checkAffectedAndFire(o11), this._decorationsTree.insert(u10), l10[c10] = u10.id, c10++;
        } else u10 && delete this._decorations[u10.id];
      }
      return l10;
    } finally {
      this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  getLanguageId() {
    return this.tokenization.getLanguageId();
  }
  setLanguage(e206, t10) {
    typeof e206 == `string` ? (this._languageSelectionListener.clear(), this._setLanguage(e206, t10)) : (this._languageSelectionListener.value = e206.onDidChange(() => this._setLanguage(e206.languageId, t10)), this._setLanguage(e206.languageId, t10));
  }
  _setLanguage(e206, t10) {
    this.tokenization.setLanguageId(e206, t10), this._languageService.requestRichLanguageFeatures(e206);
  }
  getLanguageIdAtPosition(e206, t10) {
    return this.tokenization.getLanguageIdAtPosition(e206, t10);
  }
  getWordAtPosition(e206) {
    return this._tokenizationTextModelPart.getWordAtPosition(e206);
  }
  getWordUntilPosition(e206) {
    return this._tokenizationTextModelPart.getWordUntilPosition(e206);
  }
  normalizePosition(e206, t10) {
    return e206;
  }
  getLineIndentColumn(e206) {
    return IO(this.getLineContent(e206)) + 1;
  }
  toString() {
    return `TextModel(${this.uri.toString()})`;
  }
}, jO = _Ba, _Ba._MODEL_SYNC_LIMIT = 50 * 1024 * 1024, _Ba.LARGE_FILE_SIZE_THRESHOLD = 20 * 1024 * 1024, _Ba.LARGE_FILE_LINE_COUNT_THRESHOLD = 300 * 1e3, _Ba.LARGE_FILE_HEAP_OPERATION_THRESHOLD = 256 * 1024 * 1024, _Ba.DEFAULT_CREATION_OPTIONS = { isForSimpleWidget: false, tabSize: vn.tabSize, indentSize: vn.indentSize, insertSpaces: vn.insertSpaces, detectIndentation: false, defaultEOL: 1, trimAutoWhitespace: vn.trimAutoWhitespace, largeFileOptimizations: vn.largeFileOptimizations, bracketPairColorizationOptions: vn.bracketPairColorizationOptions }, _Ba);
FO = jO = Fde([AO(4, wO), AO(5, Jf), AO(6, bp), AO(7, V)], FO);
function IO(e206) {
  let t10 = 0;
  for (let n10 of e206) if (n10 === ` ` || n10 === `	`) t10++;
  else break;
  return t10;
}
function LO(e206) {
  return !!(e206.options.overviewRuler && e206.options.overviewRuler.color);
}
function Hde(e206) {
  return !!e206.after || !!e206.before;
}
function RO(e206) {
  return !!e206.options.after || !!e206.options.before;
}
var zO = class {
  constructor() {
    this._decorationsTree0 = new VE(), this._decorationsTree1 = new VE(), this._injectedTextDecorationsTree = new VE();
  }
  ensureAllNodesHaveRanges(e206) {
    this.getAll(e206, 0, false, false, false, false);
  }
  _ensureNodesHaveRanges(e206, t10) {
    for (let n10 of t10) n10.range === null && (n10.range = e206.getRangeAt(n10.cachedAbsoluteStart, n10.cachedAbsoluteEnd));
    return t10;
  }
  getAllInInterval(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = e206.getVersionId(), c10 = this._intervalSearch(t10, n10, r10, i10, a10, s10, o10);
    return this._ensureNodesHaveRanges(e206, c10);
  }
  _intervalSearch(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = this._decorationsTree0.intervalSearch(e206, t10, n10, r10, i10, a10, o10), c10 = this._decorationsTree1.intervalSearch(e206, t10, n10, r10, i10, a10, o10), l10 = this._injectedTextDecorationsTree.intervalSearch(e206, t10, n10, r10, i10, a10, o10);
    return s10.concat(c10).concat(l10);
  }
  getInjectedTextInInterval(e206, t10, n10, r10) {
    let i10 = e206.getVersionId(), a10 = this._injectedTextDecorationsTree.intervalSearch(t10, n10, r10, false, false, i10, false);
    return this._ensureNodesHaveRanges(e206, a10).filter((e207) => e207.options.showIfCollapsed || !e207.range.isEmpty());
  }
  getFontDecorationsInInterval(e206, t10, n10, r10) {
    let i10 = e206.getVersionId(), a10 = this._decorationsTree0.intervalSearch(t10, n10, r10, false, false, i10, false);
    return this._ensureNodesHaveRanges(e206, a10).filter((e207) => e207.options.affectsFont);
  }
  getAllInjectedText(e206, t10) {
    let n10 = e206.getVersionId(), r10 = this._injectedTextDecorationsTree.search(t10, false, false, n10, false);
    return this._ensureNodesHaveRanges(e206, r10).filter((e207) => e207.options.showIfCollapsed || !e207.range.isEmpty());
  }
  getAllCustomLineHeights(e206, t10) {
    let n10 = e206.getVersionId(), r10 = this._search(t10, false, false, false, n10, false);
    return this._ensureNodesHaveRanges(e206, r10).filter((e207) => typeof e207.options.lineHeight == `number`);
  }
  getAll(e206, t10, n10, r10, i10, a10) {
    let o10 = e206.getVersionId(), s10 = this._search(t10, n10, r10, i10, o10, a10);
    return this._ensureNodesHaveRanges(e206, s10);
  }
  _search(e206, t10, n10, r10, i10, a10) {
    if (r10) return this._decorationsTree1.search(e206, t10, n10, i10, a10);
    {
      let r11 = this._decorationsTree0.search(e206, t10, n10, i10, a10), o10 = this._decorationsTree1.search(e206, t10, n10, i10, a10), s10 = this._injectedTextDecorationsTree.search(e206, t10, n10, i10, a10);
      return r11.concat(o10).concat(s10);
    }
  }
  collectNodesFromOwner(e206) {
    let t10 = this._decorationsTree0.collectNodesFromOwner(e206), n10 = this._decorationsTree1.collectNodesFromOwner(e206), r10 = this._injectedTextDecorationsTree.collectNodesFromOwner(e206);
    return t10.concat(n10).concat(r10);
  }
  collectNodesPostOrder() {
    let e206 = this._decorationsTree0.collectNodesPostOrder(), t10 = this._decorationsTree1.collectNodesPostOrder(), n10 = this._injectedTextDecorationsTree.collectNodesPostOrder();
    return e206.concat(t10).concat(n10);
  }
  insert(e206) {
    RO(e206) ? this._injectedTextDecorationsTree.insert(e206) : LO(e206) ? this._decorationsTree1.insert(e206) : this._decorationsTree0.insert(e206);
  }
  delete(e206) {
    RO(e206) ? this._injectedTextDecorationsTree.delete(e206) : LO(e206) ? this._decorationsTree1.delete(e206) : this._decorationsTree0.delete(e206);
  }
  getNodeRange(e206, t10) {
    let n10 = e206.getVersionId();
    return t10.cachedVersionId !== n10 && this._resolveNode(t10, n10), t10.range === null && (t10.range = e206.getRangeAt(t10.cachedAbsoluteStart, t10.cachedAbsoluteEnd)), t10.range;
  }
  _resolveNode(e206, t10) {
    RO(e206) ? this._injectedTextDecorationsTree.resolveNode(e206, t10) : LO(e206) ? this._decorationsTree1.resolveNode(e206, t10) : this._decorationsTree0.resolveNode(e206, t10);
  }
  acceptReplace(e206, t10, n10, r10) {
    this._decorationsTree0.acceptReplace(e206, t10, n10, r10), this._decorationsTree1.acceptReplace(e206, t10, n10, r10), this._injectedTextDecorationsTree.acceptReplace(e206, t10, n10, r10);
  }
};
function BO(e206) {
  return e206.replace(/[^a-z0-9\-_]/gi, ` `);
}
var VO = class {
  constructor(e206) {
    this.color = e206.color || ``, this.darkColor = e206.darkColor || ``;
  }
}, Ude = class extends VO {
  constructor(e206) {
    super(e206), this._resolvedColor = null, this.position = typeof e206.position == `number` ? e206.position : Qp.Center;
  }
  getColor(e206) {
    return this._resolvedColor || (Ib(e206.type) && this.darkColor ? this._resolvedColor = this._resolveColor(this.darkColor, e206) : this._resolvedColor = this._resolveColor(this.color, e206)), this._resolvedColor;
  }
  invalidateCachedColor() {
    this._resolvedColor = null;
  }
  _resolveColor(e206, t10) {
    if (typeof e206 == `string`) return e206;
    let n10 = e206 ? t10.getColor(e206.id) : null;
    return n10 ? n10.toString() : ``;
  }
}, Wde = class {
  constructor(e206) {
    this.position = e206?.position ?? $p.Center, this.persistLane = e206?.persistLane;
  }
}, Gde = class extends VO {
  constructor(e206) {
    super(e206), this.position = e206.position, this.sectionHeaderStyle = e206.sectionHeaderStyle ?? null, this.sectionHeaderText = e206.sectionHeaderText ?? null;
  }
  getColor(e206) {
    return this._resolvedColor || (Ib(e206.type) && this.darkColor ? this._resolvedColor = this._resolveColor(this.darkColor, e206) : this._resolvedColor = this._resolveColor(this.color, e206)), this._resolvedColor;
  }
  invalidateCachedColor() {
    this._resolvedColor = void 0;
  }
  _resolveColor(e206, t10) {
    return typeof e206 == `string` ? Y.fromHex(e206) : t10.getColor(e206.id);
  }
}, HO = class e121 {
  static from(t10) {
    return t10 instanceof e121 ? t10 : new e121(t10);
  }
  constructor(e206) {
    this.content = e206.content || ``, this.tokens = e206.tokens ?? null, this.inlineClassName = e206.inlineClassName || null, this.inlineClassNameAffectsLetterSpacing = e206.inlineClassNameAffectsLetterSpacing || false, this.attachedData = e206.attachedData || null, this.cursorStops = e206.cursorStops || null;
  }
}, UO = class e122 {
  static register(t10) {
    return new e122(t10);
  }
  static createDynamic(t10) {
    return new e122(t10);
  }
  constructor(e206) {
    this.description = e206.description, this.blockClassName = e206.blockClassName ? BO(e206.blockClassName) : null, this.blockDoesNotCollapse = e206.blockDoesNotCollapse ?? null, this.blockIsAfterEnd = e206.blockIsAfterEnd ?? null, this.blockPadding = e206.blockPadding ?? null, this.stickiness = e206.stickiness || 0, this.zIndex = e206.zIndex || 0, this.className = e206.className ? BO(e206.className) : null, this.shouldFillLineOnLineBreak = e206.shouldFillLineOnLineBreak ?? null, this.hoverMessage = e206.hoverMessage || null, this.glyphMarginHoverMessage = e206.glyphMarginHoverMessage || null, this.lineNumberHoverMessage = e206.lineNumberHoverMessage || null, this.isWholeLine = e206.isWholeLine || false, this.lineHeight = e206.lineHeight ? Math.min(e206.lineHeight, Bde) : null, this.fontSize = e206.fontSize || null, this.affectsFont = !!e206.fontSize || !!e206.fontFamily || !!e206.fontWeight || !!e206.fontStyle, this.showIfCollapsed = e206.showIfCollapsed || false, this.collapseOnReplaceEdit = e206.collapseOnReplaceEdit || false, this.overviewRuler = e206.overviewRuler ? new Ude(e206.overviewRuler) : null, this.minimap = e206.minimap ? new Gde(e206.minimap) : null, this.glyphMargin = e206.glyphMarginClassName ? new Wde(e206.glyphMargin) : null, this.glyphMarginClassName = e206.glyphMarginClassName ? BO(e206.glyphMarginClassName) : null, this.linesDecorationsClassName = e206.linesDecorationsClassName ? BO(e206.linesDecorationsClassName) : null, this.lineNumberClassName = e206.lineNumberClassName ? BO(e206.lineNumberClassName) : null, this.linesDecorationsTooltip = e206.linesDecorationsTooltip ? yte(e206.linesDecorationsTooltip) : null, this.firstLineDecorationClassName = e206.firstLineDecorationClassName ? BO(e206.firstLineDecorationClassName) : null, this.marginClassName = e206.marginClassName ? BO(e206.marginClassName) : null, this.inlineClassName = e206.inlineClassName ? BO(e206.inlineClassName) : null, this.inlineClassNameAffectsLetterSpacing = e206.inlineClassNameAffectsLetterSpacing || false, this.beforeContentClassName = e206.beforeContentClassName ? BO(e206.beforeContentClassName) : null, this.afterContentClassName = e206.afterContentClassName ? BO(e206.afterContentClassName) : null, this.after = e206.after ? HO.from(e206.after) : null, this.before = e206.before ? HO.from(e206.before) : null, this.hideInCommentTokens = e206.hideInCommentTokens ?? false, this.hideInStringTokens = e206.hideInStringTokens ?? false, this.textDirection = e206.textDirection ?? null;
  }
};
UO.EMPTY = UO.register({ description: `empty` });
var WO = [UO.register({ description: `tracked-range-always-grows-when-typing-at-edges`, stickiness: 0 }), UO.register({ description: `tracked-range-never-grows-when-typing-at-edges`, stickiness: 1 }), UO.register({ description: `tracked-range-grows-only-when-typing-before`, stickiness: 2 }), UO.register({ description: `tracked-range-grows-only-when-typing-after`, stickiness: 3 })];
function GO(e206) {
  return e206 instanceof UO ? e206 : UO.createDynamic(e206);
}
var KO = class {
  static toKey(e206) {
    return `${e206.ownerId};${e206.decorationId};${e206.lineNumber}`;
  }
  constructor(e206, t10, n10, r10) {
    this.ownerId = e206, this.decorationId = t10, this.lineNumber = n10, this.lineHeight = r10;
  }
}, qO = class {
  static toKey(e206) {
    return `${e206.ownerId};${e206.decorationId};${e206.lineNumber}`;
  }
  constructor(e206, t10, n10) {
    this.ownerId = e206, this.decorationId = t10, this.lineNumber = n10;
  }
}, Kde = class extends D {
  constructor(e206) {
    super(), this.handleBeforeFire = e206, this._actual = this._register(new k()), this.event = this._actual.event, this._affectedInjectedTextLines = null, this._affectedLineHeights = null, this._affectedFontLines = null, this._deferredCnt = 0, this._shouldFireDeferred = false, this._affectsMinimap = false, this._affectsOverviewRuler = false, this._affectsGlyphMargin = false, this._affectsLineNumber = false;
  }
  beginDeferredEmit() {
    this._deferredCnt++;
  }
  endDeferredEmit() {
    this._deferredCnt--, this._deferredCnt === 0 && (this._shouldFireDeferred && this.doFire(), this._affectedInjectedTextLines?.clear(), this._affectedInjectedTextLines = null, this._affectedLineHeights?.clear(), this._affectedLineHeights = null, this._affectedFontLines?.clear(), this._affectedFontLines = null);
  }
  recordLineAffectedByInjectedText(e206) {
    this._affectedInjectedTextLines || (this._affectedInjectedTextLines = /* @__PURE__ */ new Set()), this._affectedInjectedTextLines.add(e206);
  }
  recordLineAffectedByLineHeightChange(e206, t10, n10, r10) {
    this._affectedLineHeights || (this._affectedLineHeights = new kO([], KO.toKey)), this._affectedLineHeights.add(new KO(e206, t10, n10, r10));
  }
  recordLineAffectedByFontChange(e206, t10, n10) {
    this._affectedFontLines || (this._affectedFontLines = new kO([], qO.toKey)), this._affectedFontLines.add(new qO(e206, t10, n10));
  }
  checkAffectedAndFire(e206) {
    this._affectsMinimap || (this._affectsMinimap = !!e206.minimap?.position), this._affectsOverviewRuler || (this._affectsOverviewRuler = !!e206.overviewRuler?.color), this._affectsGlyphMargin || (this._affectsGlyphMargin = !!e206.glyphMarginClassName), this._affectsLineNumber || (this._affectsLineNumber = !!e206.lineNumberClassName), this.tryFire();
  }
  fire() {
    this._affectsMinimap = true, this._affectsOverviewRuler = true, this._affectsGlyphMargin = true, this.tryFire();
  }
  tryFire() {
    this._deferredCnt === 0 ? this.doFire() : this._shouldFireDeferred = true;
  }
  doFire() {
    this.handleBeforeFire(this._affectedInjectedTextLines, this._affectedLineHeights, this._affectedFontLines);
    let e206 = { affectsMinimap: this._affectsMinimap, affectsOverviewRuler: this._affectsOverviewRuler, affectsGlyphMargin: this._affectsGlyphMargin, affectsLineNumber: this._affectsLineNumber };
    this._shouldFireDeferred = false, this._affectsMinimap = false, this._affectsOverviewRuler = false, this._affectsGlyphMargin = false, this._actual.fire(e206);
  }
}, qde = class extends D {
  constructor() {
    super(), this._fastEmitter = this._register(new k()), this.fastEvent = this._fastEmitter.event, this._slowEmitter = this._register(new k()), this.slowEvent = this._slowEmitter.event, this._deferredCnt = 0, this._deferredEvent = null;
  }
  beginDeferredEmit() {
    this._deferredCnt++;
  }
  endDeferredEmit(e206 = null) {
    if (this._deferredCnt--, this._deferredCnt === 0 && this._deferredEvent !== null) {
      this._deferredEvent.rawContentChangedEvent.resultingSelection = e206;
      let t10 = this._deferredEvent;
      this._deferredEvent = null, this._fastEmitter.fire(t10), this._slowEmitter.fire(t10);
    }
  }
  fire(e206) {
    if (this._deferredCnt > 0) {
      this._deferredEvent ? this._deferredEvent = this._deferredEvent.merge(e206) : this._deferredEvent = e206;
      return;
    }
    this._fastEmitter.fire(e206), this._slowEmitter.fire(e206);
  }
}, Jde = class e123 {
  static create(t10) {
    return new e123(t10.get(151), t10.get(150));
  }
  constructor(e206, t10) {
    this.classifier = new Yde(e206, t10);
  }
  createLineBreaksComputer(e206, t10, n10, r10, i10, a10) {
    let o10 = [], s10 = [], c10 = [];
    return { addRequest: (e207, t11, n11) => {
      o10.push(e207), s10.push(t11), c10.push(n11);
    }, finalize: () => {
      let l10 = e206.typicalFullwidthCharacterWidth / e206.typicalHalfwidthCharacterWidth, u10 = [];
      for (let e207 = 0, d10 = o10.length; e207 < d10; e207++) {
        let d11 = s10[e207], f10 = c10[e207], p10 = o10[e207], m10 = a10 && p10.includes(`"`) && p10.includes(`\\n`);
        f10 && !f10.injectionOptions && !d11 && !m10 ? u10[e207] = Xde(this.classifier, f10, p10, t10, n10, l10, r10, i10) : u10[e207] = Zde(this.classifier, p10, d11, t10, n10, l10, r10, i10, m10);
      }
      return JO.length = 0, YO.length = 0, u10;
    } };
  }
}, Yde = class extends Lp {
  constructor(e206, t10) {
    super(0);
    for (let t11 = 0; t11 < e206.length; t11++) this.set(e206.charCodeAt(t11), 1);
    for (let e207 = 0; e207 < t10.length; e207++) this.set(t10.charCodeAt(e207), 2);
  }
  get(e206) {
    return e206 >= 0 && e206 < 256 ? this._asciiMap[e206] : e206 >= 12352 && e206 <= 12543 || e206 >= 13312 && e206 <= 19903 || e206 >= 19968 && e206 <= 40959 ? 3 : this._map.get(e206) || this._defaultValue;
  }
}, JO = [], YO = [];
function Xde(e206, t10, n10, r10, i10, a10, o10, s10) {
  if (i10 === -1) return null;
  let c10 = n10.length;
  if (c10 <= 1) return null;
  let l10 = s10 === `keepAll`, u10 = t10.breakOffsets, d10 = t10.breakOffsetsVisibleColumn, f10 = $O(n10, r10, i10, a10, o10), p10 = i10 - f10, m10 = JO, h10 = YO, g10 = 0, _10 = 0, v10 = 0, y10 = i10, b10 = u10.length, x10 = 0;
  if (x10 >= 0) {
    let e207 = Math.abs(d10[x10] - y10);
    for (; x10 + 1 < b10; ) {
      let t11 = Math.abs(d10[x10 + 1] - y10);
      if (t11 >= e207) break;
      e207 = t11, x10++;
    }
  }
  for (; x10 < b10; ) {
    let t11 = x10 < 0 ? 0 : u10[x10], i11 = x10 < 0 ? 0 : d10[x10];
    _10 > t11 && (t11 = _10, i11 = v10);
    let o11 = 0, s11 = 0, f11 = 0, S10 = 0;
    if (i11 <= y10) {
      let v11 = i11, b11 = t11 === 0 ? 0 : n10.charCodeAt(t11 - 1), x11 = t11 === 0 ? 0 : e206.get(b11), ee3 = true;
      for (let i12 = t11; i12 < c10; i12++) {
        let t12 = i12, c11 = n10.charCodeAt(i12), u11, d11;
        if (ao(c11) ? (i12++, u11 = 0, d11 = 2) : (u11 = e206.get(c11), d11 = XO(c11, v11, r10, a10)), t12 > _10 && QO(b11, x11, c11, u11, l10) && (o11 = t12, s11 = v11), v11 += d11, v11 > y10) {
          t12 > _10 ? (f11 = t12, S10 = v11 - d11) : (f11 = i12 + 1, S10 = v11), v11 - s11 > p10 && (o11 = 0), ee3 = false;
          break;
        }
        b11 = c11, x11 = u11;
      }
      if (ee3) {
        g10 > 0 && (m10[g10] = u10[u10.length - 1], h10[g10] = d10[u10.length - 1], g10++);
        break;
      }
    }
    if (o11 === 0) {
      let c11 = i11, u11 = n10.charCodeAt(t11), d11 = e206.get(u11), m11 = false;
      for (let r11 = t11 - 1; r11 >= _10; r11--) {
        let t12 = r11 + 1, i12 = n10.charCodeAt(r11);
        if (i12 === 9) {
          m11 = true;
          break;
        }
        let h11, g11;
        if (oo(i12) ? (r11--, h11 = 0, g11 = 2) : (h11 = e206.get(i12), g11 = yo(i12) ? a10 : 1), c11 <= y10) {
          if (f11 === 0 && (f11 = t12, S10 = c11), c11 <= y10 - p10) break;
          if (QO(i12, h11, u11, d11, l10)) {
            o11 = t12, s11 = c11;
            break;
          }
        }
        c11 -= g11, u11 = i12, d11 = h11;
      }
      if (o11 !== 0) {
        let e207 = p10 - (S10 - s11);
        if (e207 <= r10) {
          let t12 = n10.charCodeAt(f11), i12;
          i12 = ao(t12) ? 2 : XO(t12, S10, r10, a10), e207 - i12 < 0 && (o11 = 0);
        }
      }
      if (m11) {
        x10--;
        continue;
      }
    }
    if (o11 === 0 && (o11 = f11, s11 = S10), o11 <= _10) {
      let e207 = n10.charCodeAt(_10);
      ao(e207) ? (o11 = _10 + 2, s11 = v10 + 2) : (o11 = _10 + 1, s11 = v10 + XO(e207, v10, r10, a10));
    }
    for (_10 = o11, m10[g10] = o11, v10 = s11, h10[g10] = s11, g10++, y10 = s11 + p10; x10 < 0 || x10 < b10 && d10[x10] < s11; ) x10++;
    let ee2 = Math.abs(d10[x10] - y10);
    for (; x10 + 1 < b10; ) {
      let e207 = Math.abs(d10[x10 + 1] - y10);
      if (e207 >= ee2) break;
      ee2 = e207, x10++;
    }
  }
  return g10 === 0 ? null : (m10.length = g10, h10.length = g10, JO = t10.breakOffsets, YO = t10.breakOffsetsVisibleColumn, t10.breakOffsets = m10, t10.breakOffsetsVisibleColumn = h10, t10.wrappedTextIndentLength = f10, t10);
}
function Zde(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
  let l10 = rT.applyInjectedText(t10, n10), u10, d10;
  if (n10 && n10.length > 0 ? (u10 = n10.map((e207) => e207.options), d10 = n10.map((e207) => e207.column - 1)) : (u10 = null, d10 = null), i10 === -1) return u10 ? new $w(d10, u10, [l10.length], [], 0) : null;
  let f10 = l10.length;
  if (f10 <= 1) return u10 ? new $w(d10, u10, [l10.length], [], 0) : null;
  let p10 = s10 === `keepAll`, m10 = $O(l10, r10, i10, a10, o10), h10 = i10 - m10, g10 = [], _10 = [], v10 = 0, y10 = 0, b10 = 0, x10 = i10, S10 = l10.charCodeAt(0), ee2 = e206.get(S10), te2 = XO(S10, 0, r10, a10), ne2 = 1;
  ao(S10) && (te2 += 1, S10 = l10.charCodeAt(1), ee2 = e206.get(S10), ne2++);
  for (let t11 = ne2; t11 < f10; t11++) {
    let n11 = t11, i11 = l10.charCodeAt(t11), o11, s11, u11 = false;
    ao(i11) ? (t11++, o11 = 0, s11 = 2) : (o11 = e206.get(i11), s11 = XO(i11, te2, r10, a10)), c10 && Qde(l10, t11) ? (y10 = n11, b10 = te2, u11 = true) : QO(S10, ee2, i11, o11, p10) && (y10 = n11, b10 = te2), te2 += s11, (te2 > x10 || u11) && ((y10 === 0 || te2 - b10 > h10) && (y10 = n11, b10 = te2 - s11), g10[v10] = y10, _10[v10] = b10, v10++, x10 = b10 + h10, y10 = 0), S10 = i11, ee2 = o11;
  }
  return v10 === 0 && (!n10 || n10.length === 0) ? null : (g10[v10] = f10, _10[v10] = te2, new $w(d10, u10, g10, _10, m10));
}
function XO(e206, t10, n10, r10) {
  return e206 === 9 ? n10 - t10 % n10 : yo(e206) || e206 < 32 ? r10 : 1;
}
function ZO(e206, t10) {
  return t10 - e206 % t10;
}
function Qde(e206, t10) {
  if (t10 >= 2 && e206.charAt(t10 - 1) === `n`) {
    let n10 = 0;
    for (let r10 = t10 - 2; r10 >= 0; r10--) if (e206.charAt(r10) === `\\`) n10++;
    else return n10 % 2 == 1;
  }
  return false;
}
function QO(e206, t10, n10, r10, i10) {
  return n10 !== 32 && (t10 === 2 && r10 !== 2 || t10 !== 1 && r10 === 1 || !i10 && t10 === 3 && r10 !== 2 || !i10 && r10 === 3 && t10 !== 1);
}
function $O(e206, t10, n10, r10, i10) {
  let a10 = 0;
  if (i10 !== 0) {
    let o10 = Ga(e206);
    if (o10 !== -1) {
      for (let n11 = 0; n11 < o10; n11++) {
        let r11 = e206.charCodeAt(n11) === 9 ? ZO(a10, t10) : 1;
        a10 += r11;
      }
      let s10 = i10 === 3 ? 2 : +(i10 === 2);
      for (let e207 = 0; e207 < s10; e207++) {
        let e208 = ZO(a10, t10);
        a10 += e208;
      }
      a10 + r10 > n10 && (a10 = 0);
    }
  }
  return a10;
}
var ek = class e124 {
  constructor(e206) {
    this._selTrackedRange = null, this._trackSelection = true, this._setState(e206, new Nx(new M(1, 1, 1, 1), 0, 0, new j(1, 1), 0), new Nx(new M(1, 1, 1, 1), 0, 0, new j(1, 1), 0));
  }
  dispose(e206) {
    this._removeTrackedRange(e206);
  }
  startTrackingSelection(e206) {
    this._trackSelection = true, this._updateTrackedRange(e206);
  }
  stopTrackingSelection(e206) {
    this._trackSelection = false, this._removeTrackedRange(e206);
  }
  _updateTrackedRange(e206) {
    this._trackSelection && (this._selTrackedRange = e206.model._setTrackedRange(this._selTrackedRange, this.modelState.selection, 0));
  }
  _removeTrackedRange(e206) {
    this._selTrackedRange = e206.model._setTrackedRange(this._selTrackedRange, null, 0);
  }
  asCursorState() {
    return new Mx(this.modelState, this.viewState);
  }
  readSelectionFromMarkers(e206) {
    let t10 = e206.model._getTrackedRange(this._selTrackedRange);
    return this.modelState.selection.isEmpty() && !t10.isEmpty() ? N.fromRange(t10.collapseToEnd(), this.modelState.selection.getDirection()) : N.fromRange(t10, this.modelState.selection.getDirection());
  }
  ensureValidState(e206) {
    this._setState(e206, this.modelState, this.viewState);
  }
  setState(e206, t10, n10) {
    this._setState(e206, t10, n10);
  }
  static _validatePositionWithCache(e206, t10, n10, r10) {
    return t10.equals(n10) ? r10 : e206.normalizePosition(t10, 2);
  }
  static _validateViewState(e206, t10) {
    let n10 = t10.position, r10 = t10.selectionStart.getStartPosition(), i10 = t10.selectionStart.getEndPosition(), a10 = e206.normalizePosition(n10, 2), o10 = this._validatePositionWithCache(e206, r10, n10, a10), s10 = this._validatePositionWithCache(e206, i10, r10, o10);
    return n10.equals(a10) && r10.equals(o10) && i10.equals(s10) ? t10 : new Nx(M.fromPositions(o10, s10), t10.selectionStartKind, t10.selectionStartLeftoverVisibleColumns + r10.column - o10.column, a10, t10.leftoverVisibleColumns + n10.column - a10.column);
  }
  _setState(t10, n10, r10) {
    if (r10 && (r10 = e124._validateViewState(t10.viewModel, r10)), n10) {
      let e206 = t10.model.validateRange(n10.selectionStart), r11 = n10.selectionStart.equalsRange(e206) ? n10.selectionStartLeftoverVisibleColumns : 0, i10 = t10.model.validatePosition(n10.position), a10 = n10.position.equals(i10) ? n10.leftoverVisibleColumns : 0;
      n10 = new Nx(e206, n10.selectionStartKind, r11, i10, a10);
    } else {
      if (!r10) return;
      let e206 = t10.model.validateRange(t10.coordinatesConverter.convertViewRangeToModelRange(r10.selectionStart)), i10 = t10.model.validatePosition(t10.coordinatesConverter.convertViewPositionToModelPosition(r10.position));
      n10 = new Nx(e206, r10.selectionStartKind, r10.selectionStartLeftoverVisibleColumns, i10, r10.leftoverVisibleColumns);
    }
    if (r10) {
      let e206 = t10.coordinatesConverter.validateViewRange(r10.selectionStart, n10.selectionStart), i10 = t10.coordinatesConverter.validateViewPosition(r10.position, n10.position);
      r10 = new Nx(e206, n10.selectionStartKind, n10.selectionStartLeftoverVisibleColumns, i10, n10.leftoverVisibleColumns);
    } else {
      let e206 = t10.coordinatesConverter.convertModelPositionToViewPosition(new j(n10.selectionStart.startLineNumber, n10.selectionStart.startColumn)), i10 = t10.coordinatesConverter.convertModelPositionToViewPosition(new j(n10.selectionStart.endLineNumber, n10.selectionStart.endColumn)), a10 = new M(e206.lineNumber, e206.column, i10.lineNumber, i10.column), o10 = t10.coordinatesConverter.convertModelPositionToViewPosition(n10.position);
      r10 = new Nx(a10, n10.selectionStartKind, n10.selectionStartLeftoverVisibleColumns, o10, n10.leftoverVisibleColumns);
    }
    this.modelState = n10, this.viewState = r10, this._updateTrackedRange(t10);
  }
}, tk = class {
  constructor(e206) {
    this.context = e206, this.cursors = [new ek(e206)], this.lastAddedCursorIndex = 0;
  }
  dispose() {
    for (let e206 of this.cursors) e206.dispose(this.context);
  }
  startTrackingSelections() {
    for (let e206 of this.cursors) e206.startTrackingSelection(this.context);
  }
  stopTrackingSelections() {
    for (let e206 of this.cursors) e206.stopTrackingSelection(this.context);
  }
  updateContext(e206) {
    this.context = e206;
  }
  ensureValidState() {
    for (let e206 of this.cursors) e206.ensureValidState(this.context);
  }
  readSelectionFromMarkers() {
    return this.cursors.map((e206) => e206.readSelectionFromMarkers(this.context));
  }
  getAll() {
    return this.cursors.map((e206) => e206.asCursorState());
  }
  getViewPositions() {
    return this.cursors.map((e206) => e206.viewState.position);
  }
  getTopMostViewPosition() {
    return Im(this.cursors, ce((e206) => e206.viewState.position, j.compare)).viewState.position;
  }
  getBottomMostViewPosition() {
    return Fm(this.cursors, ce((e206) => e206.viewState.position, j.compare)).viewState.position;
  }
  getSelections() {
    return this.cursors.map((e206) => e206.modelState.selection);
  }
  getViewSelections() {
    return this.cursors.map((e206) => e206.viewState.selection);
  }
  setSelections(e206) {
    this.setStates(Mx.fromModelSelections(e206));
  }
  getPrimaryCursor() {
    return this.cursors[0].asCursorState();
  }
  setStates(e206) {
    e206 !== null && (this.cursors[0].setState(this.context, e206[0].modelState, e206[0].viewState), this._setSecondaryStates(e206.slice(1)));
  }
  _setSecondaryStates(e206) {
    let t10 = this.cursors.length - 1, n10 = e206.length;
    if (t10 < n10) {
      let e207 = n10 - t10;
      for (let t11 = 0; t11 < e207; t11++) this._addSecondaryCursor();
    } else if (t10 > n10) {
      let e207 = t10 - n10;
      for (let t11 = 0; t11 < e207; t11++) this._removeSecondaryCursor(this.cursors.length - 2);
    }
    for (let t11 = 0; t11 < n10; t11++) this.cursors[t11 + 1].setState(this.context, e206[t11].modelState, e206[t11].viewState);
  }
  killSecondaryCursors() {
    this._setSecondaryStates([]);
  }
  _addSecondaryCursor() {
    this.cursors.push(new ek(this.context)), this.lastAddedCursorIndex = this.cursors.length - 1;
  }
  getLastAddedCursorIndex() {
    return this.cursors.length === 1 || this.lastAddedCursorIndex === 0 ? 0 : this.lastAddedCursorIndex;
  }
  _removeSecondaryCursor(e206) {
    this.lastAddedCursorIndex >= e206 + 1 && this.lastAddedCursorIndex--, this.cursors[e206 + 1].dispose(this.context), this.cursors.splice(e206 + 1, 1);
  }
  normalize() {
    if (this.cursors.length === 1) return;
    let e206 = this.cursors.slice(0), t10 = [];
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) t10.push({ index: n10, selection: e206[n10].modelState.selection });
    t10.sort(ce((e207) => e207.selection, M.compareRangesUsingStarts));
    for (let n10 = 0; n10 < t10.length - 1; n10++) {
      let r10 = t10[n10], i10 = t10[n10 + 1], a10 = r10.selection, o10 = i10.selection;
      if (!this.context.cursorConfig.multiCursorMergeOverlapping) continue;
      let s10;
      if (s10 = o10.isEmpty() || a10.isEmpty() ? o10.getStartPosition().isBeforeOrEqual(a10.getEndPosition()) : o10.getStartPosition().isBefore(a10.getEndPosition()), s10) {
        let a11 = r10.index < i10.index ? n10 : n10 + 1, o11 = r10.index < i10.index ? n10 + 1 : n10, s11 = t10[o11].index, c10 = t10[a11].index, l10 = t10[o11].selection, u10 = t10[a11].selection;
        if (!l10.equalsSelection(u10)) {
          let n11 = l10.plusRange(u10), r11 = l10.selectionStartLineNumber === l10.startLineNumber && l10.selectionStartColumn === l10.startColumn, i11 = u10.selectionStartLineNumber === u10.startLineNumber && u10.selectionStartColumn === u10.startColumn, o12;
          s11 === this.lastAddedCursorIndex ? (o12 = r11, this.lastAddedCursorIndex = c10) : o12 = i11;
          let d10;
          d10 = o12 ? new N(n11.startLineNumber, n11.startColumn, n11.endLineNumber, n11.endColumn) : new N(n11.endLineNumber, n11.endColumn, n11.startLineNumber, n11.startColumn), t10[a11].selection = d10;
          let f10 = Mx.fromModelSelection(d10);
          e206[c10].setState(this.context, f10.modelState, f10.viewState);
        }
        for (let e207 of t10) e207.index > s11 && e207.index--;
        e206.splice(s11, 1), t10.splice(o11, 1), this._removeSecondaryCursor(s11 - 1), n10--;
      }
    }
  }
}, nk = class {
  constructor(e206, t10, n10, r10) {
    this._cursorContextBrand = void 0, this.model = e206, this.viewModel = t10, this.coordinatesConverter = n10, this.cursorConfig = r10;
  }
}, $de = class {
  constructor() {
    this.type = 0;
  }
}, efe = class {
  constructor() {
    this.type = 1;
  }
}, tfe = class {
  constructor(e206) {
    this.type = 2, this._source = e206;
  }
  hasChanged(e206) {
    return this._source.hasChanged(e206);
  }
}, nfe = class {
  constructor(e206, t10, n10) {
    this.selections = e206, this.modelSelections = t10, this.reason = n10, this.type = 3;
  }
}, rk = class {
  constructor(e206) {
    this.type = 4, e206 ? (this.affectsMinimap = e206.affectsMinimap, this.affectsOverviewRuler = e206.affectsOverviewRuler, this.affectsGlyphMargin = e206.affectsGlyphMargin, this.affectsLineNumber = e206.affectsLineNumber) : (this.affectsMinimap = true, this.affectsOverviewRuler = true, this.affectsGlyphMargin = true, this.affectsLineNumber = true);
  }
}, ik = class {
  constructor() {
    this.type = 5;
  }
}, rfe = class {
  constructor(e206) {
    this.type = 6, this.isFocused = e206;
  }
}, ife = class {
  constructor() {
    this.type = 7;
  }
}, ak = class {
  constructor() {
    this.type = 8;
  }
}, ok = class {
  constructor(e206, t10) {
    this.fromLineNumber = e206, this.count = t10, this.type = 9;
  }
}, sk = class {
  constructor(e206, t10) {
    this.type = 10, this.fromLineNumber = e206, this.toLineNumber = t10;
  }
}, ck = class {
  constructor(e206, t10) {
    this.type = 11, this.fromLineNumber = e206, this.toLineNumber = t10;
  }
}, lk = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.source = e206, this.minimalReveal = t10, this.range = n10, this.selections = r10, this.verticalType = i10, this.revealHorizontal = a10, this.scrollType = o10, this.type = 12;
  }
}, afe = class {
  constructor(e206) {
    this.type = 13, this.scrollWidth = e206.scrollWidth, this.scrollLeft = e206.scrollLeft, this.scrollHeight = e206.scrollHeight, this.scrollTop = e206.scrollTop, this.scrollWidthChanged = e206.scrollWidthChanged, this.scrollLeftChanged = e206.scrollLeftChanged, this.scrollHeightChanged = e206.scrollHeightChanged, this.scrollTopChanged = e206.scrollTopChanged;
  }
}, ofe = class {
  constructor(e206) {
    this.theme = e206, this.type = 14;
  }
}, sfe = class {
  constructor(e206) {
    this.type = 15, this.ranges = e206;
  }
}, cfe = class {
  constructor() {
    this.type = 16;
  }
}, lfe = class {
  constructor() {
    this.type = 17;
  }
}, ufe = class extends D {
  constructor() {
    super(), this._onEvent = this._register(new k()), this.onEvent = this._onEvent.event, this._eventHandlers = [], this._viewEventQueue = null, this._isConsumingViewEventQueue = false, this._collector = null, this._collectorCnt = 0, this._outgoingEvents = [];
  }
  emitOutgoingEvent(e206) {
    this._addOutgoingEvent(e206), this._emitOutgoingEvents();
  }
  _addOutgoingEvent(e206) {
    for (let t10 = 0, n10 = this._outgoingEvents.length; t10 < n10; t10++) {
      let n11 = this._outgoingEvents[t10].kind === e206.kind ? this._outgoingEvents[t10].attemptToMerge(e206) : null;
      if (n11) {
        this._outgoingEvents[t10] = n11;
        return;
      }
    }
    this._outgoingEvents.push(e206);
  }
  _emitOutgoingEvents() {
    for (; this._outgoingEvents.length > 0; ) {
      if (this._collector || this._isConsumingViewEventQueue) return;
      let e206 = this._outgoingEvents.shift();
      e206.isNoOp() || this._onEvent.fire(e206);
    }
  }
  addViewEventHandler(e206) {
    for (let t10 = 0, n10 = this._eventHandlers.length; t10 < n10; t10++) this._eventHandlers[t10] === e206 && console.warn(`Detected duplicate listener in ViewEventDispatcher`, e206);
    this._eventHandlers.push(e206);
  }
  removeViewEventHandler(e206) {
    for (let t10 = 0; t10 < this._eventHandlers.length; t10++) if (this._eventHandlers[t10] === e206) {
      this._eventHandlers.splice(t10, 1);
      break;
    }
  }
  beginEmitViewEvents() {
    return this._collectorCnt++, this._collectorCnt === 1 && (this._collector = new dfe()), this._collector;
  }
  endEmitViewEvents() {
    if (this._collectorCnt--, this._collectorCnt === 0) {
      let e206 = this._collector.outgoingEvents, t10 = this._collector.viewEvents;
      this._collector = null;
      for (let t11 of e206) this._addOutgoingEvent(t11);
      t10.length > 0 && this._emitMany(t10);
    }
    this._emitOutgoingEvents();
  }
  emitSingleViewEvent(e206) {
    try {
      this.beginEmitViewEvents().emitViewEvent(e206);
    } finally {
      this.endEmitViewEvents();
    }
  }
  _emitMany(e206) {
    this._viewEventQueue ? this._viewEventQueue = this._viewEventQueue.concat(e206) : this._viewEventQueue = e206, this._isConsumingViewEventQueue || this._consumeViewEventQueue();
  }
  _consumeViewEventQueue() {
    try {
      this._isConsumingViewEventQueue = true, this._doConsumeQueue();
    } finally {
      this._isConsumingViewEventQueue = false;
    }
  }
  _doConsumeQueue() {
    for (; this._viewEventQueue; ) {
      let e206 = this._viewEventQueue;
      this._viewEventQueue = null;
      let t10 = this._eventHandlers.slice(0);
      for (let n10 of t10) n10.handleEvents(e206);
    }
  }
}, dfe = class {
  constructor() {
    this.viewEvents = [], this.outgoingEvents = [];
  }
  emitViewEvent(e206) {
    this.viewEvents.push(e206);
  }
  emitOutgoingEvent(e206) {
    this.outgoingEvents.push(e206);
  }
}, ffe = class e125 {
  constructor(e206, t10, n10, r10) {
    this.kind = 0, this._oldContentWidth = e206, this._oldContentHeight = t10, this.contentWidth = n10, this.contentHeight = r10, this.contentWidthChanged = this._oldContentWidth !== this.contentWidth, this.contentHeightChanged = this._oldContentHeight !== this.contentHeight;
  }
  isNoOp() {
    return !this.contentWidthChanged && !this.contentHeightChanged;
  }
  attemptToMerge(t10) {
    return t10.kind === this.kind ? new e125(this._oldContentWidth, this._oldContentHeight, t10.contentWidth, t10.contentHeight) : null;
  }
}, uk = class e126 {
  constructor(e206, t10) {
    this.kind = 1, this.oldHasFocus = e206, this.hasFocus = t10;
  }
  isNoOp() {
    return this.oldHasFocus === this.hasFocus;
  }
  attemptToMerge(t10) {
    return t10.kind === this.kind ? new e126(this.oldHasFocus, t10.hasFocus) : null;
  }
}, pfe = class {
  constructor(e206, t10) {
    this.kind = 2, this.oldHasFocus = e206, this.hasFocus = t10;
  }
  isNoOp() {
    return this.oldHasFocus === this.hasFocus;
  }
  attemptToMerge(e206) {
    return e206.kind === this.kind ? new uk(this.oldHasFocus, e206.hasFocus) : null;
  }
}, mfe = class e127 {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this.kind = 3, this._oldScrollWidth = e206, this._oldScrollLeft = t10, this._oldScrollHeight = n10, this._oldScrollTop = r10, this.scrollWidth = i10, this.scrollLeft = a10, this.scrollHeight = o10, this.scrollTop = s10, this.scrollWidthChanged = this._oldScrollWidth !== this.scrollWidth, this.scrollLeftChanged = this._oldScrollLeft !== this.scrollLeft, this.scrollHeightChanged = this._oldScrollHeight !== this.scrollHeight, this.scrollTopChanged = this._oldScrollTop !== this.scrollTop;
  }
  isNoOp() {
    return !this.scrollWidthChanged && !this.scrollLeftChanged && !this.scrollHeightChanged && !this.scrollTopChanged;
  }
  attemptToMerge(t10) {
    return t10.kind === this.kind ? new e127(this._oldScrollWidth, this._oldScrollLeft, this._oldScrollHeight, this._oldScrollTop, t10.scrollWidth, t10.scrollLeft, t10.scrollHeight, t10.scrollTop) : null;
  }
}, hfe = class {
  constructor() {
    this.kind = 4;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return e206.kind === this.kind ? this : null;
  }
}, gfe = class {
  constructor() {
    this.kind = 5;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return e206.kind === this.kind ? this : null;
  }
}, _fe = class e128 {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.kind = 7, this.oldSelections = e206, this.selections = t10, this.oldModelVersionId = n10, this.modelVersionId = r10, this.source = i10, this.reason = a10, this.reachedMaxCursorCount = o10;
  }
  static _selectionsAreEqual(e206, t10) {
    if (!e206 && !t10) return true;
    if (!e206 || !t10) return false;
    let n10 = e206.length;
    if (n10 !== t10.length) return false;
    for (let r10 = 0; r10 < n10; r10++) if (!e206[r10].equalsSelection(t10[r10])) return false;
    return true;
  }
  isNoOp() {
    return e128._selectionsAreEqual(this.oldSelections, this.selections) && this.oldModelVersionId === this.modelVersionId;
  }
  attemptToMerge(t10) {
    return t10.kind === this.kind ? new e128(this.oldSelections, t10.selections, this.oldModelVersionId, t10.modelVersionId, t10.source, t10.reason, this.reachedMaxCursorCount || t10.reachedMaxCursorCount) : null;
  }
}, vfe = class {
  constructor() {
    this.kind = 6;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return e206.kind === this.kind ? this : null;
  }
}, yfe = class {
  constructor(e206) {
    this.event = e206, this.kind = 8;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, bfe = class {
  constructor(e206) {
    this.event = e206, this.kind = 9;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, xfe = class {
  constructor(e206) {
    this.event = e206, this.kind = 10;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, Sfe = class {
  constructor(e206) {
    this.event = e206, this.kind = 11;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, Cfe = class {
  constructor(e206) {
    this.event = e206, this.kind = 12;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, wfe = class {
  constructor(e206) {
    this.event = e206, this.kind = 13;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, Tfe = class {
  constructor(e206) {
    this.event = e206, this.kind = 14;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, Efe = class {
  constructor(e206) {
    this.event = e206, this.kind = 15;
  }
  isNoOp() {
    return false;
  }
  attemptToMerge(e206) {
    return null;
  }
}, Dfe = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._model = e206, this._knownModelVersionId = this._model.getVersionId(), this._viewModel = t10, this._coordinatesConverter = n10, this.context = new nk(this._model, this._viewModel, this._coordinatesConverter, r10), this._cursors = new tk(this.context), this._hasFocus = false, this._isHandling = false, this._compositionState = null, this._columnSelectData = null, this._autoClosedActions = [], this._prevEditOperationType = 0;
  }
  dispose() {
    this._cursors.dispose(), this._autoClosedActions = Kt(this._autoClosedActions), super.dispose();
  }
  updateConfiguration(e206) {
    this.context = new nk(this._model, this._viewModel, this._coordinatesConverter, e206), this._cursors.updateContext(this.context);
  }
  onLineMappingChanged(e206) {
    this._knownModelVersionId === this._model.getVersionId() && this.setStates(e206, `viewModel`, 0, this.getCursorStates());
  }
  setHasFocus(e206) {
    this._hasFocus = e206;
  }
  _validateAutoClosedActions() {
    if (this._autoClosedActions.length > 0) {
      let e206 = this._cursors.getSelections();
      for (let t10 = 0; t10 < this._autoClosedActions.length; t10++) {
        let n10 = this._autoClosedActions[t10];
        n10.isValid(e206) || (n10.dispose(), this._autoClosedActions.splice(t10, 1), t10--);
      }
    }
  }
  getPrimaryCursorState() {
    return this._cursors.getPrimaryCursor();
  }
  getLastAddedCursorIndex() {
    return this._cursors.getLastAddedCursorIndex();
  }
  getCursorStates() {
    return this._cursors.getAll();
  }
  setStates(e206, t10, n10, r10) {
    let i10 = false, a10 = this.context.cursorConfig.multiCursorLimit;
    r10 !== null && r10.length > a10 && (r10 = r10.slice(0, a10), i10 = true);
    let o10 = dk.from(this._model, this);
    return this._cursors.setStates(r10), this._cursors.normalize(), this._columnSelectData = null, this._validateAutoClosedActions(), this._emitStateChangedIfNecessary(e206, t10, n10, o10, i10);
  }
  setCursorColumnSelectData(e206) {
    this._columnSelectData = e206;
  }
  revealAll(e206, t10, n10, r10, i10, a10) {
    let o10 = this._cursors.getViewPositions(), s10 = null, c10 = null;
    o10.length > 1 ? c10 = this._cursors.getViewSelections() : s10 = M.fromPositions(o10[0], o10[0]), e206.emitViewEvent(new lk(t10, n10, s10, c10, r10, i10, a10));
  }
  revealPrimary(e206, t10, n10, r10, i10, a10) {
    let o10 = [this._cursors.getPrimaryCursor().viewState.selection];
    e206.emitViewEvent(new lk(t10, n10, null, o10, r10, i10, a10));
  }
  saveState() {
    let e206 = [], t10 = this._cursors.getSelections();
    for (let n10 = 0, r10 = t10.length; n10 < r10; n10++) {
      let r11 = t10[n10];
      e206.push({ inSelectionMode: !r11.isEmpty(), selectionStart: { lineNumber: r11.selectionStartLineNumber, column: r11.selectionStartColumn }, position: { lineNumber: r11.positionLineNumber, column: r11.positionColumn } });
    }
    return e206;
  }
  restoreState(e206, t10) {
    let n10 = [];
    for (let e207 = 0, r10 = t10.length; e207 < r10; e207++) {
      let r11 = t10[e207], i10 = 1, a10 = 1;
      r11.position && r11.position.lineNumber && (i10 = r11.position.lineNumber), r11.position && r11.position.column && (a10 = r11.position.column);
      let o10 = i10, s10 = a10;
      r11.selectionStart && r11.selectionStart.lineNumber && (o10 = r11.selectionStart.lineNumber), r11.selectionStart && r11.selectionStart.column && (s10 = r11.selectionStart.column), n10.push({ selectionStartLineNumber: o10, selectionStartColumn: s10, positionLineNumber: i10, positionColumn: a10 });
    }
    this.setStates(e206, `restoreState`, 0, Mx.fromModelSelections(n10)), this.revealAll(e206, `restoreState`, false, 0, true, 1);
  }
  onModelContentChanged(e206, t10) {
    if (t10 instanceof oT) {
      if (this._isHandling) return;
      this._isHandling = true;
      try {
        this.setStates(e206, `modelChange`, 0, this.getCursorStates());
      } finally {
        this._isHandling = false;
      }
    } else {
      let n10 = t10.rawContentChangedEvent;
      if (this._knownModelVersionId = n10.versionId, this._isHandling) return;
      let r10 = n10.containsEvent(1);
      if (this._prevEditOperationType = 0, r10) this._cursors.dispose(), this._cursors = new tk(this.context), this._validateAutoClosedActions(), this._emitStateChangedIfNecessary(e206, `model`, 1, null, false);
      else if (this._hasFocus && n10.resultingSelection && n10.resultingSelection.length > 0) {
        let t11 = Mx.fromModelSelections(n10.resultingSelection);
        this.setStates(e206, `modelChange`, n10.isUndoing ? 5 : n10.isRedoing ? 6 : 2, t11) && this.revealAll(e206, `modelChange`, false, 0, true, 0);
      } else {
        let t11 = this._cursors.readSelectionFromMarkers();
        this.setStates(e206, `modelChange`, 2, Mx.fromModelSelections(t11));
      }
    }
  }
  getSelection() {
    return this._cursors.getPrimaryCursor().modelState.selection;
  }
  getTopMostViewPosition() {
    return this._cursors.getTopMostViewPosition();
  }
  getBottomMostViewPosition() {
    return this._cursors.getBottomMostViewPosition();
  }
  getCursorColumnSelectData() {
    if (this._columnSelectData) return this._columnSelectData;
    let e206 = this._cursors.getPrimaryCursor(), t10 = e206.viewState.selectionStart.getStartPosition(), n10 = e206.viewState.position;
    return { isReal: false, fromViewLineNumber: t10.lineNumber, fromViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, t10), toViewLineNumber: n10.lineNumber, toViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, n10) };
  }
  getSelections() {
    return this._cursors.getSelections();
  }
  setSelections(e206, t10, n10, r10) {
    this.setStates(e206, t10, r10, Mx.fromModelSelections(n10));
  }
  getPrevEditOperationType() {
    return this._prevEditOperationType;
  }
  setPrevEditOperationType(e206) {
    this._prevEditOperationType = e206;
  }
  _pushAutoClosedAction(e206, t10) {
    let n10 = [], r10 = [];
    for (let i11 = 0, a11 = e206.length; i11 < a11; i11++) n10.push({ range: e206[i11], options: { description: `auto-closed-character`, inlineClassName: `auto-closed-character`, stickiness: 1 } }), r10.push({ range: t10[i11], options: { description: `auto-closed-enclosing`, stickiness: 1 } });
    let i10 = this._model.deltaDecorations([], n10), a10 = this._model.deltaDecorations([], r10);
    this._autoClosedActions.push(new fk(this._model, i10, a10));
  }
  _executeEditOperation(e206, t10) {
    if (!e206) return;
    e206.shouldPushStackElementBefore && this._model.pushStackElement();
    let n10 = Ofe.executeCommands(this._model, this._cursors.getSelections(), e206.commands, t10);
    if (n10) {
      this._interpretCommandResult(n10);
      let t11 = [], r10 = [];
      for (let n11 = 0; n11 < e206.commands.length; n11++) {
        let i10 = e206.commands[n11];
        i10 instanceof fS && i10.enclosingRange && i10.closeCharacterRange && (t11.push(i10.closeCharacterRange), r10.push(i10.enclosingRange));
      }
      t11.length > 0 && this._pushAutoClosedAction(t11, r10), this._prevEditOperationType = e206.type;
    }
    e206.shouldPushStackElementAfter && this._model.pushStackElement();
  }
  _interpretCommandResult(e206) {
    (!e206 || e206.length === 0) && (e206 = this._cursors.readSelectionFromMarkers()), this._columnSelectData = null, this._cursors.setSelections(e206), this._cursors.normalize();
  }
  _emitStateChangedIfNecessary(e206, t10, n10, r10, i10) {
    let a10 = dk.from(this._model, this);
    if (a10.equals(r10)) return false;
    let o10 = this._cursors.getSelections(), s10 = this._cursors.getViewSelections();
    if (e206.emitViewEvent(new nfe(s10, o10, n10)), !r10 || r10.cursorState.length !== a10.cursorState.length || a10.cursorState.some((e207, t11) => !e207.modelState.equals(r10.cursorState[t11].modelState))) {
      let s11 = r10 ? r10.cursorState.map((e207) => e207.modelState.selection) : null, c10 = r10 ? r10.modelVersionId : 0;
      e206.emitOutgoingEvent(new _fe(s11, o10, c10, a10.modelVersionId, t10 || `keyboard`, n10, i10));
    }
    return true;
  }
  _findAutoClosingPairs(e206) {
    if (!e206.length) return null;
    let t10 = [];
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
      let r11 = e206[n10];
      if (!r11.text || r11.text.indexOf(`
`) >= 0) return null;
      let i10 = r11.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);
      if (!i10) return null;
      let a10 = i10[1], o10 = this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a10);
      if (!o10 || o10.length !== 1) return null;
      let s10 = o10[0].open, c10 = r11.text.length - i10[2].length - 1, l10 = r11.text.lastIndexOf(s10, c10 - 1);
      if (l10 === -1) return null;
      t10.push([l10, c10]);
    }
    return t10;
  }
  executeEdits(e206, t10, n10, r10, i10) {
    let a10 = null;
    t10 === `snippet` && (a10 = this._findAutoClosingPairs(n10)), a10 && (n10[0]._isTracked = true);
    let o10 = [], s10 = [], c10 = this._model.pushEditOperations(this.getSelections(), n10, (e207) => {
      if (a10) for (let t12 = 0, n11 = a10.length; t12 < n11; t12++) {
        let [n12, r11] = a10[t12], i11 = e207[t12], c11 = i11.range.startLineNumber, l10 = i11.range.startColumn - 1 + n12, u10 = i11.range.startColumn - 1 + r11;
        o10.push(new M(c11, u10 + 1, c11, u10 + 2)), s10.push(new M(c11, l10 + 1, c11, u10 + 2));
      }
      let t11 = r10(e207);
      return t11 && (this._isHandling = true), t11;
    }, void 0, i10);
    c10 && (this._isHandling = false, this.setSelections(e206, t10, c10, 0)), o10.length > 0 && this._pushAutoClosedAction(o10, s10);
  }
  _executeEdit(e206, t10, n10, r10 = 0) {
    if (this.context.cursorConfig.readOnly) return;
    let i10 = dk.from(this._model, this);
    this._cursors.stopTrackingSelections(), this._isHandling = true;
    try {
      this._cursors.ensureValidState(), e206();
    } catch (e207) {
      be(e207);
    }
    this._isHandling = false, this._cursors.startTrackingSelections(), this._validateAutoClosedActions(), this._emitStateChangedIfNecessary(t10, n10, r10, i10, false) && this.revealAll(t10, n10, false, 0, true, 0);
  }
  getAutoClosedCharacters() {
    return fk.getAllAutoClosedCharacters(this._autoClosedActions);
  }
  startComposition(e206) {
    this._compositionState = new Afe(this._model, this.getSelections());
  }
  endComposition(e206, t10) {
    let n10 = mE.cursor({ kind: `compositionEnd`, detailedSource: t10 }), r10 = this._compositionState ? this._compositionState.deduceOutcome(this._model, this.getSelections()) : null;
    this._compositionState = null, this._executeEdit(() => {
      t10 === `keyboard` && this._executeEditOperation(SS.compositionEndWithInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, r10, this.getSelections(), this.getAutoClosedCharacters()), n10);
    }, e206, t10);
  }
  type(e206, t10, n10) {
    let r10 = mE.cursor({ kind: `type`, detailedSource: n10 });
    this._executeEdit(() => {
      if (n10 === `keyboard`) {
        let e207 = t10.length, n11 = 0;
        for (; n11 < e207; ) {
          let e208 = fo(t10, n11), i10 = t10.substr(n11, e208);
          this._executeEditOperation(SS.typeWithInterceptors(!!this._compositionState, this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), this.getAutoClosedCharacters(), i10), r10), n11 += e208;
        }
      } else this._executeEditOperation(SS.typeWithoutInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), t10), r10);
    }, e206, n10);
  }
  compositionType(e206, t10, n10, r10, i10, a10) {
    let o10 = mE.cursor({ kind: `compositionType`, detailedSource: a10 });
    if (t10.length === 0 && n10 === 0 && r10 === 0) {
      if (i10 !== 0) {
        let t11 = this.getSelections().map((e207) => {
          let t12 = e207.getPosition();
          return new N(t12.lineNumber, t12.column + i10, t12.lineNumber, t12.column + i10);
        });
        this.setSelections(e206, a10, t11, 0);
      }
      return;
    }
    this._executeEdit(() => {
      this._executeEditOperation(SS.compositionType(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), t10, n10, r10, i10), o10);
    }, e206, a10);
  }
  paste(e206, t10, n10, r10, i10) {
    let a10 = mE.cursor({ kind: `paste`, detailedSource: i10 });
    this._executeEdit(() => {
      this._executeEditOperation(SS.paste(this.context.cursorConfig, this._model, this.getSelections(), t10, n10, r10 || []), a10);
    }, e206, i10, 4);
  }
  cut(e206, t10) {
    let n10 = mE.cursor({ kind: `cut`, detailedSource: t10 });
    this._executeEdit(() => {
      this._executeEditOperation(Gx.cut(this.context.cursorConfig, this._model, this.getSelections()), n10);
    }, e206, t10);
  }
  executeCommand(e206, t10, n10) {
    let r10 = mE.cursor({ kind: `executeCommand`, detailedSource: n10 });
    this._executeEdit(() => {
      this._cursors.killSecondaryCursors(), this._executeEditOperation(new Px(0, [t10], { shouldPushStackElementBefore: false, shouldPushStackElementAfter: false }), r10);
    }, e206, n10);
  }
  executeCommands(e206, t10, n10) {
    let r10 = mE.cursor({ kind: `executeCommands`, detailedSource: n10 });
    this._executeEdit(() => {
      this._executeEditOperation(new Px(0, t10, { shouldPushStackElementBefore: false, shouldPushStackElementAfter: false }), r10);
    }, e206, n10);
  }
}, dk = class e129 {
  static from(t10, n10) {
    return new e129(t10.getVersionId(), n10.getCursorStates());
  }
  constructor(e206, t10) {
    this.modelVersionId = e206, this.cursorState = t10;
  }
  equals(e206) {
    if (!e206 || this.modelVersionId !== e206.modelVersionId || this.cursorState.length !== e206.cursorState.length) return false;
    for (let t10 = 0, n10 = this.cursorState.length; t10 < n10; t10++) if (!this.cursorState[t10].equals(e206.cursorState[t10])) return false;
    return true;
  }
}, fk = class {
  static getAllAutoClosedCharacters(e206) {
    let t10 = [];
    for (let n10 of e206) t10 = t10.concat(n10.getAutoClosedCharactersRanges());
    return t10;
  }
  constructor(e206, t10, n10) {
    this._model = e206, this._autoClosedCharactersDecorations = t10, this._autoClosedEnclosingDecorations = n10;
  }
  dispose() {
    this._autoClosedCharactersDecorations = this._model.deltaDecorations(this._autoClosedCharactersDecorations, []), this._autoClosedEnclosingDecorations = this._model.deltaDecorations(this._autoClosedEnclosingDecorations, []);
  }
  getAutoClosedCharactersRanges() {
    let e206 = [];
    for (let t10 = 0; t10 < this._autoClosedCharactersDecorations.length; t10++) {
      let n10 = this._model.getDecorationRange(this._autoClosedCharactersDecorations[t10]);
      n10 && e206.push(n10);
    }
    return e206;
  }
  isValid(e206) {
    let t10 = [];
    for (let e207 = 0; e207 < this._autoClosedEnclosingDecorations.length; e207++) {
      let n10 = this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e207]);
      if (n10 && (t10.push(n10), n10.startLineNumber !== n10.endLineNumber)) return false;
    }
    t10.sort(M.compareRangesUsingStarts), e206.sort(M.compareRangesUsingStarts);
    for (let n10 = 0; n10 < e206.length; n10++) if (n10 >= t10.length || !t10[n10].strictContainsRange(e206[n10])) return false;
    return true;
  }
}, Ofe = class {
  static executeCommands(e206, t10, n10, r10 = mE.unknown({ name: `executeCommands` })) {
    let i10 = { model: e206, selectionsBefore: t10, trackedRanges: [], trackedRangesDirection: [] }, a10 = this._innerExecuteCommands(i10, n10, r10);
    for (let e207 = 0, t11 = i10.trackedRanges.length; e207 < t11; e207++) i10.model._setTrackedRange(i10.trackedRanges[e207], null, 0);
    return a10;
  }
  static _innerExecuteCommands(e206, t10, n10) {
    if (this._arrayIsEmpty(t10)) return null;
    let r10 = this._getEditOperations(e206, t10);
    if (r10.operations.length === 0) return null;
    let i10 = r10.operations, a10 = this._getLoserCursorMap(i10);
    if (a10.hasOwnProperty(`0`)) return console.warn(`Ignoring commands`), null;
    let o10 = [];
    for (let e207 = 0, t11 = i10.length; e207 < t11; e207++) a10.hasOwnProperty(i10[e207].identifier.major.toString()) || o10.push(i10[e207]);
    r10.hadTrackedEditOperation && o10.length > 0 && (o10[0]._isTracked = true);
    let s10 = e206.model.pushEditOperations(e206.selectionsBefore, o10, (n11) => {
      let r11 = [];
      for (let t11 = 0; t11 < e206.selectionsBefore.length; t11++) r11[t11] = [];
      for (let e207 of n11) e207.identifier && r11[e207.identifier.major].push(e207);
      let i11 = (e207, t11) => e207.identifier.minor - t11.identifier.minor, a11 = [];
      for (let n12 = 0; n12 < e206.selectionsBefore.length; n12++) r11[n12].length > 0 ? (r11[n12].sort(i11), a11[n12] = t10[n12].computeCursorState(e206.model, { getInverseEditOperations: () => r11[n12], getTrackedSelection: (t11) => {
        let n13 = parseInt(t11, 10), r12 = e206.model._getTrackedRange(e206.trackedRanges[n13]);
        return e206.trackedRangesDirection[n13] === 0 ? new N(r12.startLineNumber, r12.startColumn, r12.endLineNumber, r12.endColumn) : new N(r12.endLineNumber, r12.endColumn, r12.startLineNumber, r12.startColumn);
      } })) : a11[n12] = e206.selectionsBefore[n12];
      return a11;
    }, void 0, n10);
    s10 || (s10 = e206.selectionsBefore);
    let c10 = [];
    for (let e207 in a10) a10.hasOwnProperty(e207) && c10.push(parseInt(e207, 10));
    c10.sort((e207, t11) => t11 - e207);
    for (let e207 of c10) s10.splice(e207, 1);
    return s10;
  }
  static _arrayIsEmpty(e206) {
    for (let t10 = 0, n10 = e206.length; t10 < n10; t10++) if (e206[t10]) return false;
    return true;
  }
  static _getEditOperations(e206, t10) {
    let n10 = [], r10 = false;
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10];
      if (a11) {
        let t11 = this._getEditOperationsFromCommand(e206, i10, a11);
        n10 = n10.concat(t11.operations), r10 || (r10 = t11.hadTrackedEditOperation);
      }
    }
    return { operations: n10, hadTrackedEditOperation: r10 };
  }
  static _getEditOperationsFromCommand(e206, t10, n10) {
    let r10 = [], i10 = 0, a10 = (e207, a11, o11 = false) => {
      M.isEmpty(e207) && a11 === `` || r10.push({ identifier: { major: t10, minor: i10++ }, range: e207, text: a11, forceMoveMarkers: o11, isAutoWhitespaceEdit: n10.insertsAutoWhitespace });
    }, o10 = false, s10 = { addEditOperation: a10, addTrackedEditOperation: (e207, t11, n11) => {
      o10 = true, a10(e207, t11, n11);
    }, trackSelection: (t11, n11) => {
      let r11 = N.liftSelection(t11), i11;
      if (r11.isEmpty()) if (typeof n11 == `boolean`) i11 = n11 ? 2 : 3;
      else {
        let t12 = e206.model.getLineMaxColumn(r11.startLineNumber);
        i11 = r11.startColumn === t12 ? 2 : 3;
      }
      else i11 = 1;
      let a11 = e206.trackedRanges.length, o11 = e206.model._setTrackedRange(null, r11, i11);
      return e206.trackedRanges[a11] = o11, e206.trackedRangesDirection[a11] = r11.getDirection(), a11.toString();
    } };
    try {
      n10.getEditOperations(e206.model, s10);
    } catch (e207) {
      return be(e207), { operations: [], hadTrackedEditOperation: false };
    }
    return { operations: r10, hadTrackedEditOperation: o10 };
  }
  static _getLoserCursorMap(e206) {
    e206 = e206.slice(0), e206.sort((e207, t11) => -M.compareRangesUsingEnds(e207.range, t11.range));
    let t10 = {};
    for (let n10 = 1; n10 < e206.length; n10++) {
      let r10 = e206[n10 - 1], i10 = e206[n10];
      if (M.getStartPosition(r10.range).isBefore(M.getEndPosition(i10.range))) {
        let a10;
        a10 = r10.identifier.major > i10.identifier.major ? r10.identifier.major : i10.identifier.major, t10[a10.toString()] = true;
        for (let t11 = 0; t11 < e206.length; t11++) e206[t11].identifier.major === a10 && (e206.splice(t11, 1), t11 < n10 && n10--, t11--);
        n10 > 0 && n10--;
      }
    }
    return t10;
  }
}, kfe = class {
  constructor(e206, t10, n10, r10) {
    this.text = e206, this.lineNumber = t10, this.startSelectionOffset = n10, this.endSelectionOffset = r10;
  }
}, Afe = class e130 {
  static _capture(e206, t10) {
    let n10 = [];
    for (let r10 of t10) {
      if (r10.startLineNumber !== r10.endLineNumber) return null;
      let t11 = r10.startLineNumber;
      n10.push(new kfe(e206.getLineContent(t11), t11, r10.startColumn - 1, r10.endColumn - 1));
    }
    return n10;
  }
  constructor(t10, n10) {
    this._original = e130._capture(t10, n10);
  }
  deduceOutcome(t10, n10) {
    if (!this._original) return null;
    let r10 = e130._capture(t10, n10);
    if (!r10 || this._original.length !== r10.length) return null;
    let i10 = [];
    for (let t11 = 0, n11 = this._original.length; t11 < n11; t11++) i10.push(e130._deduceOutcome(this._original[t11], r10[t11]));
    return i10;
  }
  static _deduceOutcome(e206, t10) {
    let n10 = Math.min(e206.startSelectionOffset, t10.startSelectionOffset, ro(e206.text, t10.text)), r10 = Math.min(e206.text.length - e206.endSelectionOffset, t10.text.length - t10.endSelectionOffset, io(e206.text, t10.text)), i10 = e206.text.substring(n10, e206.text.length - r10), a10 = n10, o10 = t10.text.length - r10, s10 = t10.text.substring(a10, o10), c10 = new M(t10.lineNumber, a10 + 1, t10.lineNumber, o10 + 1);
    return new Pse(i10, e206.startSelectionOffset - n10, e206.endSelectionOffset - n10, s10, t10.startSelectionOffset - n10, t10.endSelectionOffset - n10, c10);
  }
}, pk = { getInitialState: () => $h, tokenizeEncoded: (e206, t10, n10) => tg(0, n10) };
async function jfe(e206, t10, n10) {
  if (!n10) return mk(t10, e206.languageIdCodec, pk);
  let r10 = await Pi.getOrCreate(n10);
  return mk(t10, e206.languageIdCodec, r10 || pk);
}
function Mfe(e206, t10, n10, r10, i10, a10, o10) {
  let s10 = `<div>`, c10 = 0, l10 = 0, u10 = true;
  for (let d10 = 0, f10 = t10.getCount(); d10 < f10; d10++) {
    let f11 = t10.getEndOffset(d10), p10 = ``;
    for (; c10 < f11 && c10 < i10; c10++) {
      let t11 = e206.charCodeAt(c10), n11 = t11 === 9;
      if (l10 += yo(t11) ? 2 : +!n11, c10 < r10) {
        if (n11) {
          let e207 = l10 % a10;
          l10 += e207 === 0 ? a10 : a10 - e207;
        }
        continue;
      }
      switch (t11) {
        case 9: {
          let e207 = l10 % a10, t12 = e207 === 0 ? a10 : a10 - e207;
          l10 += t12;
          let n12 = t12;
          for (; n12 > 0; ) o10 && u10 ? (p10 += `&#160;`, u10 = false) : (p10 += ` `, u10 = true), n12--;
          break;
        }
        case 60:
          p10 += `&lt;`, u10 = false;
          break;
        case 62:
          p10 += `&gt;`, u10 = false;
          break;
        case 38:
          p10 += `&amp;`, u10 = false;
          break;
        case 0:
          p10 += `&#00;`, u10 = false;
          break;
        case 65279:
        case 8232:
        case 8233:
        case 133:
          p10 += `\uFFFD`, u10 = false;
          break;
        case 13:
          p10 += `&#8203`, u10 = false;
          break;
        case 32:
          o10 && u10 ? (p10 += `&#160;`, u10 = false) : (p10 += ` `, u10 = true);
          break;
        default:
          p10 += String.fromCharCode(t11), u10 = false;
      }
    }
    if (!(f11 <= r10) && (s10 += `<span style="${t10.getInlineStyle(d10, n10)}">${p10}</span>`, f11 > i10 || c10 >= i10 || r10 >= i10)) break;
  }
  return s10 += `</div>`, s10;
}
function mk(e206, t10, n10) {
  let r10 = `<div class="monaco-tokenized-source">`, i10 = Wa(e206), a10 = n10.getInitialState();
  for (let e207 = 0, o10 = i10.length; e207 < o10; e207++) {
    let o11 = i10[e207];
    e207 > 0 && (r10 += `<br/>`);
    let s10 = n10.tokenizeEncoded(o11, true, a10);
    rg.convertToEndOffset(s10.tokens, o11.length);
    let c10 = new rg(s10.tokens, o11, t10).inflate(), l10 = 0;
    for (let e208 = 0, t11 = c10.getCount(); e208 < t11; e208++) {
      let t12 = c10.getClassName(e208), n11 = c10.getEndOffset(e208);
      r10 += `<span class="${t12}">${Ra(o11.substring(l10, n11))}</span>`, l10 = n11;
    }
    a10 = s10.endState;
  }
  return r10 += `</div>`, r10;
}
var Nfe = class {
  constructor(e206, t10, n10, r10, i10) {
    this.decorationId = e206, this.index = t10, this.lineNumber = n10, this.specialHeight = r10, this.prefixSum = i10, this.maximumSpecialHeight = r10, this.deleted = false;
  }
}, hk = class {
  constructor(e206, t10) {
    if (this._decorationIDToCustomLine = new gk(), this._orderedCustomLines = [], this._pendingSpecialLinesToInsert = [], this._invalidIndex = 0, this._hasPending = false, this._defaultLineHeight = e206, t10.length > 0) {
      for (let e207 of t10) this.insertOrChangeCustomLineHeight(e207.decorationId, e207.startLineNumber, e207.endLineNumber, e207.lineHeight);
      this.commit();
    }
  }
  set defaultLineHeight(e206) {
    this._defaultLineHeight = e206;
  }
  get defaultLineHeight() {
    return this._defaultLineHeight;
  }
  removeCustomLineHeight(e206) {
    let t10 = this._decorationIDToCustomLine.get(e206);
    if (t10) {
      this._decorationIDToCustomLine.delete(e206);
      for (let e207 of t10) e207.deleted = true, this._invalidIndex = Math.min(this._invalidIndex, e207.index);
      this._hasPending = true;
    }
  }
  insertOrChangeCustomLineHeight(e206, t10, n10, r10) {
    this.removeCustomLineHeight(e206);
    for (let i10 = t10; i10 <= n10; i10++) {
      let t11 = new Nfe(e206, -1, i10, r10, 0);
      this._pendingSpecialLinesToInsert.push(t11);
    }
    this._hasPending = true;
  }
  heightForLineNumber(e206) {
    let t10 = this._binarySearchOverOrderedCustomLinesArray(e206);
    return t10 >= 0 ? this._orderedCustomLines[t10].maximumSpecialHeight : this._defaultLineHeight;
  }
  getAccumulatedLineHeightsIncludingLineNumber(e206) {
    let t10 = this._binarySearchOverOrderedCustomLinesArray(e206);
    if (t10 >= 0) return this._orderedCustomLines[t10].prefixSum + this._orderedCustomLines[t10].maximumSpecialHeight;
    if (t10 === -1) return this._defaultLineHeight * e206;
    let n10 = -(t10 + 1), r10 = this._orderedCustomLines[n10 - 1];
    return r10.prefixSum + r10.maximumSpecialHeight + this._defaultLineHeight * (e206 - r10.lineNumber);
  }
  onLinesDeleted(e206, t10) {
    let n10 = t10 - e206 + 1, r10 = this._orderedCustomLines.length, i10 = this._binarySearchOverOrderedCustomLinesArray(e206), a10;
    if (i10 >= 0) {
      a10 = i10;
      for (let t11 = i10 - 1; t11 >= 0 && this._orderedCustomLines[t11].lineNumber === e206; t11--) a10--;
    } else a10 = i10 === -(r10 + 1) && i10 !== -1 ? r10 - 1 : -(i10 + 1);
    let o10 = this._binarySearchOverOrderedCustomLinesArray(t10), s10;
    if (o10 >= 0) {
      s10 = o10;
      for (let e207 = o10 + 1; e207 < r10 && this._orderedCustomLines[e207].lineNumber === t10; e207++) s10++;
    } else s10 = o10 === -(r10 + 1) && o10 !== -1 ? r10 - 1 : -(o10 + 1);
    let c10 = s10 > a10, l10 = s10 === a10 && this._orderedCustomLines[a10] && this._orderedCustomLines[a10].lineNumber >= e206 && this._orderedCustomLines[a10].lineNumber <= t10;
    if (c10 || l10) {
      let r11 = 0;
      for (let e207 = a10; e207 <= s10; e207++) r11 = Math.max(r11, this._orderedCustomLines[e207].maximumSpecialHeight);
      let i11 = 0;
      if (a10 > 0) {
        let t11 = this._orderedCustomLines[a10 - 1];
        i11 = t11.prefixSum + t11.maximumSpecialHeight + this._defaultLineHeight * (e206 - t11.lineNumber - 1);
      } else i11 = e206 > 0 ? (e206 - 1) * this._defaultLineHeight : 0;
      let o11 = this._orderedCustomLines[a10], c11 = this._orderedCustomLines[s10], l11 = this._orderedCustomLines[s10 + 1], u10 = l11 && l11.lineNumber === t10 + 1 ? l11.maximumSpecialHeight : this._defaultLineHeight, d10 = c11.prefixSum + c11.maximumSpecialHeight - o11.prefixSum + this._defaultLineHeight * (t10 - c11.lineNumber) + this._defaultLineHeight * (o11.lineNumber - e206) + u10 - r11, f10 = /* @__PURE__ */ new Set(), p10 = [], m10 = new gk(), h10 = 0;
      for (let t11 = 0; t11 < this._orderedCustomLines.length; t11++) {
        let o12 = this._orderedCustomLines[t11];
        if (t11 < a10) p10.push(o12), m10.add(o12.decorationId, o12);
        else if (t11 >= a10 && t11 <= s10) {
          let t12 = o12.decorationId;
          f10.has(t12) ? h10++ : (o12.index -= h10, o12.lineNumber = e206, o12.prefixSum = i11, o12.maximumSpecialHeight = r11, p10.push(o12), m10.add(o12.decorationId, o12));
        } else t11 > s10 && (o12.index -= h10, o12.lineNumber -= n10, o12.prefixSum -= d10, p10.push(o12), m10.add(o12.decorationId, o12));
        f10.add(o12.decorationId);
      }
      this._orderedCustomLines = p10, this._decorationIDToCustomLine = m10;
    } else {
      let e207 = n10 * this._defaultLineHeight;
      for (let r11 = s10; r11 < this._orderedCustomLines.length; r11++) {
        let i11 = this._orderedCustomLines[r11];
        i11.lineNumber > t10 && (i11.lineNumber -= n10, i11.prefixSum -= e207);
      }
    }
  }
  onLinesInserted(e206, t10) {
    let n10 = t10 - e206 + 1, r10 = this._binarySearchOverOrderedCustomLinesArray(e206), i10;
    if (r10 >= 0) {
      i10 = r10;
      for (let t11 = r10 - 1; t11 >= 0 && this._orderedCustomLines[t11].lineNumber === e206; t11--) i10--;
    } else i10 = -(r10 + 1);
    let a10 = [], o10 = /* @__PURE__ */ new Set();
    for (let t11 = i10; t11 < this._orderedCustomLines.length; t11++) this._orderedCustomLines[t11].lineNumber === e206 && o10.add(this._orderedCustomLines[t11].decorationId);
    let s10 = /* @__PURE__ */ new Set();
    for (let t11 = i10 - 1; t11 >= 0; t11--) this._orderedCustomLines[t11].lineNumber === e206 - 1 && s10.add(this._orderedCustomLines[t11].decorationId);
    let c10 = OO(s10, o10);
    for (let e207 = i10; e207 < this._orderedCustomLines.length; e207++) this._orderedCustomLines[e207].lineNumber += n10, this._orderedCustomLines[e207].prefixSum += this._defaultLineHeight * n10;
    if (c10.size > 0) {
      for (let t11 of c10) {
        let n11 = this._decorationIDToCustomLine.get(t11);
        if (n11) {
          let r11 = n11.reduce((e207, t12) => Math.min(e207, t12.lineNumber), e206), i11 = n11.reduce((e207, t12) => Math.max(e207, t12.lineNumber), e206), o11 = n11.reduce((e207, t12) => Math.max(e207, t12.specialHeight), 0);
          a10.push({ decorationId: t11, startLineNumber: r11, endLineNumber: i11, lineHeight: o11 });
        }
      }
      for (let e207 of a10) this.insertOrChangeCustomLineHeight(e207.decorationId, e207.startLineNumber, e207.endLineNumber, e207.lineHeight);
      this.commit();
    }
  }
  commit() {
    if (!this._hasPending) return;
    for (let e207 of this._pendingSpecialLinesToInsert) {
      let t11 = this._binarySearchOverOrderedCustomLinesArray(e207.lineNumber), n11 = t11 >= 0 ? t11 : -(t11 + 1);
      this._orderedCustomLines.splice(n11, 0, e207), this._invalidIndex = Math.min(this._invalidIndex, n11);
    }
    this._pendingSpecialLinesToInsert = [];
    let e206 = new gk(), t10 = [];
    for (let n11 = 0; n11 < this._invalidIndex; n11++) {
      let r11 = this._orderedCustomLines[n11];
      t10.push(r11), e206.add(r11.decorationId, r11);
    }
    let n10 = 0, r10 = this._invalidIndex > 0 ? t10[this._invalidIndex - 1] : void 0;
    for (let i10 = this._invalidIndex; i10 < this._orderedCustomLines.length; i10++) {
      let a10 = this._orderedCustomLines[i10];
      if (a10.deleted) {
        n10++;
        continue;
      }
      if (a10.index = i10 - n10, r10 && r10.lineNumber === a10.lineNumber) a10.maximumSpecialHeight = r10.maximumSpecialHeight, a10.prefixSum = r10.prefixSum;
      else {
        let e207 = a10.specialHeight;
        for (let t12 = i10; t12 < this._orderedCustomLines.length; t12++) {
          let n11 = this._orderedCustomLines[t12];
          if (!n11.deleted) {
            if (n11.lineNumber !== a10.lineNumber) break;
            e207 = Math.max(e207, n11.specialHeight);
          }
        }
        a10.maximumSpecialHeight = e207;
        let t11;
        t11 = r10 ? r10.prefixSum + r10.maximumSpecialHeight + this._defaultLineHeight * (a10.lineNumber - r10.lineNumber - 1) : this._defaultLineHeight * (a10.lineNumber - 1), a10.prefixSum = t11;
      }
      r10 = a10, t10.push(a10), e206.add(a10.decorationId, a10);
    }
    this._orderedCustomLines = t10, this._decorationIDToCustomLine = e206, this._invalidIndex = 1 / 0, this._hasPending = false;
  }
  _binarySearchOverOrderedCustomLinesArray(e206) {
    return l(this._orderedCustomLines.length, (t10) => {
      let n10 = this._orderedCustomLines[t10];
      return n10.lineNumber === e206 ? 0 : n10.lineNumber < e206 ? -1 : 1;
    });
  }
}, gk = class {
  constructor() {
    this._map = /* @__PURE__ */ new Map();
  }
  add(e206, t10) {
    let n10 = this._map.get(e206);
    n10 ? n10.push(t10) : this._map.set(e206, [t10]);
  }
  get(e206) {
    return this._map.get(e206);
  }
  delete(e206) {
    this._map.delete(e206);
  }
}, Pfe = class {
  constructor() {
    this._hasPending = false, this._inserts = [], this._changes = [], this._removes = [];
  }
  insert(e206) {
    this._hasPending = true, this._inserts.push(e206);
  }
  change(e206) {
    this._hasPending = true, this._changes.push(e206);
  }
  remove(e206) {
    this._hasPending = true, this._removes.push(e206);
  }
  commit(e206) {
    if (!this._hasPending) return;
    let t10 = this._inserts, n10 = this._changes, r10 = this._removes;
    this._hasPending = false, this._inserts = [], this._changes = [], this._removes = [], e206._commitPendingChanges(t10, n10, r10);
  }
}, Ffe = class {
  constructor(e206, t10, n10, r10, i10) {
    this.id = e206, this.afterLineNumber = t10, this.ordinal = n10, this.height = r10, this.minWidth = i10, this.prefixSum = 0;
  }
}, Ife = (_Ca = class {
  constructor(t10, n10, r10, i10, a10) {
    this._instanceId = So(++_Ca.INSTANCE_COUNT), this._pendingChanges = new Pfe(), this._lastWhitespaceId = 0, this._arr = [], this._prefixSumValidIndex = -1, this._minWidth = -1, this._lineCount = t10, this._paddingTop = r10, this._paddingBottom = i10, this._lineHeightsManager = new hk(n10, a10);
  }
  static findInsertionIndex(e206, t10, n10) {
    let r10 = 0, i10 = e206.length;
    for (; r10 < i10; ) {
      let a10 = r10 + i10 >>> 1;
      t10 === e206[a10].afterLineNumber ? n10 < e206[a10].ordinal ? i10 = a10 : r10 = a10 + 1 : t10 < e206[a10].afterLineNumber ? i10 = a10 : r10 = a10 + 1;
    }
    return r10;
  }
  setDefaultLineHeight(e206) {
    this._lineHeightsManager.defaultLineHeight = e206;
  }
  setPadding(e206, t10) {
    this._paddingTop = e206, this._paddingBottom = t10;
  }
  onFlushed(e206, t10) {
    this._lineCount = e206, this._lineHeightsManager = new hk(this._lineHeightsManager.defaultLineHeight, t10);
  }
  changeLineHeights(e206) {
    let t10 = false;
    try {
      e206({ insertOrChangeCustomLineHeight: (e207, n10, r10, i10) => {
        t10 = true, this._lineHeightsManager.insertOrChangeCustomLineHeight(e207, n10, r10, i10);
      }, removeCustomLineHeight: (e207) => {
        t10 = true, this._lineHeightsManager.removeCustomLineHeight(e207);
      } });
    } finally {
      this._lineHeightsManager.commit();
    }
    return t10;
  }
  changeWhitespace(e206) {
    let t10 = false;
    try {
      e206({ insertWhitespace: (e207, n10, r10, i10) => {
        t10 = true, e207 |= 0, n10 |= 0, r10 |= 0, i10 |= 0;
        let a10 = this._instanceId + ++this._lastWhitespaceId;
        return this._pendingChanges.insert(new Ffe(a10, e207, n10, r10, i10)), a10;
      }, changeOneWhitespace: (e207, n10, r10) => {
        t10 = true, n10 |= 0, r10 |= 0, this._pendingChanges.change({ id: e207, newAfterLineNumber: n10, newHeight: r10 });
      }, removeWhitespace: (e207) => {
        t10 = true, this._pendingChanges.remove({ id: e207 });
      } });
    } finally {
      this._pendingChanges.commit(this);
    }
    return t10;
  }
  _commitPendingChanges(e206, t10, n10) {
    if ((e206.length > 0 || n10.length > 0) && (this._minWidth = -1), e206.length + t10.length + n10.length <= 1) {
      for (let t11 of e206) this._insertWhitespace(t11);
      for (let e207 of t10) this._changeOneWhitespace(e207.id, e207.newAfterLineNumber, e207.newHeight);
      for (let e207 of n10) {
        let t11 = this._findWhitespaceIndex(e207.id);
        t11 !== -1 && this._removeWhitespace(t11);
      }
      return;
    }
    let r10 = /* @__PURE__ */ new Set();
    for (let e207 of n10) r10.add(e207.id);
    let i10 = /* @__PURE__ */ new Map();
    for (let e207 of t10) i10.set(e207.id, e207);
    let a10 = (e207) => {
      let t11 = [];
      for (let n11 of e207) if (!r10.has(n11.id)) {
        if (i10.has(n11.id)) {
          let e208 = i10.get(n11.id);
          n11.afterLineNumber = e208.newAfterLineNumber, n11.height = e208.newHeight;
        }
        t11.push(n11);
      }
      return t11;
    }, o10 = a10(this._arr).concat(a10(e206));
    o10.sort((e207, t11) => e207.afterLineNumber === t11.afterLineNumber ? e207.ordinal - t11.ordinal : e207.afterLineNumber - t11.afterLineNumber), this._arr = o10, this._prefixSumValidIndex = -1;
  }
  _insertWhitespace(t10) {
    let n10 = _Ca.findInsertionIndex(this._arr, t10.afterLineNumber, t10.ordinal);
    this._arr.splice(n10, 0, t10), this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, n10 - 1);
  }
  _findWhitespaceIndex(e206) {
    let t10 = this._arr;
    for (let n10 = 0, r10 = t10.length; n10 < r10; n10++) if (t10[n10].id === e206) return n10;
    return -1;
  }
  _changeOneWhitespace(e206, t10, n10) {
    let r10 = this._findWhitespaceIndex(e206);
    if (r10 !== -1 && (this._arr[r10].height !== n10 && (this._arr[r10].height = n10, this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, r10 - 1)), this._arr[r10].afterLineNumber !== t10)) {
      let e207 = this._arr[r10];
      this._removeWhitespace(r10), e207.afterLineNumber = t10, this._insertWhitespace(e207);
    }
  }
  _removeWhitespace(e206) {
    this._arr.splice(e206, 1), this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, e206 - 1);
  }
  onLinesDeleted(e206, t10) {
    e206 |= 0, t10 |= 0, this._lineCount -= t10 - e206 + 1;
    for (let n10 = 0, r10 = this._arr.length; n10 < r10; n10++) {
      let r11 = this._arr[n10].afterLineNumber;
      e206 <= r11 && r11 <= t10 ? this._arr[n10].afterLineNumber = e206 - 1 : r11 > t10 && (this._arr[n10].afterLineNumber -= t10 - e206 + 1);
    }
    this._lineHeightsManager.onLinesDeleted(e206, t10);
  }
  onLinesInserted(e206, t10) {
    e206 |= 0, t10 |= 0, this._lineCount += t10 - e206 + 1;
    for (let n10 = 0, r10 = this._arr.length; n10 < r10; n10++) {
      let r11 = this._arr[n10].afterLineNumber;
      e206 <= r11 && (this._arr[n10].afterLineNumber += t10 - e206 + 1);
    }
    this._lineHeightsManager.onLinesInserted(e206, t10);
  }
  getWhitespacesTotalHeight() {
    return this._arr.length === 0 ? 0 : this.getWhitespacesAccumulatedHeight(this._arr.length - 1);
  }
  getWhitespacesAccumulatedHeight(e206) {
    e206 |= 0;
    let t10 = Math.max(0, this._prefixSumValidIndex + 1);
    t10 === 0 && (this._arr[0].prefixSum = this._arr[0].height, t10++);
    for (let n10 = t10; n10 <= e206; n10++) this._arr[n10].prefixSum = this._arr[n10 - 1].prefixSum + this._arr[n10].height;
    return this._prefixSumValidIndex = Math.max(this._prefixSumValidIndex, e206), this._arr[e206].prefixSum;
  }
  getLinesTotalHeight() {
    return this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(this._lineCount) + this.getWhitespacesTotalHeight() + this._paddingTop + this._paddingBottom;
  }
  getWhitespaceAccumulatedHeightBeforeLineNumber(e206) {
    e206 |= 0;
    let t10 = this._findLastWhitespaceBeforeLineNumber(e206);
    return t10 === -1 ? 0 : this.getWhitespacesAccumulatedHeight(t10);
  }
  _findLastWhitespaceBeforeLineNumber(e206) {
    e206 |= 0;
    let t10 = this._arr, n10 = 0, r10 = t10.length - 1;
    for (; n10 <= r10; ) {
      let i10 = (r10 - n10 | 0) / 2 | 0, a10 = n10 + i10 | 0;
      if (t10[a10].afterLineNumber < e206) {
        if (a10 + 1 >= t10.length || t10[a10 + 1].afterLineNumber >= e206) return a10;
        n10 = a10 + 1 | 0;
      } else r10 = a10 - 1 | 0;
    }
    return -1;
  }
  _findFirstWhitespaceAfterLineNumber(e206) {
    e206 |= 0;
    let t10 = this._findLastWhitespaceBeforeLineNumber(e206) + 1;
    return t10 < this._arr.length ? t10 : -1;
  }
  getFirstWhitespaceIndexAfterLineNumber(e206) {
    return e206 |= 0, this._findFirstWhitespaceAfterLineNumber(e206);
  }
  getVerticalOffsetForLineNumber(e206, t10 = false) {
    e206 |= 0;
    let n10;
    n10 = e206 > 1 ? this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e206 - 1) : 0;
    let r10 = this.getWhitespaceAccumulatedHeightBeforeLineNumber(e206 - +!!t10);
    return n10 + r10 + this._paddingTop;
  }
  getLineHeightForLineNumber(e206) {
    return this._lineHeightsManager.heightForLineNumber(e206);
  }
  getVerticalOffsetAfterLineNumber(e206, t10 = false) {
    return e206 |= 0, this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e206) + this.getWhitespaceAccumulatedHeightBeforeLineNumber(e206 + +!!t10) + this._paddingTop;
  }
  getWhitespaceMinWidth() {
    if (this._minWidth === -1) {
      let e206 = 0;
      for (let t10 = 0, n10 = this._arr.length; t10 < n10; t10++) e206 = Math.max(e206, this._arr[t10].minWidth);
      this._minWidth = e206;
    }
    return this._minWidth;
  }
  isAfterLines(e206) {
    return e206 > this.getLinesTotalHeight();
  }
  isInTopPadding(e206) {
    return this._paddingTop === 0 ? false : e206 < this._paddingTop;
  }
  isInBottomPadding(e206) {
    return this._paddingBottom === 0 ? false : e206 >= this.getLinesTotalHeight() - this._paddingBottom;
  }
  getLineNumberAtOrAfterVerticalOffset(e206) {
    if (e206 |= 0, e206 < 0) return 1;
    let t10 = this._lineCount | 0, n10 = 1, r10 = t10;
    for (; n10 < r10; ) {
      let t11 = (n10 + r10) / 2 | 0, i10 = this.getLineHeightForLineNumber(t11), a10 = this.getVerticalOffsetForLineNumber(t11) | 0;
      if (e206 >= a10 + i10) n10 = t11 + 1;
      else if (e206 >= a10) return t11;
      else r10 = t11;
    }
    return n10 > t10 ? t10 : n10;
  }
  getLinesViewportData(e206, t10) {
    e206 |= 0, t10 |= 0;
    let n10 = this.getLineNumberAtOrAfterVerticalOffset(e206) | 0, r10 = this.getVerticalOffsetForLineNumber(n10) | 0, i10 = this._lineCount | 0, a10 = this.getFirstWhitespaceIndexAfterLineNumber(n10) | 0, o10 = this.getWhitespacesCount() | 0, s10, c10;
    a10 === -1 ? (a10 = o10, c10 = i10 + 1, s10 = 0) : (c10 = this.getAfterLineNumberForWhitespaceIndex(a10) | 0, s10 = this.getHeightForWhitespaceIndex(a10) | 0);
    let l10 = r10, u10 = l10, d10 = 5e5, f10 = 0;
    r10 >= d10 && (f10 = Math.floor(r10 / d10) * d10, f10 = Math.floor(f10 / this._lineHeightsManager.defaultLineHeight) * this._lineHeightsManager.defaultLineHeight, u10 -= f10);
    let p10 = [], m10 = e206 + (t10 - e206) / 2, h10 = -1;
    for (let e207 = n10; e207 <= i10; e207++) {
      let r11 = this.getLineHeightForLineNumber(e207);
      if (h10 === -1) {
        let t11 = l10, n11 = l10 + r11;
        (t11 <= m10 && m10 < n11 || t11 > m10) && (h10 = e207);
      }
      for (l10 += r11, p10[e207 - n10] = u10, u10 += r11; c10 === e207; ) u10 += s10, l10 += s10, a10++, a10 >= o10 ? c10 = i10 + 1 : (c10 = this.getAfterLineNumberForWhitespaceIndex(a10) | 0, s10 = this.getHeightForWhitespaceIndex(a10) | 0);
      if (l10 >= t10) {
        i10 = e207;
        break;
      }
    }
    h10 === -1 && (h10 = i10);
    let g10 = this.getVerticalOffsetForLineNumber(i10) | 0, _10 = n10, v10 = i10;
    return _10 < v10 && r10 < e206 && _10++, _10 < v10 && g10 + this.getLineHeightForLineNumber(i10) > t10 && v10--, { bigNumbersDelta: f10, startLineNumber: n10, endLineNumber: i10, relativeVerticalOffset: p10, centeredLineNumber: h10, completelyVisibleStartLineNumber: _10, completelyVisibleEndLineNumber: v10, lineHeight: this._lineHeightsManager.defaultLineHeight };
  }
  getVerticalOffsetForWhitespaceIndex(e206) {
    e206 |= 0;
    let t10 = this.getAfterLineNumberForWhitespaceIndex(e206), n10;
    n10 = t10 >= 1 ? this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t10) : 0;
    let r10;
    return r10 = e206 > 0 ? this.getWhitespacesAccumulatedHeight(e206 - 1) : 0, n10 + r10 + this._paddingTop;
  }
  getWhitespaceIndexAtOrAfterVerticallOffset(e206) {
    e206 |= 0;
    let t10 = 0, n10 = this.getWhitespacesCount() - 1;
    if (n10 < 0) return -1;
    let r10 = this.getVerticalOffsetForWhitespaceIndex(n10), i10 = this.getHeightForWhitespaceIndex(n10);
    if (e206 >= r10 + i10) return -1;
    for (; t10 < n10; ) {
      let r11 = Math.floor((t10 + n10) / 2), i11 = this.getVerticalOffsetForWhitespaceIndex(r11), a10 = this.getHeightForWhitespaceIndex(r11);
      if (e206 >= i11 + a10) t10 = r11 + 1;
      else if (e206 >= i11) return r11;
      else n10 = r11;
    }
    return t10;
  }
  getWhitespaceAtVerticalOffset(e206) {
    e206 |= 0;
    let t10 = this.getWhitespaceIndexAtOrAfterVerticallOffset(e206);
    if (t10 < 0 || t10 >= this.getWhitespacesCount()) return null;
    let n10 = this.getVerticalOffsetForWhitespaceIndex(t10);
    if (n10 > e206) return null;
    let r10 = this.getHeightForWhitespaceIndex(t10);
    return { id: this.getIdForWhitespaceIndex(t10), afterLineNumber: this.getAfterLineNumberForWhitespaceIndex(t10), verticalOffset: n10, height: r10 };
  }
  getWhitespaceViewportData(e206, t10) {
    e206 |= 0, t10 |= 0;
    let n10 = this.getWhitespaceIndexAtOrAfterVerticallOffset(e206), r10 = this.getWhitespacesCount() - 1;
    if (n10 < 0) return [];
    let i10 = [];
    for (let e207 = n10; e207 <= r10; e207++) {
      let n11 = this.getVerticalOffsetForWhitespaceIndex(e207), r11 = this.getHeightForWhitespaceIndex(e207);
      if (n11 >= t10) break;
      i10.push({ id: this.getIdForWhitespaceIndex(e207), afterLineNumber: this.getAfterLineNumberForWhitespaceIndex(e207), verticalOffset: n11, height: r11 });
    }
    return i10;
  }
  getWhitespaces() {
    return this._arr.slice(0);
  }
  getWhitespacesCount() {
    return this._arr.length;
  }
  getIdForWhitespaceIndex(e206) {
    return e206 |= 0, this._arr[e206].id;
  }
  getAfterLineNumberForWhitespaceIndex(e206) {
    return e206 |= 0, this._arr[e206].afterLineNumber;
  }
  getHeightForWhitespaceIndex(e206) {
    return e206 |= 0, this._arr[e206].height;
  }
}, _Ca.INSTANCE_COUNT = 0, _Ca), Lfe = 125, _k = class {
  constructor(e206, t10, n10, r10) {
    e206 |= 0, t10 |= 0, n10 |= 0, r10 |= 0, e206 < 0 && (e206 = 0), t10 < 0 && (t10 = 0), n10 < 0 && (n10 = 0), r10 < 0 && (r10 = 0), this.width = e206, this.contentWidth = t10, this.scrollWidth = Math.max(e206, t10), this.height = n10, this.contentHeight = r10, this.scrollHeight = Math.max(n10, r10);
  }
  equals(e206) {
    return this.width === e206.width && this.contentWidth === e206.contentWidth && this.height === e206.height && this.contentHeight === e206.contentHeight;
  }
}, Rfe = class extends D {
  constructor(e206, t10) {
    super(), this._onDidContentSizeChange = this._register(new k()), this.onDidContentSizeChange = this._onDidContentSizeChange.event, this._dimensions = new _k(0, 0, 0, 0), this._scrollable = this._register(new ox({ forceIntegerValues: true, smoothScrollDuration: e206, scheduleAtNextAnimationFrame: t10 })), this.onDidScroll = this._scrollable.onScroll;
  }
  getScrollable() {
    return this._scrollable;
  }
  setSmoothScrollDuration(e206) {
    this._scrollable.setSmoothScrollDuration(e206);
  }
  validateScrollPosition(e206) {
    return this._scrollable.validateScrollPosition(e206);
  }
  getScrollDimensions() {
    return this._dimensions;
  }
  setScrollDimensions(e206) {
    if (this._dimensions.equals(e206)) return;
    let t10 = this._dimensions;
    this._dimensions = e206, this._scrollable.setScrollDimensions({ width: e206.width, scrollWidth: e206.scrollWidth, height: e206.height, scrollHeight: e206.scrollHeight }, true);
    let n10 = t10.contentWidth !== e206.contentWidth, r10 = t10.contentHeight !== e206.contentHeight;
    (n10 || r10) && this._onDidContentSizeChange.fire(new ffe(t10.contentWidth, t10.contentHeight, e206.contentWidth, e206.contentHeight));
  }
  getFutureScrollPosition() {
    return this._scrollable.getFutureScrollPosition();
  }
  getCurrentScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
  setScrollPositionNow(e206) {
    this._scrollable.setScrollPositionNow(e206);
  }
  setScrollPositionSmooth(e206) {
    this._scrollable.setScrollPositionSmooth(e206);
  }
  hasPendingScrollAnimation() {
    return this._scrollable.hasPendingScrollAnimation();
  }
}, zfe = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._configuration = e206;
    let i10 = this._configuration.options, a10 = i10.get(165), o10 = i10.get(96);
    this._linesLayout = new Ife(t10, i10.get(75), o10.top, o10.bottom, n10), this._maxLineWidth = 0, this._overlayWidgetsMinWidth = 0, this._scrollable = this._register(new Rfe(0, r10)), this._configureSmoothScrollDuration(), this._scrollable.setScrollDimensions(new _k(a10.contentWidth, 0, a10.height, 0)), this.onDidScroll = this._scrollable.onDidScroll, this.onDidContentSizeChange = this._scrollable.onDidContentSizeChange, this._updateHeight();
  }
  dispose() {
    super.dispose();
  }
  getScrollable() {
    return this._scrollable.getScrollable();
  }
  onHeightMaybeChanged() {
    this._updateHeight();
  }
  _configureSmoothScrollDuration() {
    this._scrollable.setSmoothScrollDuration(this._configuration.options.get(130) ? Lfe : 0);
  }
  onConfigurationChanged(e206) {
    let t10 = this._configuration.options;
    if (e206.hasChanged(75) && this._linesLayout.setDefaultLineHeight(t10.get(75)), e206.hasChanged(96)) {
      let e207 = t10.get(96);
      this._linesLayout.setPadding(e207.top, e207.bottom);
    }
    if (e206.hasChanged(165)) {
      let e207 = t10.get(165), n10 = e207.contentWidth, r10 = e207.height, i10 = this._scrollable.getScrollDimensions(), a10 = i10.contentWidth;
      this._scrollable.setScrollDimensions(new _k(n10, i10.contentWidth, r10, this._getContentHeight(n10, r10, a10)));
    } else this._updateHeight();
    e206.hasChanged(130) && this._configureSmoothScrollDuration();
  }
  onFlushed(e206, t10) {
    this._linesLayout.onFlushed(e206, t10);
  }
  onLinesDeleted(e206, t10) {
    this._linesLayout.onLinesDeleted(e206, t10);
  }
  onLinesInserted(e206, t10) {
    this._linesLayout.onLinesInserted(e206, t10);
  }
  _getHorizontalScrollbarHeight(e206, t10) {
    let n10 = this._configuration.options.get(117);
    return n10.horizontal === 2 || e206 >= t10 ? 0 : n10.horizontalScrollbarSize;
  }
  _getContentHeight(e206, t10, n10) {
    let r10 = this._configuration.options, i10 = this._linesLayout.getLinesTotalHeight();
    return r10.get(119) ? i10 += Math.max(0, t10 - r10.get(75) - r10.get(96).bottom) : r10.get(117).ignoreHorizontalScrollbarInContentHeight || (i10 += this._getHorizontalScrollbarHeight(e206, n10)), i10;
  }
  _updateHeight() {
    let e206 = this._scrollable.getScrollDimensions(), t10 = e206.width, n10 = e206.height, r10 = e206.contentWidth;
    this._scrollable.setScrollDimensions(new _k(t10, e206.contentWidth, n10, this._getContentHeight(t10, n10, r10)));
  }
  getCurrentViewport() {
    let e206 = this._scrollable.getScrollDimensions(), t10 = this._scrollable.getCurrentScrollPosition();
    return new gg(t10.scrollTop, t10.scrollLeft, e206.width, e206.height);
  }
  getFutureViewport() {
    let e206 = this._scrollable.getScrollDimensions(), t10 = this._scrollable.getFutureScrollPosition();
    return new gg(t10.scrollTop, t10.scrollLeft, e206.width, e206.height);
  }
  _computeContentWidth() {
    let e206 = this._configuration.options, t10 = this._maxLineWidth, n10 = e206.get(166), r10 = e206.get(59), i10 = e206.get(165);
    if (n10.isViewportWrapping) {
      let n11 = e206.get(81);
      return t10 > i10.contentWidth + r10.typicalHalfwidthCharacterWidth && n11.enabled && n11.side === `right` ? t10 + i10.verticalScrollbarWidth : t10;
    } else {
      let n11 = e206.get(118) * r10.typicalHalfwidthCharacterWidth, a10 = this._linesLayout.getWhitespaceMinWidth();
      return Math.max(t10 + n11 + i10.verticalScrollbarWidth, a10, this._overlayWidgetsMinWidth);
    }
  }
  setMaxLineWidth(e206) {
    this._maxLineWidth = e206, this._updateContentWidth();
  }
  setOverlayWidgetsMinWidth(e206) {
    this._overlayWidgetsMinWidth = e206, this._updateContentWidth();
  }
  _updateContentWidth() {
    let e206 = this._scrollable.getScrollDimensions();
    this._scrollable.setScrollDimensions(new _k(e206.width, this._computeContentWidth(), e206.height, e206.contentHeight)), this._updateHeight();
  }
  saveState() {
    let e206 = this._scrollable.getFutureScrollPosition(), t10 = e206.scrollTop, n10 = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t10);
    return { scrollTop: t10, scrollTopWithoutViewZones: t10 - this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n10), scrollLeft: e206.scrollLeft };
  }
  changeWhitespace(e206) {
    let t10 = this._linesLayout.changeWhitespace(e206);
    return t10 && this.onHeightMaybeChanged(), t10;
  }
  changeSpecialLineHeights(e206) {
    let t10 = this._linesLayout.changeLineHeights(e206);
    return t10 && this.onHeightMaybeChanged(), t10;
  }
  getVerticalOffsetForLineNumber(e206, t10 = false) {
    return this._linesLayout.getVerticalOffsetForLineNumber(e206, t10);
  }
  getVerticalOffsetAfterLineNumber(e206, t10 = false) {
    return this._linesLayout.getVerticalOffsetAfterLineNumber(e206, t10);
  }
  getLineHeightForLineNumber(e206) {
    return this._linesLayout.getLineHeightForLineNumber(e206);
  }
  isAfterLines(e206) {
    return this._linesLayout.isAfterLines(e206);
  }
  isInTopPadding(e206) {
    return this._linesLayout.isInTopPadding(e206);
  }
  isInBottomPadding(e206) {
    return this._linesLayout.isInBottomPadding(e206);
  }
  getLineNumberAtVerticalOffset(e206) {
    return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e206);
  }
  getWhitespaceAtVerticalOffset(e206) {
    return this._linesLayout.getWhitespaceAtVerticalOffset(e206);
  }
  getLinesViewportData() {
    let e206 = this.getCurrentViewport();
    return this._linesLayout.getLinesViewportData(e206.top, e206.top + e206.height);
  }
  getLinesViewportDataAtScrollTop(e206) {
    let t10 = this._scrollable.getScrollDimensions();
    return e206 + t10.height > t10.scrollHeight && (e206 = t10.scrollHeight - t10.height), e206 < 0 && (e206 = 0), this._linesLayout.getLinesViewportData(e206, e206 + t10.height);
  }
  getWhitespaceViewportData() {
    let e206 = this.getCurrentViewport();
    return this._linesLayout.getWhitespaceViewportData(e206.top, e206.top + e206.height);
  }
  getWhitespaces() {
    return this._linesLayout.getWhitespaces();
  }
  getContentWidth() {
    return this._scrollable.getScrollDimensions().contentWidth;
  }
  getScrollWidth() {
    return this._scrollable.getScrollDimensions().scrollWidth;
  }
  getContentHeight() {
    return this._scrollable.getScrollDimensions().contentHeight;
  }
  getScrollHeight() {
    return this._scrollable.getScrollDimensions().scrollHeight;
  }
  getCurrentScrollLeft() {
    return this._scrollable.getCurrentScrollPosition().scrollLeft;
  }
  getCurrentScrollTop() {
    return this._scrollable.getCurrentScrollPosition().scrollTop;
  }
  validateScrollPosition(e206) {
    return this._scrollable.validateScrollPosition(e206);
  }
  setScrollPosition(e206, t10) {
    t10 === 1 ? this._scrollable.setScrollPositionNow(e206) : this._scrollable.setScrollPositionSmooth(e206);
  }
  hasPendingScrollAnimation() {
    return this._scrollable.hasPendingScrollAnimation();
  }
  deltaScrollNow(e206, t10) {
    let n10 = this._scrollable.getCurrentScrollPosition();
    this._scrollable.setScrollPositionNow({ scrollLeft: n10.scrollLeft + e206, scrollTop: n10.scrollTop + t10 });
  }
}, vk = class {
  constructor(e206, t10, n10) {
    this.range = e206, this.inlineClassName = t10, this.type = n10;
  }
}, Bfe = class {
  constructor(e206, t10, n10, r10) {
    this.startOffset = e206, this.endOffset = t10, this.inlineClassName = n10, this.inlineClassNameAffectsLetterSpacing = r10;
  }
  toInlineDecoration(e206) {
    return new vk(new M(e206, this.startOffset + 1, e206, this.endOffset + 1), this.inlineClassName, this.inlineClassNameAffectsLetterSpacing ? 3 : 0);
  }
}, Vfe = class {
  constructor(e206, t10, n10, r10, i10) {
    this.editorId = e206, this.model = t10, this.configuration = n10, this._linesCollection = r10, this._coordinatesConverter = i10, this._decorationsCache = /* @__PURE__ */ Object.create(null), this._cachedModelDecorationsResolver = null, this._cachedModelDecorationsResolverViewRange = null;
  }
  _clearCachedModelDecorationsResolver() {
    this._cachedModelDecorationsResolver = null, this._cachedModelDecorationsResolverViewRange = null;
  }
  dispose() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  reset() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  onModelDecorationsChanged() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  onLineMappingChanged() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  _getOrCreateViewModelDecoration(e206) {
    let t10 = e206.id, n10 = this._decorationsCache[t10];
    if (!n10) {
      let r10 = e206.range, i10 = e206.options, a10;
      if (i10.isWholeLine) {
        let e207 = this._coordinatesConverter.convertModelPositionToViewPosition(new j(r10.startLineNumber, 1), 0, false, true), t11 = this._coordinatesConverter.convertModelPositionToViewPosition(new j(r10.endLineNumber, this.model.getLineMaxColumn(r10.endLineNumber)), 1);
        a10 = new M(e207.lineNumber, e207.column, t11.lineNumber, t11.column);
      } else a10 = this._coordinatesConverter.convertModelRangeToViewRange(r10, 1);
      n10 = new MC(a10, i10), this._decorationsCache[t10] = n10;
    }
    return n10;
  }
  getMinimapDecorationsInRange(e206) {
    return this._getDecorationsInRange(e206, true, false).decorations;
  }
  getDecorationsViewportData(e206) {
    let t10 = this._cachedModelDecorationsResolver !== null;
    return t10 && (t10 = e206.equalsRange(this._cachedModelDecorationsResolverViewRange)), t10 || (this._cachedModelDecorationsResolver = this._getDecorationsInRange(e206, false, false), this._cachedModelDecorationsResolverViewRange = e206), this._cachedModelDecorationsResolver;
  }
  getDecorationsOnLine(e206, t10 = false, n10 = false) {
    let r10 = new M(e206, this._linesCollection.getViewLineMinColumn(e206), e206, this._linesCollection.getViewLineMaxColumn(e206));
    return this._getDecorationsInRange(r10, t10, n10);
  }
  _getDecorationsInRange(e206, t10, n10) {
    let r10 = this._linesCollection.getDecorationsInRange(e206, this.editorId, nr(this.configuration.options), rr(this.configuration.options), t10, n10), i10 = e206.startLineNumber, a10 = e206.endLineNumber, o10 = [], s10 = 0, c10 = [];
    for (let e207 = i10; e207 <= a10; e207++) c10[e207 - i10] = [];
    let l10 = false;
    for (let e207 = 0, t11 = r10.length; e207 < t11; e207++) {
      let t12 = r10[e207], n11 = t12.options;
      if (!NC(this.model, t12)) continue;
      let u10 = this._getOrCreateViewModelDecoration(t12), d10 = u10.range;
      if (o10[s10++] = u10, n11.inlineClassName) {
        let e208 = new vk(d10, n11.inlineClassName, n11.inlineClassNameAffectsLetterSpacing ? 3 : 0), t13 = Math.max(i10, d10.startLineNumber), r11 = Math.min(a10, d10.endLineNumber);
        for (let n12 = t13; n12 <= r11; n12++) c10[n12 - i10].push(e208);
      }
      if (n11.beforeContentClassName && i10 <= d10.startLineNumber && d10.startLineNumber <= a10) {
        let e208 = new vk(new M(d10.startLineNumber, d10.startColumn, d10.startLineNumber, d10.startColumn), n11.beforeContentClassName, 1);
        c10[d10.startLineNumber - i10].push(e208);
      }
      if (n11.afterContentClassName && i10 <= d10.endLineNumber && d10.endLineNumber <= a10) {
        let e208 = new vk(new M(d10.endLineNumber, d10.endColumn, d10.endLineNumber, d10.endColumn), n11.afterContentClassName, 2);
        c10[d10.endLineNumber - i10].push(e208);
      }
      n11.affectsFont && (l10 = true);
    }
    return { decorations: o10, inlineDecorations: c10, hasVariableFonts: l10 };
  }
};
function yk(e206, t10) {
  return e206 === null ? t10 ? bk.INSTANCE : xk.INSTANCE : new Hfe(e206, t10);
}
var Hfe = class {
  constructor(e206, t10) {
    this._projectionData = e206, this._isVisible = t10;
  }
  isVisible() {
    return this._isVisible;
  }
  setVisible(e206) {
    return this._isVisible = e206, this;
  }
  getProjectionData() {
    return this._projectionData;
  }
  getViewLineCount() {
    return this._isVisible ? this._projectionData.getOutputLineCount() : 0;
  }
  getViewLineContent(e206, t10, n10) {
    this._assertVisible();
    let r10 = n10 > 0 ? this._projectionData.breakOffsets[n10 - 1] : 0, i10 = this._projectionData.breakOffsets[n10], a10;
    if (this._projectionData.injectionOffsets !== null) {
      let n11 = this._projectionData.injectionOffsets.map((e207, t11) => new rT(0, 0, e207 + 1, this._projectionData.injectionOptions[t11], 0));
      a10 = rT.applyInjectedText(e206.getLineContent(t10), n11).substring(r10, i10);
    } else a10 = e206.getValueInRange({ startLineNumber: t10, startColumn: r10 + 1, endLineNumber: t10, endColumn: i10 + 1 });
    return n10 > 0 && (a10 = Ck(this._projectionData.wrappedTextIndentLength) + a10), a10;
  }
  getViewLineLength(e206, t10, n10) {
    return this._assertVisible(), this._projectionData.getLineLength(n10);
  }
  getViewLineMinColumn(e206, t10, n10) {
    return this._assertVisible(), this._projectionData.getMinOutputOffset(n10) + 1;
  }
  getViewLineMaxColumn(e206, t10, n10) {
    return this._assertVisible(), this._projectionData.getMaxOutputOffset(n10) + 1;
  }
  getViewLineData(e206, t10, n10) {
    let r10 = [];
    return this.getViewLinesData(e206, t10, n10, 1, 0, [true], r10), r10[0];
  }
  getViewLinesData(e206, t10, n10, r10, i10, a10, o10) {
    this._assertVisible();
    let s10 = this._projectionData, c10 = s10.injectionOffsets, l10 = s10.injectionOptions, u10 = null;
    if (c10) {
      u10 = [];
      let e207 = 0, t11 = 0;
      for (let n11 = 0; n11 < s10.getOutputLineCount(); n11++) {
        let r11 = [];
        u10[n11] = r11;
        let i11 = n11 > 0 ? s10.breakOffsets[n11 - 1] : 0, a11 = s10.breakOffsets[n11];
        for (; t11 < c10.length; ) {
          let o11 = l10[t11].content.length, u11 = c10[t11] + e207, d11 = u11 + o11;
          if (u11 > a11) break;
          if (i11 < d11) {
            let e208 = l10[t11];
            if (e208.inlineClassName) {
              let t12 = n11 > 0 ? s10.wrappedTextIndentLength : 0, o12 = t12 + Math.max(u11 - i11, 0), c11 = t12 + Math.min(d11 - i11, a11 - i11);
              o12 !== c11 && r11.push(new Bfe(o12, c11, e208.inlineClassName, e208.inlineClassNameAffectsLetterSpacing));
            }
          }
          if (d11 <= a11) e207 += o11, t11++;
          else break;
        }
      }
    }
    let d10;
    if (c10) {
      let n11 = [];
      for (let e207 = 0; e207 < c10.length; e207++) {
        let t11 = c10[e207], r11 = l10[e207].tokens;
        r11 ? r11.forEach((r12, i11) => {
          n11.push({ offset: t11, text: r12.substring(l10[e207].content), tokenMetadata: i11.metadata });
        }) : n11.push({ offset: t11, text: l10[e207].content, tokenMetadata: rg.defaultTokenMetadata });
      }
      d10 = e206.tokenization.getLineTokens(t10).withInserted(n11);
    } else d10 = e206.tokenization.getLineTokens(t10);
    for (let e207 = n10; e207 < n10 + r10; e207++) {
      let t11 = i10 + e207 - n10;
      if (!a10[t11]) {
        o10[t11] = null;
        continue;
      }
      o10[t11] = this._getViewLineData(d10, u10 ? u10[e207] : null, e207);
    }
  }
  _getViewLineData(e206, t10, n10) {
    this._assertVisible();
    let r10 = this._projectionData, i10 = n10 > 0 ? r10.wrappedTextIndentLength : 0, a10 = n10 > 0 ? r10.breakOffsets[n10 - 1] : 0, o10 = r10.breakOffsets[n10], s10 = e206.sliceAndInflate(a10, o10, i10), c10 = s10.getLineContent();
    n10 > 0 && (c10 = Ck(r10.wrappedTextIndentLength) + c10);
    let l10 = this._projectionData.getMinOutputOffset(n10) + 1, u10 = c10.length + 1, d10 = n10 + 1 < this.getViewLineCount(), f10 = n10 === 0 ? 0 : r10.breakOffsetsVisibleColumn[n10 - 1];
    return new _g2(c10, d10, l10, u10, f10, s10, t10);
  }
  getModelColumnOfViewPosition(e206, t10) {
    return this._assertVisible(), this._projectionData.translateToInputOffset(e206, t10 - 1) + 1;
  }
  getViewPositionOfModelPosition(e206, t10, n10 = 2) {
    return this._assertVisible(), this._projectionData.translateToOutputPosition(t10 - 1, n10).toPosition(e206);
  }
  getViewLineNumberOfModelPosition(e206, t10) {
    return this._assertVisible(), e206 + this._projectionData.translateToOutputPosition(t10 - 1).outputLineIndex;
  }
  normalizePosition(e206, t10, n10) {
    let r10 = t10.lineNumber - e206;
    return this._projectionData.normalizeOutputPosition(e206, t10.column - 1, n10).toPosition(r10);
  }
  getInjectedTextAt(e206, t10) {
    return this._projectionData.getInjectedText(e206, t10 - 1);
  }
  _assertVisible() {
    if (!this._isVisible) throw Error(`Not supported`);
  }
}, bk = (_Da = class {
  constructor() {
  }
  isVisible() {
    return true;
  }
  setVisible(e206) {
    return e206 ? this : xk.INSTANCE;
  }
  getProjectionData() {
    return null;
  }
  getViewLineCount() {
    return 1;
  }
  getViewLineContent(e206, t10, n10) {
    return e206.getLineContent(t10);
  }
  getViewLineLength(e206, t10, n10) {
    return e206.getLineLength(t10);
  }
  getViewLineMinColumn(e206, t10, n10) {
    return e206.getLineMinColumn(t10);
  }
  getViewLineMaxColumn(e206, t10, n10) {
    return e206.getLineMaxColumn(t10);
  }
  getViewLineData(e206, t10, n10) {
    let r10 = e206.tokenization.getLineTokens(t10), i10 = r10.getLineContent();
    return new _g2(i10, false, 1, i10.length + 1, 0, r10.inflate(), null);
  }
  getViewLinesData(e206, t10, n10, r10, i10, a10, o10) {
    if (!a10[i10]) {
      o10[i10] = null;
      return;
    }
    o10[i10] = this.getViewLineData(e206, t10, 0);
  }
  getModelColumnOfViewPosition(e206, t10) {
    return t10;
  }
  getViewPositionOfModelPosition(e206, t10) {
    return new j(e206, t10);
  }
  getViewLineNumberOfModelPosition(e206, t10) {
    return e206;
  }
  normalizePosition(e206, t10, n10) {
    return t10;
  }
  getInjectedTextAt(e206, t10) {
    return null;
  }
}, _Da.INSTANCE = new _Da(), _Da), xk = (_Ea = class {
  constructor() {
  }
  isVisible() {
    return false;
  }
  setVisible(e206) {
    return e206 ? bk.INSTANCE : this;
  }
  getProjectionData() {
    return null;
  }
  getViewLineCount() {
    return 0;
  }
  getViewLineContent(e206, t10, n10) {
    throw Error(`Not supported`);
  }
  getViewLineLength(e206, t10, n10) {
    throw Error(`Not supported`);
  }
  getViewLineMinColumn(e206, t10, n10) {
    throw Error(`Not supported`);
  }
  getViewLineMaxColumn(e206, t10, n10) {
    throw Error(`Not supported`);
  }
  getViewLineData(e206, t10, n10) {
    throw Error(`Not supported`);
  }
  getViewLinesData(e206, t10, n10, r10, i10, a10, o10) {
    throw Error(`Not supported`);
  }
  getModelColumnOfViewPosition(e206, t10) {
    throw Error(`Not supported`);
  }
  getViewPositionOfModelPosition(e206, t10) {
    throw Error(`Not supported`);
  }
  getViewLineNumberOfModelPosition(e206, t10) {
    throw Error(`Not supported`);
  }
  normalizePosition(e206, t10, n10) {
    throw Error(`Not supported`);
  }
  getInjectedTextAt(e206, t10) {
    throw Error(`Not supported`);
  }
}, _Ea.INSTANCE = new _Ea(), _Ea), Sk = [``];
function Ck(e206) {
  if (e206 >= Sk.length) for (let t10 = 1; t10 <= e206; t10++) Sk[t10] = Ufe(t10);
  return Sk[e206];
}
function Ufe(e206) {
  return Array(e206 + 1).join(` `);
}
var Wfe = class {
  constructor(e206) {
    this._model = e206;
  }
  _validPosition(e206) {
    return this._model.validatePosition(e206);
  }
  _validRange(e206) {
    return this._model.validateRange(e206);
  }
  convertViewPositionToModelPosition(e206) {
    return this._validPosition(e206);
  }
  convertViewRangeToModelRange(e206) {
    return this._validRange(e206);
  }
  validateViewPosition(e206, t10) {
    return this._validPosition(t10);
  }
  validateViewRange(e206, t10) {
    return this._validRange(t10);
  }
  convertModelPositionToViewPosition(e206) {
    return this._validPosition(e206);
  }
  convertModelRangeToViewRange(e206) {
    return this._validRange(e206);
  }
  modelPositionIsVisible(e206) {
    let t10 = this._model.getLineCount();
    return !(e206.lineNumber < 1 || e206.lineNumber > t10);
  }
  getModelLineViewLineCount(e206) {
    return 1;
  }
  getViewLineNumberOfModelPosition(e206, t10) {
    return e206;
  }
}, Gfe = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    this._editorId = e206, this.model = t10, this._validModelVersionId = -1, this._domLineBreaksComputerFactory = n10, this._monospaceLineBreaksComputerFactory = r10, this.fontInfo = i10, this.tabSize = a10, this.wrappingStrategy = o10, this.wrappingColumn = s10, this.wrappingIndent = c10, this.wordBreak = l10, this.wrapOnEscapedLineFeeds = u10, this._constructLines(true, null);
  }
  dispose() {
    this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, []);
  }
  createCoordinatesConverter() {
    return new qfe(this);
  }
  _constructLines(e206, t10) {
    this.modelLineProjections = [], e206 && (this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, []));
    let n10 = this.model.getLinesContent(), r10 = this.model.getInjectedTextDecorations(this._editorId), i10 = n10.length, a10 = this.createLineBreaksComputer(), o10 = new me(rT.fromDecorations(r10));
    for (let e207 = 0; e207 < i10; e207++) {
      let r11 = o10.takeWhile((t11) => t11.lineNumber === e207 + 1);
      a10.addRequest(n10[e207], r11, t10 ? t10[e207] : null);
    }
    let s10 = a10.finalize(), c10 = [], l10 = this.hiddenAreasDecorationIds.map((e207) => this.model.getDecorationRange(e207)).sort(M.compareRangesUsingStarts), u10 = 1, d10 = 0, f10 = -1, p10 = f10 + 1 < l10.length ? d10 + 1 : i10 + 2;
    for (let e207 = 0; e207 < i10; e207++) {
      let t11 = e207 + 1;
      t11 === p10 && (f10++, u10 = l10[f10].startLineNumber, d10 = l10[f10].endLineNumber, p10 = f10 + 1 < l10.length ? d10 + 1 : i10 + 2);
      let n11 = t11 >= u10 && t11 <= d10, r11 = yk(s10[e207], !n11);
      c10[e207] = r11.getViewLineCount(), this.modelLineProjections[e207] = r11;
    }
    this._validModelVersionId = this.model.getVersionId(), this.projectedModelLineLineCounts = new Bie(c10);
  }
  getHiddenAreas() {
    return this.hiddenAreasDecorationIds.map((e206) => this.model.getDecorationRange(e206));
  }
  setHiddenAreas(e206) {
    let t10 = Kfe(e206.map((e207) => this.model.validateRange(e207))), n10 = this.hiddenAreasDecorationIds.map((e207) => this.model.getDecorationRange(e207)).sort(M.compareRangesUsingStarts);
    if (t10.length === n10.length) {
      let e207 = false;
      for (let r11 = 0; r11 < t10.length; r11++) if (!t10[r11].equalsRange(n10[r11])) {
        e207 = true;
        break;
      }
      if (!e207) return false;
    }
    let r10 = t10.map((e207) => ({ range: e207, options: UO.EMPTY }));
    this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, r10);
    let i10 = t10, a10 = 1, o10 = 0, s10 = -1, c10 = s10 + 1 < i10.length ? o10 + 1 : this.modelLineProjections.length + 2, l10 = false;
    for (let e207 = 0; e207 < this.modelLineProjections.length; e207++) {
      let t11 = e207 + 1;
      t11 === c10 && (s10++, a10 = i10[s10].startLineNumber, o10 = i10[s10].endLineNumber, c10 = s10 + 1 < i10.length ? o10 + 1 : this.modelLineProjections.length + 2);
      let n11 = false;
      if (t11 >= a10 && t11 <= o10 ? this.modelLineProjections[e207].isVisible() && (this.modelLineProjections[e207] = this.modelLineProjections[e207].setVisible(false), n11 = true) : (l10 = true, this.modelLineProjections[e207].isVisible() || (this.modelLineProjections[e207] = this.modelLineProjections[e207].setVisible(true), n11 = true)), n11) {
        let t12 = this.modelLineProjections[e207].getViewLineCount();
        this.projectedModelLineLineCounts.setValue(e207, t12);
      }
    }
    return l10 || this.setHiddenAreas([]), true;
  }
  modelPositionIsVisible(e206, t10) {
    return e206 < 1 || e206 > this.modelLineProjections.length ? false : this.modelLineProjections[e206 - 1].isVisible();
  }
  getModelLineViewLineCount(e206) {
    return e206 < 1 || e206 > this.modelLineProjections.length ? 1 : this.modelLineProjections[e206 - 1].getViewLineCount();
  }
  setTabSize(e206) {
    return this.tabSize === e206 ? false : (this.tabSize = e206, this._constructLines(false, null), true);
  }
  setWrappingSettings(e206, t10, n10, r10, i10) {
    let a10 = this.fontInfo.equals(e206), o10 = this.wrappingStrategy === t10, s10 = this.wrappingColumn === n10, c10 = this.wrappingIndent === r10, l10 = this.wordBreak === i10;
    if (a10 && o10 && s10 && c10 && l10) return false;
    let u10 = a10 && o10 && !s10 && c10 && l10;
    this.fontInfo = e206, this.wrappingStrategy = t10, this.wrappingColumn = n10, this.wrappingIndent = r10, this.wordBreak = i10;
    let d10 = null;
    if (u10) {
      d10 = [];
      for (let e207 = 0, t11 = this.modelLineProjections.length; e207 < t11; e207++) d10[e207] = this.modelLineProjections[e207].getProjectionData();
    }
    return this._constructLines(false, d10), true;
  }
  createLineBreaksComputer() {
    return (this.wrappingStrategy === `advanced` ? this._domLineBreaksComputerFactory : this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo, this.tabSize, this.wrappingColumn, this.wrappingIndent, this.wordBreak, this.wrapOnEscapedLineFeeds);
  }
  onModelFlushed() {
    this._constructLines(true, null);
  }
  onModelLinesDeleted(e206, t10, n10) {
    if (!e206 || e206 <= this._validModelVersionId) return null;
    let r10 = t10 === 1 ? 1 : this.projectedModelLineLineCounts.getPrefixSum(t10 - 1) + 1, i10 = this.projectedModelLineLineCounts.getPrefixSum(n10);
    return this.modelLineProjections.splice(t10 - 1, n10 - t10 + 1), this.projectedModelLineLineCounts.removeValues(t10 - 1, n10 - t10 + 1), new sk(r10, i10);
  }
  onModelLinesInserted(e206, t10, n10, r10) {
    if (!e206 || e206 <= this._validModelVersionId) return null;
    let i10 = t10 > 2 && !this.modelLineProjections[t10 - 2].isVisible(), a10 = t10 === 1 ? 1 : this.projectedModelLineLineCounts.getPrefixSum(t10 - 1) + 1, o10 = 0, s10 = [], c10 = [];
    for (let e207 = 0, t11 = r10.length; e207 < t11; e207++) {
      let t12 = yk(r10[e207], !i10);
      s10.push(t12);
      let n11 = t12.getViewLineCount();
      o10 += n11, c10[e207] = n11;
    }
    return this.modelLineProjections = this.modelLineProjections.slice(0, t10 - 1).concat(s10).concat(this.modelLineProjections.slice(t10 - 1)), this.projectedModelLineLineCounts.insertValues(t10 - 1, c10), new ck(a10, a10 + o10 - 1);
  }
  onModelLineChanged(e206, t10, n10) {
    if (e206 !== null && e206 <= this._validModelVersionId) return [false, null, null, null];
    let r10 = t10 - 1, i10 = this.modelLineProjections[r10].getViewLineCount(), a10 = yk(n10, this.modelLineProjections[r10].isVisible());
    this.modelLineProjections[r10] = a10;
    let o10 = this.modelLineProjections[r10].getViewLineCount(), s10 = false, c10 = 0, l10 = -1, u10 = 0, d10 = -1, f10 = 0, p10 = -1;
    i10 > o10 ? (c10 = this.projectedModelLineLineCounts.getPrefixSum(t10 - 1) + 1, l10 = c10 + o10 - 1, f10 = l10 + 1, p10 = f10 + (i10 - o10) - 1, s10 = true) : i10 < o10 ? (c10 = this.projectedModelLineLineCounts.getPrefixSum(t10 - 1) + 1, l10 = c10 + i10 - 1, u10 = l10 + 1, d10 = u10 + (o10 - i10) - 1, s10 = true) : (c10 = this.projectedModelLineLineCounts.getPrefixSum(t10 - 1) + 1, l10 = c10 + o10 - 1), this.projectedModelLineLineCounts.setValue(r10, o10);
    let m10 = c10 <= l10 ? new ok(c10, l10 - c10 + 1) : null, h10 = u10 <= d10 ? new ck(u10, d10) : null, g10 = f10 <= p10 ? new sk(f10, p10) : null;
    return [s10, m10, h10, g10];
  }
  acceptVersionId(e206) {
    this._validModelVersionId = e206, this.modelLineProjections.length === 1 && !this.modelLineProjections[0].isVisible() && this.setHiddenAreas([]);
  }
  getViewLineCount() {
    return this.projectedModelLineLineCounts.getTotalSum();
  }
  _toValidViewLineNumber(e206) {
    if (e206 < 1) return 1;
    let t10 = this.getViewLineCount();
    return e206 > t10 ? t10 : e206 | 0;
  }
  getActiveIndentGuide(e206, t10, n10) {
    e206 = this._toValidViewLineNumber(e206), t10 = this._toValidViewLineNumber(t10), n10 = this._toValidViewLineNumber(n10);
    let r10 = this.convertViewPositionToModelPosition(e206, this.getViewLineMinColumn(e206)), i10 = this.convertViewPositionToModelPosition(t10, this.getViewLineMinColumn(t10)), a10 = this.convertViewPositionToModelPosition(n10, this.getViewLineMinColumn(n10)), o10 = this.model.guides.getActiveIndentGuide(r10.lineNumber, i10.lineNumber, a10.lineNumber), s10 = this.convertModelPositionToViewPosition(o10.startLineNumber, 1), c10 = this.convertModelPositionToViewPosition(o10.endLineNumber, this.model.getLineMaxColumn(o10.endLineNumber));
    return { startLineNumber: s10.lineNumber, endLineNumber: c10.lineNumber, indent: o10.indent };
  }
  getViewLineInfo(e206) {
    e206 = this._toValidViewLineNumber(e206);
    let t10 = this.projectedModelLineLineCounts.getIndexOf(e206 - 1), n10 = t10.index, r10 = t10.remainder;
    return new wk(n10 + 1, r10);
  }
  getMinColumnOfViewLine(e206) {
    return this.modelLineProjections[e206.modelLineNumber - 1].getViewLineMinColumn(this.model, e206.modelLineNumber, e206.modelLineWrappedLineIdx);
  }
  getMaxColumnOfViewLine(e206) {
    return this.modelLineProjections[e206.modelLineNumber - 1].getViewLineMaxColumn(this.model, e206.modelLineNumber, e206.modelLineWrappedLineIdx);
  }
  getModelStartPositionOfViewLine(e206) {
    let t10 = this.modelLineProjections[e206.modelLineNumber - 1], n10 = t10.getViewLineMinColumn(this.model, e206.modelLineNumber, e206.modelLineWrappedLineIdx), r10 = t10.getModelColumnOfViewPosition(e206.modelLineWrappedLineIdx, n10);
    return new j(e206.modelLineNumber, r10);
  }
  getModelEndPositionOfViewLine(e206) {
    let t10 = this.modelLineProjections[e206.modelLineNumber - 1], n10 = t10.getViewLineMaxColumn(this.model, e206.modelLineNumber, e206.modelLineWrappedLineIdx), r10 = t10.getModelColumnOfViewPosition(e206.modelLineWrappedLineIdx, n10);
    return new j(e206.modelLineNumber, r10);
  }
  getViewLineInfosGroupedByModelRanges(e206, t10) {
    let n10 = this.getViewLineInfo(e206), r10 = this.getViewLineInfo(t10), i10 = [], a10 = this.getModelStartPositionOfViewLine(n10), o10 = [];
    for (let e207 = n10.modelLineNumber; e207 <= r10.modelLineNumber; e207++) {
      let t11 = this.modelLineProjections[e207 - 1];
      if (t11.isVisible()) {
        let i11 = e207 === n10.modelLineNumber ? n10.modelLineWrappedLineIdx : 0, a11 = e207 === r10.modelLineNumber ? r10.modelLineWrappedLineIdx + 1 : t11.getViewLineCount();
        for (let t12 = i11; t12 < a11; t12++) o10.push(new wk(e207, t12));
      }
      if (!t11.isVisible() && a10) {
        let t12 = new j(e207 - 1, this.model.getLineMaxColumn(e207 - 1) + 1), n11 = M.fromPositions(a10, t12);
        i10.push(new Tk(n11, o10)), o10 = [], a10 = null;
      } else t11.isVisible() && !a10 && (a10 = new j(e207, 1));
    }
    if (a10) {
      let e207 = M.fromPositions(a10, this.getModelEndPositionOfViewLine(r10));
      i10.push(new Tk(e207, o10));
    }
    return i10;
  }
  getViewLinesBracketGuides(e206, t10, n10, r10) {
    let i10 = n10 ? this.convertViewPositionToModelPosition(n10.lineNumber, n10.column) : null, a10 = [];
    for (let n11 of this.getViewLineInfosGroupedByModelRanges(e206, t10)) {
      let e207 = n11.modelRange.startLineNumber, t11 = this.model.guides.getLinesBracketGuides(e207, n11.modelRange.endLineNumber, i10, r10);
      for (let r11 of n11.viewLines) {
        let n12 = t11[r11.modelLineNumber - e207].map((e208) => {
          if (e208.forWrappedLinesAfterColumn !== -1 && this.modelLineProjections[r11.modelLineNumber - 1].getViewPositionOfModelPosition(0, e208.forWrappedLinesAfterColumn).lineNumber >= r11.modelLineWrappedLineIdx || e208.forWrappedLinesBeforeOrAtColumn !== -1 && this.modelLineProjections[r11.modelLineNumber - 1].getViewPositionOfModelPosition(0, e208.forWrappedLinesBeforeOrAtColumn).lineNumber < r11.modelLineWrappedLineIdx) return;
          if (!e208.horizontalLine) return e208;
          let t12 = -1;
          if (e208.column !== -1) {
            let n14 = this.modelLineProjections[r11.modelLineNumber - 1].getViewPositionOfModelPosition(0, e208.column);
            if (n14.lineNumber === r11.modelLineWrappedLineIdx) t12 = n14.column;
            else if (n14.lineNumber < r11.modelLineWrappedLineIdx) t12 = this.getMinColumnOfViewLine(r11);
            else if (n14.lineNumber > r11.modelLineWrappedLineIdx) return;
          }
          let n13 = this.convertModelPositionToViewPosition(r11.modelLineNumber, e208.horizontalLine.endColumn), i11 = this.modelLineProjections[r11.modelLineNumber - 1].getViewPositionOfModelPosition(0, e208.horizontalLine.endColumn);
          return i11.lineNumber === r11.modelLineWrappedLineIdx ? new _C2(e208.visibleColumn, t12, e208.className, new vC(e208.horizontalLine.top, n13.column), -1, -1) : i11.lineNumber < r11.modelLineWrappedLineIdx ? void 0 : e208.visibleColumn === -1 ? new _C2(e208.visibleColumn, t12, e208.className, new vC(e208.horizontalLine.top, this.getMaxColumnOfViewLine(r11)), -1, -1) : void 0;
        });
        a10.push(n12.filter((e208) => !!e208));
      }
    }
    return a10;
  }
  getViewLinesIndentGuides(e206, t10) {
    e206 = this._toValidViewLineNumber(e206), t10 = this._toValidViewLineNumber(t10);
    let n10 = this.convertViewPositionToModelPosition(e206, this.getViewLineMinColumn(e206)), r10 = this.convertViewPositionToModelPosition(t10, this.getViewLineMaxColumn(t10)), i10 = [], a10 = [], o10 = [], s10 = n10.lineNumber - 1, c10 = r10.lineNumber - 1, l10 = null;
    for (let e207 = s10; e207 <= c10; e207++) {
      let t11 = this.modelLineProjections[e207];
      if (t11.isVisible()) {
        let r11 = t11.getViewLineNumberOfModelPosition(0, e207 === s10 ? n10.column : 1), i11 = t11.getViewLineNumberOfModelPosition(0, this.model.getLineMaxColumn(e207 + 1)), c11 = i11 - r11 + 1, u11 = 0;
        c11 > 1 && t11.getViewLineMinColumn(this.model, e207 + 1, i11) === 1 && (u11 = r11 === 0 ? 1 : 2), a10.push(c11), o10.push(u11), l10 === null && (l10 = new j(e207 + 1, 0));
      } else l10 !== null && (i10 = i10.concat(this.model.guides.getLinesIndentGuides(l10.lineNumber, e207)), l10 = null);
    }
    l10 !== null && (i10 = i10.concat(this.model.guides.getLinesIndentGuides(l10.lineNumber, r10.lineNumber)), l10 = null);
    let u10 = t10 - e206 + 1, d10 = Array(u10), f10 = 0;
    for (let e207 = 0, t11 = i10.length; e207 < t11; e207++) {
      let t12 = i10[e207], n11 = Math.min(u10 - f10, a10[e207]), r11 = o10[e207], s11;
      s11 = r11 === 2 ? 0 : r11 === 1 ? 1 : n11;
      for (let e208 = 0; e208 < n11; e208++) e208 === s11 && (t12 = 0), d10[f10++] = t12;
    }
    return d10;
  }
  getViewLineContent(e206) {
    let t10 = this.getViewLineInfo(e206);
    return this.modelLineProjections[t10.modelLineNumber - 1].getViewLineContent(this.model, t10.modelLineNumber, t10.modelLineWrappedLineIdx);
  }
  getViewLineLength(e206) {
    let t10 = this.getViewLineInfo(e206);
    return this.modelLineProjections[t10.modelLineNumber - 1].getViewLineLength(this.model, t10.modelLineNumber, t10.modelLineWrappedLineIdx);
  }
  getViewLineMinColumn(e206) {
    let t10 = this.getViewLineInfo(e206);
    return this.modelLineProjections[t10.modelLineNumber - 1].getViewLineMinColumn(this.model, t10.modelLineNumber, t10.modelLineWrappedLineIdx);
  }
  getViewLineMaxColumn(e206) {
    let t10 = this.getViewLineInfo(e206);
    return this.modelLineProjections[t10.modelLineNumber - 1].getViewLineMaxColumn(this.model, t10.modelLineNumber, t10.modelLineWrappedLineIdx);
  }
  getViewLineData(e206) {
    let t10 = this.getViewLineInfo(e206);
    return this.modelLineProjections[t10.modelLineNumber - 1].getViewLineData(this.model, t10.modelLineNumber, t10.modelLineWrappedLineIdx);
  }
  getViewLinesData(e206, t10, n10) {
    e206 = this._toValidViewLineNumber(e206), t10 = this._toValidViewLineNumber(t10);
    let r10 = this.projectedModelLineLineCounts.getIndexOf(e206 - 1), i10 = e206, a10 = r10.index, o10 = r10.remainder, s10 = [];
    for (let r11 = a10, c10 = this.model.getLineCount(); r11 < c10; r11++) {
      let c11 = this.modelLineProjections[r11];
      if (!c11.isVisible()) continue;
      let l10 = r11 === a10 ? o10 : 0, u10 = c11.getViewLineCount() - l10, d10 = false;
      if (i10 + u10 > t10 && (d10 = true, u10 = t10 - i10 + 1), c11.getViewLinesData(this.model, r11 + 1, l10, u10, i10 - e206, n10, s10), i10 += u10, d10) break;
    }
    return s10;
  }
  validateViewPosition(e206, t10, n10) {
    e206 = this._toValidViewLineNumber(e206);
    let r10 = this.projectedModelLineLineCounts.getIndexOf(e206 - 1), i10 = r10.index, a10 = r10.remainder, o10 = this.modelLineProjections[i10], s10 = o10.getViewLineMinColumn(this.model, i10 + 1, a10), c10 = o10.getViewLineMaxColumn(this.model, i10 + 1, a10);
    t10 < s10 && (t10 = s10), t10 > c10 && (t10 = c10);
    let l10 = o10.getModelColumnOfViewPosition(a10, t10);
    return this.model.validatePosition(new j(i10 + 1, l10)).equals(n10) ? new j(e206, t10) : this.convertModelPositionToViewPosition(n10.lineNumber, n10.column);
  }
  validateViewRange(e206, t10) {
    let n10 = this.validateViewPosition(e206.startLineNumber, e206.startColumn, t10.getStartPosition()), r10 = this.validateViewPosition(e206.endLineNumber, e206.endColumn, t10.getEndPosition());
    return new M(n10.lineNumber, n10.column, r10.lineNumber, r10.column);
  }
  convertViewPositionToModelPosition(e206, t10) {
    let n10 = this.getViewLineInfo(e206), r10 = this.modelLineProjections[n10.modelLineNumber - 1].getModelColumnOfViewPosition(n10.modelLineWrappedLineIdx, t10);
    return this.model.validatePosition(new j(n10.modelLineNumber, r10));
  }
  convertViewRangeToModelRange(e206) {
    let t10 = this.convertViewPositionToModelPosition(e206.startLineNumber, e206.startColumn), n10 = this.convertViewPositionToModelPosition(e206.endLineNumber, e206.endColumn);
    return new M(t10.lineNumber, t10.column, n10.lineNumber, n10.column);
  }
  convertModelPositionToViewPosition(e206, t10, n10 = 2, r10 = false, i10 = false) {
    let a10 = this.model.validatePosition(new j(e206, t10)), o10 = a10.lineNumber, s10 = a10.column, c10 = o10 - 1, l10 = false;
    if (i10) for (; c10 < this.modelLineProjections.length && !this.modelLineProjections[c10].isVisible(); ) c10++, l10 = true;
    else for (; c10 > 0 && !this.modelLineProjections[c10].isVisible(); ) c10--, l10 = true;
    if (c10 === 0 && !this.modelLineProjections[c10].isVisible()) return new j(+!r10, 1);
    let u10 = 1 + this.projectedModelLineLineCounts.getPrefixSum(c10), d10;
    return d10 = l10 ? i10 ? this.modelLineProjections[c10].getViewPositionOfModelPosition(u10, 1, n10) : this.modelLineProjections[c10].getViewPositionOfModelPosition(u10, this.model.getLineMaxColumn(c10 + 1), n10) : this.modelLineProjections[o10 - 1].getViewPositionOfModelPosition(u10, s10, n10), d10;
  }
  convertModelRangeToViewRange(e206, t10 = 0) {
    if (e206.isEmpty()) {
      let n10 = this.convertModelPositionToViewPosition(e206.startLineNumber, e206.startColumn, t10);
      return M.fromPositions(n10);
    } else {
      let t11 = this.convertModelPositionToViewPosition(e206.startLineNumber, e206.startColumn, 1), n10 = this.convertModelPositionToViewPosition(e206.endLineNumber, e206.endColumn, 0);
      return new M(t11.lineNumber, t11.column, n10.lineNumber, n10.column);
    }
  }
  getViewLineNumberOfModelPosition(e206, t10) {
    let n10 = e206 - 1;
    if (this.modelLineProjections[n10].isVisible()) {
      let e207 = 1 + this.projectedModelLineLineCounts.getPrefixSum(n10);
      return this.modelLineProjections[n10].getViewLineNumberOfModelPosition(e207, t10);
    }
    for (; n10 > 0 && !this.modelLineProjections[n10].isVisible(); ) n10--;
    if (n10 === 0 && !this.modelLineProjections[n10].isVisible()) return 1;
    let r10 = 1 + this.projectedModelLineLineCounts.getPrefixSum(n10);
    return this.modelLineProjections[n10].getViewLineNumberOfModelPosition(r10, this.model.getLineMaxColumn(n10 + 1));
  }
  getDecorationsInRange(e206, t10, n10, r10, i10, a10) {
    let o10 = this.convertViewPositionToModelPosition(e206.startLineNumber, e206.startColumn), s10 = this.convertViewPositionToModelPosition(e206.endLineNumber, e206.endColumn);
    if (s10.lineNumber - o10.lineNumber <= e206.endLineNumber - e206.startLineNumber) return this.model.getDecorationsInRange(new M(o10.lineNumber, 1, s10.lineNumber, s10.column), t10, n10, r10, i10, a10);
    let c10 = [], l10 = o10.lineNumber - 1, u10 = s10.lineNumber - 1, d10 = null;
    for (let e207 = l10; e207 <= u10; e207++) if (this.modelLineProjections[e207].isVisible()) d10 === null && (d10 = new j(e207 + 1, e207 === l10 ? o10.column : 1));
    else if (d10 !== null) {
      let a11 = this.model.getLineMaxColumn(e207);
      c10 = c10.concat(this.model.getDecorationsInRange(new M(d10.lineNumber, d10.column, e207, a11), t10, n10, r10, i10)), d10 = null;
    }
    d10 !== null && (c10 = c10.concat(this.model.getDecorationsInRange(new M(d10.lineNumber, d10.column, s10.lineNumber, s10.column), t10, n10, r10, i10)), d10 = null), c10.sort((e207, t11) => {
      let n11 = M.compareRangesUsingStarts(e207.range, t11.range);
      return n11 === 0 ? e207.id < t11.id ? -1 : +(e207.id > t11.id) : n11;
    });
    let f10 = [], p10 = 0, m10 = null;
    for (let e207 of c10) {
      let t11 = e207.id;
      m10 !== t11 && (m10 = t11, f10[p10++] = e207);
    }
    return f10;
  }
  getInjectedTextAt(e206) {
    let t10 = this.getViewLineInfo(e206.lineNumber);
    return this.modelLineProjections[t10.modelLineNumber - 1].getInjectedTextAt(t10.modelLineWrappedLineIdx, e206.column);
  }
  normalizePosition(e206, t10) {
    let n10 = this.getViewLineInfo(e206.lineNumber);
    return this.modelLineProjections[n10.modelLineNumber - 1].normalizePosition(n10.modelLineWrappedLineIdx, e206, t10);
  }
  getLineIndentColumn(e206) {
    let t10 = this.getViewLineInfo(e206);
    return t10.modelLineWrappedLineIdx === 0 ? this.model.getLineIndentColumn(t10.modelLineNumber) : 0;
  }
};
function Kfe(e206) {
  if (e206.length === 0) return [];
  let t10 = e206.slice();
  t10.sort(M.compareRangesUsingStarts);
  let n10 = [], r10 = t10[0].startLineNumber, i10 = t10[0].endLineNumber;
  for (let e207 = 1, a10 = t10.length; e207 < a10; e207++) {
    let a11 = t10[e207];
    a11.startLineNumber > i10 + 1 ? (n10.push(new M(r10, 1, i10, 1)), r10 = a11.startLineNumber, i10 = a11.endLineNumber) : a11.endLineNumber > i10 && (i10 = a11.endLineNumber);
  }
  return n10.push(new M(r10, 1, i10, 1)), n10;
}
var wk = class {
  constructor(e206, t10) {
    this.modelLineNumber = e206, this.modelLineWrappedLineIdx = t10;
  }
}, Tk = class {
  constructor(e206, t10) {
    this.modelRange = e206, this.viewLines = t10;
  }
}, qfe = class {
  constructor(e206) {
    this._lines = e206;
  }
  convertViewPositionToModelPosition(e206) {
    return this._lines.convertViewPositionToModelPosition(e206.lineNumber, e206.column);
  }
  convertViewRangeToModelRange(e206) {
    return this._lines.convertViewRangeToModelRange(e206);
  }
  validateViewPosition(e206, t10) {
    return this._lines.validateViewPosition(e206.lineNumber, e206.column, t10);
  }
  validateViewRange(e206, t10) {
    return this._lines.validateViewRange(e206, t10);
  }
  convertModelPositionToViewPosition(e206, t10, n10, r10) {
    return this._lines.convertModelPositionToViewPosition(e206.lineNumber, e206.column, t10, n10, r10);
  }
  convertModelRangeToViewRange(e206, t10) {
    return this._lines.convertModelRangeToViewRange(e206, t10);
  }
  modelPositionIsVisible(e206) {
    return this._lines.modelPositionIsVisible(e206.lineNumber, e206.column);
  }
  getModelLineViewLineCount(e206) {
    return this._lines.getModelLineViewLineCount(e206);
  }
  getViewLineNumberOfModelPosition(e206, t10) {
    return this._lines.getViewLineNumberOfModelPosition(e206, t10);
  }
}, Jfe = class {
  constructor(e206) {
    this.model = e206;
  }
  dispose() {
  }
  createCoordinatesConverter() {
    return new Wfe(this.model);
  }
  getHiddenAreas() {
    return [];
  }
  setHiddenAreas(e206) {
    return false;
  }
  setTabSize(e206) {
    return false;
  }
  setWrappingSettings(e206, t10, n10, r10) {
    return false;
  }
  createLineBreaksComputer() {
    let e206 = [];
    return { addRequest: (t10, n10, r10) => {
      e206.push(null);
    }, finalize: () => e206 };
  }
  onModelFlushed() {
  }
  onModelLinesDeleted(e206, t10, n10) {
    return new sk(t10, n10);
  }
  onModelLinesInserted(e206, t10, n10, r10) {
    return new ck(t10, n10);
  }
  onModelLineChanged(e206, t10, n10) {
    return [false, new ok(t10, 1), null, null];
  }
  acceptVersionId(e206) {
  }
  getViewLineCount() {
    return this.model.getLineCount();
  }
  getActiveIndentGuide(e206, t10, n10) {
    return { startLineNumber: e206, endLineNumber: e206, indent: 0 };
  }
  getViewLinesBracketGuides(e206, t10, n10) {
    return Array(t10 - e206 + 1).fill([]);
  }
  getViewLinesIndentGuides(e206, t10) {
    let n10 = t10 - e206 + 1, r10 = Array(n10);
    for (let e207 = 0; e207 < n10; e207++) r10[e207] = 0;
    return r10;
  }
  getViewLineContent(e206) {
    return this.model.getLineContent(e206);
  }
  getViewLineLength(e206) {
    return this.model.getLineLength(e206);
  }
  getViewLineMinColumn(e206) {
    return this.model.getLineMinColumn(e206);
  }
  getViewLineMaxColumn(e206) {
    return this.model.getLineMaxColumn(e206);
  }
  getViewLineData(e206) {
    let t10 = this.model.tokenization.getLineTokens(e206), n10 = t10.getLineContent();
    return new _g2(n10, false, 1, n10.length + 1, 0, t10.inflate(), null);
  }
  getViewLinesData(e206, t10, n10) {
    let r10 = this.model.getLineCount();
    e206 = Math.min(Math.max(1, e206), r10), t10 = Math.min(Math.max(1, t10), r10);
    let i10 = [];
    for (let r11 = e206; r11 <= t10; r11++) {
      let t11 = r11 - e206;
      i10[t11] = n10[t11] ? this.getViewLineData(r11) : null;
    }
    return i10;
  }
  getDecorationsInRange(e206, t10, n10, r10, i10, a10) {
    return this.model.getDecorationsInRange(e206, t10, n10, r10, i10, a10);
  }
  normalizePosition(e206, t10) {
    return this.model.normalizePosition(e206, t10);
  }
  getLineIndentColumn(e206) {
    return this.model.getLineIndentColumn(e206);
  }
  getInjectedTextAt(e206) {
    return null;
  }
}, Ek = $p.Right, Yfe = class {
  constructor(e206) {
    this.persist = 0, this._requiredLanes = 1, this.lanes = new Uint8Array(Math.ceil((e206 + 1) * Ek / 8));
  }
  reset(e206) {
    let t10 = Math.ceil((e206 + 1) * Ek / 8);
    this.lanes.length < t10 ? this.lanes = new Uint8Array(t10) : this.lanes.fill(0), this._requiredLanes = 1;
  }
  get requiredLanes() {
    return this._requiredLanes;
  }
  push(e206, t10, n10) {
    n10 && (this.persist |= 1 << e206 - 1);
    for (let n11 = t10.startLineNumber; n11 <= t10.endLineNumber; n11++) {
      let t11 = Ek * n11 + (e206 - 1);
      this.lanes[t11 >>> 3] |= 1 << t11 % 8, this._requiredLanes = Math.max(this._requiredLanes, this.countAtLine(n11));
    }
  }
  getLanesAtLine(e206) {
    let t10 = [], n10 = Ek * e206;
    for (let e207 = 0; e207 < Ek; e207++) (this.persist & 1 << e207 || this.lanes[n10 >>> 3] & 1 << n10 % 8) && t10.push(e207 + 1), n10++;
    return t10.length ? t10 : [$p.Center];
  }
  countAtLine(e206) {
    let t10 = Ek * e206, n10 = 0;
    for (let e207 = 0; e207 < Ek; e207++) (this.persist & 1 << e207 || this.lanes[t10 >>> 3] & 1 << t10 % 8) && n10++, t10++;
    return n10;
  }
}, Xfe = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    if (super(), this.languageConfigurationService = o10, this._themeService = s10, this._attachedView = c10, this._transactionalTarget = l10, this.hiddenAreasModel = new $fe(), this.previousHiddenAreas = [], this._editorId = e206, this._configuration = t10, this.model = n10, this._eventDispatcher = new ufe(), this.onEvent = this._eventDispatcher.onEvent, this.cursorConfig = new jx(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._updateConfigurationViewLineCount = this._register(new us(() => this._updateConfigurationViewLineCountNow(), 0)), this._hasFocus = false, this._viewportStart = Zfe.create(this.model), this.glyphLanes = new Yfe(0), this.model.isTooLargeForTokenization()) this._lines = new Jfe(this.model);
    else {
      let e207 = this._configuration.options, t11 = e207.get(59), n11 = e207.get(156), a11 = e207.get(166), o11 = e207.get(155), s11 = e207.get(146), c11 = e207.get(160);
      this._lines = new Gfe(this._editorId, this.model, r10, i10, t11, this.model.getOptions().tabSize, n11, a11.wrappingColumn, o11, s11, c11);
    }
    this.coordinatesConverter = this._lines.createCoordinatesConverter(), this._cursor = this._register(new Dfe(n10, this, this.coordinatesConverter, this.cursorConfig)), this.viewLayout = this._register(new zfe(this._configuration, this.getLineCount(), this._getCustomLineHeights(), a10)), this._register(this.viewLayout.onDidScroll((e207) => {
      e207.scrollTopChanged && this._handleVisibleLinesChanged(), e207.scrollTopChanged && this._viewportStart.invalidate(), this._eventDispatcher.emitSingleViewEvent(new afe(e207)), this._eventDispatcher.emitOutgoingEvent(new mfe(e207.oldScrollWidth, e207.oldScrollLeft, e207.oldScrollHeight, e207.oldScrollTop, e207.scrollWidth, e207.scrollLeft, e207.scrollHeight, e207.scrollTop));
    })), this._register(this.viewLayout.onDidContentSizeChange((e207) => {
      this._eventDispatcher.emitOutgoingEvent(e207);
    })), this._decorations = new Vfe(this._editorId, this.model, this._configuration, this._lines, this.coordinatesConverter), this._registerModelEvents(), this._register(this._configuration.onDidChangeFast((e207) => {
      try {
        let t11 = this._eventDispatcher.beginEmitViewEvents();
        this._onConfigurationChanged(t11, e207);
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
    })), this._register(DC.getInstance().onDidChange(() => {
      this._eventDispatcher.emitSingleViewEvent(new cfe());
    })), this._register(this._themeService.onDidColorThemeChange((e207) => {
      this._invalidateDecorationsColorCache(), this._eventDispatcher.emitSingleViewEvent(new ofe(e207));
    })), this._updateConfigurationViewLineCountNow();
  }
  dispose() {
    super.dispose(), this._decorations.dispose(), this._lines.dispose(), this._viewportStart.dispose(), this._eventDispatcher.dispose();
  }
  createLineBreaksComputer() {
    return this._lines.createLineBreaksComputer();
  }
  addViewEventHandler(e206) {
    this._eventDispatcher.addViewEventHandler(e206);
  }
  removeViewEventHandler(e206) {
    this._eventDispatcher.removeViewEventHandler(e206);
  }
  _getCustomLineHeights() {
    return this._configuration.options.get(5) ? this.model.getCustomLineHeightsDecorations(this._editorId).map((e206) => {
      let t10 = e206.range.startLineNumber, n10 = this.coordinatesConverter.convertModelRangeToViewRange(new M(t10, 1, t10, this.model.getLineMaxColumn(t10)));
      return { decorationId: e206.id, startLineNumber: n10.startLineNumber, endLineNumber: n10.endLineNumber, lineHeight: e206.options.lineHeight || 0 };
    }) : [];
  }
  _updateConfigurationViewLineCountNow() {
    this._configuration.setViewLineCount(this._lines.getViewLineCount());
  }
  getModelVisibleRanges() {
    let e206 = this.viewLayout.getLinesViewportData(), t10 = new M(e206.startLineNumber, this.getLineMinColumn(e206.startLineNumber), e206.endLineNumber, this.getLineMaxColumn(e206.endLineNumber));
    return this._toModelVisibleRanges(t10);
  }
  visibleLinesStabilized() {
    let e206 = this.getModelVisibleRanges();
    this._attachedView.setVisibleLines(e206, true);
  }
  _handleVisibleLinesChanged() {
    let e206 = this.getModelVisibleRanges();
    this._attachedView.setVisibleLines(e206, false);
  }
  setHasFocus(e206) {
    this._hasFocus = e206, this._cursor.setHasFocus(e206), this._eventDispatcher.emitSingleViewEvent(new rfe(e206)), this._eventDispatcher.emitOutgoingEvent(new uk(!e206, e206));
  }
  setHasWidgetFocus(e206) {
    this._eventDispatcher.emitOutgoingEvent(new pfe(!e206, e206));
  }
  onCompositionStart() {
    this._eventDispatcher.emitSingleViewEvent(new $de());
  }
  onCompositionEnd() {
    this._eventDispatcher.emitSingleViewEvent(new efe());
  }
  _captureStableViewport() {
    if (this._viewportStart.isValid && this.viewLayout.getCurrentScrollTop() > 0) {
      let e206 = new j(this._viewportStart.viewLineNumber, this.getLineMinColumn(this._viewportStart.viewLineNumber));
      return new Ok(this.coordinatesConverter.convertViewPositionToModelPosition(e206), this._viewportStart.startLineDelta);
    }
    return new Ok(null, 0);
  }
  _onConfigurationChanged(e206, t10) {
    let n10 = this._captureStableViewport(), r10 = this._configuration.options, i10 = r10.get(59), a10 = r10.get(156), o10 = r10.get(166), s10 = r10.get(155), c10 = r10.get(146);
    this._lines.setWrappingSettings(i10, a10, o10.wrappingColumn, s10, c10) && (e206.emitViewEvent(new ik()), e206.emitViewEvent(new ak()), e206.emitViewEvent(new rk(null)), this._cursor.onLineMappingChanged(e206), this._decorations.onLineMappingChanged(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()), this._updateConfigurationViewLineCount.schedule()), t10.hasChanged(104) && (this._decorations.reset(), e206.emitViewEvent(new rk(null))), t10.hasChanged(112) && (this._decorations.reset(), e206.emitViewEvent(new rk(null))), e206.emitViewEvent(new tfe(t10)), this.viewLayout.onConfigurationChanged(t10), n10.recoverViewportStart(this.coordinatesConverter, this.viewLayout), jx.shouldRecreate(t10) && (this.cursorConfig = new jx(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig));
  }
  _registerModelEvents() {
    this._register(this.model.onDidChangeContentOrInjectedText((e206) => {
      try {
        let t11 = this._eventDispatcher.beginEmitViewEvents(), n10 = false, r10 = false, i10 = e206 instanceof lT ? e206.rawContentChangedEvent.changes : e206.changes, a10 = e206 instanceof lT ? e206.rawContentChangedEvent.versionId : null, o10 = this._lines.createLineBreaksComputer();
        for (let e207 of i10) switch (e207.changeType) {
          case 4:
            for (let t12 = 0; t12 < e207.detail.length; t12++) {
              let n11 = e207.detail[t12], r11 = e207.injectedTexts[t12];
              r11 && (r11 = r11.filter((e208) => !e208.ownerId || e208.ownerId === this._editorId)), o10.addRequest(n11, r11, null);
            }
            break;
          case 2: {
            let t12 = null;
            e207.injectedText && (t12 = e207.injectedText.filter((e208) => !e208.ownerId || e208.ownerId === this._editorId)), o10.addRequest(e207.detail, t12, null);
            break;
          }
        }
        let s10 = new me(o10.finalize());
        for (let e207 of i10) switch (e207.changeType) {
          case 1:
            this._lines.onModelFlushed(), t11.emitViewEvent(new ik()), this._decorations.reset(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()), n10 = true;
            break;
          case 3: {
            let r11 = this._lines.onModelLinesDeleted(a10, e207.fromLineNumber, e207.toLineNumber);
            r11 !== null && (t11.emitViewEvent(r11), this.viewLayout.onLinesDeleted(r11.fromLineNumber, r11.toLineNumber)), n10 = true;
            break;
          }
          case 4: {
            let r11 = s10.takeCount(e207.detail.length), i11 = this._lines.onModelLinesInserted(a10, e207.fromLineNumber, e207.toLineNumber, r11);
            i11 !== null && (t11.emitViewEvent(i11), this.viewLayout.onLinesInserted(i11.fromLineNumber, i11.toLineNumber)), n10 = true;
            break;
          }
          case 2: {
            let n11 = s10.dequeue(), [i11, o11, c10, l10] = this._lines.onModelLineChanged(a10, e207.lineNumber, n11);
            r10 = i11, o11 && t11.emitViewEvent(o11), c10 && (t11.emitViewEvent(c10), this.viewLayout.onLinesInserted(c10.fromLineNumber, c10.toLineNumber)), l10 && (t11.emitViewEvent(l10), this.viewLayout.onLinesDeleted(l10.fromLineNumber, l10.toLineNumber));
            break;
          }
          case 5:
            break;
        }
        a10 !== null && this._lines.acceptVersionId(a10), this.viewLayout.onHeightMaybeChanged(), !n10 && r10 && (t11.emitViewEvent(new ak()), t11.emitViewEvent(new rk(null)), this._cursor.onLineMappingChanged(t11), this._decorations.onLineMappingChanged());
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
      let t10 = this._viewportStart.isValid;
      if (this._viewportStart.invalidate(), this._configuration.setModelLineCount(this.model.getLineCount()), this._updateConfigurationViewLineCountNow(), !this._hasFocus && this.model.getAttachedEditorCount() >= 2 && t10) {
        let e207 = this.model._getTrackedRange(this._viewportStart.modelTrackedRange);
        if (e207) {
          let t11 = this.coordinatesConverter.convertModelPositionToViewPosition(e207.getStartPosition()), n10 = this.viewLayout.getVerticalOffsetForLineNumber(t11.lineNumber);
          this.viewLayout.setScrollPosition({ scrollTop: n10 + this._viewportStart.startLineDelta }, 1);
        }
      }
      try {
        let t11 = this._eventDispatcher.beginEmitViewEvents();
        e206 instanceof lT && t11.emitOutgoingEvent(new Sfe(e206.contentChangedEvent)), this._cursor.onModelContentChanged(t11, e206);
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
      this._handleVisibleLinesChanged();
    })), this._configuration.options.get(5) && this._register(this.model.onDidChangeLineHeight((e206) => {
      let t10 = e206.changes.filter((e207) => e207.ownerId === this._editorId || e207.ownerId === 0);
      if (this.viewLayout.changeSpecialLineHeights((e207) => {
        for (let n10 of t10) {
          let { decorationId: t11, lineNumber: r10, lineHeight: i10 } = n10, a10 = this.coordinatesConverter.convertModelRangeToViewRange(new M(r10, 1, r10, this.model.getLineMaxColumn(r10)));
          i10 === null ? e207.removeCustomLineHeight(t11) : e207.insertOrChangeCustomLineHeight(t11, a10.startLineNumber, a10.endLineNumber, i10);
        }
      }), t10.length > 0) {
        let e207 = new sT(t10);
        this._eventDispatcher.emitOutgoingEvent(new Tfe(e207));
      }
    })), this._configuration.options.get(172) && this._register(this.model.onDidChangeFont((e206) => {
      let t10 = e206.changes.filter((e207) => e207.ownerId === this._editorId || e207.ownerId === 0);
      if (t10.length > 0) {
        let e207 = new cT(t10);
        this._eventDispatcher.emitOutgoingEvent(new Efe(e207));
      }
    })), this._register(this.model.onDidChangeTokens((e206) => {
      let t10 = [];
      for (let n10 = 0, r10 = e206.ranges.length; n10 < r10; n10++) {
        let r11 = e206.ranges[n10];
        t10[n10] = { fromLineNumber: this.coordinatesConverter.convertModelPositionToViewPosition(new j(r11.fromLineNumber, 1)).lineNumber, toLineNumber: this.coordinatesConverter.convertModelPositionToViewPosition(new j(r11.toLineNumber, this.model.getLineMaxColumn(r11.toLineNumber))).lineNumber };
      }
      this._eventDispatcher.emitSingleViewEvent(new sfe(t10)), this._eventDispatcher.emitOutgoingEvent(new wfe(e206));
    })), this._register(this.model.onDidChangeLanguageConfiguration((e206) => {
      this._eventDispatcher.emitSingleViewEvent(new ife()), this.cursorConfig = new jx(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig), this._eventDispatcher.emitOutgoingEvent(new xfe(e206));
    })), this._register(this.model.onDidChangeLanguage((e206) => {
      this.cursorConfig = new jx(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig), this._eventDispatcher.emitOutgoingEvent(new bfe(e206));
    })), this._register(this.model.onDidChangeOptions((e206) => {
      if (this._lines.setTabSize(this.model.getOptions().tabSize)) {
        try {
          let e207 = this._eventDispatcher.beginEmitViewEvents();
          e207.emitViewEvent(new ik()), e207.emitViewEvent(new ak()), e207.emitViewEvent(new rk(null)), this._cursor.onLineMappingChanged(e207), this._decorations.onLineMappingChanged(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights());
        } finally {
          this._eventDispatcher.endEmitViewEvents();
        }
        this._updateConfigurationViewLineCount.schedule();
      }
      this.cursorConfig = new jx(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig), this._eventDispatcher.emitOutgoingEvent(new Cfe(e206));
    })), this._register(this.model.onDidChangeDecorations((e206) => {
      this._decorations.onModelDecorationsChanged(), this._eventDispatcher.emitSingleViewEvent(new rk(e206)), this._eventDispatcher.emitOutgoingEvent(new yfe(e206));
    }));
  }
  getFontSizeAtPosition(e206) {
    if (!this._configuration.options.get(172)) return null;
    let t10 = this.model.getFontDecorationsInRange(M.fromPositions(e206), this._editorId), n10 = this._configuration.options.get(59).fontSize + `px`;
    for (let e207 of t10) if (e207.options.fontSize) {
      n10 = e207.options.fontSize;
      break;
    }
    return n10;
  }
  setHiddenAreas(e206, t10, n10) {
    this.hiddenAreasModel.setHiddenAreas(t10, e206);
    let r10 = this.hiddenAreasModel.getMergedRanges();
    if (r10 === this.previousHiddenAreas && !n10) return;
    this.previousHiddenAreas = r10;
    let i10 = this._captureStableViewport(), a10 = false;
    try {
      let e207 = this._eventDispatcher.beginEmitViewEvents();
      a10 = this._lines.setHiddenAreas(r10), a10 && (e207.emitViewEvent(new ik()), e207.emitViewEvent(new ak()), e207.emitViewEvent(new rk(null)), this._cursor.onLineMappingChanged(e207), this._decorations.onLineMappingChanged(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()), this.viewLayout.onHeightMaybeChanged());
      let t11 = i10.viewportStartModelPosition?.lineNumber;
      t11 && r10.some((e208) => e208.startLineNumber <= t11 && t11 <= e208.endLineNumber) || i10.recoverViewportStart(this.coordinatesConverter, this.viewLayout);
    } finally {
      this._eventDispatcher.endEmitViewEvents();
    }
    this._updateConfigurationViewLineCount.schedule(), a10 && this._eventDispatcher.emitOutgoingEvent(new gfe());
  }
  getVisibleRangesPlusViewportAboveBelow() {
    let e206 = this._configuration.options.get(165), t10 = this._configuration.options.get(75), n10 = Math.max(20, Math.round(e206.height / t10)), r10 = this.viewLayout.getLinesViewportData(), i10 = Math.max(1, r10.completelyVisibleStartLineNumber - n10), a10 = Math.min(this.getLineCount(), r10.completelyVisibleEndLineNumber + n10);
    return this._toModelVisibleRanges(new M(i10, this.getLineMinColumn(i10), a10, this.getLineMaxColumn(a10)));
  }
  getVisibleRanges() {
    let e206 = this.getCompletelyVisibleViewRange();
    return this._toModelVisibleRanges(e206);
  }
  getHiddenAreas() {
    return this._lines.getHiddenAreas();
  }
  _toModelVisibleRanges(e206) {
    let t10 = this.coordinatesConverter.convertViewRangeToModelRange(e206), n10 = this._lines.getHiddenAreas();
    if (n10.length === 0) return [t10];
    let r10 = [], i10 = 0, a10 = t10.startLineNumber, o10 = t10.startColumn, s10 = t10.endLineNumber, c10 = t10.endColumn;
    for (let e207 = 0, t11 = n10.length; e207 < t11; e207++) {
      let t12 = n10[e207].startLineNumber, c11 = n10[e207].endLineNumber;
      c11 < a10 || t12 > s10 || (a10 < t12 && (r10[i10++] = new M(a10, o10, t12 - 1, this.model.getLineMaxColumn(t12 - 1))), a10 = c11 + 1, o10 = 1);
    }
    return (a10 < s10 || a10 === s10 && o10 < c10) && (r10[i10++] = new M(a10, o10, s10, c10)), r10;
  }
  getCompletelyVisibleViewRange() {
    let e206 = this.viewLayout.getLinesViewportData(), t10 = e206.completelyVisibleStartLineNumber, n10 = e206.completelyVisibleEndLineNumber;
    return new M(t10, this.getLineMinColumn(t10), n10, this.getLineMaxColumn(n10));
  }
  getCompletelyVisibleViewRangeAtScrollTop(e206) {
    let t10 = this.viewLayout.getLinesViewportDataAtScrollTop(e206), n10 = t10.completelyVisibleStartLineNumber, r10 = t10.completelyVisibleEndLineNumber;
    return new M(n10, this.getLineMinColumn(n10), r10, this.getLineMaxColumn(r10));
  }
  saveState() {
    let e206 = this.viewLayout.saveState(), t10 = e206.scrollTop, n10 = this.viewLayout.getLineNumberAtVerticalOffset(t10), r10 = this.coordinatesConverter.convertViewPositionToModelPosition(new j(n10, this.getLineMinColumn(n10))), i10 = this.viewLayout.getVerticalOffsetForLineNumber(n10) - t10;
    return { scrollLeft: e206.scrollLeft, firstPosition: r10, firstPositionDeltaTop: i10 };
  }
  reduceRestoreState(e206) {
    if (e206.firstPosition === void 0) return this._reduceRestoreStateCompatibility(e206);
    let t10 = this.model.validatePosition(e206.firstPosition), n10 = this.coordinatesConverter.convertModelPositionToViewPosition(t10), r10 = this.viewLayout.getVerticalOffsetForLineNumber(n10.lineNumber) - e206.firstPositionDeltaTop;
    return { scrollLeft: e206.scrollLeft, scrollTop: r10 };
  }
  _reduceRestoreStateCompatibility(e206) {
    return { scrollLeft: e206.scrollLeft, scrollTop: e206.scrollTopWithoutViewZones };
  }
  getTabSize() {
    return this.model.getOptions().tabSize;
  }
  getLineCount() {
    return this._lines.getViewLineCount();
  }
  setViewport(e206, t10, n10) {
    this._viewportStart.update(this, e206);
  }
  getActiveIndentGuide(e206, t10, n10) {
    return this._lines.getActiveIndentGuide(e206, t10, n10);
  }
  getLinesIndentGuides(e206, t10) {
    return this._lines.getViewLinesIndentGuides(e206, t10);
  }
  getBracketGuidesInRangeByLine(e206, t10, n10, r10) {
    return this._lines.getViewLinesBracketGuides(e206, t10, n10, r10);
  }
  getLineContent(e206) {
    return this._lines.getViewLineContent(e206);
  }
  getLineLength(e206) {
    return this._lines.getViewLineLength(e206);
  }
  getLineMinColumn(e206) {
    return this._lines.getViewLineMinColumn(e206);
  }
  getLineMaxColumn(e206) {
    return this._lines.getViewLineMaxColumn(e206);
  }
  getLineFirstNonWhitespaceColumn(e206) {
    let t10 = Ga(this.getLineContent(e206));
    return t10 === -1 ? 0 : t10 + 1;
  }
  getLineLastNonWhitespaceColumn(e206) {
    let t10 = qa(this.getLineContent(e206));
    return t10 === -1 ? 0 : t10 + 2;
  }
  getMinimapDecorationsInRange(e206) {
    return this._decorations.getMinimapDecorationsInRange(e206);
  }
  getDecorationsInViewport(e206) {
    return this._decorations.getDecorationsViewportData(e206).decorations;
  }
  getInjectedTextAt(e206) {
    return this._lines.getInjectedTextAt(e206);
  }
  _getTextDirection(e206, t10) {
    let n10 = 0;
    for (let r10 of t10) {
      let t11 = r10.range;
      if (t11.startLineNumber > e206 || t11.endLineNumber < e206) continue;
      let i10 = r10.options.textDirection;
      i10 === em.RTL ? n10++ : i10 === em.LTR && n10--;
    }
    return n10 > 0 ? em.RTL : em.LTR;
  }
  getTextDirection(e206) {
    let t10 = this._decorations.getDecorationsOnLine(e206);
    return this._getTextDirection(e206, t10.decorations);
  }
  getViewportViewLineRenderingData(e206, t10) {
    let n10 = this._decorations.getDecorationsViewportData(e206), r10 = n10.inlineDecorations[t10 - e206.startLineNumber];
    return this._getViewLineRenderingData(t10, r10, n10.hasVariableFonts, n10.decorations);
  }
  getViewLineRenderingData(e206) {
    let t10 = this._decorations.getDecorationsOnLine(e206);
    return this._getViewLineRenderingData(e206, t10.inlineDecorations[0], t10.hasVariableFonts, t10.decorations);
  }
  _getViewLineRenderingData(e206, t10, n10, r10) {
    let i10 = this.model.mightContainRTL(), a10 = this.model.mightContainNonBasicASCII(), o10 = this.getTabSize(), s10 = this._lines.getViewLineData(e206);
    return s10.inlineDecorations && (t10 = [...t10, ...s10.inlineDecorations.map((t11) => t11.toInlineDecoration(e206))]), new vg(s10.minColumn, s10.maxColumn, s10.content, s10.continuesWithWrappedLine, i10, a10, s10.tokens, t10, o10, s10.startVisibleColumn, this._getTextDirection(e206, r10), n10);
  }
  getViewLineData(e206) {
    return this._lines.getViewLineData(e206);
  }
  getMinimapLinesRenderingData(e206, t10, n10) {
    let r10 = this._lines.getViewLinesData(e206, t10, n10);
    return new hae(this.getTabSize(), r10);
  }
  getAllOverviewRulerDecorations(e206) {
    let t10 = this.model.getOverviewRulerDecorations(this._editorId, nr(this._configuration.options), rr(this._configuration.options)), n10 = new Qfe();
    for (let r10 of t10) {
      let t11 = r10.options, i10 = t11.overviewRuler;
      if (!i10) continue;
      let a10 = i10.position;
      if (a10 === 0) continue;
      let o10 = i10.getColor(e206.value), s10 = this.coordinatesConverter.getViewLineNumberOfModelPosition(r10.range.startLineNumber, r10.range.startColumn), c10 = this.coordinatesConverter.getViewLineNumberOfModelPosition(r10.range.endLineNumber, r10.range.endColumn);
      n10.accept(o10, t11.zIndex, s10, c10, a10);
    }
    return n10.asArray;
  }
  _invalidateDecorationsColorCache() {
    let e206 = this.model.getOverviewRulerDecorations();
    for (let t10 of e206) t10.options.overviewRuler?.invalidateCachedColor(), t10.options.minimap?.invalidateCachedColor();
  }
  getValueInRange(e206, t10) {
    let n10 = this.coordinatesConverter.convertViewRangeToModelRange(e206);
    return this.model.getValueInRange(n10, t10);
  }
  getValueLengthInRange(e206, t10) {
    let n10 = this.coordinatesConverter.convertViewRangeToModelRange(e206);
    return this.model.getValueLengthInRange(n10, t10);
  }
  modifyPosition(e206, t10) {
    let n10 = this.coordinatesConverter.convertViewPositionToModelPosition(e206), r10 = this.model.modifyPosition(n10, t10);
    return this.coordinatesConverter.convertModelPositionToViewPosition(r10);
  }
  deduceModelPositionRelativeToViewPosition(e206, t10, n10) {
    let r10 = this.coordinatesConverter.convertViewPositionToModelPosition(e206);
    this.model.getEOL().length === 2 && (t10 < 0 ? t10 -= n10 : t10 += n10);
    let i10 = this.model.getOffsetAt(r10) + t10;
    return this.model.getPositionAt(i10);
  }
  getPlainTextToCopy(e206, t10, n10) {
    let r10 = n10 ? `\r
` : this.model.getEOL();
    e206 = e206.slice(0), e206.sort(M.compareRangesUsingStarts);
    let i10 = false, a10 = false;
    for (let t11 of e206) t11.isEmpty() ? i10 = true : a10 = true;
    if (!a10) {
      if (!t10) return ``;
      let n11 = e206.map((e207) => e207.startLineNumber), i11 = ``;
      for (let e207 = 0; e207 < n11.length; e207++) e207 > 0 && n11[e207 - 1] === n11[e207] || (i11 += this.model.getLineContent(n11[e207]) + r10);
      return i11;
    }
    if (i10 && t10) {
      let t11 = [], r11 = 0;
      for (let i11 of e206) {
        let e207 = i11.startLineNumber;
        i11.isEmpty() ? e207 !== r11 && t11.push(this.model.getLineContent(e207)) : t11.push(this.model.getValueInRange(i11, n10 ? 2 : 0)), r11 = e207;
      }
      return t11.length === 1 ? t11[0] : t11;
    }
    let o10 = [];
    for (let t11 of e206) t11.isEmpty() || o10.push(this.model.getValueInRange(t11, n10 ? 2 : 0));
    return o10.length === 1 ? o10[0] : o10;
  }
  getRichTextToCopy(e206, t10) {
    let n10 = this.model.getLanguageId();
    if (n10 === `plaintext` || e206.length !== 1) return null;
    let r10 = e206[0];
    if (r10.isEmpty()) {
      if (!t10) return null;
      let e207 = r10.startLineNumber;
      r10 = new M(e207, this.model.getLineMinColumn(e207), e207, this.model.getLineMaxColumn(e207));
    }
    let i10 = this._configuration.options.get(59), a10 = this._getColorMap(), o10 = /[:;\\\/<>]/.test(i10.fontFamily) || i10.fontFamily === _n.fontFamily, s10;
    return o10 ? s10 = _n.fontFamily : (s10 = i10.fontFamily, s10 = s10.replace(/"/g, `'`), /[,']/.test(s10) || /[+ ]/.test(s10) && (s10 = `'${s10}'`), s10 = `${s10}, ${_n.fontFamily}`), { mode: n10, html: `<div style="color: ${a10[1]};background-color: ${a10[2]};font-family: ${s10};font-weight: ${i10.fontWeight};font-size: ${i10.fontSize}px;line-height: ${i10.lineHeight}px;white-space: pre;">` + this._getHTMLToCopy(r10, a10) + `</div>` };
  }
  _getHTMLToCopy(e206, t10) {
    let n10 = e206.startLineNumber, r10 = e206.startColumn, i10 = e206.endLineNumber, a10 = e206.endColumn, o10 = this.getTabSize(), s10 = ``;
    for (let e207 = n10; e207 <= i10; e207++) {
      let c10 = this.model.tokenization.getLineTokens(e207), l10 = c10.getLineContent(), u10 = e207 === n10 ? r10 - 1 : 0, d10 = e207 === i10 ? a10 - 1 : l10.length;
      l10 === `` ? s10 += `<br>` : s10 += Mfe(l10, c10.inflate(), t10, u10, d10, o10, wt);
    }
    return s10;
  }
  _getColorMap() {
    let e206 = Pi.getColorMap(), t10 = [`#000000`];
    if (e206) for (let n10 = 1, r10 = e206.length; n10 < r10; n10++) t10[n10] = Y.Format.CSS.formatHex(e206[n10]);
    return t10;
  }
  getPrimaryCursorState() {
    return this._cursor.getPrimaryCursorState();
  }
  getLastAddedCursorIndex() {
    return this._cursor.getLastAddedCursorIndex();
  }
  getCursorStates() {
    return this._cursor.getCursorStates();
  }
  setCursorStates(e206, t10, n10) {
    return this._withViewEventsCollector((r10) => this._cursor.setStates(r10, e206, t10, n10));
  }
  getCursorColumnSelectData() {
    return this._cursor.getCursorColumnSelectData();
  }
  getCursorAutoClosedCharacters() {
    return this._cursor.getAutoClosedCharacters();
  }
  setCursorColumnSelectData(e206) {
    this._cursor.setCursorColumnSelectData(e206);
  }
  getPrevEditOperationType() {
    return this._cursor.getPrevEditOperationType();
  }
  setPrevEditOperationType(e206) {
    this._cursor.setPrevEditOperationType(e206);
  }
  getSelection() {
    return this._cursor.getSelection();
  }
  getSelections() {
    return this._cursor.getSelections();
  }
  getPosition() {
    return this._cursor.getPrimaryCursorState().modelState.position;
  }
  setSelections(e206, t10, n10 = 0) {
    this._withViewEventsCollector((r10) => this._cursor.setSelections(r10, e206, t10, n10));
  }
  saveCursorState() {
    return this._cursor.saveState();
  }
  restoreCursorState(e206) {
    this._withViewEventsCollector((t10) => this._cursor.restoreState(t10, e206));
  }
  _executeCursorEdit(e206) {
    if (this._cursor.context.cursorConfig.readOnly) {
      this._eventDispatcher.emitOutgoingEvent(new vfe());
      return;
    }
    this._withViewEventsCollector(e206);
  }
  executeEdits(e206, t10, n10, r10) {
    this._executeCursorEdit((i10) => this._cursor.executeEdits(i10, e206, t10, n10, r10));
  }
  startComposition() {
    this._executeCursorEdit((e206) => this._cursor.startComposition(e206));
  }
  endComposition(e206) {
    this._executeCursorEdit((t10) => this._cursor.endComposition(t10, e206));
  }
  type(e206, t10) {
    this._executeCursorEdit((n10) => this._cursor.type(n10, e206, t10));
  }
  compositionType(e206, t10, n10, r10, i10) {
    this._executeCursorEdit((a10) => this._cursor.compositionType(a10, e206, t10, n10, r10, i10));
  }
  paste(e206, t10, n10, r10) {
    this._executeCursorEdit((i10) => this._cursor.paste(i10, e206, t10, n10, r10));
  }
  cut(e206) {
    this._executeCursorEdit((t10) => this._cursor.cut(t10, e206));
  }
  executeCommand(e206, t10) {
    this._executeCursorEdit((n10) => this._cursor.executeCommand(n10, e206, t10));
  }
  executeCommands(e206, t10) {
    this._executeCursorEdit((n10) => this._cursor.executeCommands(n10, e206, t10));
  }
  revealAllCursors(e206, t10, n10 = false) {
    this._withViewEventsCollector((r10) => this._cursor.revealAll(r10, e206, n10, 0, t10, 0));
  }
  revealPrimaryCursor(e206, t10, n10 = false) {
    this._withViewEventsCollector((r10) => this._cursor.revealPrimary(r10, e206, n10, 0, t10, 0));
  }
  revealTopMostCursor(e206) {
    let t10 = this._cursor.getTopMostViewPosition(), n10 = new M(t10.lineNumber, t10.column, t10.lineNumber, t10.column);
    this._withViewEventsCollector((t11) => t11.emitViewEvent(new lk(e206, false, n10, null, 0, true, 0)));
  }
  revealBottomMostCursor(e206) {
    let t10 = this._cursor.getBottomMostViewPosition(), n10 = new M(t10.lineNumber, t10.column, t10.lineNumber, t10.column);
    this._withViewEventsCollector((t11) => t11.emitViewEvent(new lk(e206, false, n10, null, 0, true, 0)));
  }
  revealRange(e206, t10, n10, r10, i10) {
    this._withViewEventsCollector((a10) => a10.emitViewEvent(new lk(e206, false, n10, null, r10, t10, i10)));
  }
  changeWhitespace(e206) {
    this.viewLayout.changeWhitespace(e206) && (this._eventDispatcher.emitSingleViewEvent(new lfe()), this._eventDispatcher.emitOutgoingEvent(new hfe()));
  }
  _withViewEventsCollector(e206) {
    return this._transactionalTarget.batchChanges(() => {
      try {
        return e206(this._eventDispatcher.beginEmitViewEvents());
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
    });
  }
  batchEvents(e206) {
    this._withViewEventsCollector(() => {
      e206();
    });
  }
  normalizePosition(e206, t10) {
    return this._lines.normalizePosition(e206, t10);
  }
  getLineIndentColumn(e206) {
    return this._lines.getLineIndentColumn(e206);
  }
}, Zfe = class e131 {
  static create(t10) {
    return new e131(t10, 1, false, t10._setTrackedRange(null, new M(1, 1, 1, 1), 1), 0);
  }
  get viewLineNumber() {
    return this._viewLineNumber;
  }
  get isValid() {
    return this._isValid;
  }
  get modelTrackedRange() {
    return this._modelTrackedRange;
  }
  get startLineDelta() {
    return this._startLineDelta;
  }
  constructor(e206, t10, n10, r10, i10) {
    this._model = e206, this._viewLineNumber = t10, this._isValid = n10, this._modelTrackedRange = r10, this._startLineDelta = i10;
  }
  dispose() {
    this._model._setTrackedRange(this._modelTrackedRange, null, 1);
  }
  update(e206, t10) {
    let n10 = e206.coordinatesConverter.convertViewPositionToModelPosition(new j(t10, e206.getLineMinColumn(t10))), r10 = e206.model._setTrackedRange(this._modelTrackedRange, new M(n10.lineNumber, n10.column, n10.lineNumber, n10.column), 1), i10 = e206.viewLayout.getVerticalOffsetForLineNumber(t10), a10 = e206.viewLayout.getCurrentScrollTop();
    this._viewLineNumber = t10, this._isValid = true, this._modelTrackedRange = r10, this._startLineDelta = a10 - i10;
  }
  invalidate() {
    this._isValid = false;
  }
}, Qfe = class {
  constructor() {
    this._asMap = /* @__PURE__ */ Object.create(null), this.asArray = [];
  }
  accept(e206, t10, n10, r10, i10) {
    let a10 = this._asMap[e206];
    if (a10) {
      let e207 = a10.data, t11 = e207[e207.length - 3], o10 = e207[e207.length - 1];
      if (t11 === i10 && o10 + 1 >= n10) {
        r10 > o10 && (e207[e207.length - 1] = r10);
        return;
      }
      e207.push(i10, n10, r10);
    } else {
      let a11 = new yg(e206, t10, [i10, n10, r10]);
      this._asMap[e206] = a11, this.asArray.push(a11);
    }
  }
}, $fe = class {
  constructor() {
    this.hiddenAreas = /* @__PURE__ */ new Map(), this.shouldRecompute = false, this.ranges = [];
  }
  setHiddenAreas(e206, t10) {
    let n10 = this.hiddenAreas.get(e206);
    n10 && Dk(n10, t10) || (this.hiddenAreas.set(e206, t10), this.shouldRecompute = true);
  }
  getMergedRanges() {
    if (!this.shouldRecompute) return this.ranges;
    this.shouldRecompute = false;
    let e206 = Array.from(this.hiddenAreas.values()).reduce((e207, t10) => epe(e207, t10), []);
    return Dk(this.ranges, e206) || (this.ranges = e206), this.ranges;
  }
};
function epe(e206, t10) {
  let n10 = [], r10 = 0, i10 = 0;
  for (; r10 < e206.length && i10 < t10.length; ) {
    let a10 = e206[r10], o10 = t10[i10];
    if (a10.endLineNumber < o10.startLineNumber - 1) n10.push(e206[r10++]);
    else if (o10.endLineNumber < a10.startLineNumber - 1) n10.push(t10[i10++]);
    else {
      let e207 = Math.min(a10.startLineNumber, o10.startLineNumber), t11 = Math.max(a10.endLineNumber, o10.endLineNumber);
      n10.push(new M(e207, 1, t11, 1)), r10++, i10++;
    }
  }
  for (; r10 < e206.length; ) n10.push(e206[r10++]);
  for (; i10 < t10.length; ) n10.push(t10[i10++]);
  return n10;
}
function Dk(e206, t10) {
  if (e206.length !== t10.length) return false;
  for (let n10 = 0; n10 < e206.length; n10++) if (!e206[n10].equalsRange(t10[n10])) return false;
  return true;
}
var Ok = class {
  constructor(e206, t10) {
    this.viewportStartModelPosition = e206, this.startLineDelta = t10;
  }
  recoverViewportStart(e206, t10) {
    if (!this.viewportStartModelPosition) return;
    let n10 = e206.convertModelPositionToViewPosition(this.viewportStartModelPosition), r10 = t10.getVerticalOffsetForLineNumber(n10.lineNumber);
    t10.setScrollPosition({ scrollTop: r10 + this.startLineDelta }, 1);
  }
}, kk = class {
  constructor(...e206) {
    this._entries = /* @__PURE__ */ new Map();
    for (let [t10, n10] of e206) this.set(t10, n10);
  }
  set(e206, t10) {
    let n10 = this._entries.get(e206);
    return this._entries.set(e206, t10), n10;
  }
  get(e206) {
    return this._entries.get(e206);
  }
}, tpe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Ak = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, jk, Mk = (_Fa = class extends D {
  get isSimpleWidget() {
    return this._configuration.isSimpleWidget;
  }
  get contextMenuId() {
    return this._configuration.contextMenuId;
  }
  get contextKeyService() {
    return this._contextKeyService;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10) {
    super(), this.languageConfigurationService = u10, this._deliveryQueue = lee(), this._contributions = this._register(new Pue()), this._onDidDispose = this._register(new k()), this.onDidDispose = this._onDidDispose.event, this._onDidChangeModelContent = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelContent = this._onDidChangeModelContent.event, this._onDidChangeModelLanguage = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelLanguage = this._onDidChangeModelLanguage.event, this._onDidChangeModelLanguageConfiguration = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelLanguageConfiguration = this._onDidChangeModelLanguageConfiguration.event, this._onDidChangeModelOptions = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelOptions = this._onDidChangeModelOptions.event, this._onDidChangeModelDecorations = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelDecorations = this._onDidChangeModelDecorations.event, this._onDidChangeLineHeight = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeLineHeight = this._onDidChangeLineHeight.event, this._onDidChangeFont = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeFont = this._onDidChangeFont.event, this._onDidChangeModelTokens = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelTokens = this._onDidChangeModelTokens.event, this._onDidChangeConfiguration = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeConfiguration = this._onDidChangeConfiguration.event, this._onWillChangeModel = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onWillChangeModel = this._onWillChangeModel.event, this._onDidChangeModel = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModel = this._onDidChangeModel.event, this._onDidChangeCursorPosition = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeCursorPosition = this._onDidChangeCursorPosition.event, this._onDidChangeCursorSelection = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeCursorSelection = this._onDidChangeCursorSelection.event, this._onDidAttemptReadOnlyEdit = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onDidAttemptReadOnlyEdit = this._onDidAttemptReadOnlyEdit.event, this._onDidLayoutChange = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidLayoutChange = this._onDidLayoutChange.event, this._editorTextFocus = this._register(new Nk({ deliveryQueue: this._deliveryQueue })), this.onDidFocusEditorText = this._editorTextFocus.onDidChangeToTrue, this.onDidBlurEditorText = this._editorTextFocus.onDidChangeToFalse, this._editorWidgetFocus = this._register(new Nk({ deliveryQueue: this._deliveryQueue })), this.onDidFocusEditorWidget = this._editorWidgetFocus.onDidChangeToTrue, this.onDidBlurEditorWidget = this._editorWidgetFocus.onDidChangeToFalse, this._onWillType = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onWillType = this._onWillType.event, this._onDidType = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onDidType = this._onDidType.event, this._onDidCompositionStart = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onDidCompositionStart = this._onDidCompositionStart.event, this._onDidCompositionEnd = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onDidCompositionEnd = this._onDidCompositionEnd.event, this._onDidPaste = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onDidPaste = this._onDidPaste.event, this._onMouseUp = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseUp = this._onMouseUp.event, this._onMouseDown = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseDown = this._onMouseDown.event, this._onMouseDrag = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseDrag = this._onMouseDrag.event, this._onMouseDrop = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseDrop = this._onMouseDrop.event, this._onMouseDropCanceled = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseDropCanceled = this._onMouseDropCanceled.event, this._onDropIntoEditor = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onDropIntoEditor = this._onDropIntoEditor.event, this._onContextMenu = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onContextMenu = this._onContextMenu.event, this._onMouseMove = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseMove = this._onMouseMove.event, this._onMouseLeave = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseLeave = this._onMouseLeave.event, this._onMouseWheel = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onMouseWheel = this._onMouseWheel.event, this._onKeyUp = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onKeyUp = this._onKeyUp.event, this._onKeyDown = this._register(new Pk(this._contributions, this._deliveryQueue)), this.onKeyDown = this._onKeyDown.event, this._onDidContentSizeChange = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidContentSizeChange = this._onDidContentSizeChange.event, this._onDidScrollChange = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidScrollChange = this._onDidScrollChange.event, this._onDidChangeViewZones = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeViewZones = this._onDidChangeViewZones.event, this._onDidChangeHiddenAreas = this._register(new k({ deliveryQueue: this._deliveryQueue })), this.onDidChangeHiddenAreas = this._onDidChangeHiddenAreas.event, this._updateCounter = 0, this._onWillTriggerEditorOperationEvent = this._register(new k()), this._onBeginUpdate = this._register(new k()), this.onBeginUpdate = this._onBeginUpdate.event, this._onEndUpdate = this._register(new k()), this.onEndUpdate = this._onEndUpdate.event, this._onBeforeExecuteEdit = this._register(new k()), this.onBeforeExecuteEdit = this._onBeforeExecuteEdit.event, this._actions = /* @__PURE__ */ new Map(), this._bannerDomNode = null, this._dropIntoEditorDecorations = this.createDecorationsCollection(), this.inComposition = false, i10.willCreateCodeEditor();
    let f10 = { ...t10 };
    if (this._domElement = e206, this._overflowWidgetsDomNode = f10.overflowWidgetsDomNode, delete f10.overflowWidgetsDomNode, this._id = ++npe, this._decorationTypeKeysToIds = {}, this._decorationTypeSubtypes = {}, this._telemetryData = n10.telemetryData, this._configuration = this._register(this._createConfiguration(n10.isSimpleWidget || false, n10.contextMenuId ?? (n10.isSimpleWidget ? W.SimpleEditorContext : W.EditorContext), f10, l10)), this._register(this._configuration.onDidChange((e207) => {
      this._onDidChangeConfiguration.fire(e207);
      let t11 = this._configuration.options;
      if (e207.hasChanged(165)) {
        let e208 = t11.get(165);
        this._onDidLayoutChange.fire(e208);
      }
    })), this._contextKeyService = this._register(o10.createScoped(this._domElement)), n10.contextKeyValues) for (let [e207, t11] of Object.entries(n10.contextKeyValues)) this._contextKeyService.createKey(e207, t11);
    this._notificationService = c10, this._codeEditorService = i10, this._commandService = a10, this._themeService = s10, this._register(new ipe(this, this._contextKeyService)), this._register(new ape(this, this._contextKeyService, d10)), this._instantiationService = this._register(r10.createChild(new kk([nd, this._contextKeyService]))), this._modelData = null, this._contentWidgets = {}, this._overlayWidgets = {}, this._glyphMarginWidgets = {};
    let p10;
    p10 = Array.isArray(n10.contributions) ? n10.contributions : of.getEditorContributions(), this._contributions.initialize(this, p10, this._instantiationService);
    for (let e207 of of.getEditorActions()) {
      if (this._actions.has(e207.id)) {
        be(Error(`Cannot have two actions with the same id ${e207.id}`));
        continue;
      }
      let t11 = new fT(e207.id, e207.label, e207.alias, e207.metadata, e207.precondition ?? void 0, (t12) => this._instantiationService.invokeFunction((n11) => Promise.resolve(e207.runEditorCommand(n11, this, t12))), this._contextKeyService);
      this._actions.set(t11.id, t11);
    }
    let m10 = () => !this._configuration.options.get(104) && this._configuration.options.get(43).enabled;
    this._register(new vne(this._domElement, { onDragOver: (e207) => {
      if (!m10()) return;
      let t11 = this.getTargetAtClientPoint(e207.clientX, e207.clientY);
      t11?.position && this.showDropIndicatorAt(t11.position);
    }, onDrop: async (e207) => {
      if (!m10() || (this.removeDropIndicator(), !e207.dataTransfer)) return;
      let t11 = this.getTargetAtClientPoint(e207.clientX, e207.clientY);
      t11?.position && this._onDropIntoEditor.fire({ position: t11.position, event: e207 });
    }, onDragLeave: () => {
      this.removeDropIndicator();
    }, onDragEnd: () => {
      this.removeDropIndicator();
    } })), this._codeEditorService.addCodeEditor(this);
  }
  writeScreenReaderContent(e206) {
    this._modelData?.view.writeScreenReaderContent(e206);
  }
  _createConfiguration(e206, t10, n10, r10) {
    return new a_(e206, t10, n10, this._domElement, r10);
  }
  getId() {
    return this.getEditorType() + `:` + this._id;
  }
  getEditorType() {
    return Qh.ICodeEditor;
  }
  dispose() {
    this._codeEditorService.removeCodeEditor(this), this._actions.clear(), this._contentWidgets = {}, this._overlayWidgets = {}, this._removeDecorationTypes(), this._postDetachModelCleanup(this._detachModel()), this._onDidDispose.fire(), super.dispose();
  }
  invokeWithinContext(e206) {
    return this._instantiationService.invokeFunction(e206);
  }
  updateOptions(e206) {
    this._configuration.updateOptions(e206 || {});
  }
  getOptions() {
    return this._configuration.options;
  }
  getOption(e206) {
    return this._configuration.options.get(e206);
  }
  getRawOptions() {
    return this._configuration.getRawOptions();
  }
  getOverflowWidgetsDomNode() {
    return this._overflowWidgetsDomNode;
  }
  getConfiguredWordAtPosition(e206) {
    return this._modelData ? Kx.getWordAtPosition(this._modelData.model, this._configuration.options.get(148), this._configuration.options.get(147), e206) : null;
  }
  getValue(e206 = null) {
    if (!this._modelData) return ``;
    let t10 = !!(e206 && e206.preserveBOM), n10 = 0;
    return e206 && e206.lineEnding && e206.lineEnding === `
` ? n10 = 1 : e206 && e206.lineEnding && e206.lineEnding === `\r
` && (n10 = 2), this._modelData.model.getValue(n10, t10);
  }
  setValue(e206) {
    try {
      if (this._beginUpdate(), !this._modelData) return;
      this._modelData.model.setValue(e206);
    } finally {
      this._endUpdate();
    }
  }
  getModel() {
    return this._modelData ? this._modelData.model : null;
  }
  setModel(e206 = null) {
    try {
      this._beginUpdate();
      let t10 = e206;
      if (this._modelData === null && t10 === null || this._modelData && this._modelData.model === t10) return;
      let n10 = { oldModelUrl: this._modelData?.model.uri || null, newModelUrl: t10?.uri || null };
      this._onWillChangeModel.fire(n10);
      let r10 = this.hasTextFocus(), i10 = this._detachModel();
      this._attachModel(t10), this.hasModel() ? r10 && this.focus() : (this._editorTextFocus.setValue(false), this._editorWidgetFocus.setValue(false)), this._removeDecorationTypes(), this._onDidChangeModel.fire(n10), this._postDetachModelCleanup(i10), this._contributionsDisposable = this._contributions.onAfterModelAttached();
    } finally {
      this._endUpdate();
    }
  }
  _removeDecorationTypes() {
    if (this._decorationTypeKeysToIds = {}, this._decorationTypeSubtypes) {
      for (let e206 in this._decorationTypeSubtypes) {
        let t10 = this._decorationTypeSubtypes[e206];
        for (let n10 in t10) this._removeDecorationType(e206 + `-` + n10);
      }
      this._decorationTypeSubtypes = {};
    }
  }
  getVisibleRanges() {
    return this._modelData ? this._modelData.viewModel.getVisibleRanges() : [];
  }
  getVisibleRangesPlusViewportAboveBelow() {
    return this._modelData ? this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow() : [];
  }
  getWhitespaces() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getWhitespaces() : [];
  }
  static _getVerticalOffsetAfterPosition(e206, t10, n10, r10) {
    let i10 = e206.model.validatePosition({ lineNumber: t10, column: n10 }), a10 = e206.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i10);
    return e206.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(a10.lineNumber, r10);
  }
  getTopForLineNumber(e206, t10 = false) {
    return this._modelData ? jk._getVerticalOffsetForPosition(this._modelData, e206, 1, t10) : -1;
  }
  getTopForPosition(e206, t10) {
    return this._modelData ? jk._getVerticalOffsetForPosition(this._modelData, e206, t10, false) : -1;
  }
  static _getVerticalOffsetForPosition(e206, t10, n10, r10 = false) {
    let i10 = e206.model.validatePosition({ lineNumber: t10, column: n10 }), a10 = e206.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i10);
    return e206.viewModel.viewLayout.getVerticalOffsetForLineNumber(a10.lineNumber, r10);
  }
  getBottomForLineNumber(e206, t10 = false) {
    if (!this._modelData) return -1;
    let n10 = this._modelData.model.getLineMaxColumn(e206);
    return jk._getVerticalOffsetAfterPosition(this._modelData, e206, n10, t10);
  }
  getLineHeightForPosition(e206) {
    if (!this._modelData) return -1;
    let t10 = this._modelData.viewModel, n10 = t10.coordinatesConverter, r10 = j.lift(e206);
    if (n10.modelPositionIsVisible(r10)) {
      let e207 = n10.convertModelPositionToViewPosition(r10);
      return t10.viewLayout.getLineHeightForLineNumber(e207.lineNumber);
    }
    return 0;
  }
  setHiddenAreas(e206, t10, n10) {
    this._modelData?.viewModel.setHiddenAreas(e206.map((e207) => M.lift(e207)), t10, n10);
  }
  getVisibleColumnFromPosition(e206) {
    if (!this._modelData) return e206.column;
    let t10 = this._modelData.model.validatePosition(e206), n10 = this._modelData.model.getOptions().tabSize;
    return Ub.visibleColumnFromColumn(this._modelData.model.getLineContent(t10.lineNumber), t10.column, n10) + 1;
  }
  getPosition() {
    return this._modelData ? this._modelData.viewModel.getPosition() : null;
  }
  setPosition(e206, t10 = `api`) {
    if (this._modelData) {
      if (!j.isIPosition(e206)) throw Error(`Invalid arguments`);
      this._modelData.viewModel.setSelections(t10, [{ selectionStartLineNumber: e206.lineNumber, selectionStartColumn: e206.column, positionLineNumber: e206.lineNumber, positionColumn: e206.column }]);
    }
  }
  _sendRevealRange(e206, t10, n10, r10) {
    if (!this._modelData) return;
    if (!M.isIRange(e206)) throw Error(`Invalid arguments`);
    let i10 = this._modelData.model.validateRange(e206), a10 = this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(i10);
    this._modelData.viewModel.revealRange(`api`, n10, a10, t10, r10);
  }
  revealLine(e206, t10 = 0) {
    this._revealLine(e206, 0, t10);
  }
  revealLineInCenter(e206, t10 = 0) {
    this._revealLine(e206, 1, t10);
  }
  revealLineInCenterIfOutsideViewport(e206, t10 = 0) {
    this._revealLine(e206, 2, t10);
  }
  revealLineNearTop(e206, t10 = 0) {
    this._revealLine(e206, 5, t10);
  }
  _revealLine(e206, t10, n10) {
    if (typeof e206 != `number`) throw Error(`Invalid arguments`);
    this._sendRevealRange(new M(e206, 1, e206, 1), t10, false, n10);
  }
  revealPosition(e206, t10 = 0) {
    this._revealPosition(e206, 0, true, t10);
  }
  revealPositionInCenter(e206, t10 = 0) {
    this._revealPosition(e206, 1, true, t10);
  }
  revealPositionInCenterIfOutsideViewport(e206, t10 = 0) {
    this._revealPosition(e206, 2, true, t10);
  }
  revealPositionNearTop(e206, t10 = 0) {
    this._revealPosition(e206, 5, true, t10);
  }
  _revealPosition(e206, t10, n10, r10) {
    if (!j.isIPosition(e206)) throw Error(`Invalid arguments`);
    this._sendRevealRange(new M(e206.lineNumber, e206.column, e206.lineNumber, e206.column), t10, n10, r10);
  }
  getSelection() {
    return this._modelData ? this._modelData.viewModel.getSelection() : null;
  }
  getSelections() {
    return this._modelData ? this._modelData.viewModel.getSelections() : null;
  }
  setSelection(e206, t10 = `api`) {
    let n10 = N.isISelection(e206), r10 = M.isIRange(e206);
    if (!n10 && !r10) throw Error(`Invalid arguments`);
    if (n10) this._setSelectionImpl(e206, t10);
    else if (r10) {
      let n11 = { selectionStartLineNumber: e206.startLineNumber, selectionStartColumn: e206.startColumn, positionLineNumber: e206.endLineNumber, positionColumn: e206.endColumn };
      this._setSelectionImpl(n11, t10);
    }
  }
  _setSelectionImpl(e206, t10) {
    if (!this._modelData) return;
    let n10 = new N(e206.selectionStartLineNumber, e206.selectionStartColumn, e206.positionLineNumber, e206.positionColumn);
    this._modelData.viewModel.setSelections(t10, [n10]);
  }
  revealLines(e206, t10, n10 = 0) {
    this._revealLines(e206, t10, 0, n10);
  }
  revealLinesInCenter(e206, t10, n10 = 0) {
    this._revealLines(e206, t10, 1, n10);
  }
  revealLinesInCenterIfOutsideViewport(e206, t10, n10 = 0) {
    this._revealLines(e206, t10, 2, n10);
  }
  revealLinesNearTop(e206, t10, n10 = 0) {
    this._revealLines(e206, t10, 5, n10);
  }
  _revealLines(e206, t10, n10, r10) {
    if (typeof e206 != `number` || typeof t10 != `number`) throw Error(`Invalid arguments`);
    this._sendRevealRange(new M(e206, 1, t10, 1), n10, false, r10);
  }
  revealRange(e206, t10 = 0, n10 = false, r10 = true) {
    this._revealRange(e206, +!!n10, r10, t10);
  }
  revealRangeInCenter(e206, t10 = 0) {
    this._revealRange(e206, 1, true, t10);
  }
  revealRangeInCenterIfOutsideViewport(e206, t10 = 0) {
    this._revealRange(e206, 2, true, t10);
  }
  revealRangeNearTop(e206, t10 = 0) {
    this._revealRange(e206, 5, true, t10);
  }
  revealRangeNearTopIfOutsideViewport(e206, t10 = 0) {
    this._revealRange(e206, 6, true, t10);
  }
  revealRangeAtTop(e206, t10 = 0) {
    this._revealRange(e206, 3, true, t10);
  }
  _revealRange(e206, t10, n10, r10) {
    if (!M.isIRange(e206)) throw Error(`Invalid arguments`);
    this._sendRevealRange(M.lift(e206), t10, n10, r10);
  }
  setSelections(e206, t10 = `api`, n10 = 0) {
    if (this._modelData) {
      if (!e206 || e206.length === 0) throw Error(`Invalid arguments`);
      for (let t11 = 0, n11 = e206.length; t11 < n11; t11++) if (!N.isISelection(e206[t11])) throw Error(`Invalid arguments`);
      this._modelData.viewModel.setSelections(t10, e206, n10);
    }
  }
  getContentWidth() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getContentWidth() : -1;
  }
  getScrollWidth() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getScrollWidth() : -1;
  }
  getScrollLeft() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getCurrentScrollLeft() : -1;
  }
  getContentHeight() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getContentHeight() : -1;
  }
  getScrollHeight() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getScrollHeight() : -1;
  }
  getScrollTop() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getCurrentScrollTop() : -1;
  }
  setScrollLeft(e206, t10 = 1) {
    if (this._modelData) {
      if (typeof e206 != `number`) throw Error(`Invalid arguments`);
      this._modelData.viewModel.viewLayout.setScrollPosition({ scrollLeft: e206 }, t10);
    }
  }
  setScrollTop(e206, t10 = 1) {
    if (this._modelData) {
      if (typeof e206 != `number`) throw Error(`Invalid arguments`);
      this._modelData.viewModel.viewLayout.setScrollPosition({ scrollTop: e206 }, t10);
    }
  }
  setScrollPosition(e206, t10 = 1) {
    this._modelData && this._modelData.viewModel.viewLayout.setScrollPosition(e206, t10);
  }
  hasPendingScrollAnimation() {
    return this._modelData ? this._modelData.viewModel.viewLayout.hasPendingScrollAnimation() : false;
  }
  saveViewState() {
    if (!this._modelData) return null;
    let e206 = this._contributions.saveViewState();
    return { cursorState: this._modelData.viewModel.saveCursorState(), viewState: this._modelData.viewModel.saveState(), contributionsState: e206 };
  }
  restoreViewState(e206) {
    if (!this._modelData || !this._modelData.hasRealView) return;
    let t10 = e206;
    if (t10 && t10.cursorState && t10.viewState) {
      let e207 = t10.cursorState;
      Array.isArray(e207) ? e207.length > 0 && this._modelData.viewModel.restoreCursorState(e207) : this._modelData.viewModel.restoreCursorState([e207]), this._contributions.restoreViewState(t10.contributionsState || {});
      let n10 = this._modelData.viewModel.reduceRestoreState(t10.viewState);
      this._modelData.view.restoreState(n10);
    }
  }
  handleInitialized() {
    this._getViewModel()?.visibleLinesStabilized();
  }
  getContribution(e206) {
    return this._contributions.get(e206);
  }
  getActions() {
    return Array.from(this._actions.values());
  }
  getSupportedActions() {
    let e206 = this.getActions();
    return e206 = e206.filter((e207) => e207.isSupported()), e206;
  }
  getAction(e206) {
    return this._actions.get(e206) || null;
  }
  trigger(e206, t10, n10) {
    n10 || (n10 = {});
    try {
      switch (this._onWillTriggerEditorOperationEvent.fire({ source: e206, handlerId: t10, payload: n10 }), this._beginUpdate(), t10) {
        case `compositionStart`:
          this._startComposition();
          return;
        case `compositionEnd`:
          this._endComposition(e206);
          return;
        case `type`: {
          let t11 = n10;
          this._type(e206, t11.text || ``);
          return;
        }
        case `replacePreviousChar`: {
          let t11 = n10;
          this._compositionType(e206, t11.text || ``, t11.replaceCharCnt || 0, 0, 0);
          return;
        }
        case `compositionType`: {
          let t11 = n10;
          this._compositionType(e206, t11.text || ``, t11.replacePrevCharCnt || 0, t11.replaceNextCharCnt || 0, t11.positionDelta || 0);
          return;
        }
        case `paste`: {
          let t11 = n10;
          this._paste(e206, t11.text || ``, t11.pasteOnNewLine || false, t11.multicursorText || null, t11.mode || null, t11.clipboardEvent);
          return;
        }
        case `cut`:
          this._cut(e206);
          return;
      }
      let r10 = this.getAction(t10);
      if (r10) {
        Promise.resolve(r10.run(n10)).then(void 0, be);
        return;
      }
      if (!this._modelData || this._triggerEditorCommand(e206, t10, n10)) return;
      this._triggerCommand(t10, n10);
    } finally {
      this._endUpdate();
    }
  }
  _triggerCommand(e206, t10) {
    this._commandService.executeCommand(e206, t10);
  }
  _startComposition() {
    this._modelData && (this.inComposition = true, this._modelData.viewModel.startComposition(), this._onDidCompositionStart.fire());
  }
  _endComposition(e206) {
    this._modelData && (this.inComposition = false, this._modelData.viewModel.endComposition(e206), this._onDidCompositionEnd.fire());
  }
  _type(e206, t10) {
    !this._modelData || t10.length === 0 || (e206 === `keyboard` && this._onWillType.fire(t10), this._modelData.viewModel.type(t10, e206), e206 === `keyboard` && this._onDidType.fire(t10));
  }
  _compositionType(e206, t10, n10, r10, i10) {
    this._modelData && this._modelData.viewModel.compositionType(t10, n10, r10, i10, e206);
  }
  _paste(e206, t10, n10, r10, i10, a10) {
    if (!this._modelData) return;
    let o10 = this._modelData.viewModel, s10 = o10.getSelection().getStartPosition();
    o10.paste(t10, n10, r10, e206);
    let c10 = o10.getSelection().getStartPosition();
    e206 === `keyboard` && this._onDidPaste.fire({ clipboardEvent: a10, range: new M(s10.lineNumber, s10.column, c10.lineNumber, c10.column), languageId: i10 });
  }
  _cut(e206) {
    this._modelData && this._modelData.viewModel.cut(e206);
  }
  _triggerEditorCommand(e206, t10, n10) {
    let r10 = of.getEditorCommand(t10);
    return r10 ? (n10 || (n10 = {}), Be(n10) && (n10.source = e206), this._instantiationService.invokeFunction((e207) => {
      Promise.resolve(r10.runEditorCommand(e207, this, n10)).then(void 0, be);
    }), true) : false;
  }
  _getViewModel() {
    return this._modelData ? this._modelData.viewModel : null;
  }
  pushUndoStop() {
    return !this._modelData || this._configuration.options.get(104) ? false : (this._modelData.model.pushStackElement(), true);
  }
  popUndoStop() {
    return !this._modelData || this._configuration.options.get(104) ? false : (this._modelData.model.popStackElement(), true);
  }
  edit(e206, t10) {
    return this.executeEdits(t10, e206.replacements.map((e207) => ({ range: e207.range, text: e207.text })), void 0);
  }
  executeEdits(e206, t10, n10) {
    if (!this._modelData || this._configuration.options.get(104)) return false;
    let r10;
    r10 = n10 ? Array.isArray(n10) ? () => n10 : n10 : () => null;
    let i10, a10;
    return e206 instanceof fE ? (a10 = e206, i10 = e206.metadata.source) : (a10 = mE.unknown({ name: i10 }), i10 = e206), this._onBeforeExecuteEdit.fire({ source: i10 ?? void 0 }), this._modelData.viewModel.executeEdits(i10, t10, r10, a10), true;
  }
  executeCommand(e206, t10) {
    this._modelData && this._modelData.viewModel.executeCommand(t10, e206);
  }
  executeCommands(e206, t10) {
    this._modelData && this._modelData.viewModel.executeCommands(t10, e206);
  }
  createDecorationsCollection(e206) {
    return new ope(this, e206);
  }
  changeDecorations(e206) {
    return this._modelData ? this._modelData.model.changeDecorations(e206, this._id) : null;
  }
  getLineDecorations(e206) {
    if (!this._modelData) return null;
    let t10 = this._configuration.options;
    return this._modelData.model.getLineDecorations(e206, this._id, nr(t10), rr(t10));
  }
  getDecorationsInRange(e206) {
    if (!this._modelData) return null;
    let t10 = this._configuration.options;
    return this._modelData.model.getDecorationsInRange(e206, this._id, nr(t10), rr(t10));
  }
  getFontSizeAtPosition(e206) {
    return this._modelData ? this._modelData.viewModel.getFontSizeAtPosition(e206) : null;
  }
  deltaDecorations(e206, t10) {
    return this._modelData ? e206.length === 0 && t10.length === 0 ? e206 : this._modelData.model.deltaDecorations(e206, t10, this._id) : [];
  }
  removeDecorations(e206) {
    !this._modelData || e206.length === 0 || this._modelData.model.changeDecorations((t10) => {
      t10.deltaDecorations(e206, []);
    });
  }
  removeDecorationsByType(e206) {
    let t10 = this._decorationTypeKeysToIds[e206];
    t10 && this.changeDecorations((e207) => e207.deltaDecorations(t10, [])), this._decorationTypeKeysToIds.hasOwnProperty(e206) && delete this._decorationTypeKeysToIds[e206], this._decorationTypeSubtypes.hasOwnProperty(e206) && delete this._decorationTypeSubtypes[e206];
  }
  getLayoutInfo() {
    return this._configuration.options.get(165);
  }
  createOverviewRuler(e206) {
    return !this._modelData || !this._modelData.hasRealView ? null : this._modelData.view.createOverviewRuler(e206);
  }
  getContainerDomNode() {
    return this._domElement;
  }
  getDomNode() {
    return !this._modelData || !this._modelData.hasRealView ? null : this._modelData.view.domNode.domNode;
  }
  delegateVerticalScrollbarPointerDown(e206) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.delegateVerticalScrollbarPointerDown(e206);
  }
  delegateScrollFromMouseWheelEvent(e206) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.delegateScrollFromMouseWheelEvent(e206);
  }
  layout(e206, t10 = false) {
    this._configuration.observeContainer(e206), t10 || this.render();
  }
  focus() {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.focus();
  }
  hasTextFocus() {
    return !this._modelData || !this._modelData.hasRealView ? false : this._modelData.view.isFocused();
  }
  hasWidgetFocus() {
    return !this._modelData || !this._modelData.hasRealView ? false : this._modelData.view.isWidgetFocused();
  }
  addContentWidget(e206) {
    let t10 = { widget: e206, position: e206.getPosition() };
    this._contentWidgets.hasOwnProperty(e206.getId()) && console.warn(`Overwriting a content widget with the same id:` + e206.getId()), this._contentWidgets[e206.getId()] = t10, this._modelData && this._modelData.hasRealView && this._modelData.view.addContentWidget(t10);
  }
  layoutContentWidget(e206) {
    let t10 = e206.getId();
    if (this._contentWidgets.hasOwnProperty(t10)) {
      let n10 = this._contentWidgets[t10];
      n10.position = e206.getPosition(), this._modelData && this._modelData.hasRealView && this._modelData.view.layoutContentWidget(n10);
    }
  }
  removeContentWidget(e206) {
    let t10 = e206.getId();
    if (this._contentWidgets.hasOwnProperty(t10)) {
      let e207 = this._contentWidgets[t10];
      delete this._contentWidgets[t10], this._modelData && this._modelData.hasRealView && this._modelData.view.removeContentWidget(e207);
    }
  }
  addOverlayWidget(e206) {
    let t10 = { widget: e206, position: e206.getPosition() };
    this._overlayWidgets.hasOwnProperty(e206.getId()) && console.warn(`Overwriting an overlay widget with the same id.`), this._overlayWidgets[e206.getId()] = t10, this._modelData && this._modelData.hasRealView && this._modelData.view.addOverlayWidget(t10);
  }
  layoutOverlayWidget(e206) {
    let t10 = e206.getId();
    if (this._overlayWidgets.hasOwnProperty(t10)) {
      let n10 = this._overlayWidgets[t10];
      n10.position = e206.getPosition(), this._modelData && this._modelData.hasRealView && this._modelData.view.layoutOverlayWidget(n10);
    }
  }
  removeOverlayWidget(e206) {
    let t10 = e206.getId();
    if (this._overlayWidgets.hasOwnProperty(t10)) {
      let e207 = this._overlayWidgets[t10];
      delete this._overlayWidgets[t10], this._modelData && this._modelData.hasRealView && this._modelData.view.removeOverlayWidget(e207);
    }
  }
  addGlyphMarginWidget(e206) {
    let t10 = { widget: e206, position: e206.getPosition() };
    this._glyphMarginWidgets.hasOwnProperty(e206.getId()) && console.warn(`Overwriting a glyph margin widget with the same id.`), this._glyphMarginWidgets[e206.getId()] = t10, this._modelData && this._modelData.hasRealView && this._modelData.view.addGlyphMarginWidget(t10);
  }
  layoutGlyphMarginWidget(e206) {
    let t10 = e206.getId();
    if (this._glyphMarginWidgets.hasOwnProperty(t10)) {
      let n10 = this._glyphMarginWidgets[t10];
      n10.position = e206.getPosition(), this._modelData && this._modelData.hasRealView && this._modelData.view.layoutGlyphMarginWidget(n10);
    }
  }
  removeGlyphMarginWidget(e206) {
    let t10 = e206.getId();
    if (this._glyphMarginWidgets.hasOwnProperty(t10)) {
      let e207 = this._glyphMarginWidgets[t10];
      delete this._glyphMarginWidgets[t10], this._modelData && this._modelData.hasRealView && this._modelData.view.removeGlyphMarginWidget(e207);
    }
  }
  changeViewZones(e206) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.change(e206);
  }
  getTargetAtClientPoint(e206, t10) {
    return !this._modelData || !this._modelData.hasRealView ? null : this._modelData.view.getTargetAtClientPoint(e206, t10);
  }
  getScrolledVisiblePosition(e206) {
    if (!this._modelData || !this._modelData.hasRealView) return null;
    let t10 = this._modelData.model.validatePosition(e206), n10 = this._configuration.options.get(165);
    return { top: jk._getVerticalOffsetForPosition(this._modelData, t10.lineNumber, t10.column) - this.getScrollTop(), left: this._modelData.view.getOffsetForColumn(t10.lineNumber, t10.column) + n10.glyphMarginWidth + n10.lineNumbersWidth + n10.decorationsWidth - this.getScrollLeft(), height: this.getLineHeightForPosition(t10) };
  }
  getOffsetForColumn(e206, t10) {
    return !this._modelData || !this._modelData.hasRealView ? -1 : this._modelData.view.getOffsetForColumn(e206, t10);
  }
  render(e206 = false) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.viewModel.batchEvents(() => {
      this._modelData.view.render(true, e206);
    });
  }
  setAriaOptions(e206) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.setAriaOptions(e206);
  }
  applyFontInfo(e206) {
    vu(e206, this._configuration.options.get(59));
  }
  setBanner(e206, t10) {
    this._bannerDomNode && this._domElement.contains(this._bannerDomNode) && this._bannerDomNode.remove(), this._bannerDomNode = e206, this._configuration.setReservedHeight(e206 ? t10 : 0), this._bannerDomNode && this._domElement.prepend(this._bannerDomNode);
  }
  _attachModel(e206) {
    if (!e206) {
      this._modelData = null;
      return;
    }
    let t10 = [];
    this._domElement.setAttribute(`data-mode-id`, e206.getLanguageId()), this._configuration.setIsDominatedByLongLines(e206.isDominatedByLongLines()), this._configuration.setModelLineCount(e206.getLineCount());
    let n10 = e206.onBeforeAttached(), r10 = new Xfe(this._id, this._configuration, e206, Aue.create(Vc(this._domElement)), Jde.create(this._configuration.options), (e207) => cl(Vc(this._domElement), e207), this.languageConfigurationService, this._themeService, n10, { batchChanges: (e207) => {
      try {
        return this._beginUpdate(), e207();
      } finally {
        this._endUpdate();
      }
    } });
    t10.push(e206.onWillDispose(() => this.setModel(null))), t10.push(r10.onEvent((t11) => {
      switch (t11.kind) {
        case 0:
          this._onDidContentSizeChange.fire(t11);
          break;
        case 1:
          this._editorTextFocus.setValue(t11.hasFocus);
          break;
        case 2:
          this._editorWidgetFocus.setValue(t11.hasFocus);
          break;
        case 3:
          this._onDidScrollChange.fire(t11);
          break;
        case 4:
          this._onDidChangeViewZones.fire();
          break;
        case 5:
          this._onDidChangeHiddenAreas.fire();
          break;
        case 6:
          this._onDidAttemptReadOnlyEdit.fire();
          break;
        case 7: {
          if (t11.reachedMaxCursorCount) {
            let e208 = C(83, `The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.`, this.getOption(89));
            this._notificationService.prompt(uw.Warning, e208, [{ label: `Find and Replace`, run: () => {
              this._commandService.executeCommand(`editor.action.startFindReplaceAction`);
            } }, { label: C(84, `Increase Multi Cursor Limit`), run: () => {
              this._commandService.executeCommand(`workbench.action.openSettings2`, { query: `editor.multiCursorLimit` });
            } }]);
          }
          let e207 = [];
          for (let n12 = 0, r12 = t11.selections.length; n12 < r12; n12++) e207[n12] = t11.selections[n12].getPosition();
          let n11 = { position: e207[0], secondaryPositions: e207.slice(1), reason: t11.reason, source: t11.source };
          this._onDidChangeCursorPosition.fire(n11);
          let r11 = { selection: t11.selections[0], secondarySelections: t11.selections.slice(1), modelVersionId: t11.modelVersionId, oldSelections: t11.oldSelections, oldModelVersionId: t11.oldModelVersionId, source: t11.source, reason: t11.reason };
          this._onDidChangeCursorSelection.fire(r11);
          break;
        }
        case 8:
          this._onDidChangeModelDecorations.fire(t11.event);
          break;
        case 9:
          this._domElement.setAttribute(`data-mode-id`, e206.getLanguageId()), this._onDidChangeModelLanguage.fire(t11.event);
          break;
        case 10:
          this._onDidChangeModelLanguageConfiguration.fire(t11.event);
          break;
        case 11:
          this._onDidChangeModelContent.fire(t11.event);
          break;
        case 12:
          this._onDidChangeModelOptions.fire(t11.event);
          break;
        case 13:
          this._onDidChangeModelTokens.fire(t11.event);
          break;
        case 14:
          this._onDidChangeLineHeight.fire(t11.event);
          break;
        case 15:
          this._onDidChangeFont.fire(t11.event);
          break;
      }
    }));
    let [i10, a10] = this._createView(r10);
    if (a10) {
      this._domElement.appendChild(i10.domNode.domNode);
      let t11 = Object.keys(this._contentWidgets);
      for (let e207 = 0, n11 = t11.length; e207 < n11; e207++) {
        let n12 = t11[e207];
        i10.addContentWidget(this._contentWidgets[n12]);
      }
      t11 = Object.keys(this._overlayWidgets);
      for (let e207 = 0, n11 = t11.length; e207 < n11; e207++) {
        let n12 = t11[e207];
        i10.addOverlayWidget(this._overlayWidgets[n12]);
      }
      t11 = Object.keys(this._glyphMarginWidgets);
      for (let e207 = 0, n11 = t11.length; e207 < n11; e207++) {
        let n12 = t11[e207];
        i10.addGlyphMarginWidget(this._glyphMarginWidgets[n12]);
      }
      i10.render(false, true), i10.domNode.domNode.setAttribute(`data-uri`, e206.uri.toString());
    }
    this._modelData = new rpe(e206, r10, i10, a10, t10, n10);
  }
  _createView(e206) {
    let t10;
    t10 = this.isSimpleWidget ? { paste: (e207, t11, n11, r10) => {
      this._paste(`keyboard`, e207, t11, n11, r10);
    }, type: (e207) => {
      this._type(`keyboard`, e207);
    }, compositionType: (e207, t11, n11, r10) => {
      this._compositionType(`keyboard`, e207, t11, n11, r10);
    }, startComposition: () => {
      this._startComposition();
    }, endComposition: () => {
      this._endComposition(`keyboard`);
    }, cut: () => {
      this._cut(`keyboard`);
    } } : { paste: (e207, t11, n11, r10) => {
      let i10 = { text: e207, pasteOnNewLine: t11, multicursorText: n11, mode: r10 };
      this._commandService.executeCommand(`paste`, i10);
    }, type: (e207) => {
      let t11 = { text: e207 };
      this._commandService.executeCommand(`type`, t11);
    }, compositionType: (e207, t11, n11, r10) => {
      if (n11 || r10) {
        let i10 = { text: e207, replacePrevCharCnt: t11, replaceNextCharCnt: n11, positionDelta: r10 };
        this._commandService.executeCommand(`compositionType`, i10);
      } else {
        let n12 = { text: e207, replaceCharCnt: t11 };
        this._commandService.executeCommand(`replacePreviousChar`, n12);
      }
    }, startComposition: () => {
      this._commandService.executeCommand(`compositionStart`, {});
    }, endComposition: () => {
      this._commandService.executeCommand(`compositionEnd`, {});
    }, cut: () => {
      this._commandService.executeCommand(`cut`, {});
    } };
    let n10 = new LS(e206.coordinatesConverter);
    return n10.onKeyDown = (e207) => this._onKeyDown.fire(e207), n10.onKeyUp = (e207) => this._onKeyUp.fire(e207), n10.onContextMenu = (e207) => this._onContextMenu.fire(e207), n10.onMouseMove = (e207) => this._onMouseMove.fire(e207), n10.onMouseLeave = (e207) => this._onMouseLeave.fire(e207), n10.onMouseDown = (e207) => this._onMouseDown.fire(e207), n10.onMouseUp = (e207) => this._onMouseUp.fire(e207), n10.onMouseDrag = (e207) => this._onMouseDrag.fire(e207), n10.onMouseDrop = (e207) => this._onMouseDrop.fire(e207), n10.onMouseDropCanceled = (e207) => this._onMouseDropCanceled.fire(e207), n10.onMouseWheel = (e207) => this._onMouseWheel.fire(e207), [new Zw(this._domElement, this.getId(), t10, this._configuration, this._themeService.getColorTheme(), e206, n10, this._overflowWidgetsDomNode, this._instantiationService), true];
  }
  _postDetachModelCleanup(e206) {
    e206?.removeAllDecorationsWithOwnerId(this._id);
  }
  _detachModel() {
    if (this._contributionsDisposable?.dispose(), this._contributionsDisposable = void 0, !this._modelData) return null;
    let e206 = this._modelData.model, t10 = this._modelData.hasRealView ? this._modelData.view.domNode.domNode : null;
    return this._modelData.dispose(), this._modelData = null, this._domElement.removeAttribute(`data-mode-id`), t10 && this._domElement.contains(t10) && t10.remove(), this._bannerDomNode && this._domElement.contains(this._bannerDomNode) && this._bannerDomNode.remove(), e206;
  }
  _removeDecorationType(e206) {
    this._codeEditorService.removeDecorationType(e206);
  }
  hasModel() {
    return this._modelData !== null;
  }
  showDropIndicatorAt(e206) {
    let t10 = [{ range: new M(e206.lineNumber, e206.column, e206.lineNumber, e206.column), options: jk.dropIntoEditorDecorationOptions }];
    this._dropIntoEditorDecorations.set(t10), this.revealPosition(e206, 1);
  }
  removeDropIndicator() {
    this._dropIntoEditorDecorations.clear();
  }
  _beginUpdate() {
    this._updateCounter++, this._updateCounter === 1 && this._onBeginUpdate.fire();
  }
  _endUpdate() {
    this._updateCounter--, this._updateCounter === 0 && this._onEndUpdate.fire();
  }
}, jk = _Fa, _Fa.dropIntoEditorDecorationOptions = UO.register({ description: `workbench-dnd-target`, className: `dnd-target` }), _Fa);
Mk = jk = tpe([Ak(3, V), Ak(4, Su), Ak(5, Mu), Ak(6, nd), Ak(7, US), Ak(8, dw), Ak(9, e_), Ak(10, bp), Ak(11, X)], Mk);
var npe = 0, rpe = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this.model = e206, this.viewModel = t10, this.view = n10, this.hasRealView = r10, this.listenersToRemove = i10, this.attachedView = a10;
  }
  dispose() {
    Kt(this.listenersToRemove), this.model.onBeforeDetached(this.attachedView), this.hasRealView && this.view.dispose(), this.viewModel.dispose();
  }
}, Nk = class extends D {
  constructor(e206) {
    super(), this._emitterOptions = e206, this._onDidChangeToTrue = this._register(new k(this._emitterOptions)), this.onDidChangeToTrue = this._onDidChangeToTrue.event, this._onDidChangeToFalse = this._register(new k(this._emitterOptions)), this.onDidChangeToFalse = this._onDidChangeToFalse.event, this._value = 0;
  }
  setValue(e206) {
    let t10 = e206 ? 2 : 1;
    this._value !== t10 && (this._value = t10, this._value === 2 ? this._onDidChangeToTrue.fire() : this._value === 1 && this._onDidChangeToFalse.fire());
  }
}, Pk = class extends k {
  constructor(e206, t10) {
    super({ deliveryQueue: t10 }), this._contributions = e206;
  }
  fire(e206) {
    this._contributions.onBeforeInteractionEvent(), super.fire(e206);
  }
}, ipe = class extends D {
  constructor(e206, t10) {
    super(), this._editor = e206, t10.createKey(`editorId`, e206.getId()), this._editorSimpleInput = $.editorSimpleInput.bindTo(t10), this._editorFocus = $.focus.bindTo(t10), this._textInputFocus = $.textInputFocus.bindTo(t10), this._editorTextFocus = $.editorTextFocus.bindTo(t10), this._tabMovesFocus = $.tabMovesFocus.bindTo(t10), this._editorReadonly = $.readOnly.bindTo(t10), this._inDiffEditor = $.inDiffEditor.bindTo(t10), this._editorColumnSelection = $.columnSelection.bindTo(t10), this._hasMultipleSelections = $.hasMultipleSelections.bindTo(t10), this._hasNonEmptySelection = $.hasNonEmptySelection.bindTo(t10), this._canUndo = $.canUndo.bindTo(t10), this._canRedo = $.canRedo.bindTo(t10), this._register(this._editor.onDidChangeConfiguration(() => this._updateFromConfig())), this._register(this._editor.onDidChangeCursorSelection(() => this._updateFromSelection())), this._register(this._editor.onDidFocusEditorWidget(() => this._updateFromFocus())), this._register(this._editor.onDidBlurEditorWidget(() => this._updateFromFocus())), this._register(this._editor.onDidFocusEditorText(() => this._updateFromFocus())), this._register(this._editor.onDidBlurEditorText(() => this._updateFromFocus())), this._register(this._editor.onDidChangeModel(() => this._updateFromModel())), this._register(this._editor.onDidChangeConfiguration(() => this._updateFromModel())), this._register($g.onDidChangeTabFocus((e207) => this._tabMovesFocus.set(e207))), this._updateFromConfig(), this._updateFromSelection(), this._updateFromFocus(), this._updateFromModel(), this._editorSimpleInput.set(this._editor.isSimpleWidget);
  }
  _updateFromConfig() {
    let e206 = this._editor.getOptions();
    this._tabMovesFocus.set(e206.get(164) || $g.getTabFocusMode()), this._editorReadonly.set(e206.get(104)), this._inDiffEditor.set(e206.get(70)), this._editorColumnSelection.set(e206.get(28));
  }
  _updateFromSelection() {
    let e206 = this._editor.getSelections();
    e206 ? (this._hasMultipleSelections.set(e206.length > 1), this._hasNonEmptySelection.set(e206.some((e207) => !e207.isEmpty()))) : (this._hasMultipleSelections.reset(), this._hasNonEmptySelection.reset());
  }
  _updateFromFocus() {
    this._editorFocus.set(this._editor.hasWidgetFocus() && !this._editor.isSimpleWidget), this._editorTextFocus.set(this._editor.hasTextFocus() && !this._editor.isSimpleWidget), this._textInputFocus.set(this._editor.hasTextFocus());
  }
  _updateFromModel() {
    let e206 = this._editor.getModel();
    this._canUndo.set(!!(e206 && e206.canUndo())), this._canRedo.set(!!(e206 && e206.canRedo()));
  }
}, ape = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._contextKeyService = t10, this._languageFeaturesService = n10, this._langId = $.languageId.bindTo(t10), this._hasCompletionItemProvider = $.hasCompletionItemProvider.bindTo(t10), this._hasCodeActionsProvider = $.hasCodeActionsProvider.bindTo(t10), this._hasCodeLensProvider = $.hasCodeLensProvider.bindTo(t10), this._hasDefinitionProvider = $.hasDefinitionProvider.bindTo(t10), this._hasDeclarationProvider = $.hasDeclarationProvider.bindTo(t10), this._hasImplementationProvider = $.hasImplementationProvider.bindTo(t10), this._hasTypeDefinitionProvider = $.hasTypeDefinitionProvider.bindTo(t10), this._hasHoverProvider = $.hasHoverProvider.bindTo(t10), this._hasDocumentHighlightProvider = $.hasDocumentHighlightProvider.bindTo(t10), this._hasDocumentSymbolProvider = $.hasDocumentSymbolProvider.bindTo(t10), this._hasReferenceProvider = $.hasReferenceProvider.bindTo(t10), this._hasRenameProvider = $.hasRenameProvider.bindTo(t10), this._hasSignatureHelpProvider = $.hasSignatureHelpProvider.bindTo(t10), this._hasInlayHintsProvider = $.hasInlayHintsProvider.bindTo(t10), this._hasDocumentFormattingProvider = $.hasDocumentFormattingProvider.bindTo(t10), this._hasDocumentSelectionFormattingProvider = $.hasDocumentSelectionFormattingProvider.bindTo(t10), this._hasMultipleDocumentFormattingProvider = $.hasMultipleDocumentFormattingProvider.bindTo(t10), this._hasMultipleDocumentSelectionFormattingProvider = $.hasMultipleDocumentSelectionFormattingProvider.bindTo(t10), this._isInEmbeddedEditor = $.isInEmbeddedEditor.bindTo(t10);
    let r10 = () => this._update();
    this._register(e206.onDidChangeModel(r10)), this._register(e206.onDidChangeModelLanguage(r10)), this._register(n10.completionProvider.onDidChange(r10)), this._register(n10.codeActionProvider.onDidChange(r10)), this._register(n10.codeLensProvider.onDidChange(r10)), this._register(n10.definitionProvider.onDidChange(r10)), this._register(n10.declarationProvider.onDidChange(r10)), this._register(n10.implementationProvider.onDidChange(r10)), this._register(n10.typeDefinitionProvider.onDidChange(r10)), this._register(n10.hoverProvider.onDidChange(r10)), this._register(n10.documentHighlightProvider.onDidChange(r10)), this._register(n10.documentSymbolProvider.onDidChange(r10)), this._register(n10.referenceProvider.onDidChange(r10)), this._register(n10.renameProvider.onDidChange(r10)), this._register(n10.documentFormattingEditProvider.onDidChange(r10)), this._register(n10.documentRangeFormattingEditProvider.onDidChange(r10)), this._register(n10.signatureHelpProvider.onDidChange(r10)), this._register(n10.inlayHintsProvider.onDidChange(r10)), r10();
  }
  dispose() {
    super.dispose();
  }
  reset() {
    this._contextKeyService.bufferChangeEvents(() => {
      this._langId.reset(), this._hasCompletionItemProvider.reset(), this._hasCodeActionsProvider.reset(), this._hasCodeLensProvider.reset(), this._hasDefinitionProvider.reset(), this._hasDeclarationProvider.reset(), this._hasImplementationProvider.reset(), this._hasTypeDefinitionProvider.reset(), this._hasHoverProvider.reset(), this._hasDocumentHighlightProvider.reset(), this._hasDocumentSymbolProvider.reset(), this._hasReferenceProvider.reset(), this._hasRenameProvider.reset(), this._hasDocumentFormattingProvider.reset(), this._hasDocumentSelectionFormattingProvider.reset(), this._hasSignatureHelpProvider.reset(), this._isInEmbeddedEditor.reset();
    });
  }
  _update() {
    let e206 = this._editor.getModel();
    if (!e206) {
      this.reset();
      return;
    }
    this._contextKeyService.bufferChangeEvents(() => {
      this._langId.set(e206.getLanguageId()), this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e206)), this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e206)), this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e206)), this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e206)), this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e206)), this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e206)), this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e206)), this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e206)), this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e206)), this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e206)), this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e206)), this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e206)), this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e206)), this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e206)), this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e206) || this._languageFeaturesService.documentRangeFormattingEditProvider.has(e206)), this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e206)), this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e206).length + this._languageFeaturesService.documentRangeFormattingEditProvider.all(e206).length > 1), this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e206).length > 1), this._isInEmbeddedEditor.set(e206.uri.scheme === xs.walkThroughSnippet || e206.uri.scheme === xs.vscodeChatCodeBlock);
    });
  }
}, ope = class {
  get length() {
    return this._decorationIds.length;
  }
  constructor(e206, t10) {
    this._editor = e206, this._decorationIds = [], this._isChangingDecorations = false, Array.isArray(t10) && t10.length > 0 && this.set(t10);
  }
  onDidChange(e206, t10, n10) {
    return this._editor.onDidChangeModelDecorations((n11) => {
      this._isChangingDecorations || e206.call(t10, n11);
    }, n10);
  }
  getRange(e206) {
    return !this._editor.hasModel() || e206 >= this._decorationIds.length ? null : this._editor.getModel().getDecorationRange(this._decorationIds[e206]);
  }
  getRanges() {
    if (!this._editor.hasModel()) return [];
    let e206 = this._editor.getModel(), t10 = [];
    for (let n10 of this._decorationIds) {
      let r10 = e206.getDecorationRange(n10);
      r10 && t10.push(r10);
    }
    return t10;
  }
  has(e206) {
    return this._decorationIds.includes(e206.id);
  }
  clear() {
    this._decorationIds.length !== 0 && this.set([]);
  }
  set(e206) {
    try {
      this._isChangingDecorations = true, this._editor.changeDecorations((t10) => {
        this._decorationIds = t10.deltaDecorations(this._decorationIds, e206);
      });
    } finally {
      this._isChangingDecorations = false;
    }
    return this._decorationIds;
  }
  append(e206) {
    let t10 = [];
    try {
      this._isChangingDecorations = true, this._editor.changeDecorations((n10) => {
        t10 = n10.deltaDecorations([], e206), this._decorationIds = this._decorationIds.concat(t10);
      });
    } finally {
      this._isChangingDecorations = false;
    }
    return t10;
  }
}, spe = `%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'`, cpe = `'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`;
function Fk(e206) {
  return spe + encodeURIComponent(e206.toString()) + cpe;
}
var lpe = `%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%223%22%20width%3D%2212%22%3E%3Cg%20fill%3D%22`, upe = `%22%3E%3Ccircle%20cx%3D%221%22%20cy%3D%221%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%225%22%20cy%3D%221%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%221%22%20r%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`;
function Ik(e206) {
  return lpe + encodeURIComponent(e206.toString()) + upe;
}
JS((e206, t10) => {
  let n10 = e206.getColor(cv);
  n10 && (t10.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Fk(n10)}") repeat-x bottom left; }`), t10.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${Fk(n10)}"); }`));
  let r10 = e206.getColor(dv);
  r10 && (t10.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Fk(r10)}") repeat-x bottom left; }`), t10.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${Fk(r10)}"); }`));
  let i10 = e206.getColor(pv);
  i10 && (t10.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Fk(i10)}") repeat-x bottom left; }`), t10.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${Fk(i10)}"); }`));
  let a10 = e206.getColor(hv);
  a10 && (t10.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Ik(a10)}") no-repeat bottom left; }`), t10.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${Ik(a10)}"); }`));
  let o10 = e206.getColor(uce);
  o10 && (t10.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${o10.rgba.a}; }`), t10.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${o10.rgba.a}; }`));
});
var dpe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, fpe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Lk = class extends D {
  constructor(e206) {
    super(), this._themeService = e206, this._onWillCreateCodeEditor = this._register(new k()), this._onCodeEditorAdd = this._register(new k()), this.onCodeEditorAdd = this._onCodeEditorAdd.event, this._onCodeEditorRemove = this._register(new k()), this.onCodeEditorRemove = this._onCodeEditorRemove.event, this._onWillCreateDiffEditor = this._register(new k()), this._onDiffEditorAdd = this._register(new k()), this.onDiffEditorAdd = this._onDiffEditorAdd.event, this._onDiffEditorRemove = this._register(new k()), this.onDiffEditorRemove = this._onDiffEditorRemove.event, this._decorationOptionProviders = /* @__PURE__ */ new Map(), this._codeEditorOpenHandlers = new Qt(), this._modelProperties = /* @__PURE__ */ new Map(), this._codeEditors = /* @__PURE__ */ Object.create(null), this._diffEditors = /* @__PURE__ */ Object.create(null), this._globalStyleSheet = null;
  }
  willCreateCodeEditor() {
    this._onWillCreateCodeEditor.fire();
  }
  addCodeEditor(e206) {
    this._codeEditors[e206.getId()] = e206, this._onCodeEditorAdd.fire(e206);
  }
  removeCodeEditor(e206) {
    delete this._codeEditors[e206.getId()] && this._onCodeEditorRemove.fire(e206);
  }
  listCodeEditors() {
    return Object.keys(this._codeEditors).map((e206) => this._codeEditors[e206]);
  }
  willCreateDiffEditor() {
    this._onWillCreateDiffEditor.fire();
  }
  addDiffEditor(e206) {
    this._diffEditors[e206.getId()] = e206, this._onDiffEditorAdd.fire(e206);
  }
  removeDiffEditor(e206) {
    delete this._diffEditors[e206.getId()] && this._onDiffEditorRemove.fire(e206);
  }
  listDiffEditors() {
    return Object.keys(this._diffEditors).map((e206) => this._diffEditors[e206]);
  }
  getFocusedCodeEditor() {
    let e206 = null, t10 = this.listCodeEditors();
    for (let n10 of t10) {
      if (n10.hasTextFocus()) return n10;
      n10.hasWidgetFocus() && (e206 = n10);
    }
    return e206;
  }
  removeDecorationType(e206) {
    let t10 = this._decorationOptionProviders.get(e206);
    t10 && (t10.refCount--, t10.refCount <= 0 && (this._decorationOptionProviders.delete(e206), t10.dispose(), this.listCodeEditors().forEach((t11) => t11.removeDecorationsByType(e206))));
  }
  setModelProperty(e206, t10, n10) {
    let r10 = e206.toString(), i10;
    this._modelProperties.has(r10) ? i10 = this._modelProperties.get(r10) : (i10 = /* @__PURE__ */ new Map(), this._modelProperties.set(r10, i10)), i10.set(t10, n10);
  }
  getModelProperty(e206, t10) {
    let n10 = e206.toString();
    if (this._modelProperties.has(n10)) return this._modelProperties.get(n10).get(t10);
  }
  async openCodeEditor(e206, t10, n10) {
    for (let r10 of this._codeEditorOpenHandlers) {
      let i10 = await r10(e206, t10, n10);
      if (i10 !== null) return i10;
    }
    return null;
  }
  registerCodeEditorOpenHandler(e206) {
    return T(this._codeEditorOpenHandlers.unshift(e206));
  }
};
Lk = dpe([fpe(0, US)], Lk);
var ppe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Rk = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, zk = class extends Lk {
  constructor(e206, t10) {
    super(t10), this._register(this.onCodeEditorAdd(() => this._checkContextKey())), this._register(this.onCodeEditorRemove(() => this._checkContextKey())), this._editorIsOpen = e206.createKey(`editorIsOpen`, false), this._activeCodeEditor = null, this._register(this.registerCodeEditorOpenHandler(async (e207, t11, n10) => t11 ? this.doOpenEditor(t11, e207) : null));
  }
  _checkContextKey() {
    let e206 = false;
    for (let t10 of this.listCodeEditors()) if (!t10.isSimpleWidget) {
      e206 = true;
      break;
    }
    this._editorIsOpen.set(e206);
  }
  setActiveCodeEditor(e206) {
    this._activeCodeEditor = e206;
  }
  getActiveCodeEditor() {
    return this._activeCodeEditor;
  }
  doOpenEditor(e206, t10) {
    if (!this.findModel(e206, t10.resource)) {
      if (t10.resource) {
        let n11 = t10.resource.scheme;
        if (n11 === xs.http || n11 === xs.https) return eu(t10.resource.toString()), e206;
      }
      return null;
    }
    let n10 = t10.options ? t10.options.selection : null;
    if (n10) if (typeof n10.endLineNumber == `number` && typeof n10.endColumn == `number`) e206.setSelection(n10), e206.revealRangeInCenter(n10, 1);
    else {
      let t11 = { lineNumber: n10.startLineNumber, column: n10.startColumn };
      e206.setPosition(t11), e206.revealPositionInCenter(t11, 1);
    }
    return e206;
  }
  findModel(e206, t10) {
    let n10 = e206.getModel();
    return n10 && n10.uri.toString() !== t10.toString() ? null : n10;
  }
};
zk = ppe([Rk(0, nd), Rk(1, US)], zk), Zf(Su, zk, 0);
var Bk = xu(`layoutService`), Vk = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Hk = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Uk = class {
  get mainContainer() {
    return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode() ?? Aa.document.body;
  }
  get activeContainer() {
    return (this._codeEditorService.getFocusedCodeEditor() ?? this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode() ?? this.mainContainer;
  }
  get mainContainerDimension() {
    return fl(this.mainContainer);
  }
  get activeContainerDimension() {
    return fl(this.activeContainer);
  }
  get containers() {
    return h(this._codeEditorService.listCodeEditors().map((e206) => e206.getContainerDomNode()));
  }
  getContainer() {
    return this.activeContainer;
  }
  whenContainerStylesLoaded() {
  }
  focus() {
    this._codeEditorService.getFocusedCodeEditor()?.focus();
  }
  constructor(e206) {
    this._codeEditorService = e206, this.onDidLayoutMainContainer = O.None, this.onDidLayoutActiveContainer = O.None, this.onDidLayoutContainer = O.None, this.onDidChangeActiveContainer = O.None, this.onDidAddContainer = O.None, this.mainContainerOffset = { top: 0, quickPickTop: 0 }, this.activeContainerOffset = { top: 0, quickPickTop: 0 };
  }
};
Uk = Vk([Hk(0, Su)], Uk);
var Wk = class extends Uk {
  get mainContainer() {
    return this._container;
  }
  constructor(e206, t10) {
    super(t10), this._container = e206;
  }
};
Wk = Vk([Hk(1, Su)], Wk), Zf(Bk, Uk, 1);
var Gk = xu(`dialogService`), mpe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Kk = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
};
function qk(e206) {
  return e206.scheme === xs.file ? e206.fsPath : e206.path;
}
var Jk = 0, Yk = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.id = ++Jk, this.type = 0, this.actual = e206, this.label = e206.label, this.confirmBeforeUndo = e206.confirmBeforeUndo || false, this.resourceLabel = t10, this.strResource = n10, this.resourceLabels = [this.resourceLabel], this.strResources = [this.strResource], this.groupId = r10, this.groupOrder = i10, this.sourceId = a10, this.sourceOrder = o10, this.isValid = true;
  }
  setValid(e206) {
    this.isValid = e206;
  }
  toString() {
    return `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? `  VALID` : `INVALID`}] ${this.actual.constructor.name} - ${this.actual}`;
  }
}, Xk = class {
  constructor(e206, t10) {
    this.resourceLabel = e206, this.reason = t10;
  }
}, Zk = class {
  constructor() {
    this.elements = /* @__PURE__ */ new Map();
  }
  createMessage() {
    let e206 = [], t10 = [];
    for (let [, n11] of this.elements) (n11.reason === 0 ? e206 : t10).push(n11.resourceLabel);
    let n10 = [];
    return e206.length > 0 && n10.push(C(2030, `The following files have been closed and modified on disk: {0}.`, e206.join(`, `))), t10.length > 0 && n10.push(C(2031, `The following files have been modified in an incompatible way: {0}.`, t10.join(`, `))), n10.join(`
`);
  }
  get size() {
    return this.elements.size;
  }
  has(e206) {
    return this.elements.has(e206);
  }
  set(e206, t10) {
    this.elements.set(e206, t10);
  }
  delete(e206) {
    return this.elements.delete(e206);
  }
}, hpe = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.id = ++Jk, this.type = 1, this.actual = e206, this.label = e206.label, this.confirmBeforeUndo = e206.confirmBeforeUndo || false, this.resourceLabels = t10, this.strResources = n10, this.groupId = r10, this.groupOrder = i10, this.sourceId = a10, this.sourceOrder = o10, this.removedResources = null, this.invalidatedResources = null;
  }
  canSplit() {
    return typeof this.actual.split == `function`;
  }
  removeResource(e206, t10, n10) {
    this.removedResources || (this.removedResources = new Zk()), this.removedResources.has(t10) || this.removedResources.set(t10, new Xk(e206, n10));
  }
  setValid(e206, t10, n10) {
    n10 ? this.invalidatedResources && (this.invalidatedResources.delete(t10), this.invalidatedResources.size === 0 && (this.invalidatedResources = null)) : (this.invalidatedResources || (this.invalidatedResources = new Zk()), this.invalidatedResources.has(t10) || this.invalidatedResources.set(t10, new Xk(e206, 0)));
  }
  toString() {
    return `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? `INVALID` : `  VALID`}] ${this.actual.constructor.name} - ${this.actual}`;
  }
}, Qk = class {
  constructor(e206, t10) {
    this.resourceLabel = e206, this.strResource = t10, this._past = [], this._future = [], this.locked = false, this.versionId = 1;
  }
  dispose() {
    for (let e206 of this._past) e206.type === 1 && e206.removeResource(this.resourceLabel, this.strResource, 0);
    for (let e206 of this._future) e206.type === 1 && e206.removeResource(this.resourceLabel, this.strResource, 0);
    this.versionId++;
  }
  toString() {
    let e206 = [];
    e206.push(`* ${this.strResource}:`);
    for (let t10 = 0; t10 < this._past.length; t10++) e206.push(`   * [UNDO] ${this._past[t10]}`);
    for (let t10 = this._future.length - 1; t10 >= 0; t10--) e206.push(`   * [REDO] ${this._future[t10]}`);
    return e206.join(`
`);
  }
  flushAllElements() {
    this._past = [], this._future = [], this.versionId++;
  }
  _setElementValidFlag(e206, t10) {
    e206.type === 1 ? e206.setValid(this.resourceLabel, this.strResource, t10) : e206.setValid(t10);
  }
  setElementsValidFlag(e206, t10) {
    for (let n10 of this._past) t10(n10.actual) && this._setElementValidFlag(n10, e206);
    for (let n10 of this._future) t10(n10.actual) && this._setElementValidFlag(n10, e206);
  }
  pushElement(e206) {
    for (let e207 of this._future) e207.type === 1 && e207.removeResource(this.resourceLabel, this.strResource, 1);
    this._future = [], this._past.push(e206), this.versionId++;
  }
  createSnapshot(e206) {
    let t10 = [];
    for (let e207 = 0, n10 = this._past.length; e207 < n10; e207++) t10.push(this._past[e207].id);
    for (let e207 = this._future.length - 1; e207 >= 0; e207--) t10.push(this._future[e207].id);
    return new TO(e206, t10);
  }
  restoreSnapshot(e206) {
    let t10 = e206.elements.length, n10 = true, r10 = 0, i10 = -1;
    for (let a11 = 0, o10 = this._past.length; a11 < o10; a11++, r10++) {
      let o11 = this._past[a11];
      n10 && (r10 >= t10 || o11.id !== e206.elements[r10]) && (n10 = false, i10 = 0), !n10 && o11.type === 1 && o11.removeResource(this.resourceLabel, this.strResource, 0);
    }
    let a10 = -1;
    for (let i11 = this._future.length - 1; i11 >= 0; i11--, r10++) {
      let o10 = this._future[i11];
      n10 && (r10 >= t10 || o10.id !== e206.elements[r10]) && (n10 = false, a10 = i11), !n10 && o10.type === 1 && o10.removeResource(this.resourceLabel, this.strResource, 0);
    }
    i10 !== -1 && (this._past = this._past.slice(0, i10)), a10 !== -1 && (this._future = this._future.slice(a10 + 1)), this.versionId++;
  }
  getElements() {
    let e206 = [], t10 = [];
    for (let t11 of this._past) e206.push(t11.actual);
    for (let e207 of this._future) t10.push(e207.actual);
    return { past: e206, future: t10 };
  }
  getClosestPastElement() {
    return this._past.length === 0 ? null : this._past[this._past.length - 1];
  }
  getSecondClosestPastElement() {
    return this._past.length < 2 ? null : this._past[this._past.length - 2];
  }
  getClosestFutureElement() {
    return this._future.length === 0 ? null : this._future[this._future.length - 1];
  }
  hasPastElements() {
    return this._past.length > 0;
  }
  hasFutureElements() {
    return this._future.length > 0;
  }
  splitPastWorkspaceElement(e206, t10) {
    for (let n10 = this._past.length - 1; n10 >= 0; n10--) if (this._past[n10] === e206) {
      t10.has(this.strResource) ? this._past[n10] = t10.get(this.strResource) : this._past.splice(n10, 1);
      break;
    }
    this.versionId++;
  }
  splitFutureWorkspaceElement(e206, t10) {
    for (let n10 = this._future.length - 1; n10 >= 0; n10--) if (this._future[n10] === e206) {
      t10.has(this.strResource) ? this._future[n10] = t10.get(this.strResource) : this._future.splice(n10, 1);
      break;
    }
    this.versionId++;
  }
  moveBackward(e206) {
    this._past.pop(), this._future.push(e206), this.versionId++;
  }
  moveForward(e206) {
    this._future.pop(), this._past.push(e206), this.versionId++;
  }
}, $k = class {
  constructor(e206) {
    this.editStacks = e206, this._versionIds = [];
    for (let e207 = 0, t10 = this.editStacks.length; e207 < t10; e207++) this._versionIds[e207] = this.editStacks[e207].versionId;
  }
  isValid() {
    for (let e206 = 0, t10 = this.editStacks.length; e206 < t10; e206++) if (this._versionIds[e206] !== this.editStacks[e206].versionId) return false;
    return true;
  }
}, eA = new Qk(``, ``);
eA.locked = true;
var tA = class {
  constructor(e206, t10) {
    this._dialogService = e206, this._notificationService = t10, this._editStacks = /* @__PURE__ */ new Map(), this._uriComparisonKeyComputers = [];
  }
  getUriComparisonKey(e206) {
    for (let t10 of this._uriComparisonKeyComputers) if (t10[0] === e206.scheme) return t10[1].getComparisonKey(e206);
    return e206.toString();
  }
  _print(e206) {
    console.log(`------------------------------------`), console.log(`AFTER ${e206}: `);
    let t10 = [];
    for (let e207 of this._editStacks) t10.push(e207[1].toString());
    console.log(t10.join(`
`));
  }
  pushElement(e206, t10 = Mde.None, n10 = EO.None) {
    if (e206.type === 0) {
      let r10 = qk(e206.resource), i10 = this.getUriComparisonKey(e206.resource);
      this._pushElement(new Yk(e206, r10, i10, t10.id, t10.nextOrder(), n10.id, n10.nextOrder()));
    } else {
      let r10 = /* @__PURE__ */ new Set(), i10 = [], a10 = [];
      for (let t11 of e206.resources) {
        let e207 = qk(t11), n11 = this.getUriComparisonKey(t11);
        r10.has(n11) || (r10.add(n11), i10.push(e207), a10.push(n11));
      }
      i10.length === 1 ? this._pushElement(new Yk(e206, i10[0], a10[0], t10.id, t10.nextOrder(), n10.id, n10.nextOrder())) : this._pushElement(new hpe(e206, i10, a10, t10.id, t10.nextOrder(), n10.id, n10.nextOrder()));
    }
  }
  _pushElement(e206) {
    for (let t10 = 0, n10 = e206.strResources.length; t10 < n10; t10++) {
      let n11 = e206.resourceLabels[t10], r10 = e206.strResources[t10], i10;
      this._editStacks.has(r10) ? i10 = this._editStacks.get(r10) : (i10 = new Qk(n11, r10), this._editStacks.set(r10, i10)), i10.pushElement(e206);
    }
  }
  getLastElement(e206) {
    let t10 = this.getUriComparisonKey(e206);
    if (this._editStacks.has(t10)) {
      let e207 = this._editStacks.get(t10);
      if (e207.hasFutureElements()) return null;
      let n10 = e207.getClosestPastElement();
      return n10 ? n10.actual : null;
    }
    return null;
  }
  _splitPastWorkspaceElement(e206, t10) {
    let n10 = e206.actual.split(), r10 = /* @__PURE__ */ new Map();
    for (let e207 of n10) {
      let t11 = new Yk(e207, qk(e207.resource), this.getUriComparisonKey(e207.resource), 0, 0, 0, 0);
      r10.set(t11.strResource, t11);
    }
    for (let n11 of e206.strResources) t10 && t10.has(n11) || this._editStacks.get(n11).splitPastWorkspaceElement(e206, r10);
  }
  _splitFutureWorkspaceElement(e206, t10) {
    let n10 = e206.actual.split(), r10 = /* @__PURE__ */ new Map();
    for (let e207 of n10) {
      let t11 = new Yk(e207, qk(e207.resource), this.getUriComparisonKey(e207.resource), 0, 0, 0, 0);
      r10.set(t11.strResource, t11);
    }
    for (let n11 of e206.strResources) t10 && t10.has(n11) || this._editStacks.get(n11).splitFutureWorkspaceElement(e206, r10);
  }
  removeElements(e206) {
    let t10 = typeof e206 == `string` ? e206 : this.getUriComparisonKey(e206);
    this._editStacks.has(t10) && (this._editStacks.get(t10).dispose(), this._editStacks.delete(t10));
  }
  setElementsValidFlag(e206, t10, n10) {
    let r10 = this.getUriComparisonKey(e206);
    this._editStacks.has(r10) && this._editStacks.get(r10).setElementsValidFlag(t10, n10);
  }
  createSnapshot(e206) {
    let t10 = this.getUriComparisonKey(e206);
    return this._editStacks.has(t10) ? this._editStacks.get(t10).createSnapshot(e206) : new TO(e206, []);
  }
  restoreSnapshot(e206) {
    let t10 = this.getUriComparisonKey(e206.resource);
    if (this._editStacks.has(t10)) {
      let n10 = this._editStacks.get(t10);
      n10.restoreSnapshot(e206), !n10.hasPastElements() && !n10.hasFutureElements() && (n10.dispose(), this._editStacks.delete(t10));
    }
  }
  getElements(e206) {
    let t10 = this.getUriComparisonKey(e206);
    return this._editStacks.has(t10) ? this._editStacks.get(t10).getElements() : { past: [], future: [] };
  }
  _findClosestUndoElementWithSource(e206) {
    if (!e206) return [null, null];
    let t10 = null, n10 = null;
    for (let [r10, i10] of this._editStacks) {
      let a10 = i10.getClosestPastElement();
      a10 && a10.sourceId === e206 && (!t10 || a10.sourceOrder > t10.sourceOrder) && (t10 = a10, n10 = r10);
    }
    return [t10, n10];
  }
  canUndo(e206) {
    if (e206 instanceof EO) {
      let [, t11] = this._findClosestUndoElementWithSource(e206.id);
      return !!t11;
    }
    let t10 = this.getUriComparisonKey(e206);
    return this._editStacks.has(t10) ? this._editStacks.get(t10).hasPastElements() : false;
  }
  _onError(e206, t10) {
    be(e206);
    for (let e207 of t10.strResources) this.removeElements(e207);
    this._notificationService.error(e206);
  }
  _acquireLocks(e206) {
    for (let t10 of e206.editStacks) if (t10.locked) throw Error(`Cannot acquire edit stack lock`);
    for (let t10 of e206.editStacks) t10.locked = true;
    return () => {
      for (let t10 of e206.editStacks) t10.locked = false;
    };
  }
  _safeInvokeWithLocks(e206, t10, n10, r10, i10) {
    let a10 = this._acquireLocks(n10), o10;
    try {
      o10 = t10();
    } catch (t11) {
      return a10(), r10.dispose(), this._onError(t11, e206);
    }
    return o10 ? o10.then(() => (a10(), r10.dispose(), i10()), (t11) => (a10(), r10.dispose(), this._onError(t11, e206))) : (a10(), r10.dispose(), i10());
  }
  async _invokeWorkspacePrepare(e206) {
    if (e206.actual.prepareUndoRedo === void 0) return D.None;
    let t10 = e206.actual.prepareUndoRedo();
    return t10 === void 0 ? D.None : t10;
  }
  _invokeResourcePrepare(e206, t10) {
    if (e206.actual.type !== 1 || e206.actual.prepareUndoRedo === void 0) return t10(D.None);
    let n10 = e206.actual.prepareUndoRedo();
    return n10 ? Gt(n10) ? t10(n10) : n10.then((e207) => t10(e207)) : t10(D.None);
  }
  _getAffectedEditStacks(e206) {
    let t10 = [];
    for (let n10 of e206.strResources) t10.push(this._editStacks.get(n10) || eA);
    return new $k(t10);
  }
  _tryToSplitAndUndo(e206, t10, n10, r10) {
    if (t10.canSplit()) return this._splitPastWorkspaceElement(t10, n10), this._notificationService.warn(r10), new nA(this._undo(e206, 0, true));
    for (let e207 of t10.strResources) this.removeElements(e207);
    return this._notificationService.warn(r10), new nA();
  }
  _checkWorkspaceUndo(e206, t10, n10, r10) {
    if (t10.removedResources) return this._tryToSplitAndUndo(e206, t10, t10.removedResources, C(2032, `Could not undo '{0}' across all files. {1}`, t10.label, t10.removedResources.createMessage()));
    if (r10 && t10.invalidatedResources) return this._tryToSplitAndUndo(e206, t10, t10.invalidatedResources, C(2033, `Could not undo '{0}' across all files. {1}`, t10.label, t10.invalidatedResources.createMessage()));
    let i10 = [];
    for (let e207 of n10.editStacks) e207.getClosestPastElement() !== t10 && i10.push(e207.resourceLabel);
    if (i10.length > 0) return this._tryToSplitAndUndo(e206, t10, null, C(2034, `Could not undo '{0}' across all files because changes were made to {1}`, t10.label, i10.join(`, `)));
    let a10 = [];
    for (let e207 of n10.editStacks) e207.locked && a10.push(e207.resourceLabel);
    return a10.length > 0 ? this._tryToSplitAndUndo(e206, t10, null, C(2035, `Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}`, t10.label, a10.join(`, `))) : n10.isValid() ? null : this._tryToSplitAndUndo(e206, t10, null, C(2036, `Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime`, t10.label));
  }
  _workspaceUndo(e206, t10, n10) {
    let r10 = this._getAffectedEditStacks(t10), i10 = this._checkWorkspaceUndo(e206, t10, r10, false);
    return i10 ? i10.returnValue : this._confirmAndExecuteWorkspaceUndo(e206, t10, r10, n10);
  }
  _isPartOfUndoGroup(e206) {
    if (!e206.groupId) return false;
    for (let [, t10] of this._editStacks) {
      let n10 = t10.getClosestPastElement();
      if (n10) {
        if (n10 === e206) {
          let n11 = t10.getSecondClosestPastElement();
          if (n11 && n11.groupId === e206.groupId) return true;
        }
        if (n10.groupId === e206.groupId) return true;
      }
    }
    return false;
  }
  async _confirmAndExecuteWorkspaceUndo(e206, t10, n10, r10) {
    if (t10.canSplit() && !this._isPartOfUndoGroup(t10)) {
      let i11;
      (function(e207) {
        e207[e207.All = 0] = `All`, e207[e207.This = 1] = `This`, e207[e207.Cancel = 2] = `Cancel`;
      })(i11 || (i11 = {}));
      let { result: a11 } = await this._dialogService.prompt({ type: lw.Info, message: C(2037, `Would you like to undo '{0}' across all files?`, t10.label), buttons: [{ label: C(2038, `&&Undo in {0} Files`, n10.editStacks.length), run: () => i11.All }, { label: C(2039, `Undo this &&File`), run: () => i11.This }], cancelButton: { run: () => i11.Cancel } });
      if (a11 === i11.Cancel) return;
      if (a11 === i11.This) return this._splitPastWorkspaceElement(t10, null), this._undo(e206, 0, true);
      let o10 = this._checkWorkspaceUndo(e206, t10, n10, false);
      if (o10) return o10.returnValue;
      r10 = true;
    }
    let i10;
    try {
      i10 = await this._invokeWorkspacePrepare(t10);
    } catch (e207) {
      return this._onError(e207, t10);
    }
    let a10 = this._checkWorkspaceUndo(e206, t10, n10, true);
    if (a10) return i10.dispose(), a10.returnValue;
    for (let e207 of n10.editStacks) e207.moveBackward(t10);
    return this._safeInvokeWithLocks(t10, () => t10.actual.undo(), n10, i10, () => this._continueUndoInGroup(t10.groupId, r10));
  }
  _resourceUndo(e206, t10, n10) {
    if (!t10.isValid) {
      e206.flushAllElements();
      return;
    }
    if (e206.locked) {
      let e207 = C(2040, `Could not undo '{0}' because there is already an undo or redo operation running.`, t10.label);
      this._notificationService.warn(e207);
      return;
    }
    return this._invokeResourcePrepare(t10, (r10) => (e206.moveBackward(t10), this._safeInvokeWithLocks(t10, () => t10.actual.undo(), new $k([e206]), r10, () => this._continueUndoInGroup(t10.groupId, n10))));
  }
  _findClosestUndoElementInGroup(e206) {
    if (!e206) return [null, null];
    let t10 = null, n10 = null;
    for (let [r10, i10] of this._editStacks) {
      let a10 = i10.getClosestPastElement();
      a10 && a10.groupId === e206 && (!t10 || a10.groupOrder > t10.groupOrder) && (t10 = a10, n10 = r10);
    }
    return [t10, n10];
  }
  _continueUndoInGroup(e206, t10) {
    if (!e206) return;
    let [, n10] = this._findClosestUndoElementInGroup(e206);
    if (n10) return this._undo(n10, 0, t10);
  }
  undo(e206) {
    if (e206 instanceof EO) {
      let [, t10] = this._findClosestUndoElementWithSource(e206.id);
      return t10 ? this._undo(t10, e206.id, false) : void 0;
    }
    return typeof e206 == `string` ? this._undo(e206, 0, false) : this._undo(this.getUriComparisonKey(e206), 0, false);
  }
  _undo(e206, t10 = 0, n10) {
    if (!this._editStacks.has(e206)) return;
    let r10 = this._editStacks.get(e206), i10 = r10.getClosestPastElement();
    if (i10) {
      if (i10.groupId) {
        let [e207, r11] = this._findClosestUndoElementInGroup(i10.groupId);
        if (i10 !== e207 && r11) return this._undo(r11, t10, n10);
      }
      if ((i10.sourceId !== t10 || i10.confirmBeforeUndo) && !n10) return this._confirmAndContinueUndo(e206, t10, i10);
      try {
        return i10.type === 1 ? this._workspaceUndo(e206, i10, n10) : this._resourceUndo(r10, i10, n10);
      } finally {
      }
    }
  }
  async _confirmAndContinueUndo(e206, t10, n10) {
    if ((await this._dialogService.confirm({ message: C(2041, `Would you like to undo '{0}'?`, n10.label), primaryButton: C(2042, `&&Yes`), cancelButton: C(2043, `No`) })).confirmed) return this._undo(e206, t10, true);
  }
  _findClosestRedoElementWithSource(e206) {
    if (!e206) return [null, null];
    let t10 = null, n10 = null;
    for (let [r10, i10] of this._editStacks) {
      let a10 = i10.getClosestFutureElement();
      a10 && a10.sourceId === e206 && (!t10 || a10.sourceOrder < t10.sourceOrder) && (t10 = a10, n10 = r10);
    }
    return [t10, n10];
  }
  canRedo(e206) {
    if (e206 instanceof EO) {
      let [, t11] = this._findClosestRedoElementWithSource(e206.id);
      return !!t11;
    }
    let t10 = this.getUriComparisonKey(e206);
    return this._editStacks.has(t10) ? this._editStacks.get(t10).hasFutureElements() : false;
  }
  _tryToSplitAndRedo(e206, t10, n10, r10) {
    if (t10.canSplit()) return this._splitFutureWorkspaceElement(t10, n10), this._notificationService.warn(r10), new nA(this._redo(e206));
    for (let e207 of t10.strResources) this.removeElements(e207);
    return this._notificationService.warn(r10), new nA();
  }
  _checkWorkspaceRedo(e206, t10, n10, r10) {
    if (t10.removedResources) return this._tryToSplitAndRedo(e206, t10, t10.removedResources, C(2044, `Could not redo '{0}' across all files. {1}`, t10.label, t10.removedResources.createMessage()));
    if (r10 && t10.invalidatedResources) return this._tryToSplitAndRedo(e206, t10, t10.invalidatedResources, C(2045, `Could not redo '{0}' across all files. {1}`, t10.label, t10.invalidatedResources.createMessage()));
    let i10 = [];
    for (let e207 of n10.editStacks) e207.getClosestFutureElement() !== t10 && i10.push(e207.resourceLabel);
    if (i10.length > 0) return this._tryToSplitAndRedo(e206, t10, null, C(2046, `Could not redo '{0}' across all files because changes were made to {1}`, t10.label, i10.join(`, `)));
    let a10 = [];
    for (let e207 of n10.editStacks) e207.locked && a10.push(e207.resourceLabel);
    return a10.length > 0 ? this._tryToSplitAndRedo(e206, t10, null, C(2047, `Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}`, t10.label, a10.join(`, `))) : n10.isValid() ? null : this._tryToSplitAndRedo(e206, t10, null, C(2048, `Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime`, t10.label));
  }
  _workspaceRedo(e206, t10) {
    let n10 = this._getAffectedEditStacks(t10), r10 = this._checkWorkspaceRedo(e206, t10, n10, false);
    return r10 ? r10.returnValue : this._executeWorkspaceRedo(e206, t10, n10);
  }
  async _executeWorkspaceRedo(e206, t10, n10) {
    let r10;
    try {
      r10 = await this._invokeWorkspacePrepare(t10);
    } catch (e207) {
      return this._onError(e207, t10);
    }
    let i10 = this._checkWorkspaceRedo(e206, t10, n10, true);
    if (i10) return r10.dispose(), i10.returnValue;
    for (let e207 of n10.editStacks) e207.moveForward(t10);
    return this._safeInvokeWithLocks(t10, () => t10.actual.redo(), n10, r10, () => this._continueRedoInGroup(t10.groupId));
  }
  _resourceRedo(e206, t10) {
    if (!t10.isValid) {
      e206.flushAllElements();
      return;
    }
    if (e206.locked) {
      let e207 = C(2049, `Could not redo '{0}' because there is already an undo or redo operation running.`, t10.label);
      this._notificationService.warn(e207);
      return;
    }
    return this._invokeResourcePrepare(t10, (n10) => (e206.moveForward(t10), this._safeInvokeWithLocks(t10, () => t10.actual.redo(), new $k([e206]), n10, () => this._continueRedoInGroup(t10.groupId))));
  }
  _findClosestRedoElementInGroup(e206) {
    if (!e206) return [null, null];
    let t10 = null, n10 = null;
    for (let [r10, i10] of this._editStacks) {
      let a10 = i10.getClosestFutureElement();
      a10 && a10.groupId === e206 && (!t10 || a10.groupOrder < t10.groupOrder) && (t10 = a10, n10 = r10);
    }
    return [t10, n10];
  }
  _continueRedoInGroup(e206) {
    if (!e206) return;
    let [, t10] = this._findClosestRedoElementInGroup(e206);
    if (t10) return this._redo(t10);
  }
  redo(e206) {
    if (e206 instanceof EO) {
      let [, t10] = this._findClosestRedoElementWithSource(e206.id);
      return t10 ? this._redo(t10) : void 0;
    }
    return typeof e206 == `string` ? this._redo(e206) : this._redo(this.getUriComparisonKey(e206));
  }
  _redo(e206) {
    if (!this._editStacks.has(e206)) return;
    let t10 = this._editStacks.get(e206), n10 = t10.getClosestFutureElement();
    if (n10) {
      if (n10.groupId) {
        let [e207, t11] = this._findClosestRedoElementInGroup(n10.groupId);
        if (n10 !== e207 && t11) return this._redo(t11);
      }
      try {
        return n10.type === 1 ? this._workspaceRedo(e206, n10) : this._resourceRedo(t10, n10);
      } finally {
      }
    }
  }
};
tA = mpe([Kk(0, Gk), Kk(1, dw)], tA);
var nA = class {
  constructor(e206) {
    this.returnValue = e206;
  }
};
Zf(wO, tA, 1);
function rA(e206, t10, n10) {
  return Math.min(Math.max(e206, t10), n10);
}
var iA = class {
  constructor() {
    this._n = 1, this._val = 0;
  }
  update(e206) {
    return this._val += (e206 - this._val) / this._n, this._n += 1, this._val;
  }
  get value() {
    return this._val;
  }
}, aA = class {
  constructor(e206) {
    this._n = 0, this._val = 0, this._values = [], this._index = 0, this._sum = 0, this._values = Array(e206), this._values.fill(0, 0, e206);
  }
  update(e206) {
    let t10 = this._values[this._index];
    return this._values[this._index] = e206, this._index = (this._index + 1) % this._values.length, this._sum -= t10, this._sum += e206, this._n < this._values.length && (this._n += 1), this._val = this._sum / this._n, this._val;
  }
  get value() {
    return this._val;
  }
}, oA = xu(`environmentService`), sA = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, cA = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, lA = xu(`ILanguageFeatureDebounceService`), uA;
(function(e206) {
  let t10 = /* @__PURE__ */ new WeakMap(), n10 = 0;
  function r10(e207) {
    let r11 = t10.get(e207);
    return r11 === void 0 && (r11 = ++n10, t10.set(e207, r11)), r11;
  }
  e206.of = r10;
})(uA || (uA = {}));
var dA = class {
  constructor(e206) {
    this._default = e206;
  }
  get(e206) {
    return this._default;
  }
  update(e206, t10) {
    return this._default;
  }
  default() {
    return this._default;
  }
}, fA = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._logService = e206, this._name = t10, this._registry = n10, this._default = r10, this._min = i10, this._max = a10, this._cache = new Td(50, 0.7);
  }
  _key(e206) {
    return e206.id + this._registry.all(e206).reduce((e207, t10) => Ls(uA.of(t10), e207), 0);
  }
  get(e206) {
    let t10 = this._key(e206), n10 = this._cache.get(t10);
    return n10 ? rA(n10.value, this._min, this._max) : this.default();
  }
  update(e206, t10) {
    let n10 = this._key(e206), r10 = this._cache.get(n10);
    r10 || (r10 = new aA(6), this._cache.set(n10, r10));
    let i10 = rA(r10.update(t10), this._min, this._max);
    return Ss(e206.uri, `output`) || this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e206.uri.toString()} is ${i10}ms`), i10;
  }
  _overall() {
    let e206 = new iA();
    for (let [, t10] of this._cache) e206.update(t10.value);
    return e206.value;
  }
  default() {
    return rA(this._overall() | 0 || this._default, this._min, this._max);
  }
}, pA = class {
  constructor(e206, t10) {
    this._logService = e206, this._data = /* @__PURE__ */ new Map(), this._isDev = t10.isExtensionDevelopment || !t10.isBuilt;
  }
  for(e206, t10, n10) {
    let r10 = n10?.min ?? 50, i10 = n10?.max ?? r10 ** 2, a10 = n10?.key ?? void 0, o10 = `${uA.of(e206)},${r10}${a10 ? `,` + a10 : ``}`, s10 = this._data.get(o10);
    return s10 || (this._isDev ? (this._logService.debug(`[DEBOUNCE: ${t10}] is disabled in developed mode`), s10 = new dA(r10 * 1.5)) : s10 = new fA(this._logService, t10, e206, this._overallAverage() | 0 || r10 * 1.5, r10, i10), this._data.set(o10, s10)), s10;
  }
  _overallAverage() {
    let e206 = new iA();
    for (let t10 of this._data.values()) e206.update(t10.default());
    return e206.value;
  }
};
pA = sA([cA(0, Ud), cA(1, oA)], pA), Zf(lA, pA, 1);
var mA = class {
  constructor(e206 = 5) {
    this.timesPerSecond = e206, this._lastRun = 0, this._minimumTimeBetweenRuns = 1e3 / e206;
  }
  runIfNotLimited(e206) {
    let t10 = Date.now();
    t10 - this._lastRun >= this._minimumTimeBetweenRuns && (this._lastRun = t10, e206());
  }
}, hA = class e132 {
  static create(t10, n10) {
    return new e132(t10, new gA(n10));
  }
  get startLineNumber() {
    return this._startLineNumber;
  }
  get endLineNumber() {
    return this._endLineNumber;
  }
  constructor(e206, t10) {
    this._startLineNumber = e206, this._tokens = t10, this._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();
  }
  toString() {
    return this._tokens.toString(this._startLineNumber);
  }
  _updateEndLineNumber() {
    this._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();
  }
  isEmpty() {
    return this._tokens.isEmpty();
  }
  getLineTokens(e206) {
    return this._startLineNumber <= e206 && e206 <= this._endLineNumber ? this._tokens.getLineTokens(e206 - this._startLineNumber) : null;
  }
  getRange() {
    let e206 = this._tokens.getRange();
    return e206 && new M(this._startLineNumber + e206.startLineNumber, e206.startColumn, this._startLineNumber + e206.endLineNumber, e206.endColumn);
  }
  removeTokens(e206) {
    let t10 = e206.startLineNumber - this._startLineNumber, n10 = e206.endLineNumber - this._startLineNumber;
    this._startLineNumber += this._tokens.removeTokens(t10, e206.startColumn - 1, n10, e206.endColumn - 1), this._updateEndLineNumber();
  }
  split(t10) {
    let n10 = t10.startLineNumber - this._startLineNumber, r10 = t10.endLineNumber - this._startLineNumber, [i10, a10, o10] = this._tokens.split(n10, t10.startColumn - 1, r10, t10.endColumn - 1);
    return [new e132(this._startLineNumber, i10), new e132(this._startLineNumber + o10, a10)];
  }
  applyEdit(e206, t10) {
    let [n10, r10, i10] = pT(t10);
    this.acceptEdit(e206, n10, r10, i10, t10.length > 0 ? t10.charCodeAt(0) : 0);
  }
  acceptEdit(e206, t10, n10, r10, i10) {
    this._acceptDeleteRange(e206), this._acceptInsertText(new j(e206.startLineNumber, e206.startColumn), t10, n10, r10, i10), this._updateEndLineNumber();
  }
  _acceptDeleteRange(e206) {
    if (e206.startLineNumber === e206.endLineNumber && e206.startColumn === e206.endColumn) return;
    let t10 = e206.startLineNumber - this._startLineNumber, n10 = e206.endLineNumber - this._startLineNumber;
    if (n10 < 0) {
      let e207 = n10 - t10;
      this._startLineNumber -= e207;
      return;
    }
    let r10 = this._tokens.getMaxDeltaLine();
    if (!(t10 >= r10 + 1)) {
      if (t10 < 0 && n10 >= r10 + 1) {
        this._startLineNumber = 0, this._tokens.clear();
        return;
      }
      if (t10 < 0) {
        let r11 = -t10;
        this._startLineNumber -= r11, this._tokens.acceptDeleteRange(e206.startColumn - 1, 0, 0, n10, e206.endColumn - 1);
      } else this._tokens.acceptDeleteRange(0, t10, e206.startColumn - 1, n10, e206.endColumn - 1);
    }
  }
  _acceptInsertText(e206, t10, n10, r10, i10) {
    if (t10 === 0 && n10 === 0) return;
    let a10 = e206.lineNumber - this._startLineNumber;
    if (a10 < 0) {
      this._startLineNumber += t10;
      return;
    }
    a10 >= this._tokens.getMaxDeltaLine() + 1 || this._tokens.acceptInsertText(a10, e206.column - 1, t10, n10, r10, i10);
  }
  reportIfInvalid(e206) {
    this._tokens.reportIfInvalid(e206, this._startLineNumber);
  }
}, gA = (_Ga = class {
  constructor(e206) {
    this._tokens = e206, this._tokenCount = e206.length / 4;
  }
  toString(e206) {
    let t10 = [];
    for (let n10 = 0; n10 < this._tokenCount; n10++) t10.push(`(${this._getDeltaLine(n10) + e206},${this._getStartCharacter(n10)}-${this._getEndCharacter(n10)})`);
    return `[${t10.join(`,`)}]`;
  }
  getMaxDeltaLine() {
    let e206 = this._getTokenCount();
    return e206 === 0 ? -1 : this._getDeltaLine(e206 - 1);
  }
  getRange() {
    let e206 = this._getTokenCount();
    if (e206 === 0) return null;
    let t10 = this._getStartCharacter(0), n10 = this._getDeltaLine(e206 - 1), r10 = this._getEndCharacter(e206 - 1);
    return new M(0, t10 + 1, n10, r10 + 1);
  }
  _getTokenCount() {
    return this._tokenCount;
  }
  _getDeltaLine(e206) {
    return this._tokens[4 * e206];
  }
  _getStartCharacter(e206) {
    return this._tokens[4 * e206 + 1];
  }
  _getEndCharacter(e206) {
    return this._tokens[4 * e206 + 2];
  }
  isEmpty() {
    return this._getTokenCount() === 0;
  }
  getLineTokens(e206) {
    let t10 = 0, n10 = this._getTokenCount() - 1;
    for (; t10 < n10; ) {
      let r10 = t10 + Math.floor((n10 - t10) / 2), i10 = this._getDeltaLine(r10);
      if (i10 < e206) t10 = r10 + 1;
      else if (i10 > e206) n10 = r10 - 1;
      else {
        let i11 = r10;
        for (; i11 > t10 && this._getDeltaLine(i11 - 1) === e206; ) i11--;
        let a10 = r10;
        for (; a10 < n10 && this._getDeltaLine(a10 + 1) === e206; ) a10++;
        return new _A2(this._tokens.subarray(4 * i11, 4 * a10 + 4));
      }
    }
    return this._getDeltaLine(t10) === e206 ? new _A2(this._tokens.subarray(4 * t10, 4 * t10 + 4)) : null;
  }
  clear() {
    this._tokenCount = 0;
  }
  removeTokens(e206, t10, n10, r10) {
    let i10 = this._tokens, a10 = this._tokenCount, o10 = 0, s10 = false, c10 = 0;
    for (let l10 = 0; l10 < a10; l10++) {
      let a11 = 4 * l10, u10 = i10[a11], d10 = i10[a11 + 1], f10 = i10[a11 + 2], p10 = i10[a11 + 3];
      if ((u10 > e206 || u10 === e206 && f10 >= t10) && (u10 < n10 || u10 === n10 && d10 <= r10)) s10 = true;
      else {
        if (o10 === 0 && (c10 = u10), s10) {
          let e207 = 4 * o10;
          i10[e207] = u10 - c10, i10[e207 + 1] = d10, i10[e207 + 2] = f10, i10[e207 + 3] = p10;
        } else c10 !== 0 && (i10[a11] = u10 - c10);
        o10++;
      }
    }
    return this._tokenCount = o10, c10;
  }
  split(t10, n10, r10, i10) {
    let a10 = this._tokens, o10 = this._tokenCount, s10 = [], c10 = [], l10 = s10, u10 = 0, d10 = 0;
    for (let e206 = 0; e206 < o10; e206++) {
      let o11 = 4 * e206, s11 = a10[o11], f10 = a10[o11 + 1], p10 = a10[o11 + 2], m10 = a10[o11 + 3];
      if (s11 > t10 || s11 === t10 && p10 >= n10) {
        if (s11 < r10 || s11 === r10 && f10 <= i10) continue;
        l10 !== c10 && (l10 = c10, u10 = 0, d10 = s11);
      }
      l10[u10++] = s11 - d10, l10[u10++] = f10, l10[u10++] = p10, l10[u10++] = m10;
    }
    return [new _Ga(new Uint32Array(s10)), new _Ga(new Uint32Array(c10)), d10];
  }
  acceptDeleteRange(e206, t10, n10, r10, i10) {
    let a10 = this._tokens, o10 = this._tokenCount, s10 = r10 - t10, c10 = 0, l10 = false;
    for (let u10 = 0; u10 < o10; u10++) {
      let d10 = 4 * u10, f10 = a10[d10], p10 = a10[d10 + 1], m10 = a10[d10 + 2], h10 = a10[d10 + 3];
      if (f10 < t10 || f10 === t10 && m10 <= n10) {
        c10++;
        continue;
      } else if (f10 === t10 && p10 < n10) f10 === r10 && m10 > i10 ? m10 -= i10 - n10 : m10 = n10;
      else if (f10 === t10 && p10 === n10) if (f10 === r10 && m10 > i10) m10 -= i10 - n10;
      else {
        l10 = true;
        continue;
      }
      else if (f10 < r10 || f10 === r10 && p10 < i10) if (f10 === r10 && m10 > i10) f10 = t10, p10 = n10, m10 = p10 + (m10 - i10);
      else {
        l10 = true;
        continue;
      }
      else if (f10 > r10) {
        if (s10 === 0 && !l10) {
          c10 = o10;
          break;
        }
        f10 -= s10;
      } else if (f10 === r10 && p10 >= i10) e206 && f10 === 0 && (p10 += e206, m10 += e206), f10 -= s10, p10 -= i10 - n10, m10 -= i10 - n10;
      else throw Error(`Not possible!`);
      let g10 = 4 * c10;
      a10[g10] = f10, a10[g10 + 1] = p10, a10[g10 + 2] = m10, a10[g10 + 3] = h10, c10++;
    }
    this._tokenCount = c10;
  }
  acceptInsertText(e206, t10, n10, r10, i10, a10) {
    let o10 = n10 === 0 && r10 === 1 && (a10 >= 48 && a10 <= 57 || a10 >= 65 && a10 <= 90 || a10 >= 97 && a10 <= 122), s10 = this._tokens, c10 = this._tokenCount;
    for (let a11 = 0; a11 < c10; a11++) {
      let c11 = 4 * a11, l10 = s10[c11], u10 = s10[c11 + 1], d10 = s10[c11 + 2];
      if (!(l10 < e206 || l10 === e206 && d10 < t10)) {
        if (l10 === e206 && d10 === t10) if (o10) d10 += 1;
        else continue;
        else if (l10 === e206 && u10 < t10 && t10 < d10) n10 === 0 ? d10 += r10 : d10 = t10;
        else {
          if (l10 === e206 && u10 === t10 && o10) continue;
          if (l10 === e206) if (l10 += n10, n10 === 0) u10 += r10, d10 += r10;
          else {
            let e207 = d10 - u10;
            u10 = i10 + (u10 - t10), d10 = u10 + e207;
          }
          else l10 += n10;
        }
        s10[c11] = l10, s10[c11 + 1] = u10, s10[c11 + 2] = d10;
      }
    }
  }
  reportIfInvalid(t10, n10) {
    for (let r10 = 0; r10 < this._tokenCount; r10++) {
      let i10 = this._getDeltaLine(r10) + n10;
      i10 < 1 ? _Ga._rateLimiter.runIfNotLimited(() => {
        console.error(`Invalid Semantic Tokens Data From Extension: lineNumber < 1`);
      }) : i10 > t10.getLineCount() ? _Ga._rateLimiter.runIfNotLimited(() => {
        console.error(`Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()`);
      }) : this._getEndCharacter(r10) > t10.getLineLength(i10) && _Ga._rateLimiter.runIfNotLimited(() => {
        console.error(`Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)`);
      });
    }
  }
}, _Ga._rateLimiter = new mA(10 / 60), _Ga), _A2 = class {
  constructor(e206) {
    this._tokens = e206;
  }
  getCount() {
    return this._tokens.length / 4;
  }
  getStartCharacter(e206) {
    return this._tokens[4 * e206 + 1];
  }
  getEndCharacter(e206) {
    return this._tokens[4 * e206 + 2];
  }
  getMetadata(e206) {
    return this._tokens[4 * e206 + 3];
  }
}, vA = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, yA = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, bA = class {
  constructor(e206, t10, n10, r10) {
    this._legend = e206, this._themeService = t10, this._languageService = n10, this._logService = r10, this._hasWarnedOverlappingTokens = false, this._hasWarnedInvalidLengthTokens = false, this._hasWarnedInvalidEditStart = false, this._hashTable = new CA();
  }
  getMetadata(e206, t10, n10) {
    let r10 = this._languageService.languageIdCodec.encodeLanguageId(n10), i10 = this._hashTable.get(e206, t10, r10), a10;
    if (i10) a10 = i10.metadata;
    else {
      let i11 = this._legend.tokenTypes[e206], o10 = [];
      if (i11) {
        let e207 = t10;
        for (let t11 = 0; e207 > 0 && t11 < this._legend.tokenModifiers.length; t11++) e207 & 1 && o10.push(this._legend.tokenModifiers[t11]), e207 >>= 1;
        let r11 = this._themeService.getColorTheme().getTokenStyleMetadata(i11, o10, n10);
        if (r11 === void 0) a10 = 2147483647;
        else {
          if (a10 = 0, r11.italic !== void 0) {
            let e208 = !!r11.italic << 11;
            a10 |= e208 | 1;
          }
          if (r11.bold !== void 0) {
            let e208 = (r11.bold ? 2 : 0) << 11;
            a10 |= e208 | 2;
          }
          if (r11.underline !== void 0) {
            let e208 = (r11.underline ? 4 : 0) << 11;
            a10 |= e208 | 4;
          }
          if (r11.strikethrough !== void 0) {
            let e208 = (r11.strikethrough ? 8 : 0) << 11;
            a10 |= e208 | 8;
          }
          if (r11.foreground) {
            let e208 = r11.foreground << 15;
            a10 |= e208 | 16;
          }
          a10 === 0 && (a10 = 2147483647);
        }
      } else a10 = 2147483647, i11 = `not-in-legend`;
      this._hashTable.add(e206, t10, r10, a10);
    }
    return a10;
  }
  warnOverlappingSemanticTokens(e206, t10) {
    this._hasWarnedOverlappingTokens || (this._hasWarnedOverlappingTokens = true, this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e206}, column ${t10}`));
  }
  warnInvalidLengthSemanticTokens(e206, t10) {
    this._hasWarnedInvalidLengthTokens || (this._hasWarnedInvalidLengthTokens = true, this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e206}, column ${t10}`));
  }
  warnInvalidEditStart(e206, t10, n10, r10, i10) {
    this._hasWarnedInvalidEditStart || (this._hasWarnedInvalidEditStart = true, this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e206}, resultId: ${t10}) at edit #${n10}: The provided start offset ${r10} is outside the previous data (length ${i10}).`));
  }
};
bA = vA([yA(1, US), yA(2, Jf), yA(3, Ud)], bA);
function xA(e206, t10, n10) {
  let r10 = e206.data, i10 = e206.data.length / 5 | 0, a10 = Math.max(Math.ceil(i10 / 1024), 400), o10 = [], s10 = 0, c10 = 1, l10 = 0;
  for (; s10 < i10; ) {
    let e207 = s10, u10 = Math.min(e207 + a10, i10);
    if (u10 < i10) {
      let t11 = u10;
      for (; t11 - 1 > e207 && r10[5 * t11] === 0; ) t11--;
      if (t11 - 1 === e207) {
        let e208 = u10;
        for (; e208 + 1 < i10 && r10[5 * e208] === 0; ) e208++;
        u10 = e208;
      } else u10 = t11;
    }
    let d10 = new Uint32Array((u10 - e207) * 4), f10 = 0, p10 = 0, m10 = 0, h10 = 0;
    for (; s10 < u10; ) {
      let e208 = 5 * s10, i11 = r10[e208], a11 = r10[e208 + 1], o11 = c10 + i11 | 0, u11 = i11 === 0 ? l10 + a11 | 0 : a11, g11 = u11 + r10[e208 + 2] | 0, _10 = r10[e208 + 3], v10 = r10[e208 + 4];
      if (g11 <= u11) t10.warnInvalidLengthSemanticTokens(o11, u11 + 1);
      else if (m10 === o11 && h10 > u11) t10.warnOverlappingSemanticTokens(o11, u11 + 1);
      else {
        let e209 = t10.getMetadata(_10, v10, n10);
        e209 !== 2147483647 && (p10 === 0 && (p10 = o11), d10[f10] = o11 - p10, d10[f10 + 1] = u11, d10[f10 + 2] = g11, d10[f10 + 3] = e209, f10 += 4, m10 = o11, h10 = g11);
      }
      c10 = o11, l10 = u11, s10++;
    }
    f10 !== d10.length && (d10 = d10.subarray(0, f10));
    let g10 = hA.create(p10, d10);
    o10.push(g10);
  }
  return o10;
}
var SA = class {
  constructor(e206, t10, n10, r10) {
    this.tokenTypeIndex = e206, this.tokenModifierSet = t10, this.languageId = n10, this.metadata = r10, this.next = null;
  }
}, CA = (_Ha = class {
  constructor() {
    this._elementsCount = 0, this._currentLengthIndex = 0, this._currentLength = _Ha._SIZES[this._currentLengthIndex], this._growCount = Math.round(this._currentLengthIndex + 1 < _Ha._SIZES.length ? 2 / 3 * this._currentLength : 0), this._elements = [], _Ha._nullOutEntries(this._elements, this._currentLength);
  }
  static _nullOutEntries(e206, t10) {
    for (let n10 = 0; n10 < t10; n10++) e206[n10] = null;
  }
  _hash2(e206, t10) {
    return (e206 << 5) - e206 + t10 | 0;
  }
  _hashFunc(e206, t10, n10) {
    return this._hash2(this._hash2(e206, t10), n10) % this._currentLength;
  }
  get(e206, t10, n10) {
    let r10 = this._hashFunc(e206, t10, n10), i10 = this._elements[r10];
    for (; i10; ) {
      if (i10.tokenTypeIndex === e206 && i10.tokenModifierSet === t10 && i10.languageId === n10) return i10;
      i10 = i10.next;
    }
    return null;
  }
  add(t10, n10, r10, i10) {
    if (this._elementsCount++, this._growCount !== 0 && this._elementsCount >= this._growCount) {
      let t11 = this._elements;
      this._currentLengthIndex++, this._currentLength = _Ha._SIZES[this._currentLengthIndex], this._growCount = Math.round(this._currentLengthIndex + 1 < _Ha._SIZES.length ? 2 / 3 * this._currentLength : 0), this._elements = [], _Ha._nullOutEntries(this._elements, this._currentLength);
      for (let e206 of t11) {
        let t12 = e206;
        for (; t12; ) {
          let e207 = t12.next;
          t12.next = null, this._add(t12), t12 = e207;
        }
      }
    }
    this._add(new SA(t10, n10, r10, i10));
  }
  _add(e206) {
    let t10 = this._hashFunc(e206.tokenTypeIndex, e206.tokenModifierSet, e206.languageId);
    e206.next = this._elements[t10], this._elements[t10] = e206;
  }
}, _Ha._SIZES = [3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143], _Ha), wA = xu(`semanticTokensStylingService`), TA = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, EA = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, DA = class extends D {
  constructor(e206, t10, n10) {
    super(), this._themeService = e206, this._logService = t10, this._languageService = n10, this._caches = /* @__PURE__ */ new WeakMap(), this._register(this._themeService.onDidColorThemeChange(() => {
      this._caches = /* @__PURE__ */ new WeakMap();
    }));
  }
  getStyling(e206) {
    return this._caches.has(e206) || this._caches.set(e206, new bA(e206.getLegend(), this._themeService, this._languageService, this._logService)), this._caches.get(e206);
  }
};
DA = TA([EA(0, US), EA(1, Ud), EA(2, Jf)], DA), Zf(wA, DA, 1);
var OA = `[/\\\\]`, kA = `[^/\\\\]`, AA = /\//g;
function jA(e206, t10) {
  switch (e206) {
    case 0:
      return ``;
    case 1:
      return `${kA}*?`;
    default:
      return `(?:${OA}|${kA}+${OA}${t10 ? `|${OA}${kA}+` : ``})*?`;
  }
}
function MA(e206, t10) {
  if (!e206) return [];
  let n10 = [], r10 = false, i10 = false, a10 = ``;
  for (let o10 of e206) {
    switch (o10) {
      case t10:
        if (!r10 && !i10) {
          n10.push(a10), a10 = ``;
          continue;
        }
        break;
      case `{`:
        r10 = true;
        break;
      case `}`:
        r10 = false;
        break;
      case `[`:
        i10 = true;
        break;
      case `]`:
        i10 = false;
        break;
    }
    a10 += o10;
  }
  return a10 && n10.push(a10), n10;
}
function NA(e206) {
  if (!e206) return ``;
  let t10 = ``, n10 = MA(e206, `/`);
  if (n10.every((e207) => e207 === `**`)) t10 = `.*`;
  else {
    let e207 = false;
    n10.forEach((r10, i10) => {
      if (r10 === `**`) {
        if (e207) return;
        t10 += jA(2, i10 === n10.length - 1);
      } else {
        let e208 = false, a10 = ``, o10 = false, s10 = ``;
        for (let n11 of r10) {
          if (n11 !== `}` && e208) {
            a10 += n11;
            continue;
          }
          if (o10 && (n11 !== `]` || !s10)) {
            let e209;
            e209 = n11 === `-` ? n11 : (n11 === `^` || n11 === `!`) && !s10 ? `^` : n11 === `/` ? `` : za(n11), s10 += e209;
            continue;
          }
          switch (n11) {
            case `{`:
              e208 = true;
              continue;
            case `[`:
              o10 = true;
              continue;
            case `}`: {
              let n12 = `(?:${MA(a10, `,`).map((e209) => NA(e209)).join(`|`)})`;
              t10 += n12, e208 = false, a10 = ``;
              break;
            }
            case `]`:
              t10 += `[` + s10 + `]`, o10 = false, s10 = ``;
              break;
            case `?`:
              t10 += kA;
              continue;
            case `*`:
              t10 += jA(1);
              continue;
            default:
              t10 += za(n11);
          }
        }
        i10 < n10.length - 1 && (n10[i10 + 1] !== `**` || i10 + 2 < n10.length) && (t10 += OA);
      }
      e207 = r10 === `**`;
    });
  }
  return t10;
}
var PA = /^\*\*\/\*\.[\w\.-]+$/, FA = /^\*\*\/([\w\.-]+)\/?$/, IA = /^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/, LA = /^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/, RA = /^\*\*((\/[\w\.-]+)+)\/?$/, zA = /^([\w\.-]+(\/[\w\.-]+)*)\/?$/, BA = new Td(1e4), VA = function() {
  return false;
}, HA = function() {
  return null;
};
function UA(e206, t10) {
  if (!e206) return HA;
  let n10;
  n10 = typeof e206 == `string` ? e206 : e206.pattern, n10 = n10.trim();
  let r10 = t10.ignoreCase ?? false, i10 = { ...t10, equals: r10 ? to : (e207, t11) => e207 === t11, endsWith: r10 ? Ste : (e207, t11) => e207.endsWith(t11), isEqualOrParent: (e207, t11) => jd(e207, t11, !Et || r10) }, a10 = `${r10 ? n10.toLowerCase() : n10}_${!!t10.trimForExclusions}_${r10}`, o10 = BA.get(a10);
  if (o10) return WA(o10, e206, i10);
  let s10;
  return o10 = PA.test(n10) ? KA(n10.substring(4), n10, i10) : (s10 = FA.exec(GA(n10, i10))) ? qA(s10[1], n10, i10) : (t10.trimForExclusions ? LA : IA).test(n10) ? JA(n10, i10) : (s10 = RA.exec(GA(n10, i10))) ? YA(s10[1].substring(1), n10, true, i10) : (s10 = zA.exec(GA(n10, i10))) ? YA(s10[1], n10, false, i10) : XA(n10, i10), BA.set(a10, o10), WA(o10, e206, i10);
}
function WA(e206, t10, n10) {
  if (typeof t10 == `string`) return e206;
  let r10 = function(r11, i10) {
    return n10.isEqualOrParent(r11, t10.base) ? e206(Ba(r11.substring(t10.base.length), Xr), i10) : null;
  };
  return r10.allBasenames = e206.allBasenames, r10.allPaths = e206.allPaths, r10.basenames = e206.basenames, r10.patterns = e206.patterns, r10;
}
function GA(e206, t10) {
  return t10.trimForExclusions && e206.endsWith(`/**`) ? e206.substring(0, e206.length - 2) : e206;
}
function KA(e206, t10, n10) {
  return function(r10, i10) {
    return typeof r10 == `string` && n10.endsWith(r10, e206) ? t10 : null;
  };
}
function qA(e206, t10, n10) {
  let r10 = `/${e206}`, i10 = `\\${e206}`, a10 = function(a11, o11) {
    return typeof a11 == `string` ? o11 ? n10.equals(o11, e206) ? t10 : null : n10.equals(a11, e206) || n10.endsWith(a11, r10) || n10.endsWith(a11, i10) ? t10 : null : null;
  }, o10 = [e206];
  return a10.basenames = o10, a10.patterns = [t10], a10.allBasenames = o10, a10;
}
function JA(e206, t10) {
  let n10 = nj(e206.slice(1, -1).split(`,`).map((e207) => UA(e207, t10)).filter((e207) => e207 !== HA), e206), r10 = n10.length;
  if (!r10) return HA;
  if (r10 === 1) return n10[0];
  let i10 = function(t11, r11) {
    for (let i11 = 0, a11 = n10.length; i11 < a11; i11++) if (n10[i11](t11, r11)) return e206;
    return null;
  }, a10 = n10.find((e207) => !!e207.allBasenames);
  a10 && (i10.allBasenames = a10.allBasenames);
  let o10 = n10.reduce((e207, t11) => t11.allPaths ? e207.concat(t11.allPaths) : e207, []);
  return o10.length && (i10.allPaths = o10), i10;
}
function YA(e206, t10, n10, r10) {
  let i10 = Xr === Kr.sep, a10 = i10 ? e206 : e206.replace(AA, Xr), o10 = Xr + a10, s10 = Kr.sep + e206, c10;
  return c10 = n10 ? function(n11, c11) {
    return typeof n11 == `string` && (r10.equals(n11, a10) || r10.endsWith(n11, o10) || !i10 && (r10.equals(n11, e206) || r10.endsWith(n11, s10))) ? t10 : null;
  } : function(n11, o11) {
    return typeof n11 == `string` && (r10.equals(n11, a10) || !i10 && r10.equals(n11, e206)) ? t10 : null;
  }, c10.allPaths = [(n10 ? `*/` : `./`) + e206], c10;
}
function XA(e206, t10) {
  try {
    let n10 = RegExp(`^${NA(e206)}$`, t10.ignoreCase ? `i` : void 0);
    return function(t11) {
      return n10.lastIndex = 0, typeof t11 == `string` && n10.test(t11) ? e206 : null;
    };
  } catch {
    return HA;
  }
}
function ZA(e206, t10, n10) {
  return !e206 || typeof t10 != `string` ? false : QA(e206, n10)(t10);
}
function QA(e206, t10 = {}) {
  if (!e206) return VA;
  if (typeof e206 == `string` || $A(e206)) {
    let n10 = UA(e206, t10);
    if (n10 === HA) return VA;
    let r10 = function(e207, t11) {
      return !!n10(e207, t11);
    };
    return n10.allBasenames && (r10.allBasenames = n10.allBasenames), n10.allPaths && (r10.allPaths = n10.allPaths), r10;
  }
  return ej(e206, t10);
}
function $A(e206) {
  let t10 = e206;
  return t10 ? typeof t10.base == `string` && typeof t10.pattern == `string` : false;
}
function ej(e206, t10) {
  let n10 = nj(Object.getOwnPropertyNames(e206).map((n11) => tj(n11, e206[n11], t10)).filter((e207) => e207 !== HA)), r10 = n10.length;
  if (!r10) return HA;
  if (!n10.some((e207) => !!e207.requiresSiblings)) {
    if (r10 === 1) return n10[0];
    let e207 = function(e208, t12) {
      let r11;
      for (let i12 = 0, a11 = n10.length; i12 < a11; i12++) {
        let a12 = n10[i12](e208, t12);
        if (typeof a12 == `string`) return a12;
        $o(a12) && (r11 || (r11 = []), r11.push(a12));
      }
      return r11 ? (async () => {
        for (let e209 of r11) {
          let t13 = await e209;
          if (typeof t13 == `string`) return t13;
        }
        return null;
      })() : null;
    }, t11 = n10.find((e208) => !!e208.allBasenames);
    t11 && (e207.allBasenames = t11.allBasenames);
    let i11 = n10.reduce((e208, t12) => t12.allPaths ? e208.concat(t12.allPaths) : e208, []);
    return i11.length && (e207.allPaths = i11), e207;
  }
  let i10 = function(e207, t11, r11) {
    let i11, a11;
    for (let o11 = 0, s10 = n10.length; o11 < s10; o11++) {
      let s11 = n10[o11];
      s11.requiresSiblings && r11 && (t11 || (t11 = Yr(e207)), i11 || (i11 = t11.substring(0, t11.length - rte(e207).length)));
      let c10 = s11(e207, t11, i11, r11);
      if (typeof c10 == `string`) return c10;
      $o(c10) && (a11 || (a11 = []), a11.push(c10));
    }
    return a11 ? (async () => {
      for (let e208 of a11) {
        let t12 = await e208;
        if (typeof t12 == `string`) return t12;
      }
      return null;
    })() : null;
  }, a10 = n10.find((e207) => !!e207.allBasenames);
  a10 && (i10.allBasenames = a10.allBasenames);
  let o10 = n10.reduce((e207, t11) => t11.allPaths ? e207.concat(t11.allPaths) : e207, []);
  return o10.length && (i10.allPaths = o10), i10;
}
function tj(e206, t10, n10) {
  if (t10 === false) return HA;
  let r10 = UA(e206, n10);
  if (r10 === HA) return HA;
  if (typeof t10 == `boolean`) return r10;
  if (t10) {
    let n11 = t10.when;
    if (typeof n11 == `string`) {
      let t11 = (t12, i10, a10, o10) => {
        if (!o10 || !r10(t12, i10)) return null;
        let s10 = o10(n11.replace(`$(basename)`, () => a10));
        return $o(s10) ? s10.then((t13) => t13 ? e206 : null) : s10 ? e206 : null;
      };
      return t11.requiresSiblings = true, t11;
    }
  }
  return r10;
}
function nj(e206, t10) {
  let n10 = e206.filter((e207) => !!e207.basenames);
  if (n10.length < 2) return e206;
  let r10 = n10.reduce((e207, t11) => {
    let n11 = t11.basenames;
    return n11 ? e207.concat(n11) : e207;
  }, []), i10;
  if (t10) {
    i10 = [];
    for (let e207 = 0, n11 = r10.length; e207 < n11; e207++) i10.push(t10);
  } else i10 = n10.reduce((e207, t11) => {
    let n11 = t11.patterns;
    return n11 ? e207.concat(n11) : e207;
  }, []);
  let a10 = function(e207, t11) {
    if (typeof e207 != `string`) return null;
    if (!t11) {
      let n12;
      for (n12 = e207.length; n12 > 0; n12--) {
        let t12 = e207.charCodeAt(n12 - 1);
        if (t12 === 47 || t12 === 92) break;
      }
      t11 = e207.substring(n12);
    }
    let n11 = r10.indexOf(t11);
    return n11 === -1 ? null : i10[n11];
  };
  a10.basenames = r10, a10.patterns = i10, a10.allBasenames = r10;
  let o10 = e206.filter((e207) => !e207.basenames);
  return o10.push(a10), o10;
}
function rj(e206, t10, n10, r10, i10, a10) {
  if (Array.isArray(e206)) {
    let o10 = 0;
    for (let s10 of e206) {
      let e207 = rj(s10, t10, n10, r10, i10, a10);
      if (e207 === 10) return e207;
      e207 > o10 && (o10 = e207);
    }
    return o10;
  } else if (typeof e206 == `string`) return r10 ? e206 === `*` ? 5 : e206 === n10 ? 10 : 0 : 0;
  else if (e206) {
    let { language: o10, pattern: s10, scheme: c10, hasAccessToAllModels: l10, notebookType: u10 } = e206;
    if (!r10 && !l10) return 0;
    u10 && i10 && (t10 = i10);
    let d10 = 0;
    if (c10) if (c10 === t10.scheme) d10 = 10;
    else if (c10 === `*`) d10 = 5;
    else return 0;
    if (o10) if (o10 === n10) d10 = 10;
    else if (o10 === `*`) d10 = Math.max(d10, 5);
    else return 0;
    if (u10) if (u10 === a10) d10 = 10;
    else if (u10 === `*` && a10 !== void 0) d10 = Math.max(d10, 5);
    else return 0;
    if (s10) {
      let e207;
      if (e207 = typeof s10 == `string` ? s10 : { ...s10, base: qr(s10.base) }, e207 === t10.fsPath || ZA(e207, t10.fsPath)) d10 = 10;
      else return 0;
    }
    return d10;
  } else return 0;
}
function ij(e206) {
  return typeof e206 == `string` ? false : Array.isArray(e206) ? e206.every(ij) : !!e206.exclusive;
}
var aj = class {
  constructor(e206, t10, n10, r10, i10) {
    this.uri = e206, this.languageId = t10, this.notebookUri = n10, this.notebookType = r10, this.recursive = i10;
  }
  equals(e206) {
    return this.notebookType === e206.notebookType && this.languageId === e206.languageId && this.uri.toString() === e206.uri.toString() && this.notebookUri?.toString() === e206.notebookUri?.toString() && this.recursive === e206.recursive;
  }
}, oj = class e133 {
  get onDidChange() {
    return this._onDidChange.event;
  }
  constructor(e206) {
    this._notebookInfoResolver = e206, this._clock = 0, this._entries = [], this._onDidChange = new k();
  }
  register(e206, t10) {
    let n10 = { selector: e206, provider: t10, _score: -1, _time: this._clock++ };
    return this._entries.push(n10), this._lastCandidate = void 0, this._onDidChange.fire(this._entries.length), T(() => {
      if (n10) {
        let e207 = this._entries.indexOf(n10);
        e207 >= 0 && (this._entries.splice(e207, 1), this._lastCandidate = void 0, this._onDidChange.fire(this._entries.length), n10 = void 0);
      }
    });
  }
  has(e206) {
    return this.all(e206).length > 0;
  }
  all(e206) {
    if (!e206) return [];
    this._updateScores(e206, false);
    let t10 = [];
    for (let e207 of this._entries) e207._score > 0 && t10.push(e207.provider);
    return t10;
  }
  ordered(e206, t10 = false) {
    let n10 = [];
    return this._orderedForEach(e206, t10, (e207) => n10.push(e207.provider)), n10;
  }
  orderedGroups(e206) {
    let t10 = [], n10, r10;
    return this._orderedForEach(e206, false, (e207) => {
      n10 && r10 === e207._score ? n10.push(e207.provider) : (r10 = e207._score, n10 = [e207.provider], t10.push(n10));
    }), t10;
  }
  _orderedForEach(e206, t10, n10) {
    this._updateScores(e206, t10);
    for (let e207 of this._entries) e207._score > 0 && n10(e207);
  }
  _updateScores(t10, n10) {
    let r10 = this._notebookInfoResolver?.(t10.uri), i10 = r10 ? new aj(t10.uri, t10.getLanguageId(), r10.uri, r10.type, n10) : new aj(t10.uri, t10.getLanguageId(), void 0, void 0, n10);
    if (!this._lastCandidate?.equals(i10)) {
      this._lastCandidate = i10;
      for (let e206 of this._entries) if (e206._score = rj(e206.selector, i10.uri, i10.languageId, cm(t10), i10.notebookUri, i10.notebookType), ij(e206.selector) && e206._score > 0) if (n10) e206._score = 0;
      else {
        for (let e207 of this._entries) e207._score = 0;
        e206._score = 1e3;
        break;
      }
      this._entries.sort(e133._compareByScoreAndTime);
    }
  }
  static _compareByScoreAndTime(e206, t10) {
    return e206._score < t10._score ? 1 : e206._score > t10._score ? -1 : sj(e206.selector) && !sj(t10.selector) ? 1 : !sj(e206.selector) && sj(t10.selector) ? -1 : e206._time < t10._time ? 1 : e206._time > t10._time ? -1 : 0;
  }
};
function sj(e206) {
  return typeof e206 == `string` ? false : Array.isArray(e206) ? e206.some(sj) : !!e206.isBuiltin;
}
Zf(X, class {
  constructor() {
    this.referenceProvider = new oj(this._score.bind(this)), this.renameProvider = new oj(this._score.bind(this)), this.newSymbolNamesProvider = new oj(this._score.bind(this)), this.codeActionProvider = new oj(this._score.bind(this)), this.definitionProvider = new oj(this._score.bind(this)), this.typeDefinitionProvider = new oj(this._score.bind(this)), this.declarationProvider = new oj(this._score.bind(this)), this.implementationProvider = new oj(this._score.bind(this)), this.documentSymbolProvider = new oj(this._score.bind(this)), this.inlayHintsProvider = new oj(this._score.bind(this)), this.colorProvider = new oj(this._score.bind(this)), this.codeLensProvider = new oj(this._score.bind(this)), this.documentFormattingEditProvider = new oj(this._score.bind(this)), this.documentRangeFormattingEditProvider = new oj(this._score.bind(this)), this.onTypeFormattingEditProvider = new oj(this._score.bind(this)), this.signatureHelpProvider = new oj(this._score.bind(this)), this.hoverProvider = new oj(this._score.bind(this)), this.documentHighlightProvider = new oj(this._score.bind(this)), this.multiDocumentHighlightProvider = new oj(this._score.bind(this)), this.selectionRangeProvider = new oj(this._score.bind(this)), this.foldingRangeProvider = new oj(this._score.bind(this)), this.linkProvider = new oj(this._score.bind(this)), this.inlineCompletionsProvider = new oj(this._score.bind(this)), this.completionProvider = new oj(this._score.bind(this)), this.linkedEditingRangeProvider = new oj(this._score.bind(this)), this.documentRangeSemanticTokensProvider = new oj(this._score.bind(this)), this.documentSemanticTokensProvider = new oj(this._score.bind(this)), this.documentDropEditProvider = new oj(this._score.bind(this)), this.documentPasteEditProvider = new oj(this._score.bind(this));
  }
  _score(e206) {
    return this._notebookTypeResolver?.(e206);
  }
}, 1);
var cj = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, lj = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, uj = xu(`hoverService`), dj = class extends D {
  get delay() {
    return this.isInstantlyHovering() ? 0 : this.hoverOptions?.dynamicDelay ? (e206) => this.hoverOptions?.dynamicDelay?.(e206) ?? this._delay : this._delay;
  }
  constructor(e206, t10, n10 = {}, r10, i10) {
    super(), this.placement = e206, this.hoverOptions = t10, this.overrideOptions = n10, this.configurationService = r10, this.hoverService = i10, this.lastHoverHideTime = 0, this.timeLimit = 200, this.hoverDisposables = this._register(new E()), this._delay = this.configurationService.getValue(`workbench.hover.delay`), this._register(this.configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(`workbench.hover.delay`) && (this._delay = this.configurationService.getValue(`workbench.hover.delay`));
    }));
  }
  showHover(e206, t10) {
    let n10 = typeof this.overrideOptions == `function` ? this.overrideOptions(e206, t10) : this.overrideOptions;
    this.hoverDisposables.clear();
    let r10 = Fl(e206.target) ? [e206.target] : e206.target.targetElements;
    for (let e207 of r10) this.hoverDisposables.add(el(e207, `keydown`, (e208) => {
      e208.equals(9) && this.hoverService.hideHover();
    }));
    let i10 = Fl(e206.content) ? void 0 : typeof e206.content == `string` ? e206.content.toString() : e206.content.value;
    return this.hoverService.showInstantHover({ ...e206, ...n10, persistence: { hideOnKeyDown: true, ...n10.persistence }, id: i10, appearance: { ...e206.appearance, compact: true, skipFadeInAnimation: this.isInstantlyHovering(), ...n10.appearance } }, t10);
  }
  isInstantlyHovering() {
    return !!this.hoverOptions?.instantHover && Date.now() - this.lastHoverHideTime < this.timeLimit;
  }
  onDidHideHover() {
    this.hoverDisposables.clear(), this.hoverOptions?.instantHover && (this.lastHoverHideTime = Date.now());
  }
};
dj = cj([lj(3, Uf), lj(4, uj)], dj);
var fj = { showHover: function() {
  throw Error(`Native hover function not implemented.`);
}, delay: 0, showNativeHover: true }, pj = xu(`contextViewService`), mj = xu(`contextMenuService`), hj = B, gj = class extends D {
  constructor(e206) {
    super(), this.containerDomNode = document.createElement(`div`), this.containerDomNode.className = `monaco-hover`, this.containerDomNode.classList.toggle(`fade-in`, !!e206), this.containerDomNode.tabIndex = 0, this.containerDomNode.setAttribute(`role`, `tooltip`), this.contentsDomNode = document.createElement(`div`), this.contentsDomNode.className = `monaco-hover-content`, this.scrollbar = this._register(new hx(this.contentsDomNode, { consumeMouseWheelIfScrollbarIsNeeded: true })), this.containerDomNode.appendChild(this.scrollbar.getDomNode());
  }
  onContentsChanged() {
    this.scrollbar.scanDomNode();
  }
}, _j2 = class e134 extends D {
  static render(t10, n10, r10) {
    return new e134(t10, n10, r10);
  }
  constructor(e206, t10, n10) {
    super(), this.actionLabel = t10.label, this.actionKeybindingLabel = n10, this.actionContainer = z(e206, hj(`div.action-container`)), this.actionContainer.setAttribute(`tabindex`, `0`), this.action = z(this.actionContainer, hj(`a.action`)), this.action.setAttribute(`role`, `button`), t10.iconClass && z(this.action, hj(`span.icon`)).classList.add(...t10.iconClass.split(` `)), this.actionRenderedLabel = n10 ? `${t10.label} (${n10})` : t10.label;
    let r10 = z(this.action, hj(`span`));
    r10.textContent = this.actionRenderedLabel, this._store.add(new yj(this.actionContainer, t10.run)), this._store.add(new bj(this.actionContainer, t10.run, [3, 10])), this.setEnabled(true);
  }
  setEnabled(e206) {
    e206 ? (this.actionContainer.classList.remove(`disabled`), this.actionContainer.removeAttribute(`aria-disabled`)) : (this.actionContainer.classList.add(`disabled`), this.actionContainer.setAttribute(`aria-disabled`, `true`));
  }
};
function vj(e206, t10) {
  return e206 && t10 ? C(7, `Inspect this in the accessible view with {0}.`, t10) : e206 ? C(8, `Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding.`) : ``;
}
var yj = class extends D {
  constructor(e206, t10) {
    super(), this._register(L(e206, R.CLICK, (n10) => {
      n10.stopPropagation(), n10.preventDefault(), t10(e206);
    }));
  }
}, bj = class extends D {
  constructor(e206, t10, n10) {
    super(), this._register(L(e206, R.KEY_DOWN, (r10) => {
      let i10 = new Jo(r10);
      n10.some((e207) => i10.equals(e207)) && (r10.stopPropagation(), r10.preventDefault(), t10(e206));
    }));
  }
};
function xj(e206) {
  let t10 = wj(e206);
  if (t10 && t10.length > 0) return new Uint32Array(t10);
}
var Sj = 0, Cj = new Uint32Array(10);
function wj(e206) {
  if (Sj = 0, Tj(e206, Dj, 4352), Sj > 0 || (Tj(e206, Oj, 4449), Sj > 0) || (Tj(e206, kj, 4520), Sj > 0) || (Tj(e206, Aj, 12593), Sj)) return Cj.subarray(0, Sj);
  if (e206 >= 44032 && e206 <= 55203) {
    let t10 = e206 - 44032, n10 = t10 % 588, r10 = Math.floor(t10 / 588), i10 = Math.floor(n10 / 28), a10 = n10 % 28 - 1;
    if (r10 < Dj.length ? Tj(r10, Dj, 0) : 4352 + r10 - 12593 < Aj.length && Tj(4352 + r10, Aj, 12593), i10 < Oj.length ? Tj(i10, Oj, 0) : 4449 + i10 - 12593 < Aj.length && Tj(4449 + i10 - 12593, Aj, 12593), a10 >= 0 && (a10 < kj.length ? Tj(a10, kj, 0) : 4520 + a10 - 12593 < Aj.length && Tj(4520 + a10 - 12593, Aj, 12593)), Sj > 0) return Cj.subarray(0, Sj);
  }
}
function Tj(e206, t10, n10) {
  e206 >= n10 && e206 < n10 + t10.length && Ej(t10[e206 - n10]);
}
function Ej(e206) {
  e206 !== 0 && (Cj[Sj++] = e206 & 255, e206 >> 8 && (Cj[Sj++] = e206 >> 8 & 255), e206 >> 16 && (Cj[Sj++] = e206 >> 16 & 255));
}
var Dj = new Uint8Array([114, 82, 115, 101, 69, 102, 97, 113, 81, 116, 84, 100, 119, 87, 99, 122, 120, 118, 103]), Oj = new Uint16Array([107, 111, 105, 79, 106, 112, 117, 80, 104, 27496, 28520, 27752, 121, 110, 27246, 28782, 27758, 98, 109, 27757, 108]), kj = new Uint16Array([114, 82, 29810, 115, 30579, 26483, 101, 102, 29286, 24934, 29030, 29798, 30822, 30310, 26470, 97, 113, 29809, 116, 84, 100, 119, 99, 122, 120, 118, 103]), Aj = new Uint16Array([114, 82, 29810, 115, 30579, 26483, 101, 69, 102, 29286, 24934, 29030, 29798, 30822, 30310, 26470, 97, 113, 81, 29809, 116, 84, 100, 119, 87, 99, 122, 120, 118, 103, 107, 111, 105, 79, 106, 112, 117, 80, 104, 27496, 28520, 27752, 121, 110, 27246, 28782, 27758, 98, 109, 27757, 108]);
function jj(...e206) {
  return function(t10, n10) {
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
      let i11 = e206[r10](t10, n10);
      if (i11) return i11;
    }
    return null;
  };
}
Nj.bind(void 0, false);
var Mj = Nj.bind(void 0, true);
function Nj(e206, t10, n10) {
  if (!n10 || n10.length < t10.length) return null;
  let r10;
  return r10 = e206 ? no(n10, t10) : n10.indexOf(t10) === 0, r10 ? t10.length > 0 ? [{ start: 0, end: t10.length }] : [] : null;
}
function Pj(e206, t10) {
  let n10 = t10.toLowerCase().indexOf(e206.toLowerCase());
  return n10 === -1 ? null : [{ start: n10, end: n10 + e206.length }];
}
function Fj(e206, t10) {
  return Ij(e206.toLowerCase(), t10.toLowerCase(), 0, 0);
}
function Ij(e206, t10, n10, r10) {
  if (n10 === e206.length) return [];
  if (r10 === t10.length) return null;
  if (e206[n10] === t10[r10]) {
    let i10 = null;
    return (i10 = Ij(e206, t10, n10 + 1, r10 + 1)) ? qj({ start: r10, end: r10 + 1 }, i10) : null;
  }
  return Ij(e206, t10, n10, r10 + 1);
}
function Lj(e206) {
  return 97 <= e206 && e206 <= 122;
}
function Rj(e206) {
  return 65 <= e206 && e206 <= 90;
}
function zj(e206) {
  return 48 <= e206 && e206 <= 57;
}
function Bj(e206) {
  return e206 === 32 || e206 === 9 || e206 === 10 || e206 === 13;
}
var Vj = /* @__PURE__ */ new Set();
`()[]{}<>\`'"-/;:,.?!`.split(``).forEach((e206) => Vj.add(e206.charCodeAt(0)));
function Hj(e206) {
  return Bj(e206) || Vj.has(e206);
}
function Uj(e206, t10) {
  return e206 === t10 || Hj(e206) && Hj(t10);
}
var Wj = /* @__PURE__ */ new Map();
function Gj(e206) {
  if (Wj.has(e206)) return Wj.get(e206);
  let t10, n10 = xj(e206);
  return n10 && (t10 = n10), Wj.set(e206, t10), t10;
}
function Kj(e206) {
  return Lj(e206) || Rj(e206) || zj(e206);
}
function qj(e206, t10) {
  return t10.length === 0 ? t10 = [e206] : e206.end === t10[0].start ? t10[0].start = e206.start : t10.unshift(e206), t10;
}
function Jj(e206, t10) {
  for (let n10 = t10; n10 < e206.length; n10++) {
    let t11 = e206.charCodeAt(n10);
    if (Rj(t11) || zj(t11) || n10 > 0 && !Kj(e206.charCodeAt(n10 - 1))) return n10;
  }
  return e206.length;
}
function Yj(e206, t10, n10, r10) {
  if (n10 === e206.length) return [];
  if (r10 === t10.length || e206[n10] !== t10[r10].toLowerCase()) return null;
  {
    let i10 = null, a10 = r10 + 1;
    for (i10 = Yj(e206, t10, n10 + 1, r10 + 1); !i10 && (a10 = Jj(t10, a10)) < t10.length; ) i10 = Yj(e206, t10, n10 + 1, a10), a10++;
    return i10 === null ? null : qj({ start: r10, end: r10 + 1 }, i10);
  }
}
function Xj(e206) {
  let t10 = 0, n10 = 0, r10 = 0, i10 = 0, a10 = 0;
  for (let o10 = 0; o10 < e206.length; o10++) a10 = e206.charCodeAt(o10), Rj(a10) && t10++, Lj(a10) && n10++, Kj(a10) && r10++, zj(a10) && i10++;
  return { upperPercent: t10 / e206.length, lowerPercent: n10 / e206.length, alphaPercent: r10 / e206.length, numericPercent: i10 / e206.length };
}
function Zj(e206) {
  let { upperPercent: t10, lowerPercent: n10 } = e206;
  return n10 === 0 && t10 > 0.6;
}
function Qj(e206) {
  let { upperPercent: t10, lowerPercent: n10, alphaPercent: r10, numericPercent: i10 } = e206;
  return n10 > 0.2 && t10 < 0.8 && r10 > 0.6 && i10 < 0.2;
}
function $j(e206) {
  let t10 = 0, n10 = 0, r10 = 0, i10 = 0;
  for (let a10 = 0; a10 < e206.length; a10++) r10 = e206.charCodeAt(a10), Rj(r10) && t10++, Lj(r10) && n10++, Bj(r10) && i10++;
  return (t10 === 0 || n10 === 0) && i10 === 0 ? e206.length <= 30 : t10 <= 5;
}
function eM(e206, t10) {
  if (!t10 || (t10 = t10.trim(), t10.length === 0) || !$j(e206)) return null;
  t10.length > 60 && (t10 = t10.substring(0, 60));
  let n10 = Xj(t10);
  if (!Qj(n10)) {
    if (!Zj(n10)) return null;
    t10 = t10.toLowerCase();
  }
  let r10 = null, i10 = 0;
  for (e206 = e206.toLowerCase(); i10 < t10.length && (r10 = Yj(e206, t10, 0, i10)) === null; ) i10 = Jj(t10, i10 + 1);
  return r10;
}
function tM(e206, t10, n10 = false) {
  if (!t10 || t10.length === 0) return null;
  let r10 = null, i10 = 0;
  for (e206 = e206.toLowerCase(), t10 = t10.toLowerCase(); i10 < t10.length && (r10 = nM(e206, t10, 0, i10, n10), r10 === null); ) i10 = rM(t10, i10 + 1);
  return r10;
}
function nM(e206, t10, n10, r10, i10) {
  let a10 = 0;
  if (n10 === e206.length) return [];
  if (r10 === t10.length) return null;
  if (!Uj(e206.charCodeAt(n10), t10.charCodeAt(r10))) {
    let i11 = Gj(e206.charCodeAt(n10));
    if (!i11) return null;
    for (let e207 = 0; e207 < i11.length; e207++) if (!Uj(i11[e207], t10.charCodeAt(r10 + e207))) return null;
    a10 += i11.length - 1;
  }
  let o10 = null, s10 = r10 + a10 + 1;
  if (o10 = nM(e206, t10, n10 + 1, s10, i10), !i10) for (; !o10 && (s10 = rM(t10, s10)) < t10.length; ) o10 = nM(e206, t10, n10 + 1, s10, i10), s10++;
  if (!o10) return null;
  if (e206.charCodeAt(n10) !== t10.charCodeAt(r10)) {
    let i11 = Gj(e206.charCodeAt(n10));
    if (!i11) return o10;
    for (let e207 = 0; e207 < i11.length; e207++) if (i11[e207] !== t10.charCodeAt(r10 + e207)) return o10;
  }
  return qj({ start: r10, end: r10 + a10 + 1 }, o10);
}
function rM(e206, t10) {
  for (let n10 = t10; n10 < e206.length; n10++) if (Hj(e206.charCodeAt(n10)) || n10 > 0 && Hj(e206.charCodeAt(n10 - 1))) return n10;
  return e206.length;
}
var iM = jj(Mj, eM, Pj), aM = jj(Mj, eM, Fj), oM = new Td(1e4);
function sM(e206, t10, n10 = false) {
  if (typeof e206 != `string` || typeof t10 != `string`) return null;
  let r10 = oM.get(e206);
  r10 || (r10 = new RegExp(xte(e206), `i`), oM.set(e206, r10));
  let i10 = r10.exec(t10);
  return i10 ? [{ start: i10.index, end: i10.index + i10[0].length }] : n10 ? aM(e206, t10) : iM(e206, t10);
}
function cM(e206, t10) {
  let n10 = TM(e206, e206.toLowerCase(), 0, t10, t10.toLowerCase(), 0, { firstMatchCanBeWeak: true, boostFullMatch: true });
  return n10 ? uM(n10) : null;
}
function lM(e206, t10, n10, r10, i10, a10) {
  let o10 = Math.min(13, e206.length);
  for (; n10 < o10; n10++) {
    let o11 = TM(e206, t10, n10, r10, i10, a10, { firstMatchCanBeWeak: true, boostFullMatch: true });
    if (o11) return o11;
  }
  return [0, a10];
}
function uM(e206) {
  if (e206 === void 0) return [];
  let t10 = [], n10 = e206[1];
  for (let r10 = e206.length - 1; r10 > 1; r10--) {
    let i10 = e206[r10] + n10, a10 = t10[t10.length - 1];
    a10 && a10.end === i10 ? a10.end = i10 + 1 : t10.push({ start: i10, end: i10 + 1 });
  }
  return t10;
}
var dM = 128;
function fM() {
  let e206 = [], t10 = [];
  for (let e207 = 0; e207 <= dM; e207++) t10[e207] = 0;
  for (let n10 = 0; n10 <= dM; n10++) e206.push(t10.slice(0));
  return e206;
}
function pM(e206) {
  let t10 = [];
  for (let n10 = 0; n10 <= e206; n10++) t10[n10] = 0;
  return t10;
}
var mM = pM(2 * dM), hM = pM(2 * dM), gM = fM(), _M2 = fM(), vM = fM();
function yM(e206, t10) {
  if (t10 < 0 || t10 >= e206.length) return false;
  let n10 = e206.codePointAt(t10);
  switch (n10) {
    case 95:
    case 45:
    case 46:
    case 32:
    case 47:
    case 92:
    case 39:
    case 34:
    case 58:
    case 36:
    case 60:
    case 62:
    case 40:
    case 41:
    case 91:
    case 93:
    case 123:
    case 125:
      return true;
    case void 0:
      return false;
    default:
      return !!bo(n10);
  }
}
function bM(e206, t10) {
  if (t10 < 0 || t10 >= e206.length) return false;
  switch (e206.charCodeAt(t10)) {
    case 32:
    case 9:
      return true;
    default:
      return false;
  }
}
function xM(e206, t10, n10) {
  return t10[e206] !== n10[e206];
}
function SM(e206, t10, n10, r10, i10, a10, o10 = false) {
  for (; t10 < n10 && i10 < a10; ) e206[t10] === r10[i10] && (o10 && (mM[t10] = i10), t10 += 1), i10 += 1;
  return t10 === n10;
}
var CM;
(function(e206) {
  e206.Default = [-100, 0];
  function t10(e207) {
    return !e207 || e207.length === 2 && e207[0] === -100 && e207[1] === 0;
  }
  e206.isDefault = t10;
})(CM || (CM = {}));
var wM = (_Ia = class {
  constructor(e206, t10) {
    this.firstMatchCanBeWeak = e206, this.boostFullMatch = t10;
  }
}, _Ia.default = { boostFullMatch: true, firstMatchCanBeWeak: false }, _Ia);
function TM(e206, t10, n10, r10, i10, a10, o10 = wM.default) {
  let s10 = e206.length > dM ? dM : e206.length, c10 = r10.length > dM ? dM : r10.length;
  if (n10 >= s10 || a10 >= c10 || s10 - n10 > c10 - a10 || !SM(t10, n10, s10, i10, a10, c10, true)) return;
  EM(s10, c10, n10, a10, t10, i10);
  let l10 = 1, u10 = 1, d10 = n10, f10 = a10, p10 = [false];
  for (l10 = 1, d10 = n10; d10 < s10; l10++, d10++) {
    let o11 = mM[d10], m11 = hM[d10], h11 = d10 + 1 < s10 ? hM[d10 + 1] : c10;
    for (u10 = o11 - a10 + 1, f10 = o11; f10 < h11; u10++, f10++) {
      let s11 = -(2 ** 53 - 1), h12 = false;
      f10 <= m11 && (s11 = DM(e206, t10, d10, n10, r10, i10, f10, c10, a10, gM[l10 - 1][u10 - 1] === 0, p10));
      let g11 = 0;
      s11 !== -(2 ** 53 - 1) && (h12 = true, g11 = s11 + _M2[l10 - 1][u10 - 1]);
      let _11 = f10 > o11, v10 = _11 ? _M2[l10][u10 - 1] + (gM[l10][u10 - 1] > 0 ? -5 : 0) : 0, y10 = f10 > o11 + 1 && gM[l10][u10 - 1] > 0, b10 = y10 ? _M2[l10][u10 - 2] + (gM[l10][u10 - 2] > 0 ? -5 : 0) : 0;
      if (y10 && (!_11 || b10 >= v10) && (!h12 || b10 >= g11)) _M2[l10][u10] = b10, vM[l10][u10] = 3, gM[l10][u10] = 0;
      else if (_11 && (!h12 || v10 >= g11)) _M2[l10][u10] = v10, vM[l10][u10] = 2, gM[l10][u10] = 0;
      else if (h12) _M2[l10][u10] = g11, vM[l10][u10] = 1, gM[l10][u10] = gM[l10 - 1][u10 - 1] + 1;
      else throw Error(`not possible`);
    }
  }
  if (!p10[0] && !o10.firstMatchCanBeWeak) return;
  l10--, u10--;
  let m10 = [_M2[l10][u10], a10], h10 = 0, g10 = 0;
  for (; l10 >= 1; ) {
    let e207 = u10;
    do {
      let t11 = vM[l10][e207];
      if (t11 === 3) e207 -= 2;
      else if (t11 === 2) --e207;
      else break;
    } while (e207 >= 1);
    h10 > 1 && t10[n10 + l10 - 1] === i10[a10 + u10 - 1] && !xM(e207 + a10 - 1, r10, i10) && h10 + 1 > gM[l10][e207] && (e207 = u10), e207 === u10 ? h10++ : h10 = 1, g10 || (g10 = e207), l10--, u10 = e207 - 1, m10.push(u10);
  }
  c10 - a10 === s10 && o10.boostFullMatch && (m10[0] += 2);
  let _10 = g10 - s10;
  return m10[0] -= _10, m10;
}
function EM(e206, t10, n10, r10, i10, a10) {
  let o10 = e206 - 1, s10 = t10 - 1;
  for (; o10 >= n10 && s10 >= r10; ) i10[o10] === a10[s10] && (hM[o10] = s10, o10--), s10--;
}
function DM(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
  if (t10[n10] !== a10[o10]) return -(2 ** 53 - 1);
  let d10 = 1, f10 = false;
  return o10 === n10 - r10 ? d10 = e206[n10] === i10[o10] ? 7 : 5 : xM(o10, i10, a10) && (o10 === 0 || !xM(o10 - 1, i10, a10)) ? (d10 = e206[n10] === i10[o10] ? 7 : 5, f10 = true) : yM(a10, o10) && (o10 === 0 || !yM(a10, o10 - 1)) ? d10 = 5 : (yM(a10, o10 - 1) || bM(a10, o10 - 1)) && (d10 = 5, f10 = true), d10 > 1 && n10 === r10 && (u10[0] = true), f10 || (f10 = xM(o10, i10, a10) || yM(a10, o10 - 1) || bM(a10, o10 - 1)), n10 === r10 ? o10 > c10 && (d10 -= f10 ? 3 : 5) : l10 ? d10 += f10 ? 2 : 0 : d10 += +!f10, o10 + 1 === s10 && (d10 -= f10 ? 3 : 5), d10;
}
function gpe(e206, t10, n10, r10, i10, a10, o10) {
  return _pe(e206, t10, n10, r10, i10, a10, true, o10);
}
function _pe(e206, t10, n10, r10, i10, a10, o10, s10) {
  let c10 = TM(e206, t10, n10, r10, i10, a10, s10);
  if (e206.length >= 3) {
    let t11 = Math.min(7, e206.length - 1);
    for (let o11 = n10 + 1; o11 < t11; o11++) {
      let t12 = vpe(e206, o11);
      if (t12) {
        let e207 = TM(t12, t12.toLowerCase(), n10, r10, i10, a10, s10);
        e207 && (e207[0] -= 3, (!c10 || e207[0] > c10[0]) && (c10 = e207));
      }
    }
  }
  return c10;
}
function vpe(e206, t10) {
  if (t10 + 1 >= e206.length) return;
  let n10 = e206[t10], r10 = e206[t10 + 1];
  if (n10 !== r10) return e206.slice(0, t10) + r10 + n10 + e206.slice(t10 + 2);
}
var ype = `$(`, OM = RegExp(`\\$\\(${ju.iconNameExpression}(?:${ju.iconModifierExpression})?\\)`, `g`), bpe = RegExp(`(\\\\)?${OM.source}`, `g`);
function xpe(e206) {
  return e206.replace(bpe, (e207, t10) => t10 ? e207 : `\\${e207}`);
}
var Spe = RegExp(`\\\\${OM.source}`, `g`);
function Cpe(e206) {
  return e206.replace(Spe, (e207) => `\\${e207}`);
}
var wpe = RegExp(`(\\s)?(\\\\)?${OM.source}(\\s)?`, `g`);
function kM(e206) {
  return e206.indexOf(ype) === -1 ? e206 : e206.replace(wpe, (e207, t10, n10, r10) => n10 ? e207 : t10 || r10 || ``);
}
function AM(e206) {
  return e206 ? e206.replace(/\$\((.*?)\)/g, (e207, t10) => ` ${t10} `).trim() : ``;
}
var jM = RegExp(`\\$\\(${ju.iconNameCharacter}+\\)`, `g`);
function MM(e206) {
  jM.lastIndex = 0;
  let t10 = ``, n10 = [], r10 = 0;
  for (; ; ) {
    let i10 = jM.lastIndex, a10 = jM.exec(e206), o10 = e206.substring(i10, a10?.index);
    if (o10.length > 0) {
      t10 += o10;
      for (let e207 = 0; e207 < o10.length; e207++) n10.push(r10);
    }
    if (!a10) break;
    r10 += a10[0].length;
  }
  return { text: t10, iconOffsets: n10 };
}
function NM(e206, t10, n10 = false) {
  let { text: r10, iconOffsets: i10 } = t10;
  if (!i10 || i10.length === 0) return sM(e206, r10, n10);
  let a10 = Ba(r10, ` `), o10 = r10.length - a10.length, s10 = sM(e206, a10, n10);
  if (s10) for (let e207 of s10) {
    let t11 = i10[e207.start + o10] + o10;
    e207.start += t11, e207.end += t11;
  }
  return s10;
}
var PM = class {
  constructor(e206 = ``, t10 = false) {
    if (this.value = e206, typeof this.value != `string`) throw De(`value`);
    typeof t10 == `boolean` ? (this.isTrusted = t10, this.supportThemeIcons = false, this.supportHtml = false, this.supportAlertSyntax = false) : (this.isTrusted = t10.isTrusted ?? void 0, this.supportThemeIcons = t10.supportThemeIcons ?? false, this.supportHtml = t10.supportHtml ?? false, this.supportAlertSyntax = t10.supportAlertSyntax ?? false);
  }
  appendText(e206, t10 = 0) {
    return this.value += Epe(this.supportThemeIcons ? xpe(e206) : e206).replace(/([ \t]+)/g, (e207, t11) => `&nbsp;`.repeat(t11.length)).replace(/\>/gm, `\\>`).replace(/\n/g, t10 === 1 ? `\\
` : `

`), this;
  }
  appendMarkdown(e206) {
    return this.value += e206, this;
  }
  appendCodeblock(e206, t10) {
    return this.value += `
${Dpe(t10, e206)}
`, this;
  }
  appendLink(e206, t10, n10) {
    return this.value += `[`, this.value += this._escape(t10, `]`), this.value += `](`, this.value += this._escape(String(e206), `)`), n10 && (this.value += ` "${this._escape(this._escape(n10, `"`), `)`)}"`), this.value += `)`, this;
  }
  _escape(e206, t10) {
    let n10 = new RegExp(za(t10), `g`);
    return e206.replace(n10, (t11, n11) => e206.charAt(n11 - 1) === `\\` ? t11 : `\\${t11}`);
  }
};
function FM(e206) {
  return IM(e206) ? !e206.value : Array.isArray(e206) ? e206.every(FM) : true;
}
function IM(e206) {
  return e206 instanceof PM ? true : e206 && typeof e206 == `object` ? typeof e206.value == `string` && (typeof e206.isTrusted == `boolean` || typeof e206.isTrusted == `object` || e206.isTrusted === void 0) && (typeof e206.supportThemeIcons == `boolean` || e206.supportThemeIcons === void 0) && (typeof e206.supportAlertSyntax == `boolean` || e206.supportAlertSyntax === void 0) : false;
}
function Tpe(e206, t10) {
  return e206 === t10 ? true : !e206 || !t10 ? false : e206.value === t10.value && e206.isTrusted === t10.isTrusted && e206.supportThemeIcons === t10.supportThemeIcons && e206.supportHtml === t10.supportHtml && e206.supportAlertSyntax === t10.supportAlertSyntax && (e206.baseUri === t10.baseUri || !!e206.baseUri && !!t10.baseUri && Fd($r.from(e206.baseUri), $r.from(t10.baseUri)));
}
function Epe(e206) {
  return e206.replace(/[\\`*_{}[\]()#+\-!~]/g, `\\$&`);
}
function Dpe(e206, t10) {
  let n10 = e206.match(/^`+/gm)?.reduce((e207, t11) => e207.length > t11.length ? e207 : t11).length ?? 0, r10 = n10 >= 3 ? n10 + 1 : 3;
  return [`${"`".repeat(r10)}${t10}`, e206, `${"`".repeat(r10)}`].join(`
`);
}
function LM(e206) {
  return e206.replace(/"/g, `&quot;`);
}
function RM(e206) {
  return e206 && e206.replace(/\\([\\`*_{}[\]()#+\-.!~])/g, `$1`);
}
function Ope(e206) {
  let t10 = [], n10 = e206.split(`|`).map((e207) => e207.trim());
  e206 = n10[0];
  let r10 = n10[1];
  if (r10) {
    let e207 = /height=(\d+)/.exec(r10), n11 = /width=(\d+)/.exec(r10), i10 = e207 ? e207[1] : ``, a10 = n11 ? n11[1] : ``, o10 = isFinite(parseInt(a10)), s10 = isFinite(parseInt(i10));
    o10 && t10.push(`width="${a10}"`), s10 && t10.push(`height="${i10}"`);
  }
  return { href: e206, dimensions: t10 };
}
function zM(e206, ...t10) {
  return $r.from({ scheme: xs.command, path: e206, query: t10.length ? encodeURIComponent(JSON.stringify(t10)) : void 0 });
}
var BM = class {
  constructor(e206) {
    this._prefix = e206, this._lastId = 0;
  }
  nextId() {
    return this._prefix + ++this._lastId;
  }
}, VM = new BM(`id#`);
function HM() {
  return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
}
var UM = HM();
function WM(e206) {
  UM = e206;
}
var GM = /[&<>"']/, kpe = new RegExp(GM.source, `g`), KM = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Ape = new RegExp(KM.source, `g`), jpe = { "&": `&amp;`, "<": `&lt;`, ">": `&gt;`, '"': `&quot;`, "'": `&#39;` }, qM = (e206) => jpe[e206];
function JM(e206, t10) {
  if (t10) {
    if (GM.test(e206)) return e206.replace(kpe, qM);
  } else if (KM.test(e206)) return e206.replace(Ape, qM);
  return e206;
}
var Mpe = /(^|[^\[])\^/g;
function YM(e206, t10) {
  let n10 = typeof e206 == `string` ? e206 : e206.source;
  t10 || (t10 = ``);
  let r10 = { replace: (e207, t11) => {
    let i10 = typeof t11 == `string` ? t11 : t11.source;
    return i10 = i10.replace(Mpe, `$1`), n10 = n10.replace(e207, i10), r10;
  }, getRegex: () => new RegExp(n10, t10) };
  return r10;
}
function XM(e206) {
  try {
    e206 = encodeURI(e206).replace(/%25/g, `%`);
  } catch {
    return null;
  }
  return e206;
}
var ZM = { exec: () => null };
function QM(e206, t10) {
  let n10 = e206.replace(/\|/g, (e207, t11, n11) => {
    let r11 = false, i10 = t11;
    for (; --i10 >= 0 && n11[i10] === `\\`; ) r11 = !r11;
    return r11 ? `|` : ` |`;
  }).split(/ \|/), r10 = 0;
  if (n10[0].trim() || n10.shift(), n10.length > 0 && !n10[n10.length - 1].trim() && n10.pop(), t10) if (n10.length > t10) n10.splice(t10);
  else for (; n10.length < t10; ) n10.push(``);
  for (; r10 < n10.length; r10++) n10[r10] = n10[r10].trim().replace(/\\\|/g, `|`);
  return n10;
}
function $M(e206, t10, n10) {
  let r10 = e206.length;
  if (r10 === 0) return ``;
  let i10 = 0;
  for (; i10 < r10 && e206.charAt(r10 - i10 - 1) === t10; ) i10++;
  return e206.slice(0, r10 - i10);
}
function Npe(e206, t10) {
  if (e206.indexOf(t10[1]) === -1) return -1;
  let n10 = 0;
  for (let r10 = 0; r10 < e206.length; r10++) if (e206[r10] === `\\`) r10++;
  else if (e206[r10] === t10[0]) n10++;
  else if (e206[r10] === t10[1] && (n10--, n10 < 0)) return r10;
  return -1;
}
function eN(e206, t10, n10, r10) {
  let i10 = t10.href, a10 = t10.title ? JM(t10.title) : null, o10 = e206[1].replace(/\\([\[\]])/g, `$1`);
  if (e206[0].charAt(0) !== `!`) {
    r10.state.inLink = true;
    let e207 = { type: `link`, raw: n10, href: i10, title: a10, text: o10, tokens: r10.inlineTokens(o10) };
    return r10.state.inLink = false, e207;
  }
  return { type: `image`, raw: n10, href: i10, title: a10, text: JM(o10) };
}
function Ppe(e206, t10) {
  let n10 = e206.match(/^(\s+)(?:```)/);
  if (n10 === null) return t10;
  let r10 = n10[1];
  return t10.split(`
`).map((e207) => {
    let t11 = e207.match(/^\s+/);
    if (t11 === null) return e207;
    let [n11] = t11;
    return n11.length >= r10.length ? e207.slice(r10.length) : e207;
  }).join(`
`);
}
var tN = class {
  constructor(e206) {
    __publicField(this, "options");
    __publicField(this, "rules");
    __publicField(this, "lexer");
    this.options = e206 || UM;
  }
  space(e206) {
    let t10 = this.rules.block.newline.exec(e206);
    if (t10 && t10[0].length > 0) return { type: `space`, raw: t10[0] };
  }
  code(e206) {
    let t10 = this.rules.block.code.exec(e206);
    if (t10) {
      let e207 = t10[0].replace(/^ {1,4}/gm, ``);
      return { type: `code`, raw: t10[0], codeBlockStyle: `indented`, text: this.options.pedantic ? e207 : $M(e207, `
`) };
    }
  }
  fences(e206) {
    let t10 = this.rules.block.fences.exec(e206);
    if (t10) {
      let e207 = t10[0], n10 = Ppe(e207, t10[3] || ``);
      return { type: `code`, raw: e207, lang: t10[2] ? t10[2].trim().replace(this.rules.inline.anyPunctuation, `$1`) : t10[2], text: n10 };
    }
  }
  heading(e206) {
    let t10 = this.rules.block.heading.exec(e206);
    if (t10) {
      let e207 = t10[2].trim();
      if (/#$/.test(e207)) {
        let t11 = $M(e207, `#`);
        (this.options.pedantic || !t11 || / $/.test(t11)) && (e207 = t11.trim());
      }
      return { type: `heading`, raw: t10[0], depth: t10[1].length, text: e207, tokens: this.lexer.inline(e207) };
    }
  }
  hr(e206) {
    let t10 = this.rules.block.hr.exec(e206);
    if (t10) return { type: `hr`, raw: $M(t10[0], `
`) };
  }
  blockquote(e206) {
    let t10 = this.rules.block.blockquote.exec(e206);
    if (t10) {
      let e207 = $M(t10[0], `
`).split(`
`), n10 = ``, r10 = ``, i10 = [];
      for (; e207.length > 0; ) {
        let t11 = false, a10 = [], o10;
        for (o10 = 0; o10 < e207.length; o10++) if (/^ {0,3}>/.test(e207[o10])) a10.push(e207[o10]), t11 = true;
        else if (!t11) a10.push(e207[o10]);
        else break;
        e207 = e207.slice(o10);
        let s10 = a10.join(`
`), c10 = s10.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
    $1`).replace(/^ {0,3}>[ \t]?/gm, ``);
        n10 = n10 ? `${n10}
${s10}` : s10, r10 = r10 ? `${r10}
${c10}` : c10;
        let l10 = this.lexer.state.top;
        if (this.lexer.state.top = true, this.lexer.blockTokens(c10, i10, true), this.lexer.state.top = l10, e207.length === 0) break;
        let u10 = i10[i10.length - 1];
        if (u10?.type === `code`) break;
        if (u10?.type === `blockquote`) {
          let t12 = u10, a11 = t12.raw + `
` + e207.join(`
`), o11 = this.blockquote(a11);
          i10[i10.length - 1] = o11, n10 = n10.substring(0, n10.length - t12.raw.length) + o11.raw, r10 = r10.substring(0, r10.length - t12.text.length) + o11.text;
          break;
        } else if (u10?.type === `list`) {
          let t12 = u10, a11 = t12.raw + `
` + e207.join(`
`), o11 = this.list(a11);
          i10[i10.length - 1] = o11, n10 = n10.substring(0, n10.length - u10.raw.length) + o11.raw, r10 = r10.substring(0, r10.length - t12.raw.length) + o11.raw, e207 = a11.substring(i10[i10.length - 1].raw.length).split(`
`);
          continue;
        }
      }
      return { type: `blockquote`, raw: n10, tokens: i10, text: r10 };
    }
  }
  list(e206) {
    let t10 = this.rules.block.list.exec(e206);
    if (t10) {
      let n10 = t10[1].trim(), r10 = n10.length > 1, i10 = { type: `list`, raw: ``, ordered: r10, start: r10 ? +n10.slice(0, -1) : ``, loose: false, items: [] };
      n10 = r10 ? `\\d{1,9}\\${n10.slice(-1)}` : `\\${n10}`, this.options.pedantic && (n10 = r10 ? n10 : `[*+-]`);
      let a10 = RegExp(`^( {0,3}${n10})((?:[	 ][^\\n]*)?(?:\\n|$))`), o10 = false;
      for (; e206; ) {
        let n11 = false, r11 = ``, s10 = ``;
        if (!(t10 = a10.exec(e206)) || this.rules.block.hr.test(e206)) break;
        r11 = t10[0], e206 = e206.substring(r11.length);
        let c10 = t10[2].split(`
`, 1)[0].replace(/^\t+/, (e207) => ` `.repeat(3 * e207.length)), l10 = e206.split(`
`, 1)[0], u10 = !c10.trim(), d10 = 0;
        if (this.options.pedantic ? (d10 = 2, s10 = c10.trimStart()) : u10 ? d10 = t10[1].length + 1 : (d10 = t10[2].search(/[^ ]/), d10 = d10 > 4 ? 1 : d10, s10 = c10.slice(d10), d10 += t10[1].length), u10 && /^ *$/.test(l10) && (r11 += l10 + `
`, e206 = e206.substring(l10.length + 1), n11 = true), !n11) {
          let t11 = RegExp(`^ {0,${Math.min(3, d10 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), n12 = RegExp(`^ {0,${Math.min(3, d10 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), i11 = RegExp(`^ {0,${Math.min(3, d10 - 1)}}(?:\`\`\`|~~~)`), a11 = RegExp(`^ {0,${Math.min(3, d10 - 1)}}#`);
          for (; e206; ) {
            let o11 = e206.split(`
`, 1)[0];
            if (l10 = o11, this.options.pedantic && (l10 = l10.replace(/^ {1,4}(?=( {4})*[^ ])/g, `  `)), i11.test(l10) || a11.test(l10) || t11.test(l10) || n12.test(e206)) break;
            if (l10.search(/[^ ]/) >= d10 || !l10.trim()) s10 += `
` + l10.slice(d10);
            else {
              if (u10 || c10.search(/[^ ]/) >= 4 || i11.test(c10) || a11.test(c10) || n12.test(c10)) break;
              s10 += `
` + l10;
            }
            !u10 && !l10.trim() && (u10 = true), r11 += o11 + `
`, e206 = e206.substring(o11.length + 1), c10 = l10.slice(d10);
          }
        }
        i10.loose || (o10 ? i10.loose = true : /\n *\n *$/.test(r11) && (o10 = true));
        let f10 = null, p10;
        this.options.gfm && (f10 = /^\[[ xX]\] /.exec(s10), f10 && (p10 = f10[0] !== `[ ] `, s10 = s10.replace(/^\[[ xX]\] +/, ``))), i10.items.push({ type: `list_item`, raw: r11, task: !!f10, checked: p10, loose: false, text: s10, tokens: [] }), i10.raw += r11;
      }
      i10.items[i10.items.length - 1].raw = i10.items[i10.items.length - 1].raw.trimEnd(), i10.items[i10.items.length - 1].text = i10.items[i10.items.length - 1].text.trimEnd(), i10.raw = i10.raw.trimEnd();
      for (let e207 = 0; e207 < i10.items.length; e207++) if (this.lexer.state.top = false, i10.items[e207].tokens = this.lexer.blockTokens(i10.items[e207].text, []), !i10.loose) {
        let t11 = i10.items[e207].tokens.filter((e208) => e208.type === `space`);
        i10.loose = t11.length > 0 && t11.some((e208) => /\n.*\n/.test(e208.raw));
      }
      if (i10.loose) for (let e207 = 0; e207 < i10.items.length; e207++) i10.items[e207].loose = true;
      return i10;
    }
  }
  html(e206) {
    let t10 = this.rules.block.html.exec(e206);
    if (t10) return { type: `html`, block: true, raw: t10[0], pre: t10[1] === `pre` || t10[1] === `script` || t10[1] === `style`, text: t10[0] };
  }
  def(e206) {
    let t10 = this.rules.block.def.exec(e206);
    if (t10) {
      let e207 = t10[1].toLowerCase().replace(/\s+/g, ` `), n10 = t10[2] ? t10[2].replace(/^<(.*)>$/, `$1`).replace(this.rules.inline.anyPunctuation, `$1`) : ``, r10 = t10[3] ? t10[3].substring(1, t10[3].length - 1).replace(this.rules.inline.anyPunctuation, `$1`) : t10[3];
      return { type: `def`, tag: e207, raw: t10[0], href: n10, title: r10 };
    }
  }
  table(e206) {
    let t10 = this.rules.block.table.exec(e206);
    if (!t10 || !/[:|]/.test(t10[2])) return;
    let n10 = QM(t10[1]), r10 = t10[2].replace(/^\||\| *$/g, ``).split(`|`), i10 = t10[3] && t10[3].trim() ? t10[3].replace(/\n[ \t]*$/, ``).split(`
`) : [], a10 = { type: `table`, raw: t10[0], header: [], align: [], rows: [] };
    if (n10.length === r10.length) {
      for (let e207 of r10) /^ *-+: *$/.test(e207) ? a10.align.push(`right`) : /^ *:-+: *$/.test(e207) ? a10.align.push(`center`) : /^ *:-+ *$/.test(e207) ? a10.align.push(`left`) : a10.align.push(null);
      for (let e207 = 0; e207 < n10.length; e207++) a10.header.push({ text: n10[e207], tokens: this.lexer.inline(n10[e207]), header: true, align: a10.align[e207] });
      for (let e207 of i10) a10.rows.push(QM(e207, a10.header.length).map((e208, t11) => ({ text: e208, tokens: this.lexer.inline(e208), header: false, align: a10.align[t11] })));
      return a10;
    }
  }
  lheading(e206) {
    let t10 = this.rules.block.lheading.exec(e206);
    if (t10) return { type: `heading`, raw: t10[0], depth: t10[2].charAt(0) === `=` ? 1 : 2, text: t10[1], tokens: this.lexer.inline(t10[1]) };
  }
  paragraph(e206) {
    let t10 = this.rules.block.paragraph.exec(e206);
    if (t10) {
      let e207 = t10[1].charAt(t10[1].length - 1) === `
` ? t10[1].slice(0, -1) : t10[1];
      return { type: `paragraph`, raw: t10[0], text: e207, tokens: this.lexer.inline(e207) };
    }
  }
  text(e206) {
    let t10 = this.rules.block.text.exec(e206);
    if (t10) return { type: `text`, raw: t10[0], text: t10[0], tokens: this.lexer.inline(t10[0]) };
  }
  escape(e206) {
    let t10 = this.rules.inline.escape.exec(e206);
    if (t10) return { type: `escape`, raw: t10[0], text: JM(t10[1]) };
  }
  tag(e206) {
    let t10 = this.rules.inline.tag.exec(e206);
    if (t10) return !this.lexer.state.inLink && /^<a /i.test(t10[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && /^<\/a>/i.test(t10[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t10[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t10[0]) && (this.lexer.state.inRawBlock = false), { type: `html`, raw: t10[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t10[0] };
  }
  link(e206) {
    let t10 = this.rules.inline.link.exec(e206);
    if (t10) {
      let e207 = t10[2].trim();
      if (!this.options.pedantic && /^</.test(e207)) {
        if (!/>$/.test(e207)) return;
        let t11 = $M(e207.slice(0, -1), `\\`);
        if ((e207.length - t11.length) % 2 == 0) return;
      } else {
        let e208 = Npe(t10[2], `()`);
        if (e208 > -1) {
          let n11 = (t10[0].indexOf(`!`) === 0 ? 5 : 4) + t10[1].length + e208;
          t10[2] = t10[2].substring(0, e208), t10[0] = t10[0].substring(0, n11).trim(), t10[3] = ``;
        }
      }
      let n10 = t10[2], r10 = ``;
      if (this.options.pedantic) {
        let e208 = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n10);
        e208 && (n10 = e208[1], r10 = e208[3]);
      } else r10 = t10[3] ? t10[3].slice(1, -1) : ``;
      return n10 = n10.trim(), /^</.test(n10) && (n10 = this.options.pedantic && !/>$/.test(e207) ? n10.slice(1) : n10.slice(1, -1)), eN(t10, { href: n10 && n10.replace(this.rules.inline.anyPunctuation, `$1`), title: r10 && r10.replace(this.rules.inline.anyPunctuation, `$1`) }, t10[0], this.lexer);
    }
  }
  reflink(e206, t10) {
    let n10;
    if ((n10 = this.rules.inline.reflink.exec(e206)) || (n10 = this.rules.inline.nolink.exec(e206))) {
      let e207 = t10[(n10[2] || n10[1]).replace(/\s+/g, ` `).toLowerCase()];
      if (!e207) {
        let e208 = n10[0].charAt(0);
        return { type: `text`, raw: e208, text: e208 };
      }
      return eN(n10, e207, n10[0], this.lexer);
    }
  }
  emStrong(e206, t10, n10 = ``) {
    let r10 = this.rules.inline.emStrongLDelim.exec(e206);
    if (r10 && !(r10[3] && n10.match(/[\p{L}\p{N}]/u)) && (!(r10[1] || r10[2]) || !n10 || this.rules.inline.punctuation.exec(n10))) {
      let n11 = [...r10[0]].length - 1, i10, a10, o10 = n11, s10 = 0, c10 = r10[0][0] === `*` ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (c10.lastIndex = 0, t10 = t10.slice(-1 * e206.length + n11); (r10 = c10.exec(t10)) != null; ) {
        if (i10 = r10[1] || r10[2] || r10[3] || r10[4] || r10[5] || r10[6], !i10) continue;
        if (a10 = [...i10].length, r10[3] || r10[4]) {
          o10 += a10;
          continue;
        } else if ((r10[5] || r10[6]) && n11 % 3 && !((n11 + a10) % 3)) {
          s10 += a10;
          continue;
        }
        if (o10 -= a10, o10 > 0) continue;
        a10 = Math.min(a10, a10 + o10 + s10);
        let t11 = [...r10[0]][0].length, c11 = e206.slice(0, n11 + r10.index + t11 + a10);
        if (Math.min(n11, a10) % 2) {
          let e207 = c11.slice(1, -1);
          return { type: `em`, raw: c11, text: e207, tokens: this.lexer.inlineTokens(e207) };
        }
        let l10 = c11.slice(2, -2);
        return { type: `strong`, raw: c11, text: l10, tokens: this.lexer.inlineTokens(l10) };
      }
    }
  }
  codespan(e206) {
    let t10 = this.rules.inline.code.exec(e206);
    if (t10) {
      let e207 = t10[2].replace(/\n/g, ` `), n10 = /[^ ]/.test(e207), r10 = /^ /.test(e207) && / $/.test(e207);
      return n10 && r10 && (e207 = e207.substring(1, e207.length - 1)), e207 = JM(e207, true), { type: `codespan`, raw: t10[0], text: e207 };
    }
  }
  br(e206) {
    let t10 = this.rules.inline.br.exec(e206);
    if (t10) return { type: `br`, raw: t10[0] };
  }
  del(e206) {
    let t10 = this.rules.inline.del.exec(e206);
    if (t10) return { type: `del`, raw: t10[0], text: t10[2], tokens: this.lexer.inlineTokens(t10[2]) };
  }
  autolink(e206) {
    let t10 = this.rules.inline.autolink.exec(e206);
    if (t10) {
      let e207, n10;
      return t10[2] === `@` ? (e207 = JM(t10[1]), n10 = `mailto:` + e207) : (e207 = JM(t10[1]), n10 = e207), { type: `link`, raw: t10[0], text: e207, href: n10, tokens: [{ type: `text`, raw: e207, text: e207 }] };
    }
  }
  url(e206) {
    let t10;
    if (t10 = this.rules.inline.url.exec(e206)) {
      let e207, n10;
      if (t10[2] === `@`) e207 = JM(t10[0]), n10 = `mailto:` + e207;
      else {
        let r10;
        do
          r10 = t10[0], t10[0] = this.rules.inline._backpedal.exec(t10[0])?.[0] ?? ``;
        while (r10 !== t10[0]);
        e207 = JM(t10[0]), n10 = t10[1] === `www.` ? `http://` + t10[0] : t10[0];
      }
      return { type: `link`, raw: t10[0], text: e207, href: n10, tokens: [{ type: `text`, raw: e207, text: e207 }] };
    }
  }
  inlineText(e206) {
    let t10 = this.rules.inline.text.exec(e206);
    if (t10) {
      let e207;
      return e207 = this.lexer.state.inRawBlock ? t10[0] : JM(t10[0]), { type: `text`, raw: t10[0], text: e207 };
    }
  }
}, Fpe = /^(?: *(?:\n|$))+/, Ipe = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Lpe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nN = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Rpe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rN = /(?:[*+-]|\d{1,9}[.)])/, iN = YM(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, rN).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), aN = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, zpe = /^[^\n]+/, oN = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Bpe = YM(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace(`label`, oN).replace(`title`, /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Vpe = YM(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rN).getRegex(), sN = `address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`, cN = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Hpe = YM(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`, `i`).replace(`comment`, cN).replace(`tag`, sN).replace(`attribute`, / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), lN = YM(aN).replace(`hr`, nN).replace(`heading`, ` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`, ``).replace(`|table`, ``).replace(`blockquote`, ` {0,3}>`).replace(`fences`, " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`, ` {0,3}(?:[*+-]|1[.)]) `).replace(`html`, `</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`, sN).getRegex(), uN = { blockquote: YM(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`, lN).getRegex(), code: Ipe, def: Bpe, fences: Lpe, heading: Rpe, hr: nN, html: Hpe, lheading: iN, list: Vpe, newline: Fpe, paragraph: lN, table: ZM, text: zpe }, dN = YM(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`, nN).replace(`heading`, ` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`, ` {0,3}>`).replace(`code`, ` {4}[^\\n]`).replace(`fences`, " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`, ` {0,3}(?:[*+-]|1[.)]) `).replace(`html`, `</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`, sN).getRegex(), Upe = { ...uN, table: dN, paragraph: YM(aN).replace(`hr`, nN).replace(`heading`, ` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`, ``).replace(`table`, dN).replace(`blockquote`, ` {0,3}>`).replace(`fences`, " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`, ` {0,3}(?:[*+-]|1[.)]) `).replace(`html`, `</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`, sN).getRegex() }, Wpe = { ...uN, html: YM(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`, cN).replace(/tag/g, `(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: ZM, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: YM(aN).replace(`hr`, nN).replace(`heading`, ` *#{1,6} *[^
]`).replace(`lheading`, iN).replace(`|table`, ``).replace(`blockquote`, ` {0,3}>`).replace(`|fences`, ``).replace(`|list`, ``).replace(`|html`, ``).replace(`|tag`, ``).getRegex() }, fN = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Gpe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, pN = /^( {2,}|\\)\n(?!\s*$)/, Kpe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, mN = `\\p{P}\\p{S}`, qpe = YM(/^((?![*_])[\spunctuation])/, `u`).replace(/punctuation/g, mN).getRegex(), Jpe = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, Ype = YM(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, `u`).replace(/punct/g, mN).getRegex(), Xpe = YM(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`, `gu`).replace(/punct/g, mN).getRegex(), Zpe = YM(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`, `gu`).replace(/punct/g, mN).getRegex(), Qpe = YM(/\\([punct])/, `gu`).replace(/punct/g, mN).getRegex(), $pe = YM(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`, /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`, /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), eme = YM(cN).replace(`(?:-->|$)`, `-->`).getRegex(), tme = YM(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`, eme).replace(`attribute`, /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), hN = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, nme = YM(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`, hN).replace(`href`, /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`, /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), gN = YM(/^!?\[(label)\]\[(ref)\]/).replace(`label`, hN).replace(`ref`, oN).getRegex(), _N = YM(/^!?\[(ref)\](?:\[\])?/).replace(`ref`, oN).getRegex(), vN = { _backpedal: ZM, anyPunctuation: Qpe, autolink: $pe, blockSkip: Jpe, br: pN, code: Gpe, del: ZM, emStrongLDelim: Ype, emStrongRDelimAst: Xpe, emStrongRDelimUnd: Zpe, escape: fN, link: nme, nolink: _N, punctuation: qpe, reflink: gN, reflinkSearch: YM(`reflink|nolink(?!\\()`, `g`).replace(`reflink`, gN).replace(`nolink`, _N).getRegex(), tag: tme, text: Kpe, url: ZM }, rme = { ...vN, link: YM(/^!?\[(label)\]\((.*?)\)/).replace(`label`, hN).getRegex(), reflink: YM(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`, hN).getRegex() }, yN = { ...vN, escape: YM(fN).replace(`])`, `~|])`).getRegex(), url: YM(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, `i`).replace(`email`, /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, ime = { ...yN, br: YM(pN).replace(`{2,}`, `*`).getRegex(), text: YM(yN.text).replace(`\\b_`, `\\b_| {2,}\\n`).replace(/\{2,\}/g, `*`).getRegex() }, bN = { normal: uN, gfm: Upe, pedantic: Wpe }, xN = { normal: vN, gfm: yN, breaks: ime, pedantic: rme }, SN = class e135 {
  constructor(e206) {
    __publicField(this, "tokens");
    __publicField(this, "options");
    __publicField(this, "state");
    __publicField(this, "tokenizer");
    __publicField(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e206 || UM, this.options.tokenizer = this.options.tokenizer || new tN(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
    let t10 = { block: bN.normal, inline: xN.normal };
    this.options.pedantic ? (t10.block = bN.pedantic, t10.inline = xN.pedantic) : this.options.gfm && (t10.block = bN.gfm, this.options.breaks ? t10.inline = xN.breaks : t10.inline = xN.gfm), this.tokenizer.rules = t10;
  }
  static get rules() {
    return { block: bN, inline: xN };
  }
  static lex(t10, n10) {
    return new e135(n10).lex(t10);
  }
  static lexInline(t10, n10) {
    return new e135(n10).inlineTokens(t10);
  }
  lex(e206) {
    e206 = e206.replace(/\r\n|\r/g, `
`), this.blockTokens(e206, this.tokens);
    for (let e207 = 0; e207 < this.inlineQueue.length; e207++) {
      let t10 = this.inlineQueue[e207];
      this.inlineTokens(t10.src, t10.tokens);
    }
    return this.inlineQueue = [], this.tokens;
  }
  blockTokens(e206, t10 = [], n10 = false) {
    e206 = this.options.pedantic ? e206.replace(/\t/g, `    `).replace(/^ +$/gm, ``) : e206.replace(/^( *)(\t+)/gm, (e207, t11, n11) => t11 + `    `.repeat(n11.length));
    let r10, i10, a10;
    for (; e206; ) if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((n11) => (r10 = n11.call({ lexer: this }, e206, t10)) ? (e206 = e206.substring(r10.raw.length), t10.push(r10), true) : false))) {
      if (r10 = this.tokenizer.space(e206)) {
        e206 = e206.substring(r10.raw.length), r10.raw.length === 1 && t10.length > 0 ? t10[t10.length - 1].raw += `
` : t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.code(e206)) {
        e206 = e206.substring(r10.raw.length), i10 = t10[t10.length - 1], i10 && (i10.type === `paragraph` || i10.type === `text`) ? (i10.raw += `
` + r10.raw, i10.text += `
` + r10.text, this.inlineQueue[this.inlineQueue.length - 1].src = i10.text) : t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.fences(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.heading(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.hr(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.blockquote(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.list(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.html(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.def(e206)) {
        e206 = e206.substring(r10.raw.length), i10 = t10[t10.length - 1], i10 && (i10.type === `paragraph` || i10.type === `text`) ? (i10.raw += `
` + r10.raw, i10.text += `
` + r10.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i10.text) : this.tokens.links[r10.tag] || (this.tokens.links[r10.tag] = { href: r10.href, title: r10.title });
        continue;
      }
      if (r10 = this.tokenizer.table(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (r10 = this.tokenizer.lheading(e206)) {
        e206 = e206.substring(r10.raw.length), t10.push(r10);
        continue;
      }
      if (a10 = e206, this.options.extensions && this.options.extensions.startBlock) {
        let t11 = 1 / 0, n11 = e206.slice(1), r11;
        this.options.extensions.startBlock.forEach((e207) => {
          r11 = e207.call({ lexer: this }, n11), typeof r11 == `number` && r11 >= 0 && (t11 = Math.min(t11, r11));
        }), t11 < 1 / 0 && t11 >= 0 && (a10 = e206.substring(0, t11 + 1));
      }
      if (this.state.top && (r10 = this.tokenizer.paragraph(a10))) {
        i10 = t10[t10.length - 1], n10 && i10?.type === `paragraph` ? (i10.raw += `
` + r10.raw, i10.text += `
` + r10.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i10.text) : t10.push(r10), n10 = a10.length !== e206.length, e206 = e206.substring(r10.raw.length);
        continue;
      }
      if (r10 = this.tokenizer.text(e206)) {
        e206 = e206.substring(r10.raw.length), i10 = t10[t10.length - 1], i10 && i10.type === `text` ? (i10.raw += `
` + r10.raw, i10.text += `
` + r10.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i10.text) : t10.push(r10);
        continue;
      }
      if (e206) {
        let t11 = `Infinite loop on byte: ` + e206.charCodeAt(0);
        if (this.options.silent) {
          console.error(t11);
          break;
        } else throw Error(t11);
      }
    }
    return this.state.top = true, t10;
  }
  inline(e206, t10 = []) {
    return this.inlineQueue.push({ src: e206, tokens: t10 }), t10;
  }
  inlineTokens(e206, t10 = []) {
    let n10, r10, i10, a10 = e206, o10, s10, c10;
    if (this.tokens.links) {
      let e207 = Object.keys(this.tokens.links);
      if (e207.length > 0) for (; (o10 = this.tokenizer.rules.inline.reflinkSearch.exec(a10)) != null; ) e207.includes(o10[0].slice(o10[0].lastIndexOf(`[`) + 1, -1)) && (a10 = a10.slice(0, o10.index) + `[` + `a`.repeat(o10[0].length - 2) + `]` + a10.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (o10 = this.tokenizer.rules.inline.blockSkip.exec(a10)) != null; ) a10 = a10.slice(0, o10.index) + `[` + `a`.repeat(o10[0].length - 2) + `]` + a10.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (o10 = this.tokenizer.rules.inline.anyPunctuation.exec(a10)) != null; ) a10 = a10.slice(0, o10.index) + `++` + a10.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e206; ) if (s10 || (c10 = ``), s10 = false, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((r11) => (n10 = r11.call({ lexer: this }, e206, t10)) ? (e206 = e206.substring(n10.raw.length), t10.push(n10), true) : false))) {
      if (n10 = this.tokenizer.escape(e206)) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.tag(e206)) {
        e206 = e206.substring(n10.raw.length), r10 = t10[t10.length - 1], r10 && n10.type === `text` && r10.type === `text` ? (r10.raw += n10.raw, r10.text += n10.text) : t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.link(e206)) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.reflink(e206, this.tokens.links)) {
        e206 = e206.substring(n10.raw.length), r10 = t10[t10.length - 1], r10 && n10.type === `text` && r10.type === `text` ? (r10.raw += n10.raw, r10.text += n10.text) : t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.emStrong(e206, a10, c10)) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.codespan(e206)) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.br(e206)) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.del(e206)) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (n10 = this.tokenizer.autolink(e206)) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (!this.state.inLink && (n10 = this.tokenizer.url(e206))) {
        e206 = e206.substring(n10.raw.length), t10.push(n10);
        continue;
      }
      if (i10 = e206, this.options.extensions && this.options.extensions.startInline) {
        let t11 = 1 / 0, n11 = e206.slice(1), r11;
        this.options.extensions.startInline.forEach((e207) => {
          r11 = e207.call({ lexer: this }, n11), typeof r11 == `number` && r11 >= 0 && (t11 = Math.min(t11, r11));
        }), t11 < 1 / 0 && t11 >= 0 && (i10 = e206.substring(0, t11 + 1));
      }
      if (n10 = this.tokenizer.inlineText(i10)) {
        e206 = e206.substring(n10.raw.length), n10.raw.slice(-1) !== `_` && (c10 = n10.raw.slice(-1)), s10 = true, r10 = t10[t10.length - 1], r10 && r10.type === `text` ? (r10.raw += n10.raw, r10.text += n10.text) : t10.push(n10);
        continue;
      }
      if (e206) {
        let t11 = `Infinite loop on byte: ` + e206.charCodeAt(0);
        if (this.options.silent) {
          console.error(t11);
          break;
        } else throw Error(t11);
      }
    }
    return t10;
  }
}, CN = class {
  constructor(e206) {
    __publicField(this, "options");
    __publicField(this, "parser");
    this.options = e206 || UM;
  }
  space(e206) {
    return ``;
  }
  code({ text: e206, lang: t10, escaped: n10 }) {
    let r10 = (t10 || ``).match(/^\S*/)?.[0], i10 = e206.replace(/\n$/, ``) + `
`;
    return r10 ? `<pre><code class="language-` + JM(r10) + `">` + (n10 ? i10 : JM(i10, true)) + `</code></pre>
` : `<pre><code>` + (n10 ? i10 : JM(i10, true)) + `</code></pre>
`;
  }
  blockquote({ tokens: e206 }) {
    return `<blockquote>
${this.parser.parse(e206)}</blockquote>
`;
  }
  html({ text: e206 }) {
    return e206;
  }
  heading({ tokens: e206, depth: t10 }) {
    return `<h${t10}>${this.parser.parseInline(e206)}</h${t10}>
`;
  }
  hr(e206) {
    return `<hr>
`;
  }
  list(e206) {
    let t10 = e206.ordered, n10 = e206.start, r10 = ``;
    for (let t11 = 0; t11 < e206.items.length; t11++) {
      let n11 = e206.items[t11];
      r10 += this.listitem(n11);
    }
    let i10 = t10 ? `ol` : `ul`, a10 = t10 && n10 !== 1 ? ` start="` + n10 + `"` : ``;
    return `<` + i10 + a10 + `>
` + r10 + `</` + i10 + `>
`;
  }
  listitem(e206) {
    let t10 = ``;
    if (e206.task) {
      let n10 = this.checkbox({ checked: !!e206.checked });
      e206.loose ? e206.tokens.length > 0 && e206.tokens[0].type === `paragraph` ? (e206.tokens[0].text = n10 + ` ` + e206.tokens[0].text, e206.tokens[0].tokens && e206.tokens[0].tokens.length > 0 && e206.tokens[0].tokens[0].type === `text` && (e206.tokens[0].tokens[0].text = n10 + ` ` + e206.tokens[0].tokens[0].text)) : e206.tokens.unshift({ type: `text`, raw: n10 + ` `, text: n10 + ` ` }) : t10 += n10 + ` `;
    }
    return t10 += this.parser.parse(e206.tokens, !!e206.loose), `<li>${t10}</li>
`;
  }
  checkbox({ checked: e206 }) {
    return `<input ` + (e206 ? `checked="" ` : ``) + `disabled="" type="checkbox">`;
  }
  paragraph({ tokens: e206 }) {
    return `<p>${this.parser.parseInline(e206)}</p>
`;
  }
  table(e206) {
    let t10 = ``, n10 = ``;
    for (let t11 = 0; t11 < e206.header.length; t11++) n10 += this.tablecell(e206.header[t11]);
    t10 += this.tablerow({ text: n10 });
    let r10 = ``;
    for (let t11 = 0; t11 < e206.rows.length; t11++) {
      let i10 = e206.rows[t11];
      n10 = ``;
      for (let e207 = 0; e207 < i10.length; e207++) n10 += this.tablecell(i10[e207]);
      r10 += this.tablerow({ text: n10 });
    }
    return r10 && (r10 = `<tbody>${r10}</tbody>`), `<table>
<thead>
` + t10 + `</thead>
` + r10 + `</table>
`;
  }
  tablerow({ text: e206 }) {
    return `<tr>
${e206}</tr>
`;
  }
  tablecell(e206) {
    let t10 = this.parser.parseInline(e206.tokens), n10 = e206.header ? `th` : `td`;
    return (e206.align ? `<${n10} align="${e206.align}">` : `<${n10}>`) + t10 + `</${n10}>
`;
  }
  strong({ tokens: e206 }) {
    return `<strong>${this.parser.parseInline(e206)}</strong>`;
  }
  em({ tokens: e206 }) {
    return `<em>${this.parser.parseInline(e206)}</em>`;
  }
  codespan({ text: e206 }) {
    return `<code>${e206}</code>`;
  }
  br(e206) {
    return `<br>`;
  }
  del({ tokens: e206 }) {
    return `<del>${this.parser.parseInline(e206)}</del>`;
  }
  link({ href: e206, title: t10, tokens: n10 }) {
    let r10 = this.parser.parseInline(n10), i10 = XM(e206);
    if (i10 === null) return r10;
    e206 = i10;
    let a10 = `<a href="` + e206 + `"`;
    return t10 && (a10 += ` title="` + t10 + `"`), a10 += `>` + r10 + `</a>`, a10;
  }
  image({ href: e206, title: t10, text: n10 }) {
    let r10 = XM(e206);
    if (r10 === null) return n10;
    e206 = r10;
    let i10 = `<img src="${e206}" alt="${n10}"`;
    return t10 && (i10 += ` title="${t10}"`), i10 += `>`, i10;
  }
  text(e206) {
    return `tokens` in e206 && e206.tokens ? this.parser.parseInline(e206.tokens) : e206.text;
  }
}, wN = class {
  strong({ text: e206 }) {
    return e206;
  }
  em({ text: e206 }) {
    return e206;
  }
  codespan({ text: e206 }) {
    return e206;
  }
  del({ text: e206 }) {
    return e206;
  }
  html({ text: e206 }) {
    return e206;
  }
  text({ text: e206 }) {
    return e206;
  }
  link({ text: e206 }) {
    return `` + e206;
  }
  image({ text: e206 }) {
    return `` + e206;
  }
  br() {
    return ``;
  }
}, TN = class e136 {
  constructor(e206) {
    __publicField(this, "options");
    __publicField(this, "renderer");
    __publicField(this, "textRenderer");
    this.options = e206 || UM, this.options.renderer = this.options.renderer || new CN(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new wN();
  }
  static parse(t10, n10) {
    return new e136(n10).parse(t10);
  }
  static parseInline(t10, n10) {
    return new e136(n10).parseInline(t10);
  }
  parse(e206, t10 = true) {
    let n10 = ``;
    for (let r10 = 0; r10 < e206.length; r10++) {
      let i10 = e206[r10];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i10.type]) {
        let e207 = i10, t11 = this.options.extensions.renderers[e207.type].call({ parser: this }, e207);
        if (t11 !== false || ![`space`, `hr`, `heading`, `code`, `table`, `blockquote`, `list`, `html`, `paragraph`, `text`].includes(e207.type)) {
          n10 += t11 || ``;
          continue;
        }
      }
      let a10 = i10;
      switch (a10.type) {
        case `space`:
          n10 += this.renderer.space(a10);
          continue;
        case `hr`:
          n10 += this.renderer.hr(a10);
          continue;
        case `heading`:
          n10 += this.renderer.heading(a10);
          continue;
        case `code`:
          n10 += this.renderer.code(a10);
          continue;
        case `table`:
          n10 += this.renderer.table(a10);
          continue;
        case `blockquote`:
          n10 += this.renderer.blockquote(a10);
          continue;
        case `list`:
          n10 += this.renderer.list(a10);
          continue;
        case `html`:
          n10 += this.renderer.html(a10);
          continue;
        case `paragraph`:
          n10 += this.renderer.paragraph(a10);
          continue;
        case `text`: {
          let i11 = a10, o10 = this.renderer.text(i11);
          for (; r10 + 1 < e206.length && e206[r10 + 1].type === `text`; ) i11 = e206[++r10], o10 += `
` + this.renderer.text(i11);
          t10 ? n10 += this.renderer.paragraph({ type: `paragraph`, raw: o10, text: o10, tokens: [{ type: `text`, raw: o10, text: o10 }] }) : n10 += o10;
          continue;
        }
        default: {
          let e207 = `Token with "` + a10.type + `" type was not found.`;
          if (this.options.silent) return console.error(e207), ``;
          throw Error(e207);
        }
      }
    }
    return n10;
  }
  parseInline(e206, t10) {
    t10 || (t10 = this.renderer);
    let n10 = ``;
    for (let r10 = 0; r10 < e206.length; r10++) {
      let i10 = e206[r10];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i10.type]) {
        let e207 = this.options.extensions.renderers[i10.type].call({ parser: this }, i10);
        if (e207 !== false || ![`escape`, `html`, `link`, `image`, `strong`, `em`, `codespan`, `br`, `del`, `text`].includes(i10.type)) {
          n10 += e207 || ``;
          continue;
        }
      }
      let a10 = i10;
      switch (a10.type) {
        case `escape`:
          n10 += t10.text(a10);
          break;
        case `html`:
          n10 += t10.html(a10);
          break;
        case `link`:
          n10 += t10.link(a10);
          break;
        case `image`:
          n10 += t10.image(a10);
          break;
        case `strong`:
          n10 += t10.strong(a10);
          break;
        case `em`:
          n10 += t10.em(a10);
          break;
        case `codespan`:
          n10 += t10.codespan(a10);
          break;
        case `br`:
          n10 += t10.br(a10);
          break;
        case `del`:
          n10 += t10.del(a10);
          break;
        case `text`:
          n10 += t10.text(a10);
          break;
        default: {
          let e207 = `Token with "` + a10.type + `" type was not found.`;
          if (this.options.silent) return console.error(e207), ``;
          throw Error(e207);
        }
      }
    }
    return n10;
  }
}, EN = (_Ja = class {
  constructor(e206) {
    __publicField(this, "options");
    this.options = e206 || UM;
  }
  preprocess(e206) {
    return e206;
  }
  postprocess(e206) {
    return e206;
  }
  processAllTokens(e206) {
    return e206;
  }
}, __publicField(_Ja, "passThroughHooks", /* @__PURE__ */ new Set([`preprocess`, `postprocess`, `processAllTokens`])), _Ja), DN = class {
  constructor(...e206) {
    __publicField(this, "defaults", HM());
    __publicField(this, "options", this.setOptions);
    __publicField(this, "parse", this.parseMarkdown(SN.lex, TN.parse));
    __publicField(this, "parseInline", this.parseMarkdown(SN.lexInline, TN.parseInline));
    __publicField(this, "Parser", TN);
    __publicField(this, "Renderer", CN);
    __publicField(this, "TextRenderer", wN);
    __publicField(this, "Lexer", SN);
    __publicField(this, "Tokenizer", tN);
    __publicField(this, "Hooks", EN);
    this.use(...e206);
  }
  walkTokens(e206, t10) {
    let n10 = [];
    for (let r10 of e206) switch (n10 = n10.concat(t10.call(this, r10)), r10.type) {
      case `table`: {
        let e207 = r10;
        for (let r11 of e207.header) n10 = n10.concat(this.walkTokens(r11.tokens, t10));
        for (let r11 of e207.rows) for (let e208 of r11) n10 = n10.concat(this.walkTokens(e208.tokens, t10));
        break;
      }
      case `list`: {
        let e207 = r10;
        n10 = n10.concat(this.walkTokens(e207.items, t10));
        break;
      }
      default: {
        let e207 = r10;
        this.defaults.extensions?.childTokens?.[e207.type] ? this.defaults.extensions.childTokens[e207.type].forEach((r11) => {
          let i10 = e207[r11].flat(1 / 0);
          n10 = n10.concat(this.walkTokens(i10, t10));
        }) : e207.tokens && (n10 = n10.concat(this.walkTokens(e207.tokens, t10)));
      }
    }
    return n10;
  }
  use(...e206) {
    let t10 = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e206.forEach((e207) => {
      let n10 = { ...e207 };
      if (n10.async = this.defaults.async || n10.async || false, e207.extensions && (e207.extensions.forEach((e208) => {
        if (!e208.name) throw Error(`extension name required`);
        if (`renderer` in e208) {
          let n11 = t10.renderers[e208.name];
          n11 ? t10.renderers[e208.name] = function(...t11) {
            let r10 = e208.renderer.apply(this, t11);
            return r10 === false && (r10 = n11.apply(this, t11)), r10;
          } : t10.renderers[e208.name] = e208.renderer;
        }
        if (`tokenizer` in e208) {
          if (!e208.level || e208.level !== `block` && e208.level !== `inline`) throw Error(`extension level must be 'block' or 'inline'`);
          let n11 = t10[e208.level];
          n11 ? n11.unshift(e208.tokenizer) : t10[e208.level] = [e208.tokenizer], e208.start && (e208.level === `block` ? t10.startBlock ? t10.startBlock.push(e208.start) : t10.startBlock = [e208.start] : e208.level === `inline` && (t10.startInline ? t10.startInline.push(e208.start) : t10.startInline = [e208.start]));
        }
        `childTokens` in e208 && e208.childTokens && (t10.childTokens[e208.name] = e208.childTokens);
      }), n10.extensions = t10), e207.renderer) {
        let t11 = this.defaults.renderer || new CN(this.defaults);
        for (let n11 in e207.renderer) {
          if (!(n11 in t11)) throw Error(`renderer '${n11}' does not exist`);
          if ([`options`, `parser`].includes(n11)) continue;
          let r10 = n11, i10 = e207.renderer[r10], a10 = t11[r10];
          t11[r10] = (...e208) => {
            let n12 = i10.apply(t11, e208);
            return n12 === false && (n12 = a10.apply(t11, e208)), n12 || ``;
          };
        }
        n10.renderer = t11;
      }
      if (e207.tokenizer) {
        let t11 = this.defaults.tokenizer || new tN(this.defaults);
        for (let n11 in e207.tokenizer) {
          if (!(n11 in t11)) throw Error(`tokenizer '${n11}' does not exist`);
          if ([`options`, `rules`, `lexer`].includes(n11)) continue;
          let r10 = n11, i10 = e207.tokenizer[r10], a10 = t11[r10];
          t11[r10] = (...e208) => {
            let n12 = i10.apply(t11, e208);
            return n12 === false && (n12 = a10.apply(t11, e208)), n12;
          };
        }
        n10.tokenizer = t11;
      }
      if (e207.hooks) {
        let t11 = this.defaults.hooks || new EN();
        for (let n11 in e207.hooks) {
          if (!(n11 in t11)) throw Error(`hook '${n11}' does not exist`);
          if (n11 === `options`) continue;
          let r10 = n11, i10 = e207.hooks[r10], a10 = t11[r10];
          EN.passThroughHooks.has(n11) ? t11[r10] = (e208) => {
            if (this.defaults.async) return Promise.resolve(i10.call(t11, e208)).then((e209) => a10.call(t11, e209));
            let n12 = i10.call(t11, e208);
            return a10.call(t11, n12);
          } : t11[r10] = (...e208) => {
            let n12 = i10.apply(t11, e208);
            return n12 === false && (n12 = a10.apply(t11, e208)), n12;
          };
        }
        n10.hooks = t11;
      }
      if (e207.walkTokens) {
        let t11 = this.defaults.walkTokens, r10 = e207.walkTokens;
        n10.walkTokens = function(e208) {
          let n11 = [];
          return n11.push(r10.call(this, e208)), t11 && (n11 = n11.concat(t11.call(this, e208))), n11;
        };
      }
      this.defaults = { ...this.defaults, ...n10 };
    }), this;
  }
  setOptions(e206) {
    return this.defaults = { ...this.defaults, ...e206 }, this;
  }
  lexer(e206, t10) {
    return SN.lex(e206, t10 ?? this.defaults);
  }
  parser(e206, t10) {
    return TN.parse(e206, t10 ?? this.defaults);
  }
  parseMarkdown(e206, t10) {
    return (n10, r10) => {
      let i10 = { ...r10 }, a10 = { ...this.defaults, ...i10 }, o10 = this.onError(!!a10.silent, !!a10.async);
      if (this.defaults.async === true && i10.async === false) return o10(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));
      if (n10 == null) return o10(Error(`marked(): input parameter is undefined or null`));
      if (typeof n10 != `string`) return o10(Error(`marked(): input parameter is of type ` + Object.prototype.toString.call(n10) + `, string expected`));
      if (a10.hooks && (a10.hooks.options = a10), a10.async) return Promise.resolve(a10.hooks ? a10.hooks.preprocess(n10) : n10).then((t11) => e206(t11, a10)).then((e207) => a10.hooks ? a10.hooks.processAllTokens(e207) : e207).then((e207) => a10.walkTokens ? Promise.all(this.walkTokens(e207, a10.walkTokens)).then(() => e207) : e207).then((e207) => t10(e207, a10)).then((e207) => a10.hooks ? a10.hooks.postprocess(e207) : e207).catch(o10);
      try {
        a10.hooks && (n10 = a10.hooks.preprocess(n10));
        let r11 = e206(n10, a10);
        a10.hooks && (r11 = a10.hooks.processAllTokens(r11)), a10.walkTokens && this.walkTokens(r11, a10.walkTokens);
        let i11 = t10(r11, a10);
        return a10.hooks && (i11 = a10.hooks.postprocess(i11)), i11;
      } catch (e207) {
        return o10(e207);
      }
    };
  }
  onError(e206, t10) {
    return (n10) => {
      if (n10.message += `
Please report this to https://github.com/markedjs/marked.`, e206) {
        let e207 = `<p>An error occurred:</p><pre>` + JM(n10.message + ``, true) + `</pre>`;
        return t10 ? Promise.resolve(e207) : e207;
      }
      if (t10) return Promise.reject(n10);
      throw n10;
    };
  }
}, ON = new DN();
function kN(e206, t10) {
  return ON.parse(e206, t10);
}
kN.options = kN.setOptions = function(e206) {
  return ON.setOptions(e206), kN.defaults = ON.defaults, WM(kN.defaults), kN;
}, kN.getDefaults = HM, kN.defaults = UM, kN.use = function(...e206) {
  return ON.use(...e206), kN.defaults = ON.defaults, WM(kN.defaults), kN;
}, kN.walkTokens = function(e206, t10) {
  return ON.walkTokens(e206, t10);
}, kN.parseInline = ON.parseInline, kN.Parser = TN, kN.parser = TN.parse, kN.Renderer = CN, kN.TextRenderer = wN, kN.Lexer = SN, kN.lexer = SN.lex, kN.Tokenizer = tN, kN.Hooks = EN, kN.parse = kN, kN.options, kN.setOptions, kN.use, kN.walkTokens, kN.parseInline;
var ame = kN;
TN.parse;
var AN = SN.lex;
function ome(e206) {
  return JSON.stringify(e206, sme);
}
function jN(e206) {
  let t10 = JSON.parse(e206);
  return t10 = MN(t10), t10;
}
function sme(e206, t10) {
  return t10 instanceof RegExp ? { $mid: 2, source: t10.source, flags: t10.flags } : t10;
}
function MN(e206, t10 = 0) {
  if (!e206 || t10 > 200) return e206;
  if (typeof e206 == `object`) {
    switch (e206.$mid) {
      case 1:
        return $r.revive(e206);
      case 2:
        return new RegExp(e206.source, e206.flags);
      case 17:
        return new Date(e206.source);
    }
    if (e206 instanceof As || e206 instanceof Uint8Array) return e206;
    if (Array.isArray(e206)) for (let n10 = 0; n10 < e206.length; ++n10) e206[n10] = MN(e206[n10], t10 + 1);
    else for (let n10 in e206) Object.hasOwnProperty.call(e206, n10) && (e206[n10] = MN(e206[n10], t10 + 1));
  }
  return e206;
}
var { entries: NN, setPrototypeOf: PN, isFrozen: cme, getPrototypeOf: lme, getOwnPropertyDescriptor: ume } = Object, { freeze: FN, seal: IN, create: LN } = Object, { apply: RN, construct: zN } = typeof Reflect < `u` && Reflect;
FN || (FN = function(e206) {
  return e206;
}), IN || (IN = function(e206) {
  return e206;
}), RN || (RN = function(e206, t10) {
  var n10 = [...arguments].slice(2);
  return e206.apply(t10, n10);
}), zN || (zN = function(e206) {
  return new e206(...[...arguments].slice(1));
});
var BN = XN(Array.prototype.forEach), dme = XN(Array.prototype.lastIndexOf), VN = XN(Array.prototype.pop), HN = XN(Array.prototype.push), fme = XN(Array.prototype.splice), UN = XN(String.prototype.toLowerCase), WN = XN(String.prototype.toString), GN = XN(String.prototype.match), KN = XN(String.prototype.replace), pme = XN(String.prototype.indexOf), mme = XN(String.prototype.trim), qN = XN(Object.prototype.hasOwnProperty), JN = XN(RegExp.prototype.test), YN = hme(TypeError);
function XN(e206) {
  return function(t10) {
    t10 instanceof RegExp && (t10.lastIndex = 0);
    var n10 = [...arguments].slice(1);
    return RN(e206, t10, n10);
  };
}
function hme(e206) {
  return function() {
    return zN(e206, [...arguments]);
  };
}
function ZN(e206, t10) {
  let n10 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : UN;
  PN && PN(e206, null);
  let r10 = t10.length;
  for (; r10--; ) {
    let i10 = t10[r10];
    if (typeof i10 == `string`) {
      let e207 = n10(i10);
      e207 !== i10 && (cme(t10) || (t10[r10] = e207), i10 = e207);
    }
    e206[i10] = true;
  }
  return e206;
}
function gme(e206) {
  for (let t10 = 0; t10 < e206.length; t10++) qN(e206, t10) || (e206[t10] = null);
  return e206;
}
function QN(e206) {
  let t10 = LN(null);
  for (let [n10, r10] of NN(e206)) qN(e206, n10) && (Array.isArray(r10) ? t10[n10] = gme(r10) : r10 && typeof r10 == `object` && r10.constructor === Object ? t10[n10] = QN(r10) : t10[n10] = r10);
  return t10;
}
function $N(e206, t10) {
  for (; e206 !== null; ) {
    let n11 = ume(e206, t10);
    if (n11) {
      if (n11.get) return XN(n11.get);
      if (typeof n11.value == `function`) return XN(n11.value);
    }
    e206 = lme(e206);
  }
  function n10() {
    return null;
  }
  return n10;
}
var eP = FN(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)), tP = FN(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.slot.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)), nP = FN([`feBlend`, `feColorMatrix`, `feComponentTransfer`, `feComposite`, `feConvolveMatrix`, `feDiffuseLighting`, `feDisplacementMap`, `feDistantLight`, `feDropShadow`, `feFlood`, `feFuncA`, `feFuncB`, `feFuncG`, `feFuncR`, `feGaussianBlur`, `feImage`, `feMerge`, `feMergeNode`, `feMorphology`, `feOffset`, `fePointLight`, `feSpecularLighting`, `feSpotLight`, `feTile`, `feTurbulence`]), _me = FN([`animate`, `color-profile`, `cursor`, `discard`, `font-face`, `font-face-format`, `font-face-name`, `font-face-src`, `font-face-uri`, `foreignobject`, `hatch`, `hatchpath`, `mesh`, `meshgradient`, `meshpatch`, `meshrow`, `missing-glyph`, `script`, `set`, `solidcolor`, `unknown`, `use`]), rP = FN(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)), vme = FN([`maction`, `maligngroup`, `malignmark`, `mlongdiv`, `mscarries`, `mscarry`, `msgroup`, `mstack`, `msline`, `msrow`, `semantics`, `annotation`, `annotation-xml`, `mprescripts`, `none`]), iP = FN([`#text`]), aP = FN(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)), oP = FN(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)), sP = FN(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)), cP = FN([`xlink:href`, `xml:id`, `xlink:title`, `xml:space`, `xmlns:xlink`]), yme = IN(/\{\{[\w\W]*|[\w\W]*\}\}/gm), bme = IN(/<%[\w\W]*|[\w\W]*%>/gm), xme = IN(/\$\{[\w\W]*/gm), Sme = IN(/^data-[\-\w.\u00B7-\uFFFF]+$/), Cme = IN(/^aria-[\-\w]+$/), lP = IN(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), wme = IN(/^(?:\w+script|data):/i), Tme = IN(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), uP = IN(/^html$/i), Eme = IN(/^[a-z][.\w]*(-[.\w]+)+$/i), dP = Object.freeze({ __proto__: null, ARIA_ATTR: Cme, ATTR_WHITESPACE: Tme, CUSTOM_ELEMENT: Eme, DATA_ATTR: Sme, DOCTYPE_NAME: uP, ERB_EXPR: bme, IS_ALLOWED_URI: lP, IS_SCRIPT_OR_DATA: wme, MUSTACHE_EXPR: yme, TMPLIT_EXPR: xme }), fP = { element: 1, text: 3, progressingInstruction: 7, comment: 8, document: 9 }, Dme = function() {
  return typeof window > `u` ? null : window;
}, Ome = function(e206, t10) {
  if (typeof e206 != `object` || typeof e206.createPolicy != `function`) return null;
  let n10 = null, r10 = `data-tt-policy-suffix`;
  t10 && t10.hasAttribute(r10) && (n10 = t10.getAttribute(r10));
  let i10 = `dompurify` + (n10 ? `#` + n10 : ``);
  try {
    return e206.createPolicy(i10, { createHTML(e207) {
      return e207;
    }, createScriptURL(e207) {
      return e207;
    } });
  } catch {
    return console.warn(`TrustedTypes policy ` + i10 + ` could not be created.`), null;
  }
}, pP = function() {
  return { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] };
};
function mP() {
  let e206 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Dme(), t10 = (e207) => mP(e207);
  if (t10.version = `3.2.7`, t10.removed = [], !e206 || !e206.document || e206.document.nodeType !== fP.document || !e206.Element) return t10.isSupported = false, t10;
  let { document: n10 } = e206, r10 = n10, i10 = r10.currentScript, { DocumentFragment: a10, HTMLTemplateElement: o10, Node: s10, Element: c10, NodeFilter: l10, NamedNodeMap: u10 = e206.NamedNodeMap || e206.MozNamedAttrMap, HTMLFormElement: d10, DOMParser: f10, trustedTypes: p10 } = e206, m10 = c10.prototype, h10 = $N(m10, `cloneNode`), g10 = $N(m10, `remove`), _10 = $N(m10, `nextSibling`), v10 = $N(m10, `childNodes`), y10 = $N(m10, `parentNode`);
  if (typeof o10 == `function`) {
    let e207 = n10.createElement(`template`);
    e207.content && e207.content.ownerDocument && (n10 = e207.content.ownerDocument);
  }
  let b10, x10 = ``, { implementation: S10, createNodeIterator: ee2, createDocumentFragment: te2, getElementsByTagName: ne2 } = n10, { importNode: re2 } = r10, ie2 = pP();
  t10.isSupported = typeof NN == `function` && typeof y10 == `function` && S10 && S10.createHTMLDocument !== void 0;
  let { MUSTACHE_EXPR: ae2, ERB_EXPR: oe2, TMPLIT_EXPR: se2, DATA_ATTR: ce2, ARIA_ATTR: le2, IS_SCRIPT_OR_DATA: ue2, ATTR_WHITESPACE: de2, CUSTOM_ELEMENT: fe2 } = dP, { IS_ALLOWED_URI: pe2 } = dP, me2 = null, he2 = ZN({}, [...eP, ...tP, ...nP, ...rP, ...iP]), ge2 = null, _e3 = ZN({}, [...aP, ...oP, ...sP, ...cP]), ve2 = Object.seal(LN(null, { tagNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, attributeNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, allowCustomizedBuiltInElements: { writable: true, configurable: false, enumerable: true, value: false } })), ye2 = null, be2 = null, xe2 = true, Se2 = true, Ce2 = false, we2 = true, Te2 = false, Ee2 = true, De2 = false, Oe2 = false, ke2 = false, Ae2 = false, je2 = false, Me2 = false, Ne2 = true, Pe2 = false, Fe2 = true, Ie2 = false, Le2 = {}, Re2 = null, ze2 = ZN({}, [`annotation-xml`, `audio`, `colgroup`, `desc`, `foreignobject`, `head`, `iframe`, `math`, `mi`, `mn`, `mo`, `ms`, `mtext`, `noembed`, `noframes`, `noscript`, `plaintext`, `script`, `style`, `svg`, `template`, `thead`, `title`, `video`, `xmp`]), Be2 = null, Ve2 = ZN({}, [`audio`, `video`, `img`, `source`, `image`, `track`]), He2 = null, Ue2 = ZN({}, [`alt`, `class`, `for`, `id`, `label`, `name`, `pattern`, `placeholder`, `role`, `summary`, `title`, `value`, `style`, `xmlns`]), We2 = `http://www.w3.org/1998/Math/MathML`, Ge2 = `http://www.w3.org/2000/svg`, Ke2 = `http://www.w3.org/1999/xhtml`, qe2 = Ke2, Je2 = false, Ye2 = null, Xe2 = ZN({}, [We2, Ge2, Ke2], WN), Ze2 = ZN({}, [`mi`, `mo`, `mn`, `ms`, `mtext`]), Qe2 = ZN({}, [`annotation-xml`]), $e2 = ZN({}, [`title`, `style`, `font`, `a`, `script`]), et2 = null, tt2 = [`application/xhtml+xml`, `text/html`], nt2 = null, rt2 = null, it2 = n10.createElement(`form`), at2 = function(e207) {
    return e207 instanceof RegExp || e207 instanceof Function;
  }, ot2 = function() {
    let e207 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(rt2 && rt2 === e207)) {
      if ((!e207 || typeof e207 != `object`) && (e207 = {}), e207 = QN(e207), et2 = tt2.indexOf(e207.PARSER_MEDIA_TYPE) === -1 ? `text/html` : e207.PARSER_MEDIA_TYPE, nt2 = et2 === `application/xhtml+xml` ? WN : UN, me2 = qN(e207, `ALLOWED_TAGS`) ? ZN({}, e207.ALLOWED_TAGS, nt2) : he2, ge2 = qN(e207, `ALLOWED_ATTR`) ? ZN({}, e207.ALLOWED_ATTR, nt2) : _e3, Ye2 = qN(e207, `ALLOWED_NAMESPACES`) ? ZN({}, e207.ALLOWED_NAMESPACES, WN) : Xe2, He2 = qN(e207, `ADD_URI_SAFE_ATTR`) ? ZN(QN(Ue2), e207.ADD_URI_SAFE_ATTR, nt2) : Ue2, Be2 = qN(e207, `ADD_DATA_URI_TAGS`) ? ZN(QN(Ve2), e207.ADD_DATA_URI_TAGS, nt2) : Ve2, Re2 = qN(e207, `FORBID_CONTENTS`) ? ZN({}, e207.FORBID_CONTENTS, nt2) : ze2, ye2 = qN(e207, `FORBID_TAGS`) ? ZN({}, e207.FORBID_TAGS, nt2) : QN({}), be2 = qN(e207, `FORBID_ATTR`) ? ZN({}, e207.FORBID_ATTR, nt2) : QN({}), Le2 = qN(e207, `USE_PROFILES`) ? e207.USE_PROFILES : false, xe2 = e207.ALLOW_ARIA_ATTR !== false, Se2 = e207.ALLOW_DATA_ATTR !== false, Ce2 = e207.ALLOW_UNKNOWN_PROTOCOLS || false, we2 = e207.ALLOW_SELF_CLOSE_IN_ATTR !== false, Te2 = e207.SAFE_FOR_TEMPLATES || false, Ee2 = e207.SAFE_FOR_XML !== false, De2 = e207.WHOLE_DOCUMENT || false, Ae2 = e207.RETURN_DOM || false, je2 = e207.RETURN_DOM_FRAGMENT || false, Me2 = e207.RETURN_TRUSTED_TYPE || false, ke2 = e207.FORCE_BODY || false, Ne2 = e207.SANITIZE_DOM !== false, Pe2 = e207.SANITIZE_NAMED_PROPS || false, Fe2 = e207.KEEP_CONTENT !== false, Ie2 = e207.IN_PLACE || false, pe2 = e207.ALLOWED_URI_REGEXP || lP, qe2 = e207.NAMESPACE || Ke2, Ze2 = e207.MATHML_TEXT_INTEGRATION_POINTS || Ze2, Qe2 = e207.HTML_INTEGRATION_POINTS || Qe2, ve2 = e207.CUSTOM_ELEMENT_HANDLING || {}, e207.CUSTOM_ELEMENT_HANDLING && at2(e207.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (ve2.tagNameCheck = e207.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e207.CUSTOM_ELEMENT_HANDLING && at2(e207.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (ve2.attributeNameCheck = e207.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e207.CUSTOM_ELEMENT_HANDLING && typeof e207.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == `boolean` && (ve2.allowCustomizedBuiltInElements = e207.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Te2 && (Se2 = false), je2 && (Ae2 = true), Le2 && (me2 = ZN({}, iP), ge2 = [], Le2.html === true && (ZN(me2, eP), ZN(ge2, aP)), Le2.svg === true && (ZN(me2, tP), ZN(ge2, oP), ZN(ge2, cP)), Le2.svgFilters === true && (ZN(me2, nP), ZN(ge2, oP), ZN(ge2, cP)), Le2.mathMl === true && (ZN(me2, rP), ZN(ge2, sP), ZN(ge2, cP))), e207.ADD_TAGS && (me2 === he2 && (me2 = QN(me2)), ZN(me2, e207.ADD_TAGS, nt2)), e207.ADD_ATTR && (ge2 === _e3 && (ge2 = QN(ge2)), ZN(ge2, e207.ADD_ATTR, nt2)), e207.ADD_URI_SAFE_ATTR && ZN(He2, e207.ADD_URI_SAFE_ATTR, nt2), e207.FORBID_CONTENTS && (Re2 === ze2 && (Re2 = QN(Re2)), ZN(Re2, e207.FORBID_CONTENTS, nt2)), Fe2 && (me2[`#text`] = true), De2 && ZN(me2, [`html`, `head`, `body`]), me2.table && (ZN(me2, [`tbody`]), delete ye2.tbody), e207.TRUSTED_TYPES_POLICY) {
        if (typeof e207.TRUSTED_TYPES_POLICY.createHTML != `function`) throw YN(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);
        if (typeof e207.TRUSTED_TYPES_POLICY.createScriptURL != `function`) throw YN(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);
        b10 = e207.TRUSTED_TYPES_POLICY, x10 = b10.createHTML(``);
      } else b10 === void 0 && (b10 = Ome(p10, i10)), b10 !== null && typeof x10 == `string` && (x10 = b10.createHTML(``));
      FN && FN(e207), rt2 = e207;
    }
  }, st2 = ZN({}, [...tP, ...nP, ..._me]), ct2 = ZN({}, [...rP, ...vme]), lt2 = function(e207) {
    let t11 = y10(e207);
    (!t11 || !t11.tagName) && (t11 = { namespaceURI: qe2, tagName: `template` });
    let n11 = UN(e207.tagName), r11 = UN(t11.tagName);
    return Ye2[e207.namespaceURI] ? e207.namespaceURI === Ge2 ? t11.namespaceURI === Ke2 ? n11 === `svg` : t11.namespaceURI === We2 ? n11 === `svg` && (r11 === `annotation-xml` || Ze2[r11]) : !!st2[n11] : e207.namespaceURI === We2 ? t11.namespaceURI === Ke2 ? n11 === `math` : t11.namespaceURI === Ge2 ? n11 === `math` && Qe2[r11] : !!ct2[n11] : e207.namespaceURI === Ke2 ? t11.namespaceURI === Ge2 && !Qe2[r11] || t11.namespaceURI === We2 && !Ze2[r11] ? false : !ct2[n11] && ($e2[n11] || !st2[n11]) : !!(et2 === `application/xhtml+xml` && Ye2[e207.namespaceURI]) : false;
  }, ut2 = function(e207) {
    HN(t10.removed, { element: e207 });
    try {
      y10(e207).removeChild(e207);
    } catch {
      g10(e207);
    }
  }, C10 = function(e207, n11) {
    try {
      HN(t10.removed, { attribute: n11.getAttributeNode(e207), from: n11 });
    } catch {
      HN(t10.removed, { attribute: null, from: n11 });
    }
    if (n11.removeAttribute(e207), e207 === `is`) if (Ae2 || je2) try {
      ut2(n11);
    } catch {
    }
    else try {
      n11.setAttribute(e207, ``);
    } catch {
    }
  }, dt2 = function(e207) {
    let t11 = null, r11 = null;
    if (ke2) e207 = `<remove></remove>` + e207;
    else {
      let t12 = GN(e207, /^[\r\n\t ]+/);
      r11 = t12 && t12[0];
    }
    et2 === `application/xhtml+xml` && qe2 === Ke2 && (e207 = `<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>` + e207 + `</body></html>`);
    let i11 = b10 ? b10.createHTML(e207) : e207;
    if (qe2 === Ke2) try {
      t11 = new f10().parseFromString(i11, et2);
    } catch {
    }
    if (!t11 || !t11.documentElement) {
      t11 = S10.createDocument(qe2, `template`, null);
      try {
        t11.documentElement.innerHTML = Je2 ? x10 : i11;
      } catch {
      }
    }
    let a11 = t11.body || t11.documentElement;
    return e207 && r11 && a11.insertBefore(n10.createTextNode(r11), a11.childNodes[0] || null), qe2 === Ke2 ? ne2.call(t11, De2 ? `html` : `body`)[0] : De2 ? t11.documentElement : a11;
  }, w10 = function(e207) {
    return ee2.call(e207.ownerDocument || e207, e207, l10.SHOW_ELEMENT | l10.SHOW_COMMENT | l10.SHOW_TEXT | l10.SHOW_PROCESSING_INSTRUCTION | l10.SHOW_CDATA_SECTION, null);
  }, ft2 = function(e207) {
    return e207 instanceof d10 && (typeof e207.nodeName != `string` || typeof e207.textContent != `string` || typeof e207.removeChild != `function` || !(e207.attributes instanceof u10) || typeof e207.removeAttribute != `function` || typeof e207.setAttribute != `function` || typeof e207.namespaceURI != `string` || typeof e207.insertBefore != `function` || typeof e207.hasChildNodes != `function`);
  }, pt2 = function(e207) {
    return typeof s10 == `function` && e207 instanceof s10;
  };
  function mt2(e207, n11, r11) {
    BN(e207, (e208) => {
      e208.call(t10, n11, r11, rt2);
    });
  }
  let ht2 = function(e207) {
    let n11 = null;
    if (mt2(ie2.beforeSanitizeElements, e207, null), ft2(e207)) return ut2(e207), true;
    let r11 = nt2(e207.nodeName);
    if (mt2(ie2.uponSanitizeElement, e207, { tagName: r11, allowedTags: me2 }), Ee2 && e207.hasChildNodes() && !pt2(e207.firstElementChild) && JN(/<[/\w!]/g, e207.innerHTML) && JN(/<[/\w!]/g, e207.textContent) || e207.nodeType === fP.progressingInstruction || Ee2 && e207.nodeType === fP.comment && JN(/<[/\w]/g, e207.data)) return ut2(e207), true;
    if (!me2[r11] || ye2[r11]) {
      if (!ye2[r11] && _t3(r11) && (ve2.tagNameCheck instanceof RegExp && JN(ve2.tagNameCheck, r11) || ve2.tagNameCheck instanceof Function && ve2.tagNameCheck(r11))) return false;
      if (Fe2 && !Re2[r11]) {
        let t11 = y10(e207) || e207.parentNode, n12 = v10(e207) || e207.childNodes;
        if (n12 && t11) {
          let r12 = n12.length;
          for (let i11 = r12 - 1; i11 >= 0; --i11) {
            let r13 = h10(n12[i11], true);
            r13.__removalCount = (e207.__removalCount || 0) + 1, t11.insertBefore(r13, _10(e207));
          }
        }
      }
      return ut2(e207), true;
    }
    return e207 instanceof c10 && !lt2(e207) || (r11 === `noscript` || r11 === `noembed` || r11 === `noframes`) && JN(/<\/no(script|embed|frames)/i, e207.innerHTML) ? (ut2(e207), true) : (Te2 && e207.nodeType === fP.text && (n11 = e207.textContent, BN([ae2, oe2, se2], (e208) => {
      n11 = KN(n11, e208, ` `);
    }), e207.textContent !== n11 && (HN(t10.removed, { element: e207.cloneNode() }), e207.textContent = n11)), mt2(ie2.afterSanitizeElements, e207, null), false);
  }, gt2 = function(e207, t11, r11) {
    if (Ne2 && (t11 === `id` || t11 === `name`) && (r11 in n10 || r11 in it2)) return false;
    if (!(Se2 && !be2[t11] && JN(ce2, t11)) && !(xe2 && JN(le2, t11))) {
      if (!ge2[t11] || be2[t11]) {
        if (!(_t3(e207) && (ve2.tagNameCheck instanceof RegExp && JN(ve2.tagNameCheck, e207) || ve2.tagNameCheck instanceof Function && ve2.tagNameCheck(e207)) && (ve2.attributeNameCheck instanceof RegExp && JN(ve2.attributeNameCheck, t11) || ve2.attributeNameCheck instanceof Function && ve2.attributeNameCheck(t11, e207)) || t11 === `is` && ve2.allowCustomizedBuiltInElements && (ve2.tagNameCheck instanceof RegExp && JN(ve2.tagNameCheck, r11) || ve2.tagNameCheck instanceof Function && ve2.tagNameCheck(r11)))) return false;
      } else if (!He2[t11] && !JN(pe2, KN(r11, de2, ``)) && !((t11 === `src` || t11 === `xlink:href` || t11 === `href`) && e207 !== `script` && pme(r11, `data:`) === 0 && Be2[e207]) && !(Ce2 && !JN(ue2, KN(r11, de2, ``))) && r11) return false;
    }
    return true;
  }, _t3 = function(e207) {
    return e207 !== `annotation-xml` && GN(e207, fe2);
  }, vt2 = function(e207) {
    mt2(ie2.beforeSanitizeAttributes, e207, null);
    let { attributes: n11 } = e207;
    if (!n11 || ft2(e207)) return;
    let r11 = { attrName: ``, attrValue: ``, keepAttr: true, allowedAttributes: ge2, forceKeepAttr: void 0 }, i11 = n11.length;
    for (; i11--; ) {
      let { name: a11, namespaceURI: o11, value: s11 } = n11[i11], c11 = nt2(a11), l11 = s11, u11 = a11 === `value` ? l11 : mme(l11);
      if (r11.attrName = c11, r11.attrValue = u11, r11.keepAttr = true, r11.forceKeepAttr = void 0, mt2(ie2.uponSanitizeAttribute, e207, r11), u11 = r11.attrValue, Pe2 && (c11 === `id` || c11 === `name`) && (C10(a11, e207), u11 = `user-content-` + u11), Ee2 && JN(/((--!?|])>)|<\/(style|title|textarea)/i, u11)) {
        C10(a11, e207);
        continue;
      }
      if (c11 === `attributename` && GN(u11, `href`)) {
        C10(a11, e207);
        continue;
      }
      if (r11.forceKeepAttr) continue;
      if (!r11.keepAttr) {
        C10(a11, e207);
        continue;
      }
      if (!we2 && JN(/\/>/i, u11)) {
        C10(a11, e207);
        continue;
      }
      Te2 && BN([ae2, oe2, se2], (e208) => {
        u11 = KN(u11, e208, ` `);
      });
      let d11 = nt2(e207.nodeName);
      if (!gt2(d11, c11, u11)) {
        C10(a11, e207);
        continue;
      }
      if (b10 && typeof p10 == `object` && typeof p10.getAttributeType == `function` && !o11) switch (p10.getAttributeType(d11, c11)) {
        case `TrustedHTML`:
          u11 = b10.createHTML(u11);
          break;
        case `TrustedScriptURL`:
          u11 = b10.createScriptURL(u11);
          break;
      }
      if (u11 !== l11) try {
        o11 ? e207.setAttributeNS(o11, a11, u11) : e207.setAttribute(a11, u11), ft2(e207) ? ut2(e207) : VN(t10.removed);
      } catch {
        C10(a11, e207);
      }
    }
    mt2(ie2.afterSanitizeAttributes, e207, null);
  }, yt2 = function e207(t11) {
    let n11 = null, r11 = w10(t11);
    for (mt2(ie2.beforeSanitizeShadowDOM, t11, null); n11 = r11.nextNode(); ) mt2(ie2.uponSanitizeShadowNode, n11, null), ht2(n11), vt2(n11), n11.content instanceof a10 && e207(n11.content);
    mt2(ie2.afterSanitizeShadowDOM, t11, null);
  };
  return t10.sanitize = function(e207) {
    let n11 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i11 = null, o11 = null, c11 = null, l11 = null;
    if (Je2 = !e207, Je2 && (e207 = `<!-->`), typeof e207 != `string` && !pt2(e207)) if (typeof e207.toString == `function`) {
      if (e207 = e207.toString(), typeof e207 != `string`) throw YN(`dirty is not a string, aborting`);
    } else throw YN(`toString is not a function`);
    if (!t10.isSupported) return e207;
    if (Oe2 || ot2(n11), t10.removed = [], typeof e207 == `string` && (Ie2 = false), Ie2) {
      if (e207.nodeName) {
        let t11 = nt2(e207.nodeName);
        if (!me2[t11] || ye2[t11]) throw YN(`root node is forbidden and cannot be sanitized in-place`);
      }
    } else if (e207 instanceof s10) i11 = dt2(`<!---->`), o11 = i11.ownerDocument.importNode(e207, true), o11.nodeType === fP.element && o11.nodeName === `BODY` || o11.nodeName === `HTML` ? i11 = o11 : i11.appendChild(o11);
    else {
      if (!Ae2 && !Te2 && !De2 && e207.indexOf(`<`) === -1) return b10 && Me2 ? b10.createHTML(e207) : e207;
      if (i11 = dt2(e207), !i11) return Ae2 ? null : Me2 ? x10 : ``;
    }
    i11 && ke2 && ut2(i11.firstChild);
    let u11 = w10(Ie2 ? e207 : i11);
    for (; c11 = u11.nextNode(); ) ht2(c11), vt2(c11), c11.content instanceof a10 && yt2(c11.content);
    if (Ie2) return e207;
    if (Ae2) {
      if (je2) for (l11 = te2.call(i11.ownerDocument); i11.firstChild; ) l11.appendChild(i11.firstChild);
      else l11 = i11;
      return (ge2.shadowroot || ge2.shadowrootmode) && (l11 = re2.call(r10, l11, true)), l11;
    }
    let d11 = De2 ? i11.outerHTML : i11.innerHTML;
    return De2 && me2[`!doctype`] && i11.ownerDocument && i11.ownerDocument.doctype && i11.ownerDocument.doctype.name && JN(uP, i11.ownerDocument.doctype.name) && (d11 = `<!DOCTYPE ` + i11.ownerDocument.doctype.name + `>
` + d11), Te2 && BN([ae2, oe2, se2], (e208) => {
      d11 = KN(d11, e208, ` `);
    }), b10 && Me2 ? b10.createHTML(d11) : d11;
  }, t10.setConfig = function() {
    ot2(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), Oe2 = true;
  }, t10.clearConfig = function() {
    rt2 = null, Oe2 = false;
  }, t10.isValidAttribute = function(e207, t11, n11) {
    return rt2 || ot2({}), gt2(nt2(e207), nt2(t11), n11);
  }, t10.addHook = function(e207, t11) {
    typeof t11 == `function` && HN(ie2[e207], t11);
  }, t10.removeHook = function(e207, t11) {
    if (t11 !== void 0) {
      let n11 = dme(ie2[e207], t11);
      return n11 === -1 ? void 0 : fme(ie2[e207], n11, 1)[0];
    }
    return VN(ie2[e207]);
  }, t10.removeHooks = function(e207) {
    ie2[e207] = [];
  }, t10.removeAllHooks = function() {
    ie2 = pP();
  }, t10;
}
var hP = mP(), gP = Object.freeze(`a.abbr.b.bdo.blockquote.br.caption.cite.code.col.colgroup.dd.del.details.dfn.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.ins.kbd.label.li.mark.ol.p.pre.q.rp.rt.ruby.s.samp.small.small.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.time.tr.tt.u.ul.var.video.wbr`.split(`.`)), _P2 = Object.freeze([`href`, `target`, `src`, `alt`, `title`, `for`, `name`, `role`, `tabindex`, `x-dispatch`, `required`, `checked`, `placeholder`, `type`, `start`, `width`, `height`, `align`]), vP = `vscode-relative-path`;
function yP(e206, t10) {
  if (t10.override === `*`) return true;
  try {
    let n10 = new URL(e206, vP + `://`);
    return !!(t10.override.includes(n10.protocol.replace(/:$/, ``)) || t10.allowRelativePaths && n10.protocol === vP + `:` && !e206.trim().toLowerCase().startsWith(vP));
  } catch {
    return false;
  }
}
function kme(e206, t10) {
  hP.addHook(`afterSanitizeAttributes`, (n10) => {
    for (let r10 of [`href`, `src`]) if (n10.hasAttribute(r10)) {
      let i10 = n10.getAttribute(r10);
      r10 === `href` ? !i10.startsWith(`#`) && !yP(i10, e206) && n10.removeAttribute(r10) : yP(i10, t10) || n10.removeAttribute(r10);
    }
  });
}
var Ame = Object.freeze({ ALLOWED_TAGS: [...gP], ALLOWED_ATTR: [..._P2], ALLOW_UNKNOWN_PROTOCOLS: true });
function jme(e206, t10) {
  return bP(e206, t10, `trusted`);
}
function bP(e206, t10, n10) {
  try {
    let r10 = { ...Ame };
    t10?.allowedTags && (t10.allowedTags.override && (r10.ALLOWED_TAGS = [...t10.allowedTags.override]), t10.allowedTags.augment && (r10.ALLOWED_TAGS = [...r10.ALLOWED_TAGS ?? [], ...t10.allowedTags.augment]));
    let i10 = [..._P2];
    t10?.allowedAttributes && (t10.allowedAttributes.override && (i10 = [...t10.allowedAttributes.override]), t10.allowedAttributes.augment && (i10 = [...i10, ...t10.allowedAttributes.augment])), i10 = i10.map((e207) => typeof e207 == `string` ? e207.toLowerCase() : { attributeName: e207.attributeName.toLowerCase(), shouldKeep: e207.shouldKeep });
    let a10 = new Set(i10.map((e207) => typeof e207 == `string` ? e207 : e207.attributeName)), o10 = /* @__PURE__ */ new Map();
    for (let e207 of i10) typeof e207 == `string` ? o10.delete(e207) : o10.set(e207.attributeName, e207);
    return r10.ALLOWED_ATTR = Array.from(a10), kme({ override: t10?.allowedLinkProtocols?.override ?? [xs.http, xs.https], allowRelativePaths: t10?.allowRelativeLinkPaths ?? false }, { override: t10?.allowedMediaProtocols?.override ?? [xs.http, xs.https], allowRelativePaths: t10?.allowRelativeMediaPaths ?? false }), t10?.replaceWithPlaintext && hP.addHook(`uponSanitizeElement`, Nme), o10.size && hP.addHook(`uponSanitizeAttribute`, (e207, t11) => {
      let n11 = o10.get(t11.attrName);
      if (n11) {
        let r11 = n11.shouldKeep(e207, t11);
        typeof r11 == `string` ? (t11.keepAttr = true, t11.attrValue = r11) : t11.keepAttr = r11;
      } else t11.keepAttr = a10.has(t11.attrName);
    }), n10 === `dom` ? hP.sanitize(e206, { ...r10, RETURN_DOM_FRAGMENT: true }) : hP.sanitize(e206, { ...r10, RETURN_TRUSTED_TYPE: true });
  } finally {
    hP.removeAllHooks();
  }
}
var Mme = [`area`, `base`, `br`, `col`, `command`, `embed`, `hr`, `img`, `input`, `keygen`, `link`, `meta`, `param`, `source`, `track`, `wbr`], Nme = (e206, t10, n10) => {
  if (!t10.allowedTags[t10.tagName] && t10.tagName !== `body`) {
    let t11 = xP(e206);
    t11 && (e206.nodeType === Node.COMMENT_NODE ? e206.parentElement?.insertBefore(t11, e206) : e206.parentElement?.replaceChild(t11, e206));
  }
};
function xP(e206) {
  if (!e206.ownerDocument) return;
  let t10, n10;
  if (e206.nodeType === Node.COMMENT_NODE) t10 = `<!--${e206.textContent}-->`;
  else if (e206 instanceof Element) {
    let r11 = e206.tagName.toLowerCase(), i11 = Mme.includes(r11);
    t10 = `<${r11}${e206.attributes.length ? ` ` + Array.from(e206.attributes).map((e207) => `${e207.name}="${e207.value}"`).join(` `) : ``}>`, i11 || (n10 = `</${r11}>`);
  } else return;
  let r10 = document.createDocumentFragment(), i10 = e206.ownerDocument.createTextNode(t10);
  for (r10.appendChild(i10); e206.firstChild; ) r10.appendChild(e206.firstChild);
  let a10 = n10 ? e206.ownerDocument.createTextNode(n10) : void 0;
  return a10 && r10.appendChild(a10), r10;
}
function SP(e206, t10, n10) {
  Jl(e206, bP(t10, n10, `dom`));
}
var Pme = RegExp(`(\\\\)?\\$\\((${ju.iconNameExpression}(?:${ju.iconModifierExpression})?)\\)`, `g`);
function CP(e206) {
  let t10 = [], n10, r10 = 0, i10 = 0;
  for (; (n10 = Pme.exec(e206)) !== null; ) {
    i10 = n10.index || 0, r10 < i10 && t10.push(e206.substring(r10, i10)), r10 = (n10.index || 0) + n10[0].length;
    let [, a10, o10] = n10;
    t10.push(a10 ? `$(${o10})` : wP({ id: o10 }));
  }
  return r10 < e206.length && t10.push(e206.substring(r10)), t10;
}
function wP(e206) {
  let t10 = B(`span`);
  return t10.classList.add(...ju.asClassNameArray(e206)), t10;
}
var TP = Object.freeze({ image: ({ href: e206, title: t10, text: n10 }) => {
  let r10 = [], i10 = [];
  return e206 && ({ href: e206, dimensions: r10 } = Ope(e206), i10.push(`src="${LM(e206)}"`)), n10 && i10.push(`alt="${LM(n10)}"`), t10 && i10.push(`title="${LM(t10)}"`), r10.length && (i10 = i10.concat(r10)), `<img ` + i10.join(` `) + `>`;
}, paragraph({ tokens: e206 }) {
  return `<p>${this.parser.parseInline(e206)}</p>`;
}, link({ href: e206, title: t10, tokens: n10 }) {
  let r10 = this.parser.parseInline(n10);
  return typeof e206 == `string` ? (e206 === r10 && (r10 = RM(r10)), t10 = typeof t10 == `string` ? LM(RM(t10)) : ``, e206 = RM(e206), e206 = e206.replace(/&/g, `&amp;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`).replace(/"/g, `&quot;`).replace(/'/g, `&#39;`), `<a href="${e206}" title="${t10 || e206}" draggable="false">${r10}</a>`) : ``;
} });
function Fme(e206) {
  return function(t10) {
    let { tokens: n10 } = t10, r10 = n10[0];
    if (r10?.type !== `paragraph`) return e206.call(this, t10);
    let i10 = r10.tokens;
    if (!i10 || i10.length === 0) return e206.call(this, t10);
    let a10 = i10[0];
    if (a10?.type !== `text`) return e206.call(this, t10);
    let o10 = /^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i, s10 = a10.raw.match(o10);
    if (!s10) return e206.call(this, t10);
    a10.raw = a10.raw.replace(o10, ``), a10.text = a10.text.replace(o10, ``);
    let c10 = { note: `info`, tip: `light-bulb`, important: `comment`, warning: `alert`, caution: `stop` }, l10 = s10[1], u10 = l10.charAt(0).toUpperCase() + l10.slice(1).toLowerCase(), d10 = l10.toLowerCase();
    return `<blockquote data-severity="${d10}"><p><span>${wP({ id: c10[d10] }).outerHTML}${u10}</span>${this.parser.parse(n10).substring(3)}</blockquote>
`;
  };
}
function EP(e206, t10 = {}, n10) {
  let r10 = new E(), i10 = false, a10 = new DN(...t10.markedExtensions ?? []), { renderer: o10, codeBlocks: s10, syncCodeBlocks: c10 } = Lme(a10, t10, e206), l10 = Rme(e206), u10;
  if (t10.fillInIncompleteTokens) {
    let e207 = { ...a10.defaults, ...t10.markedOptions, renderer: o10 }, n11 = Zme(a10.lexer(l10, e207));
    u10 = a10.parser(n11, e207);
  } else u10 = a10.parse(l10, { ...t10?.markedOptions, renderer: o10, async: false });
  e206.supportThemeIcons && (u10 = CP(u10).map((e207) => typeof e207 == `string` ? e207 : e207.outerHTML).join(``));
  let d10 = document.createElement(`div`), f10 = jP(e206, t10.sanitizerConfig ?? {});
  SP(d10, u10, f10), Ime(e206, t10, d10);
  let p10;
  if (n10 ? (p10 = n10, Jl(n10, ...d10.children)) : p10 = d10, s10.length > 0) Promise.all(s10).then((e207) => {
    if (i10) return;
    let n11 = new Map(e207), r11 = p10.querySelectorAll(`div[data-code]`);
    for (let e208 of r11) {
      let t11 = n11.get(e208.dataset.code ?? ``);
      t11 && Jl(e208, t11);
    }
    t10.asyncRenderCallback?.();
  });
  else if (c10.length > 0) {
    let e207 = new Map(c10), t11 = p10.querySelectorAll(`div[data-code]`);
    for (let n11 of t11) {
      let t12 = e207.get(n11.dataset.code ?? ``);
      t12 && Jl(n11, t12);
    }
  }
  if (t10.asyncRenderCallback) for (let e207 of p10.getElementsByTagName(`img`)) {
    let n11 = r10.add(L(e207, `load`, () => {
      n11.dispose(), t10.asyncRenderCallback();
    }));
  }
  if (t10.actionHandler) {
    let n11 = (n12) => {
      let r11 = new Xo(Vc(p10), n12);
      !r11.leftButton && !r11.middleButton || DP(e206, t10, r11);
    };
    r10.add(L(p10, `click`, n11)), r10.add(L(p10, `auxclick`, n11)), r10.add(L(p10, `keydown`, (n12) => {
      let r11 = new Jo(n12);
      !r11.equals(10) && !r11.equals(3) || DP(e206, t10, r11);
    }));
  }
  for (let e207 of [...p10.getElementsByTagName(`input`)]) if (e207.attributes.getNamedItem(`type`)?.value === `checkbox`) e207.setAttribute(`disabled`, ``);
  else if (t10.sanitizerConfig?.replaceWithPlaintext) {
    let t11 = xP(e207);
    t11 ? e207.parentElement?.replaceChild(t11, e207) : e207.remove();
  } else e207.remove();
  return { element: p10, dispose: () => {
    i10 = true, r10.dispose();
  } };
}
function Ime(e206, t10, n10) {
  for (let r10 of n10.querySelectorAll(`img, audio, video, source`)) {
    let n11 = r10.getAttribute(`src`);
    if (n11) {
      let i10 = n11;
      try {
        e206.baseUri && (i10 = AP($r.from(e206.baseUri), i10));
      } catch {
      }
      if (r10.setAttribute(`src`, OP(e206, i10, true)), t10.sanitizerConfig?.remoteImageIsAllowed) {
        let e207 = $r.parse(i10);
        e207.scheme !== xs.file && e207.scheme !== xs.data && !t10.sanitizerConfig.remoteImageIsAllowed(e207) && r10.replaceWith(B(``, void 0, r10.outerHTML));
      }
    }
  }
  for (let t11 of n10.querySelectorAll(`a`)) {
    let n11 = t11.getAttribute(`href`);
    if (t11.setAttribute(`href`, ``), !n11 || /^data:|javascript:/i.test(n11) || /^command:/i.test(n11) && !e206.isTrusted || /^command:(\/\/\/)?_workbench\.downloadResource/i.test(n11)) t11.replaceWith(...t11.childNodes);
    else {
      let r10 = OP(e206, n11, false);
      e206.baseUri && (r10 = AP($r.from(e206.baseUri), n11)), t11.dataset.href = r10;
    }
  }
}
function Lme(e206, t10, n10) {
  let r10 = new e206.Renderer(t10.markedOptions);
  r10.image = TP.image, r10.link = TP.link, r10.paragraph = TP.paragraph, n10.supportAlertSyntax && (r10.blockquote = Fme(r10.blockquote));
  let i10 = [], a10 = [];
  return t10.codeBlockRendererSync ? r10.code = ({ text: e207, lang: n11, raw: r11 }) => {
    let i11 = VM.nextId(), o10 = t10.codeBlockRendererSync(kP(n11), e207, r11);
    return a10.push([i11, o10]), `<div class="code" data-code="${i11}">${Ra(e207)}</div>`;
  } : t10.codeBlockRenderer && (r10.code = ({ text: e207, lang: n11 }) => {
    let r11 = VM.nextId(), a11 = t10.codeBlockRenderer(kP(n11), e207);
    return i10.push(a11.then((e208) => [r11, e208])), `<div class="code" data-code="${r11}">${Ra(e207)}</div>`;
  }), n10.supportHtml || (r10.html = ({ text: e207 }) => t10.sanitizerConfig?.replaceWithPlaintext ? Ra(e207) : n10.isTrusted && e207.match(/^(<span[^>]+>)|(<\/\s*span>)$/) ? e207 : ``), { renderer: r10, codeBlocks: i10, syncCodeBlocks: a10 };
}
function Rme(e206) {
  let t10 = e206.value;
  return t10.length > 1e5 && (t10 = `${t10.substr(0, 1e5)}\u2026`), e206.supportThemeIcons && (t10 = Cpe(t10)), t10;
}
function DP(e206, t10, n10) {
  let r10 = n10.target.closest(`a[data-href]`);
  if (Fl(r10)) try {
    let n11 = r10.dataset.href;
    n11 && (e206.baseUri && (n11 = AP($r.from(e206.baseUri), n11)), t10.actionHandler?.(n11, e206));
  } catch (e207) {
    be(e207);
  } finally {
    n10.preventDefault();
  }
}
function zme(e206, t10) {
  let n10;
  try {
    n10 = jN(decodeURIComponent(t10));
  } catch {
  }
  return n10 ? (n10 = rt(n10, (t11) => {
    if (e206.uris && e206.uris[t11]) return $r.revive(e206.uris[t11]);
  }), encodeURIComponent(JSON.stringify(n10))) : t10;
}
function OP(e206, t10, n10) {
  let r10 = e206.uris && e206.uris[t10], i10 = $r.revive(r10);
  return n10 ? t10.startsWith(xs.data + `:`) ? t10 : (i10 || (i10 = $r.parse(t10)), Es.uriToBrowserUri(i10).toString(true)) : !i10 || $r.parse(t10).toString() === i10.toString() ? t10 : (i10.query && (i10 = i10.with({ query: zme(e206, i10.query) })), i10.toString());
}
function kP(e206) {
  if (!e206) return ``;
  let t10 = e206.split(/[\s+|:|,|\{|\?]/, 1);
  return t10.length ? t10[0] : e206;
}
function AP(e206, t10) {
  return /^\w[\w\d+.-]*:/.test(t10) ? t10 : e206.path.endsWith(`/`) ? zd(e206, t10).toString() : zd(Ld(e206), t10).toString();
}
function Bme(e206, t10, n10 = {}) {
  return jme(e206, jP(t10, n10));
}
var Vme = Object.freeze([...gP, `input`]), Hme = Object.freeze([`align`, `autoplay`, `alt`, `colspan`, `controls`, `draggable`, `height`, `href`, `loop`, `muted`, `playsinline`, `poster`, `rowspan`, `src`, `target`, `title`, `type`, `width`, `start`, `checked`, `disabled`, `value`, `data-code`, `data-href`, `data-severity`, { attributeName: `style`, shouldKeep: (e206, t10) => e206.tagName === `SPAN` && t10.attrName === `style` ? /^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(t10.attrValue) : false }, { attributeName: `class`, shouldKeep: (e206, t10) => e206.tagName === `SPAN` && t10.attrName === `class` ? /^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t10.attrValue) : false }]);
function jP(e206, t10) {
  let n10 = e206.isTrusted ?? false, r10 = [xs.http, xs.https, xs.mailto, xs.file, xs.vscodeFileResource, xs.vscodeRemote, xs.vscodeRemoteResource, xs.vscodeNotebookCell];
  return n10 && r10.push(xs.command), t10.allowedLinkSchemes?.augment && r10.push(...t10.allowedLinkSchemes.augment), { allowedTags: { override: t10.allowedTags?.override ?? Vme }, allowedAttributes: { override: t10.allowedAttributes?.override ?? Hme }, allowedLinkProtocols: { override: r10 }, allowRelativeLinkPaths: !!e206.baseUri, allowedMediaProtocols: { override: [xs.http, xs.https, xs.data, xs.file, xs.vscodeFileResource, xs.vscodeRemote, xs.vscodeRemoteResource] }, allowRelativeMediaPaths: !!e206.baseUri, replaceWithPlaintext: t10.replaceWithPlaintext };
}
function Ume(e206, t10) {
  if (typeof e206 == `string`) return e206;
  let n10 = e206.value ?? ``;
  return n10.length > 1e5 && (n10 = `${n10.substr(0, 1e5)}\u2026`), Bme(ame(n10, { async: false, renderer: Gme.value }), { isTrusted: false }, {}).toString().replace(/&(#\d+|[a-zA-Z]+);/g, (e207) => Wme.get(e207) ?? e207).trim();
}
var Wme = /* @__PURE__ */ new Map([[`&quot;`, `"`], [`&nbsp;`, ` `], [`&amp;`, `&`], [`&#39;`, `'`], [`&lt;`, `<`], [`&gt;`, `>`]]);
function MP() {
  let e206 = new CN();
  return e206.code = ({ text: e207 }) => Ra(e207), e206.blockquote = ({ text: e207 }) => e207 + `
`, e206.html = (e207) => ``, e206.heading = function({ tokens: e207 }) {
    return this.parser.parseInline(e207) + `
`;
  }, e206.hr = () => ``, e206.list = function({ items: e207 }) {
    return e207.map((e208) => this.listitem(e208)).join(`
`) + `
`;
  }, e206.listitem = ({ text: e207 }) => e207 + `
`, e206.paragraph = function({ tokens: e207 }) {
    return this.parser.parseInline(e207) + `
`;
  }, e206.table = function({ header: e207, rows: t10 }) {
    return e207.map((e208) => this.tablecell(e208)).join(` `) + `
` + t10.map((e208) => e208.map((e209) => this.tablecell(e209)).join(` `)).join(`
`) + `
`;
  }, e206.tablerow = ({ text: e207 }) => e207, e206.tablecell = function({ tokens: e207 }) {
    return this.parser.parseInline(e207);
  }, e206.strong = ({ text: e207 }) => e207, e206.em = ({ text: e207 }) => e207, e206.codespan = ({ text: e207 }) => Ra(e207), e206.br = (e207) => `
`, e206.del = ({ text: e207 }) => e207, e206.image = (e207) => ``, e206.text = ({ text: e207 }) => e207, e206.link = ({ text: e207 }) => e207, e206;
}
var Gme = new Fa(MP);
new Fa(() => {
  let e206 = MP();
  return e206.code = ({ text: e207 }) => `
\`\`\`
${Ra(e207)}
\`\`\`
`, e206;
});
function NP(e206) {
  let t10 = ``;
  return e206.forEach((e207) => {
    t10 += e207.raw;
  }), t10;
}
function PP(e206) {
  if (e206.tokens) for (let t10 = e206.tokens.length - 1; t10 >= 0; t10--) {
    let n10 = e206.tokens[t10];
    if (n10.type === `text`) {
      let r10 = n10.raw.split(`
`), i10 = r10[r10.length - 1];
      if (i10.includes("`")) return $me(e206);
      if (i10.includes(`**`)) return ahe(e206);
      if (i10.match(/\*\w/)) return ehe(e206);
      if (i10.match(/(^|\s)__\w/)) return ohe(e206);
      if (i10.match(/(^|\s)_\w/)) return the(e206);
      if (Kme(i10) || qme(i10) && e206.tokens.slice(0, t10).some((e207) => e207.type === `text` && e207.raw.match(/\[[^\]]*$/))) {
        let n11 = e206.tokens.slice(t10 + 1);
        return n11[0]?.type === `link` && n11[1]?.type === `text` && n11[1].raw.match(/^ *"[^"]*$/) || i10.match(/^[^"]* +"[^"]*$/) ? rhe(e206) : nhe(e206);
      } else if (i10.match(/(^|\s)\[\w*[^\]]*$/)) return ihe(e206);
    }
  }
}
function Kme(e206) {
  return !!e206.match(/(^|\s)\[.*\]\(\w*/);
}
function qme(e206) {
  return !!e206.match(/^[^\[]*\]\([^\)]*$/);
}
function Jme(e206) {
  let t10 = e206.items[e206.items.length - 1], n10 = t10.tokens ? t10.tokens[t10.tokens.length - 1] : void 0, r10 = (e207) => {
    let t11 = e207.items.at(-1)?.tokens.at(-1);
    return t11?.type === `heading` || t11?.type === `list` && r10(t11);
  }, i10;
  if (n10?.type === `text` && !(`inRawBlock` in t10)) i10 = PP(n10);
  else if (r10(e206)) {
    let t11 = AN(e206.raw.trim() + ` &nbsp;`)[0];
    return t11.type === `list` ? t11 : void 0;
  }
  if (!i10 || i10.type !== `paragraph`) return;
  let a10 = NP(e206.items.slice(0, -1)), o10 = t10.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];
  if (!o10) return;
  let s10 = AN(a10 + (o10 + NP(t10.tokens.slice(0, -1)) + i10.raw))[0];
  if (s10.type === `list`) return s10;
}
function Yme(e206, t10) {
  if (e206.raw.match(/-\s*$/)) return AN(t10 + ` &nbsp;`);
}
var Xme = 3;
function Zme(e206) {
  for (let t10 = 0; t10 < Xme; t10++) {
    let t11 = Qme(e206);
    if (t11) e206 = t11;
    else break;
  }
  return e206;
}
function Qme(e206) {
  let t10, n10;
  for (t10 = 0; t10 < e206.length; t10++) {
    let r11 = e206[t10];
    if (r11.type === `paragraph` && r11.raw.match(/(\n|^)\|/)) {
      n10 = she(e206.slice(t10));
      break;
    }
  }
  let r10 = e206.at(-1);
  if (!n10 && r10?.type === `list`) {
    let i10 = Jme(r10);
    i10 && (n10 = [i10], t10 = e206.length - 1);
  }
  if (!n10 && r10?.type === `paragraph`) {
    let i10 = PP(r10);
    i10 && (n10 = [i10], t10 = e206.length - 1);
  }
  if (n10) {
    let r11 = [...e206.slice(0, t10), ...n10];
    return r11.links = e206.links, r11;
  }
  if (r10?.type === `heading`) {
    let t11 = Yme(r10, NP(e206));
    if (t11) return t11;
  }
  return null;
}
function $me(e206) {
  return FP(e206, "`");
}
function ehe(e206) {
  return FP(e206, `*`);
}
function the(e206) {
  return FP(e206, `_`);
}
function nhe(e206) {
  return FP(e206, `)`, false);
}
function rhe(e206) {
  return FP(e206, `")`, false);
}
function ihe(e206) {
  return FP(e206, `](https://microsoft.com)`, false);
}
function ahe(e206) {
  return FP(e206, `**`);
}
function ohe(e206) {
  return FP(e206, `__`);
}
function FP(e206, t10, n10 = true) {
  let r10 = NP(Array.isArray(e206) ? e206 : [e206]);
  return AN((n10 ? r10.trimEnd() : r10) + t10)[0];
}
function she(e206) {
  let t10 = NP(e206), n10 = t10.split(`
`), r10, i10 = false;
  for (let e207 = 0; e207 < n10.length; e207++) {
    let t11 = n10[e207].trim();
    if (r10 === void 0 && t11.match(/^\s*\|/)) {
      let e208 = t11.match(/(\|[^\|]+)(?=\||$)/g);
      e208 && (r10 = e208.length);
    } else if (typeof r10 == `number`) if (t11.match(/^\s*\|/)) {
      if (e207 !== n10.length - 1) return;
      i10 = true;
    } else return;
  }
  if (typeof r10 == `number` && r10 > 0) {
    let e207 = i10 ? n10.slice(0, -1).join(`
`) : t10;
    return AN(e207 + (e207.match(/\|\s*$/) ? `` : `|`) + `
|${` --- |`.repeat(r10)}`);
  }
}
var IP = xu(`openerService`);
function che(e206, t10) {
  return e206.with({ fragment: `${t10.startLineNumber},${t10.startColumn}${t10.endLineNumber ? `-${t10.endLineNumber}${t10.endColumn ? `,${t10.endColumn}` : ``}` : ``}` });
}
function lhe(e206) {
  let t10, n10 = /^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e206.fragment);
  return n10 && (t10 = { startLineNumber: parseInt(n10[1]), startColumn: n10[2] ? parseInt(n10[2]) : 1, endLineNumber: n10[4] ? parseInt(n10[4]) : void 0, endColumn: n10[4] ? n10[5] ? parseInt(n10[5]) : 1 : void 0 }, e206 = e206.with({ fragment: `` })), { selection: t10, uri: e206 };
}
var uhe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, dhe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, LP = xu(`markdownRendererService`), RP = class {
  constructor(e206) {
    this._openerService = e206;
  }
  render(e206, t10, n10) {
    let r10 = { ...t10 };
    r10.actionHandler || (r10.actionHandler = (e207, t11) => zP(this._openerService, e207, t11.isTrusted)), r10.codeBlockRenderer || (r10.codeBlockRenderer = (e207, t11) => this._defaultCodeBlockRenderer?.renderCodeBlock(e207, t11, r10 ?? {}) ?? Promise.resolve(document.createElement(`span`)));
    let i10 = EP(e206, r10, n10);
    return i10.element.classList.add(`rendered-markdown`), i10;
  }
  setDefaultCodeBlockRenderer(e206) {
    this._defaultCodeBlockRenderer = e206;
  }
};
RP = uhe([dhe(0, IP)], RP);
async function zP(e206, t10, n10, r10) {
  try {
    return await e206.open(t10, { fromUserGesture: true, allowContributedOpeners: true, allowCommands: fhe(n10), skipValidation: r10 });
  } catch (e207) {
    return be(e207), false;
  }
}
function fhe(e206) {
  return e206 === true ? true : e206 && Array.isArray(e206.enabledCommands) ? e206.enabledCommands : false;
}
Zf(LP, RP, 1);
var phe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, BP = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, VP = B, HP = class extends rx {
  get _targetWindow() {
    return Vc(this._target.targetElements[0]);
  }
  get _targetDocumentElement() {
    return Vc(this._target.targetElements[0]).document.documentElement;
  }
  get isDisposed() {
    return this._isDisposed;
  }
  get isMouseIn() {
    return this._lockMouseTracker.isMouseIn;
  }
  get domNode() {
    return this._hover.containerDomNode;
  }
  get onDispose() {
    return this._onDispose.event;
  }
  get onRequestLayout() {
    return this._onRequestLayout.event;
  }
  get anchor() {
    return this._hoverPosition === 2 ? 0 : 1;
  }
  get x() {
    return this._x;
  }
  get y() {
    return this._y;
  }
  get isLocked() {
    return this._isLocked;
  }
  set isLocked(e206) {
    this._isLocked !== e206 && (this._isLocked = e206, this._hoverContainer.classList.toggle(`locked`, this._isLocked));
  }
  constructor(e206, t10, n10, r10, i10) {
    var _a3, _b3, _c3;
    if (super(), this._keybindingService = t10, this._configurationService = n10, this._markdownRenderer = r10, this._accessibilityService = i10, this._messageListeners = new E(), this._isDisposed = false, this._forcePosition = false, this._x = 0, this._y = 0, this._isLocked = false, this._enableFocusTraps = false, this._addedFocusTrap = false, this._maxHeightRatioRelativeToWindow = 0.5, this._onDispose = this._register(new k()), this._onRequestLayout = this._register(new k()), this._linkHandler = e206.linkHandler, this._target = `targetElements` in e206.target ? e206.target : new mhe(e206.target), e206.style) switch (e206.style) {
      case 1:
        e206.appearance ?? (e206.appearance = {}), (_a3 = e206.appearance).compact ?? (_a3.compact = true), (_b3 = e206.appearance).showPointer ?? (_b3.showPointer = true);
        break;
      case 2:
        e206.appearance ?? (e206.appearance = {}), (_c3 = e206.appearance).compact ?? (_c3.compact = true);
        break;
    }
    this._hoverPointer = e206.appearance?.showPointer ? VP(`div.workbench-hover-pointer`) : void 0, this._hover = this._register(new gj(!e206.appearance?.skipFadeInAnimation)), this._hover.containerDomNode.classList.add(`workbench-hover`), e206.appearance?.compact && this._hover.containerDomNode.classList.add(`workbench-hover`, `compact`), e206.additionalClasses && this._hover.containerDomNode.classList.add(...e206.additionalClasses), e206.position?.forcePosition && (this._forcePosition = true), e206.trapFocus && (this._enableFocusTraps = true);
    let a10 = e206.appearance?.maxHeightRatio;
    a10 !== void 0 && a10 > 0 && a10 <= 1 && (this._maxHeightRatioRelativeToWindow = a10), this._hoverPosition = e206.position?.hoverPosition === void 0 ? 3 : He(e206.position.hoverPosition) ? e206.position.hoverPosition : 2, this.onmousedown(this._hover.containerDomNode, (e207) => e207.stopPropagation()), this.onkeydown(this._hover.containerDomNode, (e207) => {
      e207.equals(9) && this.dispose();
    }), this._register(L(this._targetWindow, `blur`, () => this.dispose()));
    let o10 = VP(`div.hover-row.markdown-hover`), s10 = VP(`div.hover-contents`);
    if (typeof e206.content == `string`) s10.textContent = e206.content, s10.style.whiteSpace = `pre-wrap`;
    else if (Fl(e206.content)) s10.appendChild(e206.content), s10.classList.add(`html-hover-contents`);
    else {
      let t11 = e206.content, { element: n11 } = this._register(this._markdownRenderer.render(t11, { actionHandler: this._linkHandler, asyncRenderCallback: () => {
        s10.classList.add(`code-hover-contents`), this.layout(), this._onRequestLayout.fire();
      } }));
      s10.appendChild(n11);
    }
    if (o10.appendChild(s10), this._hover.contentsDomNode.appendChild(o10), e206.actions && e206.actions.length > 0) {
      let t11 = VP(`div.hover-row.status-bar`), n11 = VP(`div.actions`);
      e206.actions.forEach((e207) => {
        let t12 = this._keybindingService.lookupKeybinding(e207.commandId), r11 = t12 ? t12.getLabel() : null;
        this._register(_j2.render(n11, { label: e207.label, commandId: e207.commandId, run: (t13) => {
          e207.run(t13), this.dispose();
        }, iconClass: e207.iconClass }, r11));
      }), t11.appendChild(n11), this._hover.containerDomNode.appendChild(t11);
    }
    this._hoverContainer = VP(`div.workbench-hover-container`), this._hoverPointer && this._hoverContainer.appendChild(this._hoverPointer), this._hoverContainer.appendChild(this._hover.containerDomNode);
    let c10;
    if (c10 = e206.actions && e206.actions.length > 0 ? false : e206.persistence?.hideOnHover === void 0 ? typeof e206.content == `string` || IM(e206.content) && !e206.content.value.includes(`](`) && !e206.content.value.includes(`</a>`) : e206.persistence.hideOnHover, e206.appearance?.showHoverHint) {
      let e207 = VP(`div.hover-row.status-bar`), t11 = VP(`div.info`);
      t11.textContent = C(1699, `Hold {0} key to mouse over`, Tt ? `Option` : `Alt`), e207.appendChild(t11), this._hover.containerDomNode.appendChild(e207);
    }
    let l10 = [...this._target.targetElements];
    c10 || l10.push(this._hoverContainer);
    let u10 = this._register(new UP(l10));
    if (this._register(u10.onMouseOut(() => {
      this._isLocked || this.dispose();
    })), c10) {
      let e207 = [...this._target.targetElements, this._hoverContainer];
      this._lockMouseTracker = this._register(new UP(e207)), this._register(this._lockMouseTracker.onMouseOut(() => {
        this._isLocked || this.dispose();
      }));
    } else this._lockMouseTracker = u10;
  }
  addFocusTrap() {
    if (!this._enableFocusTraps || this._addedFocusTrap) return;
    this._addedFocusTrap = true;
    let e206 = this._hover.containerDomNode, t10 = this.findLastFocusableChild(this._hover.containerDomNode);
    if (t10) {
      let n10 = ql(this._hoverContainer, VP(`div`)), r10 = z(this._hoverContainer, VP(`div`));
      n10.tabIndex = 0, r10.tabIndex = 0, this._register(L(r10, `focus`, (t11) => {
        e206.focus(), t11.preventDefault();
      })), this._register(L(n10, `focus`, (e207) => {
        t10.focus(), e207.preventDefault();
      }));
    }
  }
  findLastFocusableChild(e206) {
    if (e206.hasChildNodes()) for (let t10 = 0; t10 < e206.childNodes.length; t10++) {
      let n10 = e206.childNodes.item(e206.childNodes.length - t10 - 1);
      if (n10.nodeType === n10.ELEMENT_NODE) {
        let e207 = n10;
        if (typeof e207.tabIndex == `number` && e207.tabIndex >= 0) return e207;
      }
      let r10 = this.findLastFocusableChild(n10);
      if (r10) return r10;
    }
  }
  render(e206) {
    e206.appendChild(this._hoverContainer);
    let t10 = this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement) && vj(this._configurationService.getValue(`accessibility.verbosity.hover`) === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding(`editor.action.accessibleView`)?.getAriaLabel());
    t10 && Gg(t10), this.layout(), this.addFocusTrap();
  }
  layout() {
    this._hover.containerDomNode.classList.remove(`right-aligned`), this._hover.contentsDomNode.style.maxHeight = ``;
    let e206 = (e207) => {
      let t11 = vl(e207), n11 = e207.getBoundingClientRect();
      return { top: n11.top * t11, bottom: n11.bottom * t11, right: n11.right * t11, left: n11.left * t11 };
    }, { top: t10, right: n10, bottom: r10, left: i10 } = this._target.targetElements.map((t11) => e206(t11))[0], a10 = n10 - i10, o10 = r10 - t10, s10 = { top: t10, right: n10, bottom: r10, left: i10, width: a10, height: o10, center: { x: i10 + a10 / 2, y: t10 + o10 / 2 } };
    if (this.adjustHorizontalHoverPosition(s10), this.adjustVerticalHoverPosition(s10), this.adjustHoverMaxHeight(s10), this._hoverContainer.style.padding = ``, this._hoverContainer.style.margin = ``, this._hoverPointer) {
      switch (this._hoverPosition) {
        case 1:
          s10.left += 3, s10.right += 3, this._hoverContainer.style.paddingLeft = `3px`, this._hoverContainer.style.marginLeft = `-3px`;
          break;
        case 0:
          s10.left -= 3, s10.right -= 3, this._hoverContainer.style.paddingRight = `3px`, this._hoverContainer.style.marginRight = `-3px`;
          break;
        case 2:
          s10.top += 3, s10.bottom += 3, this._hoverContainer.style.paddingTop = `3px`, this._hoverContainer.style.marginTop = `-3px`;
          break;
        case 3:
          s10.top -= 3, s10.bottom -= 3, this._hoverContainer.style.paddingBottom = `3px`, this._hoverContainer.style.marginBottom = `-3px`;
          break;
      }
      s10.center.x = s10.left + a10 / 2, s10.center.y = s10.top + o10 / 2;
    }
    this.computeXCordinate(s10), this.computeYCordinate(s10), this._hoverPointer && (this._hoverPointer.classList.remove(`top`), this._hoverPointer.classList.remove(`left`), this._hoverPointer.classList.remove(`right`), this._hoverPointer.classList.remove(`bottom`), this.setHoverPointerPosition(s10)), this._hover.onContentsChanged();
  }
  computeXCordinate(e206) {
    let t10 = this._hover.containerDomNode.clientWidth + 2;
    this._target.x === void 0 ? this._hoverPosition === 1 ? this._x = e206.right : this._hoverPosition === 0 ? this._x = e206.left - t10 : (this._hoverPointer ? this._x = e206.center.x - this._hover.containerDomNode.clientWidth / 2 : this._x = e206.left, this._x + t10 >= this._targetDocumentElement.clientWidth && (this._hover.containerDomNode.classList.add(`right-aligned`), this._x = Math.max(this._targetDocumentElement.clientWidth - t10 - 2, this._targetDocumentElement.clientLeft))) : this._x = this._target.x, this._x < this._targetDocumentElement.clientLeft && (this._x = e206.left + 2);
  }
  computeYCordinate(e206) {
    this._target.y === void 0 ? this._hoverPosition === 3 ? this._y = e206.top : this._hoverPosition === 2 ? this._y = e206.bottom - 2 : this._hoverPointer ? this._y = e206.center.y + this._hover.containerDomNode.clientHeight / 2 : this._y = e206.bottom : this._y = this._target.y, this._y > this._targetWindow.innerHeight && (this._y = e206.bottom);
  }
  adjustHorizontalHoverPosition(e206) {
    if (this._target.x !== void 0) return;
    let t10 = this._hoverPointer ? 3 : 0;
    if (this._forcePosition) {
      let n10 = t10 + 2;
      this._hoverPosition === 1 ? this._hover.containerDomNode.style.maxWidth = `${this._targetDocumentElement.clientWidth - e206.right - n10}px` : this._hoverPosition === 0 && (this._hover.containerDomNode.style.maxWidth = `${e206.left - n10}px`);
      return;
    }
    this._hoverPosition === 1 ? this._targetDocumentElement.clientWidth - e206.right < this._hover.containerDomNode.clientWidth + t10 && (e206.left >= this._hover.containerDomNode.clientWidth + t10 ? this._hoverPosition = 0 : this._hoverPosition = 2) : this._hoverPosition === 0 && (e206.left < this._hover.containerDomNode.clientWidth + t10 && (this._targetDocumentElement.clientWidth - e206.right >= this._hover.containerDomNode.clientWidth + t10 ? this._hoverPosition = 1 : this._hoverPosition = 2), e206.left - this._hover.containerDomNode.clientWidth - t10 <= this._targetDocumentElement.clientLeft && (this._hoverPosition = 1));
  }
  adjustVerticalHoverPosition(e206) {
    if (this._target.y !== void 0 || this._forcePosition) return;
    let t10 = this._hoverPointer ? 3 : 0;
    this._hoverPosition === 3 ? e206.top - this._hover.containerDomNode.clientHeight - t10 < 0 && (this._hoverPosition = 2) : this._hoverPosition === 2 && e206.bottom + this._hover.containerDomNode.offsetHeight + t10 > this._targetWindow.innerHeight && (this._hoverPosition = 3);
  }
  adjustHoverMaxHeight(e206) {
    let t10 = this._targetWindow.innerHeight * this._maxHeightRatioRelativeToWindow;
    if (this._forcePosition) {
      let n10 = (this._hoverPointer ? 3 : 0) + 2;
      this._hoverPosition === 3 ? t10 = Math.min(t10, e206.top - n10) : this._hoverPosition === 2 && (t10 = Math.min(t10, this._targetWindow.innerHeight - e206.bottom - n10));
    }
    if (this._hover.containerDomNode.style.maxHeight = `${t10}px`, this._hover.contentsDomNode.clientHeight < this._hover.contentsDomNode.scrollHeight) {
      let e207 = `${this._hover.scrollbar.options.verticalScrollbarSize}px`;
      this._hover.contentsDomNode.style.paddingRight !== e207 && (this._hover.contentsDomNode.style.paddingRight = e207);
    }
  }
  setHoverPointerPosition(e206) {
    if (this._hoverPointer) switch (this._hoverPosition) {
      case 0:
      case 1: {
        this._hoverPointer.classList.add(this._hoverPosition === 0 ? `right` : `left`);
        let t10 = this._hover.containerDomNode.clientHeight;
        t10 > e206.height ? this._hoverPointer.style.top = `${e206.center.y - (this._y - t10) - 3}px` : this._hoverPointer.style.top = `${Math.round(t10 / 2) - 3}px`;
        break;
      }
      case 3:
      case 2: {
        this._hoverPointer.classList.add(this._hoverPosition === 3 ? `bottom` : `top`);
        let t10 = this._hover.containerDomNode.clientWidth, n10 = Math.round(t10 / 2) - 3, r10 = this._x + n10;
        (r10 < e206.left || r10 > e206.right) && (n10 = e206.center.x - this._x - 3), this._hoverPointer.style.left = `${n10}px`;
        break;
      }
    }
  }
  focus() {
    this._hover.containerDomNode.focus();
  }
  dispose() {
    this._isDisposed || (this._onDispose.fire(), this._target.dispose?.(), this._hoverContainer.remove(), this._messageListeners.dispose(), super.dispose()), this._isDisposed = true;
  }
};
HP = phe([BP(1, Dw), BP(2, Uf), BP(3, LP), BP(4, e_)], HP);
var UP = class extends rx {
  get onMouseOut() {
    return this._onMouseOut.event;
  }
  get isMouseIn() {
    return this._isMouseIn;
  }
  constructor(e206, t10 = 200) {
    super(), this._elements = e206, this._eventDebounceDelay = t10, this._isMouseIn = true, this._mouseTimer = this._register(new Jt()), this._onMouseOut = this._register(new k());
    for (let e207 of this._elements) this.onmouseover(e207, () => this._onTargetMouseOver()), this.onmouseleave(e207, () => this._onTargetMouseLeave());
  }
  _onTargetMouseOver() {
    this._isMouseIn = true, this._mouseTimer.clear();
  }
  _onTargetMouseLeave() {
    this._isMouseIn = false, this._mouseTimer.value = new cs(() => this._fireIfMouseOutside(), this._eventDebounceDelay);
  }
  _fireIfMouseOutside() {
    this._isMouseIn || this._onMouseOut.fire();
  }
}, mhe = class {
  constructor(e206) {
    this._element = e206, this.targetElements = [this._element];
  }
  dispose() {
  }
}, WP;
(function(e206) {
  function t10(e207, t11) {
    if (e207.start >= t11.end || t11.start >= e207.end) return { start: 0, end: 0 };
    let n11 = Math.max(e207.start, t11.start), r11 = Math.min(e207.end, t11.end);
    return r11 - n11 <= 0 ? { start: 0, end: 0 } : { start: n11, end: r11 };
  }
  e206.intersect = t10;
  function n10(e207) {
    return e207.end - e207.start <= 0;
  }
  e206.isEmpty = n10;
  function r10(e207, r11) {
    return !n10(t10(e207, r11));
  }
  e206.intersects = r10;
  function i10(e207, t11) {
    let r11 = [], i11 = { start: e207.start, end: Math.min(t11.start, e207.end) }, a10 = { start: Math.max(t11.end, e207.start), end: e207.end };
    return n10(i11) || r11.push(i11), n10(a10) || r11.push(a10), r11;
  }
  e206.relativeComplement = i10;
})(WP || (WP = {}));
function hhe(e206) {
  let t10 = e206;
  return !!t10 && typeof t10.x == `number` && typeof t10.y == `number`;
}
var GP;
(function(e206) {
  e206[e206.AVOID = 0] = `AVOID`, e206[e206.ALIGN = 1] = `ALIGN`;
})(GP || (GP = {}));
function KP(e206, t10, n10) {
  let r10 = n10.mode === GP.ALIGN ? n10.offset : n10.offset + n10.size, i10 = n10.mode === GP.ALIGN ? n10.offset + n10.size : n10.offset;
  return n10.position === 0 ? t10 <= e206 - r10 ? r10 : t10 <= i10 ? i10 - t10 : Math.max(e206 - t10, 0) : t10 <= i10 ? i10 - t10 : t10 <= e206 - r10 ? r10 : 0;
}
var ghe = (_Ka = class extends D {
  constructor(e206, t10) {
    super(), this.container = null, this.useFixedPosition = false, this.useShadowDOM = false, this.delegate = null, this.toDisposeOnClean = D.None, this.toDisposeOnSetContainer = D.None, this.shadowRoot = null, this.shadowRootHostElement = null, this.view = B(`.context-view`), Ql(this.view), this.setContainer(e206, t10), this._register(T(() => this.setContainer(null, 1)));
  }
  setContainer(t10, n10) {
    this.useFixedPosition = n10 !== 1;
    let r10 = this.useShadowDOM;
    if (this.useShadowDOM = n10 === 3, !(t10 === this.container && r10 === this.useShadowDOM) && (this.container && (this.container = (this.toDisposeOnSetContainer.dispose(), this.view.remove(), this.shadowRoot && (this.shadowRoot = null, this.shadowRootHostElement?.remove(), this.shadowRootHostElement = null), null)), t10)) {
      if (this.container = t10, this.useShadowDOM) {
        this.shadowRootHostElement = B(`.shadow-root-host`), this.container.appendChild(this.shadowRootHostElement), this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: `open` });
        let e206 = document.createElement(`style`);
        e206.textContent = _he, this.shadowRoot.appendChild(e206), this.shadowRoot.appendChild(this.view), this.shadowRoot.appendChild(B(`slot`));
      } else this.container.appendChild(this.view);
      let n11 = new E();
      _Ka.BUBBLE_UP_EVENTS.forEach((e206) => {
        n11.add(el(this.container, e206, (e207) => {
          this.onDOMEvent(e207, false);
        }));
      }), _Ka.BUBBLE_DOWN_EVENTS.forEach((e206) => {
        n11.add(el(this.container, e206, (e207) => {
          this.onDOMEvent(e207, true);
        }, true));
      }), this.toDisposeOnSetContainer = n11;
    }
  }
  show(e206) {
    this.isVisible() && this.hide(), Xc(this.view), this.view.className = `context-view monaco-component`, this.view.style.top = `0px`, this.view.style.left = `0px`, this.view.style.zIndex = `${2575 + (e206.layer ?? 0)}`, this.view.style.position = this.useFixedPosition ? `fixed` : `absolute`, Zl(this.view), this.toDisposeOnClean = e206.render(this.view) || D.None, this.delegate = e206, this.doLayout(), this.delegate.focus?.();
  }
  getViewElement() {
    return this.view;
  }
  layout() {
    if (this.isVisible()) {
      if (this.delegate.canRelayout === false && !(kt && Bo.pointerEvents)) {
        this.hide();
        return;
      }
      this.delegate?.layout?.(), this.doLayout();
    }
  }
  doLayout() {
    if (!this.isVisible()) return;
    let e206 = this.delegate.getAnchor(), t10;
    if (Fl(e206)) {
      let n11 = _l2(e206), r11 = vl(e206);
      t10 = { top: n11.top * r11, left: n11.left * r11, width: n11.width * r11, height: n11.height * r11 };
    } else t10 = hhe(e206) ? { top: e206.y, left: e206.x, width: e206.width || 1, height: e206.height || 2 } : { top: e206.posy, left: e206.posx, width: 2, height: 2 };
    let n10 = yl(this.view), r10 = Sl(this.view), i10 = this.delegate.anchorPosition ?? 0, a10 = this.delegate.anchorAlignment ?? 0, o10 = this.delegate.anchorAxisAlignment ?? 0, s10, c10, l10 = Nl();
    if (o10 === 0) {
      let e207 = { offset: t10.top - l10.pageYOffset, size: t10.height, position: i10 === 0 ? 0 : 1 }, o11 = { offset: t10.left, size: t10.width, position: a10 === 0 ? 0 : 1, mode: GP.ALIGN };
      s10 = KP(l10.innerHeight, r10, e207) + l10.pageYOffset, WP.intersects({ start: s10, end: s10 + r10 }, { start: e207.offset, end: e207.offset + e207.size }) && (o11.mode = GP.AVOID), c10 = KP(l10.innerWidth, n10, o11);
    } else {
      let e207 = { offset: t10.left, size: t10.width, position: a10 === 0 ? 0 : 1 }, o11 = { offset: t10.top, size: t10.height, position: i10 === 0 ? 0 : 1, mode: GP.ALIGN };
      c10 = KP(l10.innerWidth, n10, e207), WP.intersects({ start: c10, end: c10 + n10 }, { start: e207.offset, end: e207.offset + e207.size }) && (o11.mode = GP.AVOID), s10 = KP(l10.innerHeight, r10, o11) + l10.pageYOffset;
    }
    this.view.classList.remove(`top`, `bottom`, `left`, `right`), this.view.classList.add(i10 === 0 ? `bottom` : `top`), this.view.classList.add(a10 === 0 ? `left` : `right`), this.view.classList.toggle(`fixed`, this.useFixedPosition);
    let u10 = _l2(this.container), d10 = this.container.scrollTop || 0, f10 = this.container.scrollLeft || 0;
    this.view.style.top = `${s10 - (this.useFixedPosition ? _l2(this.view).top : u10.top) + d10}px`, this.view.style.left = `${c10 - (this.useFixedPosition ? _l2(this.view).left : u10.left) + f10}px`, this.view.style.width = `initial`;
  }
  hide(e206) {
    let t10 = this.delegate;
    this.delegate = null, t10?.onHide && t10.onHide(e206), this.toDisposeOnClean.dispose(), Ql(this.view);
  }
  isVisible() {
    return !!this.delegate;
  }
  onDOMEvent(e206, t10) {
    this.delegate && (this.delegate.onDOMEvent ? this.delegate.onDOMEvent(e206, Vc(e206).document.activeElement) : t10 && !Cl(e206.target, this.container) && this.hide());
  }
  dispose() {
    this.hide(), super.dispose();
  }
}, _Ka.BUBBLE_UP_EVENTS = [`click`, `keydown`, `focus`, `blur`], _Ka.BUBBLE_DOWN_EVENTS = [`click`], _Ka), _he = `
	:host {
		all: initial; /* 1st rule so subsequent properties are reset. */
	}

	.codicon[class*='codicon-'] {
		font: normal normal normal 16px/1 codicon;
		display: inline-block;
		text-decoration: none;
		text-rendering: auto;
		text-align: center;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		user-select: none;
		-webkit-user-select: none;
		-ms-user-select: none;
	}

	:host {
		font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
	}

	:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
	:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
	:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
	:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
	:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; }

	:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
	:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
	:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
	:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
	:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }

	:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
	:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
	:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
	:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
	:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
`, vhe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, yhe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, qP = class extends D {
  constructor(e206) {
    super(), this.layoutService = e206, this.contextView = this._register(new ghe(this.layoutService.mainContainer, 1)), this.layout(), this._register(e206.onDidLayoutContainer(() => this.layout()));
  }
  showContextView(e206, t10, n10) {
    let r10;
    r10 = t10 ? t10 === this.layoutService.getContainer(Vc(t10)) ? 1 : n10 ? 3 : 2 : 1, this.contextView.setContainer(t10 ?? this.layoutService.activeContainer, r10), this.contextView.show(e206);
    let i10 = { close: () => {
      this.openContextView === i10 && this.hideContextView();
    } };
    return this.openContextView = i10, i10;
  }
  layout() {
    this.contextView.layout();
  }
  hideContextView(e206) {
    this.contextView.hide(e206), this.openContextView = void 0;
  }
};
qP = vhe([yhe(0, Bk)], qP);
var bhe = class extends qP {
  getContextViewElement() {
    return this.contextView.getViewElement();
  }
};
function JP(e206) {
  let t10 = e206;
  return typeof t10 == `object` && `markdown` in t10 && `markdownNotSupportedFallback` in t10;
}
var xhe = class {
  constructor(e206, t10, n10) {
    this.hoverDelegate = e206, this.target = t10, this.fadeInAnimation = n10;
  }
  async update(e206, t10, n10) {
    if (this._cancellationTokenSource && (this._cancellationTokenSource = (this._cancellationTokenSource.dispose(true), void 0)), this.isDisposed) return;
    let r10;
    if (Re(e206) || Fl(e206) || e206 === void 0) r10 = e206;
    else {
      this._cancellationTokenSource = new pr();
      let i10 = this._cancellationTokenSource.token, a10;
      if (a10 = JP(e206) ? Xe(e206.markdown) ? e206.markdown(i10).then((t11) => t11 ?? e206.markdownNotSupportedFallback) : e206.markdown ?? e206.markdownNotSupportedFallback : e206.element(i10), a10 instanceof Promise ? (this._hoverWidget || this.show(C(1700, `Loading...`), t10, n10), r10 = await a10) : r10 = a10, this.isDisposed || i10.isCancellationRequested) return;
    }
    this.show(r10, t10, n10);
  }
  show(e206, t10, n10) {
    let r10 = this._hoverWidget;
    if (this.hasContent(e206)) {
      let i10 = { content: e206, target: this.target, actions: n10?.actions, linkHandler: n10?.linkHandler, trapFocus: n10?.trapFocus, appearance: { showPointer: this.hoverDelegate.placement === `element`, skipFadeInAnimation: !this.fadeInAnimation || !!r10, showHoverHint: n10?.appearance?.showHoverHint }, position: { hoverPosition: 2 } };
      this._hoverWidget = this.hoverDelegate.showHover(i10, t10);
    }
    r10?.dispose();
  }
  hasContent(e206) {
    return e206 ? IM(e206) ? !!e206.value : true : false;
  }
  get isDisposed() {
    return this._hoverWidget?.isDisposed;
  }
  dispose() {
    this._hoverWidget?.dispose(), this._cancellationTokenSource?.dispose(true), this._cancellationTokenSource = void 0;
  }
}, She = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, YP = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, XP = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._instantiationService = e206, this._configurationService = t10, this._keybindingService = r10, this._layoutService = i10, this._accessibilityService = a10, this._currentDelayedHoverWasShown = false, this._delayedHovers = /* @__PURE__ */ new Map(), this._managedHovers = /* @__PURE__ */ new Map(), this._register(n10.onDidShowContextMenu(() => this.hideHover())), this._contextViewHandler = this._register(new qP(this._layoutService)), this._register(ld.registerCommandAndKeybindingRule({ id: `workbench.action.showHover`, weight: 0, primary: Sr(2089, 2087), handler: () => {
      this._showAndFocusHoverForActiveElement();
    } }));
  }
  showInstantHover(e206, t10, n10, r10) {
    let i10 = this._createHover(e206, n10);
    if (i10) return this._showHover(i10, e206, t10), i10;
  }
  showDelayedHover(e206, t10) {
    if (e206.id === void 0 && (e206.id = QP(e206.content)), !this._currentDelayedHover || this._currentDelayedHoverWasShown) {
      if (this._currentHover?.isLocked) return;
      if (ZP(this._currentHoverOptions) === ZP(e206)) return this._currentHover;
      if (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== void 0 && this._currentDelayedHoverGroupId === t10?.groupId) return this.showInstantHover({ ...e206, appearance: { ...e206.appearance, skipFadeInAnimation: true } });
    } else if (this._currentDelayedHover && ZP(this._currentHoverOptions) === ZP(e206)) return this._currentDelayedHover;
    let n10 = this._createHover(e206, void 0);
    if (!n10) {
      this._currentDelayedHover = void 0, this._currentDelayedHoverWasShown = false, this._currentDelayedHoverGroupId = void 0;
      return;
    }
    return this._currentDelayedHover = n10, this._currentDelayedHoverWasShown = false, this._currentDelayedHoverGroupId = t10?.groupId, is(this._configurationService.getValue(`workbench.hover.delay`)).then(() => {
      n10 && !n10.isDisposed && (this._currentDelayedHoverWasShown = true, this._showHover(n10, e206));
    }), n10;
  }
  setupDelayedHover(e206, t10, n10) {
    return this._setupDelayedHover(e206, () => ({ ...typeof t10 == `function` ? t10() : t10, target: e206 }), n10);
  }
  setupDelayedHoverAtMouse(e206, t10, n10) {
    return this._setupDelayedHover(e206, (n11) => ({ ...typeof t10 == `function` ? t10() : t10, target: { targetElements: [e206], x: n11 === void 0 ? void 0 : n11.x + 10 } }), n10);
  }
  _setupDelayedHover(e206, t10, n10) {
    let r10 = new E();
    return r10.add(L(e206, R.MOUSE_OVER, (e207) => {
      this.showDelayedHover(t10(e207), { groupId: n10?.groupId });
    })), n10?.setupKeyboardEvents && r10.add(L(e206, R.KEY_DOWN, (e207) => {
      let n11 = new Jo(e207);
      (n11.equals(10) || n11.equals(3)) && this.showInstantHover(t10(), true);
    })), this._delayedHovers.set(e206, { show: (e207) => {
      this.showInstantHover(t10(), e207);
    } }), r10.add(T(() => this._delayedHovers.delete(e206))), r10;
  }
  _createHover(e206, t10) {
    if (this._currentDelayedHover = void 0, e206.content === `` || this._currentHover?.isLocked || (e206.id === void 0 && (e206.id = QP(e206.content)), ZP(this._currentHoverOptions) === ZP(e206))) return;
    this._currentHoverOptions = e206, this._lastHoverOptions = e206;
    let n10 = e206.trapFocus || this._accessibilityService.isScreenReaderOptimized(), r10 = kl();
    t10 || (n10 && r10 ? r10.classList.contains(`monaco-hover`) || (this._lastFocusedElementBeforeOpen = r10) : this._lastFocusedElementBeforeOpen = void 0);
    let i10 = new E(), a10 = this._instantiationService.createInstance(HP, e206);
    if (e206.persistence?.sticky && (a10.isLocked = true), e206.position?.hoverPosition && !He(e206.position.hoverPosition) && (e206.target = { targetElements: Fl(e206.target) ? [e206.target] : e206.target.targetElements, x: e206.position.hoverPosition.x + 10 }), a10.onDispose(() => {
      this._currentHover?.domNode && jl(this._currentHover.domNode) && this._lastFocusedElementBeforeOpen?.focus(), ZP(this._currentHoverOptions) === ZP(e206) && this.doHideHover(), i10.dispose();
    }, void 0, i10), !e206.container) {
      let t11 = Fl(e206.target) ? e206.target : e206.target.targetElements[0];
      e206.container = this._layoutService.getContainer(Vc(t11));
    }
    if (a10.onRequestLayout(() => this._contextViewHandler.layout(), void 0, i10), e206.persistence?.sticky) i10.add(L(Vc(e206.container).document, R.MOUSE_DOWN, (e207) => {
      Cl(e207.target, a10.domNode) || this.doHideHover();
    }));
    else {
      if (`targetElements` in e206.target) for (let t12 of e206.target.targetElements) i10.add(L(t12, R.CLICK, () => this.hideHover()));
      else i10.add(L(e206.target, R.CLICK, () => this.hideHover()));
      let t11 = kl();
      if (t11) {
        let n11 = Vc(t11).document;
        i10.add(L(t11, R.KEY_DOWN, (t12) => this._keyDown(t12, a10, !!e206.persistence?.hideOnKeyDown))), i10.add(L(n11, R.KEY_DOWN, (t12) => this._keyDown(t12, a10, !!e206.persistence?.hideOnKeyDown))), i10.add(L(t11, R.KEY_UP, (e207) => this._keyUp(e207, a10))), i10.add(L(n11, R.KEY_UP, (e207) => this._keyUp(e207, a10)));
      }
    }
    if (`IntersectionObserver` in Aa) {
      let t11 = new IntersectionObserver((e207) => this._intersectionChange(e207, a10), { threshold: 0 }), n11 = `targetElements` in e206.target ? e206.target.targetElements[0] : e206.target;
      t11.observe(n11), i10.add(T(() => t11.disconnect()));
    }
    return this._currentHover = a10, a10;
  }
  _showHover(e206, t10, n10) {
    this._contextViewHandler.showContextView(new whe(e206, n10), t10.container);
  }
  hideHover(e206) {
    !e206 && this._currentHover?.isLocked || !this._currentHoverOptions || this.doHideHover();
  }
  doHideHover() {
    this._currentHover = void 0, this._currentHoverOptions = void 0, this._contextViewHandler.hideContextView();
  }
  _intersectionChange(e206, t10) {
    e206[e206.length - 1].isIntersecting || t10.dispose();
  }
  showAndFocusLastHover() {
    this._lastHoverOptions && this.showInstantHover(this._lastHoverOptions, true, true);
  }
  _showAndFocusHoverForActiveElement() {
    let e206 = kl();
    for (; e206; ) {
      let t10 = this._delayedHovers.get(e206) ?? this._managedHovers.get(e206);
      if (t10) {
        t10.show(true);
        return;
      }
      e206 = e206.parentElement;
    }
  }
  _keyDown(e206, t10, n10) {
    if (e206.key === `Alt`) {
      t10.isLocked = true;
      return;
    }
    let r10 = new Jo(e206);
    this._keybindingService.resolveKeyboardEvent(r10).getSingleModifierDispatchChords().some((e207) => !!e207) || this._keybindingService.softDispatch(r10, r10.target).kind !== 0 || n10 && (!this._currentHoverOptions?.trapFocus || e206.key !== `Tab`) && (this.hideHover(), this._lastFocusedElementBeforeOpen?.focus());
  }
  _keyUp(e206, t10) {
    e206.key === `Alt` && (t10.isLocked = false, t10.isMouseIn || (this.hideHover(), this._lastFocusedElementBeforeOpen?.focus()));
  }
  setupManagedHover(e206, t10, n10, r10) {
    if (e206.showNativeHover) return Che(t10, n10);
    t10.setAttribute(`custom-hover`, `true`), t10.title !== `` && (console.warn(`HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.`), console.trace(`Stack trace:`, t10.title), t10.title = ``);
    let i10, a10, o10 = (t11, n11) => {
      let r11 = a10 !== void 0;
      t11 && (a10?.dispose(), a10 = void 0), n11 && (i10?.dispose(), i10 = void 0), r11 && (e206.onDidHideHover?.(), a10 = void 0);
    }, s10 = (i11, o11, s11, c11) => new cs(async () => {
      (!a10 || a10.isDisposed) && (a10 = new xhe(e206, s11 || t10, i11 > 0), await a10.update(typeof n10 == `function` ? n10() : n10, o11, { ...r10, trapFocus: c11 }));
    }, i11), c10 = new E(), l10 = false;
    c10.add(L(t10, R.MOUSE_DOWN, () => {
      l10 = true, o10(true, true);
    }, true)), c10.add(L(t10, R.MOUSE_UP, () => {
      l10 = false;
    }, true)), c10.add(L(t10, R.MOUSE_LEAVE, (e207) => {
      l10 = false, o10(false, e207.fromElement === t10);
    }, true)), c10.add(L(t10, R.MOUSE_OVER, (r11) => {
      if (i10) return;
      let a11 = new E(), c11 = { targetElements: [t10], dispose: () => {
      } };
      (e206.placement === void 0 || e206.placement === `mouse`) && a11.add(L(t10, R.MOUSE_MOVE, (e207) => {
        c11.x = e207.x + 10, eF(e207, t10) || o10(true, true);
      }, true)), i10 = a11, eF(r11, t10) && a11.add(s10(typeof e206.delay == `function` ? e206.delay(n10) : e206.delay, false, c11));
    }, true)), iu(t10) || c10.add(L(t10, R.FOCUS, (r11) => {
      if (l10 || i10 || !eF(r11, t10)) return;
      let a11 = { targetElements: [t10], dispose: () => {
      } }, c11 = new E();
      c11.add(L(t10, R.BLUR, () => o10(true, true), true)), c11.add(s10(typeof e206.delay == `function` ? e206.delay(n10) : e206.delay, false, a11)), i10 = c11;
    }, true));
    let u10 = { show: (e207) => {
      o10(false, true), s10(0, e207, void 0, e207);
    }, hide: () => {
      o10(true, true);
    }, update: async (e207, t11) => {
      n10 = e207, await a10?.update(n10, void 0, t11);
    }, dispose: () => {
      this._managedHovers.delete(t10), c10.dispose(), o10(true, true);
    } };
    return this._managedHovers.set(t10, u10), u10;
  }
  showManagedHover(e206) {
    let t10 = this._managedHovers.get(e206);
    t10 && t10.show(true);
  }
  dispose() {
    this._managedHovers.forEach((e206) => e206.dispose()), super.dispose();
  }
};
XP = She([YP(0, V), YP(1, Uf), YP(2, mj), YP(3, Dw), YP(4, Bk), YP(5, e_)], XP);
function ZP(e206) {
  if (e206 !== void 0) return e206?.id ?? e206;
}
function QP(e206) {
  if (!Fl(e206)) return typeof e206 == `string` ? e206.toString() : e206.value;
}
function $P(e206) {
  let t10 = typeof e206 == `function` ? e206() : e206;
  if (Re(t10)) return kM(t10);
  if (JP(t10)) return t10.markdownNotSupportedFallback;
}
function Che(e206, t10) {
  function n10(t11) {
    t11 ? e206.setAttribute(`title`, t11) : e206.removeAttribute(`title`);
  }
  return n10($P(t10)), { update: (e207) => n10($P(e207)), show: () => {
  }, hide: () => {
  }, dispose: () => n10(void 0) };
}
var whe = class {
  get anchorPosition() {
    return this._hover.anchor;
  }
  constructor(e206, t10 = false) {
    this._hover = e206, this._focus = t10, this.layer = 1;
  }
  render(e206) {
    return this._hover.render(e206), this._focus && this._hover.focus(), this._hover;
  }
  getAnchor() {
    return { x: this._hover.x, y: this._hover.y };
  }
  layout() {
    this._hover.layout();
  }
};
function eF(e206, t10) {
  return Fl(e206.target) && The(e206.target, t10) === t10;
}
function The(e206, t10) {
  for (t10 ?? (t10 = Vc(e206).document.body); !e206.hasAttribute(`custom-hover`) && e206 !== t10; ) e206 = e206.parentElement;
  return e206;
}
Zf(uj, XP, 1), JS((e206, t10) => {
  let n10 = e206.getColor(Ov);
  n10 && (t10.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n10.transparent(0.5)}; }`), t10.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${n10.transparent(0.5)}; }`));
});
var Ehe = { ctrlCmd: false, alt: false }, tF;
(function(e206) {
  e206[e206.Blur = 1] = `Blur`, e206[e206.Gesture = 2] = `Gesture`, e206[e206.Other = 3] = `Other`;
})(tF || (tF = {}));
var nF;
(function(e206) {
  e206[e206.NONE = 0] = `NONE`, e206[e206.FIRST = 1] = `FIRST`, e206[e206.SECOND = 2] = `SECOND`, e206[e206.LAST = 3] = `LAST`;
})(nF || (nF = {}));
var rF;
(function(e206) {
  e206[e206.First = 1] = `First`, e206[e206.Second = 2] = `Second`, e206[e206.Last = 3] = `Last`, e206[e206.Next = 4] = `Next`, e206[e206.Previous = 5] = `Previous`, e206[e206.NextPage = 6] = `NextPage`, e206[e206.PreviousPage = 7] = `PreviousPage`, e206[e206.NextSeparator = 8] = `NextSeparator`, e206[e206.PreviousSeparator = 9] = `PreviousSeparator`;
})(rF || (rF = {}));
var iF;
(function(e206) {
  e206[e206.Title = 1] = `Title`, e206[e206.Inline = 2] = `Inline`, e206[e206.Input = 3] = `Input`;
})(iF || (iF = {}));
var aF = xu(`quickInputService`), oF;
(function(e206) {
  e206[e206.STORAGE_DOES_NOT_EXIST = 0] = `STORAGE_DOES_NOT_EXIST`, e206[e206.STORAGE_IN_MEMORY = 1] = `STORAGE_IN_MEMORY`;
})(oF || (oF = {}));
var sF;
(function(e206) {
  e206[e206.None = 0] = `None`, e206[e206.Initialized = 1] = `Initialized`, e206[e206.Closed = 2] = `Closed`;
})(sF || (sF = {}));
var cF = (_La = class extends D {
  constructor(t10, n10 = /* @__PURE__ */ Object.create(null)) {
    super(), this.database = t10, this.options = n10, this._onDidChangeStorage = this._register(new ln()), this.onDidChangeStorage = this._onDidChangeStorage.event, this.state = sF.None, this.cache = /* @__PURE__ */ new Map(), this.flushDelayer = this._register(new rs(_La.DEFAULT_FLUSH_DELAY)), this.pendingDeletes = /* @__PURE__ */ new Set(), this.pendingInserts = /* @__PURE__ */ new Map(), this.pendingClose = void 0, this.whenFlushedCallbacks = [], this.registerListeners();
  }
  registerListeners() {
    this._register(this.database.onDidChangeItemsExternal((e206) => this.onDidChangeItemsExternal(e206)));
  }
  onDidChangeItemsExternal(e206) {
    this._onDidChangeStorage.pause();
    try {
      e206.changed?.forEach((e207, t10) => this.acceptExternal(t10, e207)), e206.deleted?.forEach((e207) => this.acceptExternal(e207, void 0));
    } finally {
      this._onDidChangeStorage.resume();
    }
  }
  acceptExternal(e206, t10) {
    if (this.state === sF.Closed) return;
    let n10 = false;
    qe(t10) ? n10 = this.cache.delete(e206) : this.cache.get(e206) !== t10 && (this.cache.set(e206, t10), n10 = true), n10 && this._onDidChangeStorage.fire({ key: e206, external: true });
  }
  get(e206, t10) {
    let n10 = this.cache.get(e206);
    return qe(n10) ? t10 : n10;
  }
  getBoolean(e206, t10) {
    let n10 = this.get(e206);
    return qe(n10) ? t10 : n10 === `true`;
  }
  getNumber(e206, t10) {
    let n10 = this.get(e206);
    return qe(n10) ? t10 : parseInt(n10, 10);
  }
  async set(e206, t10, n10 = false) {
    if (this.state === sF.Closed) return;
    if (qe(t10)) return this.delete(e206, n10);
    let r10 = Be(t10) || Array.isArray(t10) ? ome(t10) : String(t10);
    if (this.cache.get(e206) !== r10) return this.cache.set(e206, r10), this.pendingInserts.set(e206, r10), this.pendingDeletes.delete(e206), this._onDidChangeStorage.fire({ key: e206, external: n10 }), this.doFlush();
  }
  async delete(e206, t10 = false) {
    if (this.state !== sF.Closed && this.cache.delete(e206)) return this.pendingDeletes.has(e206) || this.pendingDeletes.add(e206), this.pendingInserts.delete(e206), this._onDidChangeStorage.fire({ key: e206, external: t10 }), this.doFlush();
  }
  get hasPending() {
    return this.pendingInserts.size > 0 || this.pendingDeletes.size > 0;
  }
  async flushPending() {
    if (!this.hasPending) return;
    let e206 = { insert: this.pendingInserts, delete: this.pendingDeletes };
    return this.pendingDeletes = /* @__PURE__ */ new Set(), this.pendingInserts = /* @__PURE__ */ new Map(), this.database.updateItems(e206).finally(() => {
      if (!this.hasPending) for (; this.whenFlushedCallbacks.length; ) this.whenFlushedCallbacks.pop()?.();
    });
  }
  async flush(e206) {
    if (!(this.state === sF.Closed || this.pendingClose)) return this.doFlush(e206);
  }
  async doFlush(e206) {
    return this.options.hint === oF.STORAGE_IN_MEMORY ? this.flushPending() : this.flushDelayer.trigger(() => this.flushPending(), e206);
  }
  async whenFlushed() {
    if (this.hasPending) return new Promise((e206) => this.whenFlushedCallbacks.push(e206));
  }
}, _La.DEFAULT_FLUSH_DELAY = 100, _La), lF = class {
  constructor() {
    this.onDidChangeItemsExternal = O.None, this.items = /* @__PURE__ */ new Map();
  }
  async updateItems(e206) {
    e206.insert?.forEach((e207, t10) => this.items.set(t10, e207)), e206.delete?.forEach((e207) => this.items.delete(e207));
  }
}, uF = `__$__targetStorageMarker`, dF = xu(`storageService`), fF;
(function(e206) {
  e206[e206.NONE = 0] = `NONE`, e206[e206.SHUTDOWN = 1] = `SHUTDOWN`;
})(fF || (fF = {}));
function Dhe(e206) {
  let t10 = e206.get(uF);
  if (t10) try {
    return JSON.parse(t10);
  } catch {
  }
  return /* @__PURE__ */ Object.create(null);
}
var Ohe = (_Ma = class extends D {
  constructor(t10 = { flushInterval: _Ma.DEFAULT_FLUSH_INTERVAL }) {
    super(), this._onDidChangeValue = this._register(new ln()), this._onDidChangeTarget = this._register(new ln()), this._onWillSaveState = this._register(new k()), this.onWillSaveState = this._onWillSaveState.event, this.runFlushWhenIdle = this._register(new Jt()), this._workspaceKeyTargets = void 0, this._profileKeyTargets = void 0, this._applicationKeyTargets = void 0, this.flushWhenIdleScheduler = this._register(new us(() => this.doFlushWhenIdle(), t10.flushInterval));
  }
  onDidChangeValue(e206, t10, n10) {
    return O.filter(this._onDidChangeValue.event, (n11) => n11.scope === e206 && (t10 === void 0 || n11.key === t10), n10);
  }
  doFlushWhenIdle() {
    this.runFlushWhenIdle.value = ds(() => {
      this.shouldFlushWhenIdle() && this.flush(), this.flushWhenIdleScheduler.schedule();
    });
  }
  shouldFlushWhenIdle() {
    return true;
  }
  emitDidChangeValue(e206, t10) {
    let { key: n10, external: r10 } = t10;
    if (n10 === `__$__targetStorageMarker`) {
      switch (e206) {
        case -1:
          this._applicationKeyTargets = void 0;
          break;
        case 0:
          this._profileKeyTargets = void 0;
          break;
        case 1:
          this._workspaceKeyTargets = void 0;
          break;
      }
      this._onDidChangeTarget.fire({ scope: e206 });
    } else this._onDidChangeValue.fire({ scope: e206, key: n10, target: this.getKeyTargets(e206)[n10], external: r10 });
  }
  get(e206, t10, n10) {
    return this.getStorage(t10)?.get(e206, n10);
  }
  getBoolean(e206, t10, n10) {
    return this.getStorage(t10)?.getBoolean(e206, n10);
  }
  getNumber(e206, t10, n10) {
    return this.getStorage(t10)?.getNumber(e206, n10);
  }
  store(e206, t10, n10, r10, i10 = false) {
    if (qe(t10)) {
      this.remove(e206, n10, i10);
      return;
    }
    this.withPausedEmitters(() => {
      this.updateKeyTarget(e206, n10, r10), this.getStorage(n10)?.set(e206, t10, i10);
    });
  }
  remove(e206, t10, n10 = false) {
    this.withPausedEmitters(() => {
      this.updateKeyTarget(e206, t10, void 0), this.getStorage(t10)?.delete(e206, n10);
    });
  }
  withPausedEmitters(e206) {
    this._onDidChangeValue.pause(), this._onDidChangeTarget.pause();
    try {
      e206();
    } finally {
      this._onDidChangeValue.resume(), this._onDidChangeTarget.resume();
    }
  }
  updateKeyTarget(e206, t10, n10, r10 = false) {
    let i10 = this.getKeyTargets(t10);
    typeof n10 == `number` ? i10[e206] !== n10 && (i10[e206] = n10, this.getStorage(t10)?.set(uF, JSON.stringify(i10), r10)) : typeof i10[e206] == `number` && (delete i10[e206], this.getStorage(t10)?.set(uF, JSON.stringify(i10), r10));
  }
  get workspaceKeyTargets() {
    return this._workspaceKeyTargets || (this._workspaceKeyTargets = this.loadKeyTargets(1)), this._workspaceKeyTargets;
  }
  get profileKeyTargets() {
    return this._profileKeyTargets || (this._profileKeyTargets = this.loadKeyTargets(0)), this._profileKeyTargets;
  }
  get applicationKeyTargets() {
    return this._applicationKeyTargets || (this._applicationKeyTargets = this.loadKeyTargets(-1)), this._applicationKeyTargets;
  }
  getKeyTargets(e206) {
    switch (e206) {
      case -1:
        return this.applicationKeyTargets;
      case 0:
        return this.profileKeyTargets;
      default:
        return this.workspaceKeyTargets;
    }
  }
  loadKeyTargets(e206) {
    let t10 = this.getStorage(e206);
    return t10 ? Dhe(t10) : /* @__PURE__ */ Object.create(null);
  }
  async flush(e206 = fF.NONE) {
    this._onWillSaveState.fire({ reason: e206 });
    let t10 = this.getStorage(-1), n10 = this.getStorage(0), r10 = this.getStorage(1);
    switch (e206) {
      case fF.NONE:
        await gs.settled([t10?.whenFlushed() ?? Promise.resolve(), n10?.whenFlushed() ?? Promise.resolve(), r10?.whenFlushed() ?? Promise.resolve()]);
        break;
      case fF.SHUTDOWN:
        await gs.settled([t10?.flush(0) ?? Promise.resolve(), n10?.flush(0) ?? Promise.resolve(), r10?.flush(0) ?? Promise.resolve()]);
        break;
    }
  }
}, _Ma.DEFAULT_FLUSH_INTERVAL = 60 * 1e3, _Ma), khe = class extends Ohe {
  constructor() {
    super(), this.applicationStorage = this._register(new cF(new lF(), { hint: oF.STORAGE_IN_MEMORY })), this.profileStorage = this._register(new cF(new lF(), { hint: oF.STORAGE_IN_MEMORY })), this.workspaceStorage = this._register(new cF(new lF(), { hint: oF.STORAGE_IN_MEMORY })), this._register(this.workspaceStorage.onDidChangeStorage((e206) => this.emitDidChangeValue(1, e206))), this._register(this.profileStorage.onDidChangeStorage((e206) => this.emitDidChangeValue(0, e206))), this._register(this.applicationStorage.onDidChangeStorage((e206) => this.emitDidChangeValue(-1, e206)));
  }
  getStorage(e206) {
    switch (e206) {
      case -1:
        return this.applicationStorage;
      case 0:
        return this.profileStorage;
      default:
        return this.workspaceStorage;
    }
  }
  shouldFlushWhenIdle() {
    return false;
  }
}, Ahe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, pF = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, mF = xu(`IInlineCompletionsService`), hF = new U(`inlineCompletions.snoozed`, false, C(79, `Whether inline completions are currently snoozed`)), gF = class extends D {
  get snoozeTimeLeft() {
    return this._snoozeTimeEnd === void 0 ? 0 : Math.max(0, this._snoozeTimeEnd - Date.now());
  }
  constructor(e206, t10) {
    super(), this._contextKeyService = e206, this._telemetryService = t10, this._onDidChangeIsSnoozing = this._register(new k()), this.onDidChangeIsSnoozing = this._onDidChangeIsSnoozing.event, this._snoozeTimeEnd = void 0, this._recentCompletionIds = [], this._timer = this._register(new cs());
    let n10 = hF.bindTo(this._contextKeyService);
    this._register(this.onDidChangeIsSnoozing(() => n10.set(this.isSnoozing())));
  }
  setSnoozeDuration(e206) {
    if (e206 < 0) throw new je(`Invalid snooze duration: ${e206}. Duration must be non-negative.`);
    if (e206 === 0) {
      this.cancelSnooze();
      return;
    }
    let t10 = this.isSnoozing(), n10 = this.snoozeTimeLeft;
    this._snoozeTimeEnd = Date.now() + e206, t10 || this._onDidChangeIsSnoozing.fire(true), this._timer.cancelAndSet(() => {
      if (!this.isSnoozing()) this._onDidChangeIsSnoozing.fire(false);
      else throw new je(`Snooze timer did not fire as expected`);
    }, this.snoozeTimeLeft + 1), this._reportSnooze(e206 - n10, e206);
  }
  isSnoozing() {
    return this.snoozeTimeLeft > 0;
  }
  cancelSnooze() {
    this.isSnoozing() && (this._reportSnooze(-this.snoozeTimeLeft, 0), this._snoozeTimeEnd = void 0, this._timer.cancel(), this._onDidChangeIsSnoozing.fire(false));
  }
  reportNewCompletion(e206) {
    this._lastCompletionId = e206, this._recentCompletionIds.unshift(e206), this._recentCompletionIds.length > 5 && this._recentCompletionIds.pop();
  }
  _reportSnooze(e206, t10) {
    let n10 = Math.round(e206 / 1e3), r10 = Math.round(t10 / 1e3);
    this._telemetryService.publicLog2(`inlineCompletions.snooze`, { deltaSeconds: n10, totalSeconds: r10, lastCompletionId: this._lastCompletionId, recentCompletionIds: this._recentCompletionIds });
  }
};
gF = Ahe([pF(0, nd), pF(1, bd)], gF), Zf(mF, gF, 1);
var jhe = `editor.action.inlineSuggest.snooze`, Mhe = `editor.action.inlineSuggest.cancelSnooze`, _F2 = `inlineCompletions.lastSnoozeDuration`, Nhe = (_Na = class extends vd {
  constructor() {
    super({ id: _Na.ID, title: w(81, `Snooze Inline Suggestions`), precondition: H.true(), f1: true });
  }
  async run(e206, ...t10) {
    let n10 = e206.get(aF), r10 = e206.get(mF), i10 = e206.get(dF), a10;
    t10.length > 0 && typeof t10[0] == `number` && (a10 = t10[0] * 6e4), a10 || (a10 = await this.getDurationFromUser(n10, i10)), a10 && r10.setSnoozeDuration(a10);
  }
  async getDurationFromUser(e206, t10) {
    let n10 = t10.getNumber(_F2, 0, 3e5), r10 = [{ label: `1 minute`, id: `1`, value: 6e4 }, { label: `5 minutes`, id: `5`, value: 3e5 }, { label: `10 minutes`, id: `10`, value: 6e5 }, { label: `15 minutes`, id: `15`, value: 9e5 }, { label: `30 minutes`, id: `30`, value: 18e5 }, { label: `60 minutes`, id: `60`, value: 36e5 }], i10 = await e206.pick(r10, { placeHolder: C(80, `Select snooze duration for Inline Suggestions`), activeItem: r10.find((e207) => e207.value === n10) });
    if (i10) return t10.store(_F2, i10.value, 0, 0), i10.value;
  }
}, _Na.ID = jhe, _Na), Phe = (_Oa = class extends vd {
  constructor() {
    super({ id: _Oa.ID, title: w(82, `Cancel Snooze Inline Suggestions`), precondition: hF, f1: true });
  }
  async run(e206) {
    e206.get(mF).cancelSnooze();
  }
}, _Oa.ID = Mhe, _Oa), vF = xu(`IWorkspaceEditService`), yF = class {
  constructor(e206) {
    this.metadata = e206;
  }
  static convert(e206) {
    return e206.edits.map((e207) => {
      if (bF.is(e207)) return bF.lift(e207);
      if (xF.is(e207)) return xF.lift(e207);
      throw Error(`Unsupported edit`);
    });
  }
}, bF = class e137 extends yF {
  static is(t10) {
    return t10 instanceof e137 ? true : Be(t10) && $r.isUri(t10.resource) && Be(t10.textEdit);
  }
  static lift(t10) {
    return t10 instanceof e137 ? t10 : new e137(t10.resource, t10.textEdit, t10.versionId, t10.metadata);
  }
  constructor(e206, t10, n10 = void 0, r10) {
    super(r10), this.resource = e206, this.textEdit = t10, this.versionId = n10;
  }
}, xF = class e138 extends yF {
  static is(t10) {
    return t10 instanceof e138 ? true : Be(t10) && (!!t10.newResource || !!t10.oldResource);
  }
  static lift(t10) {
    return t10 instanceof e138 ? t10 : new e138(t10.oldResource, t10.newResource, t10.options, t10.metadata);
  }
  constructor(e206, t10, n10 = {}, r10) {
    super(r10), this.oldResource = e206, this.newResource = t10, this.options = n10;
  }
}, SF = { enableSplitViewResizing: true, renderSideBySide: true, renderMarginRevertIcon: true, renderGutterMenu: true, maxComputationTime: 5e3, maxFileSize: 50, ignoreTrimWhitespace: true, renderIndicators: true, originalEditable: false, diffCodeLens: false, renderOverviewRuler: true, diffWordWrap: `inherit`, diffAlgorithm: `advanced`, accessibilityVerbose: false, experimental: { showMoves: false, showEmptyDecorations: true, useTrueInlineView: false }, hideUnchangedRegions: { enabled: false, contextLineCount: 3, minimumLineCount: 3, revealLineCount: 20 }, isInEmbeddedEditor: false, onlyShowAccessibleDiffViewer: false, renderSideBySideInlineBreakpoint: 900, useInlineViewWhenSpaceIsLimited: true, compactMode: false }, CF = Object.freeze({ id: `editor`, order: 5, type: `object`, title: C(147, `Editor`), scope: 6 }), wF = { ...CF, properties: { "editor.tabSize": { type: `number`, default: vn.tabSize, minimum: 1, maximum: 100, markdownDescription: C(148, `The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.`, "`#editor.detectIndentation#`") }, "editor.indentSize": { anyOf: [{ type: `string`, enum: [`tabSize`] }, { type: `number`, minimum: 1 }], default: `tabSize`, markdownDescription: C(149, 'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.') }, "editor.insertSpaces": { type: `boolean`, default: vn.insertSpaces, markdownDescription: C(150, "Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.", "`#editor.detectIndentation#`") }, "editor.detectIndentation": { type: `boolean`, default: vn.detectIndentation, markdownDescription: C(151, `Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.`, "`#editor.tabSize#`", "`#editor.insertSpaces#`") }, "editor.trimAutoWhitespace": { type: `boolean`, default: vn.trimAutoWhitespace, description: C(152, `Remove trailing auto inserted whitespace.`) }, "editor.largeFileOptimizations": { type: `boolean`, default: vn.largeFileOptimizations, description: C(153, `Special handling for large files to disable certain memory intensive features.`) }, "editor.wordBasedSuggestions": { enum: [`off`, `currentDocument`, `matchingDocuments`, `allDocuments`], default: `matchingDocuments`, enumDescriptions: [C(154, `Turn off Word Based Suggestions.`), C(155, `Only suggest words from the active document.`), C(156, `Suggest words from all open documents of the same language.`), C(157, `Suggest words from all open documents.`)], description: C(158, `Controls whether completions should be computed based on words in the document and from which documents they are computed.`) }, "editor.semanticHighlighting.enabled": { enum: [true, false, `configuredByTheme`], enumDescriptions: [C(159, `Semantic highlighting enabled for all color themes.`), C(160, `Semantic highlighting disabled for all color themes.`), C(161, "Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")], default: `configuredByTheme`, description: C(162, `Controls whether the semanticHighlighting is shown for the languages that support it.`) }, "editor.stablePeek": { type: `boolean`, default: false, markdownDescription: C(163, "Keep peek editors open even when double-clicking their content or when hitting `Escape`.") }, "editor.maxTokenizationLineLength": { type: `integer`, default: 2e4, description: C(164, `Lines above this length will not be tokenized for performance reasons`) }, "editor.experimental.asyncTokenization": { type: `boolean`, default: true, description: C(165, `Controls whether the tokenization should happen asynchronously on a web worker.`), tags: [`experimental`] }, "editor.experimental.asyncTokenizationLogging": { type: `boolean`, default: false, description: C(166, `Controls whether async tokenization should be logged. For debugging only.`) }, "editor.experimental.asyncTokenizationVerification": { type: `boolean`, default: false, description: C(167, `Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only.`), tags: [`experimental`] }, "editor.experimental.treeSitterTelemetry": { type: `boolean`, default: false, markdownDescription: C(168, "Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."), tags: [`experimental`], experiment: { mode: `auto` } }, "editor.experimental.preferTreeSitter.css": { type: `boolean`, default: false, markdownDescription: C(169, "Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."), tags: [`experimental`], experiment: { mode: `auto` } }, "editor.experimental.preferTreeSitter.typescript": { type: `boolean`, default: false, markdownDescription: C(170, "Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."), tags: [`experimental`], experiment: { mode: `auto` } }, "editor.experimental.preferTreeSitter.ini": { type: `boolean`, default: false, markdownDescription: C(171, "Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."), tags: [`experimental`], experiment: { mode: `auto` } }, "editor.experimental.preferTreeSitter.regex": { type: `boolean`, default: false, markdownDescription: C(172, "Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."), tags: [`experimental`], experiment: { mode: `auto` } }, "editor.language.brackets": { type: [`array`, `null`], default: null, description: C(173, `Defines the bracket symbols that increase or decrease the indentation.`), items: { type: `array`, items: [{ type: `string`, description: C(174, `The opening bracket character or string sequence.`) }, { type: `string`, description: C(175, `The closing bracket character or string sequence.`) }] } }, "editor.language.colorizedBracketPairs": { type: [`array`, `null`], default: null, description: C(176, `Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled.`), items: { type: `array`, items: [{ type: `string`, description: C(177, `The opening bracket character or string sequence.`) }, { type: `string`, description: C(178, `The closing bracket character or string sequence.`) }] } }, "diffEditor.maxComputationTime": { type: `number`, default: SF.maxComputationTime, description: C(179, `Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.`) }, "diffEditor.maxFileSize": { type: `number`, default: SF.maxFileSize, description: C(180, `Maximum file size in MB for which to compute diffs. Use 0 for no limit.`) }, "diffEditor.renderSideBySide": { type: `boolean`, default: SF.renderSideBySide, description: C(181, `Controls whether the diff editor shows the diff side by side or inline.`) }, "diffEditor.renderSideBySideInlineBreakpoint": { type: `number`, default: SF.renderSideBySideInlineBreakpoint, description: C(182, `If the diff editor width is smaller than this value, the inline view is used.`) }, "diffEditor.useInlineViewWhenSpaceIsLimited": { type: `boolean`, default: SF.useInlineViewWhenSpaceIsLimited, description: C(183, `If enabled and the editor width is too small, the inline view is used.`) }, "diffEditor.renderMarginRevertIcon": { type: `boolean`, default: SF.renderMarginRevertIcon, description: C(184, `When enabled, the diff editor shows arrows in its glyph margin to revert changes.`) }, "diffEditor.renderGutterMenu": { type: `boolean`, default: SF.renderGutterMenu, description: C(185, `When enabled, the diff editor shows a special gutter for revert and stage actions.`) }, "diffEditor.ignoreTrimWhitespace": { type: `boolean`, default: SF.ignoreTrimWhitespace, description: C(186, `When enabled, the diff editor ignores changes in leading or trailing whitespace.`) }, "diffEditor.renderIndicators": { type: `boolean`, default: SF.renderIndicators, description: C(187, `Controls whether the diff editor shows +/- indicators for added/removed changes.`) }, "diffEditor.codeLens": { type: `boolean`, default: SF.diffCodeLens, description: C(188, `Controls whether the editor shows CodeLens.`) }, "diffEditor.wordWrap": { type: `string`, enum: [`off`, `on`, `inherit`], default: SF.diffWordWrap, markdownEnumDescriptions: [C(189, `Lines will never wrap.`), C(190, `Lines will wrap at the viewport width.`), C(191, `Lines will wrap according to the {0} setting.`, "`#editor.wordWrap#`")] }, "diffEditor.diffAlgorithm": { type: `string`, enum: [`legacy`, `advanced`], default: SF.diffAlgorithm, markdownEnumDescriptions: [C(192, `Uses the legacy diffing algorithm.`), C(193, `Uses the advanced diffing algorithm.`)] }, "diffEditor.hideUnchangedRegions.enabled": { type: `boolean`, default: SF.hideUnchangedRegions.enabled, markdownDescription: C(194, `Controls whether the diff editor shows unchanged regions.`) }, "diffEditor.hideUnchangedRegions.revealLineCount": { type: `integer`, default: SF.hideUnchangedRegions.revealLineCount, markdownDescription: C(195, `Controls how many lines are used for unchanged regions.`), minimum: 1 }, "diffEditor.hideUnchangedRegions.minimumLineCount": { type: `integer`, default: SF.hideUnchangedRegions.minimumLineCount, markdownDescription: C(196, `Controls how many lines are used as a minimum for unchanged regions.`), minimum: 1 }, "diffEditor.hideUnchangedRegions.contextLineCount": { type: `integer`, default: SF.hideUnchangedRegions.contextLineCount, markdownDescription: C(197, `Controls how many lines are used as context when comparing unchanged regions.`), minimum: 1 }, "diffEditor.experimental.showMoves": { type: `boolean`, default: SF.experimental.showMoves, markdownDescription: C(198, `Controls whether the diff editor should show detected code moves.`) }, "diffEditor.experimental.showEmptyDecorations": { type: `boolean`, default: SF.experimental.showEmptyDecorations, description: C(199, `Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.`) }, "diffEditor.experimental.useTrueInlineView": { type: `boolean`, default: SF.experimental.useTrueInlineView, description: C(200, `If enabled and the editor uses the inline view, word changes are rendered inline.`) } } };
function Fhe(e206) {
  return e206.type !== void 0 || e206.anyOf !== void 0;
}
for (let e206 of cr) {
  let t10 = e206.schema;
  if (t10 !== void 0) if (Fhe(t10)) wF.properties[`editor.${e206.name}`] = t10;
  else for (let e207 in t10) Object.hasOwnProperty.call(t10, e207) && (wF.properties[e207] = t10[e207]);
}
var TF = null;
function EF() {
  return TF === null && (TF = /* @__PURE__ */ Object.create(null), Object.keys(wF.properties).forEach((e206) => {
    TF[e206] = true;
  })), TF;
}
function Ihe(e206) {
  return EF()[`editor.${e206}`] || false;
}
function Lhe(e206) {
  return EF()[`diffEditor.${e206}`] || false;
}
cd.as(op.Configuration).registerConfiguration(wF);
var DF = class {
  static insert(e206, t10) {
    return { range: new M(e206.lineNumber, e206.column, e206.lineNumber, e206.column), text: t10, forceMoveMarkers: true };
  }
  static delete(e206) {
    return { range: e206, text: null };
  }
  static replace(e206, t10) {
    return { range: e206, text: t10 };
  }
  static replaceMove(e206, t10) {
    return { range: e206, text: t10, forceMoveMarkers: true };
  }
};
function OF(e206) {
  return Object.isFrozen(e206) ? e206 : tt(e206);
}
var kF = class e139 {
  static createEmptyModel(t10) {
    return new e139({}, [], [], void 0, t10);
  }
  constructor(e206, t10, n10, r10, i10) {
    this._contents = e206, this._keys = t10, this._overrides = n10, this.raw = r10, this.logService = i10, this.overrideConfigurations = /* @__PURE__ */ new Map();
  }
  get rawConfiguration() {
    if (!this._rawConfiguration) if (this.raw) {
      let t10 = (Array.isArray(this.raw) ? this.raw : [this.raw]).map((t11) => {
        if (t11 instanceof e139) return t11;
        let n10 = new Rhe(``, this.logService);
        return n10.parseRaw(t11), n10.configurationModel;
      });
      this._rawConfiguration = t10.reduce((e206, t11) => t11 === e206 ? t11 : e206.merge(t11), t10[0]);
    } else this._rawConfiguration = this;
    return this._rawConfiguration;
  }
  get contents() {
    return this._contents;
  }
  get overrides() {
    return this._overrides;
  }
  get keys() {
    return this._keys;
  }
  isEmpty() {
    return this._keys.length === 0 && Object.keys(this._contents).length === 0 && this._overrides.length === 0;
  }
  getValue(e206) {
    return e206 ? qf(this.contents, e206) : this.contents;
  }
  inspect(t10, n10) {
    let r10 = this;
    return { get value() {
      return OF(r10.rawConfiguration.getValue(t10));
    }, get override() {
      return n10 ? OF(r10.rawConfiguration.getOverrideValue(t10, n10)) : void 0;
    }, get merged() {
      return OF(n10 ? r10.rawConfiguration.override(n10).getValue(t10) : r10.rawConfiguration.getValue(t10));
    }, get overrides() {
      let n11 = [];
      for (let { contents: i10, identifiers: a10, keys: o10 } of r10.rawConfiguration.overrides) {
        let s10 = new e139(i10, o10, [], void 0, r10.logService).getValue(t10);
        s10 !== void 0 && n11.push({ identifiers: a10, value: s10 });
      }
      return n11.length ? OF(n11) : void 0;
    } };
  }
  getOverrideValue(e206, t10) {
    let n10 = this.getContentsForOverrideIdentifer(t10);
    return n10 ? e206 ? qf(n10, e206) : n10 : void 0;
  }
  override(e206) {
    let t10 = this.overrideConfigurations.get(e206);
    return t10 || (t10 = this.createOverrideConfigurationModel(e206), this.overrideConfigurations.set(e206, t10)), t10;
  }
  merge(...t10) {
    let n10 = et(this.contents), r10 = et(this.overrides), i10 = [...this.keys], a10 = this.raw ? Array.isArray(this.raw) ? [...this.raw] : [this.raw] : [this];
    for (let e206 of t10) if (a10.push(...e206.raw ? Array.isArray(e206.raw) ? e206.raw : [e206.raw] : [e206]), !e206.isEmpty()) {
      this.mergeContents(n10, e206.contents);
      for (let t11 of e206.overrides) {
        let [e207] = r10.filter((e208) => o(e208.identifiers, t11.identifiers));
        e207 ? (this.mergeContents(e207.contents, t11.contents), e207.keys.push(...t11.keys), e207.keys = y(e207.keys)) : r10.push(et(t11));
      }
      for (let t11 of e206.keys) i10.indexOf(t11) === -1 && i10.push(t11);
    }
    return new e139(n10, i10, r10, !a10.length || a10.every((t11) => t11 instanceof e139) ? void 0 : a10, this.logService);
  }
  createOverrideConfigurationModel(t10) {
    let n10 = this.getContentsForOverrideIdentifer(t10);
    if (!n10 || typeof n10 != `object` || !Object.keys(n10).length) return this;
    let r10 = {};
    for (let e206 of y([...Object.keys(this.contents), ...Object.keys(n10)])) {
      let t11 = this.contents[e206], i10 = n10[e206];
      i10 && (typeof t11 == `object` && typeof i10 == `object` ? (t11 = et(t11), this.mergeContents(t11, i10)) : t11 = i10), r10[e206] = t11;
    }
    return new e139(r10, this.keys, this.overrides, void 0, this.logService);
  }
  mergeContents(e206, t10) {
    for (let n10 of Object.keys(t10)) {
      if (n10 in e206 && Be(e206[n10]) && Be(t10[n10])) {
        this.mergeContents(e206[n10], t10[n10]);
        continue;
      }
      e206[n10] = et(t10[n10]);
    }
  }
  getContentsForOverrideIdentifer(e206) {
    let t10 = null, n10 = null, r10 = (e207) => {
      e207 && (n10 ? this.mergeContents(n10, e207) : n10 = et(e207));
    };
    for (let n11 of this.overrides) n11.identifiers.length === 1 && n11.identifiers[0] === e206 ? t10 = n11.contents : n11.identifiers.includes(e206) && r10(n11.contents);
    return r10(t10), n10;
  }
  toJSON() {
    return { contents: this.contents, overrides: this.overrides, keys: this.keys };
  }
  setValue(e206, t10) {
    this.updateValue(e206, t10, false);
  }
  removeValue(e206) {
    let t10 = this.keys.indexOf(e206);
    t10 !== -1 && (this.keys.splice(t10, 1), Vre(this.contents, e206), dp.test(e206) && this.overrides.splice(this.overrides.findIndex((t11) => o(t11.identifiers, fp(e206))), 1));
  }
  updateValue(e206, t10, n10) {
    if (Gf(this.contents, e206, t10, (e207) => this.logService.error(e207)), n10 || (n10 = this.keys.indexOf(e206) === -1), n10 && this.keys.push(e206), dp.test(e206)) {
      let t11 = fp(e206), n11 = { identifiers: t11, keys: Object.keys(this.contents[e206]), contents: Wf(this.contents[e206], (e207) => this.logService.error(e207)) }, r10 = this.overrides.findIndex((e207) => o(e207.identifiers, t11));
      r10 === -1 ? this.overrides.push(n11) : this.overrides[r10] = n11;
    }
  }
}, Rhe = class {
  constructor(e206, t10) {
    this._name = e206, this.logService = t10, this._raw = null, this._configurationModel = null, this._restrictedConfigurations = [];
  }
  get configurationModel() {
    return this._configurationModel || kF.createEmptyModel(this.logService);
  }
  parseRaw(e206, t10) {
    this._raw = e206;
    let { contents: n10, keys: r10, overrides: i10, restricted: a10, hasExcludedProperties: o10 } = this.doParseRaw(e206, t10);
    this._configurationModel = new kF(n10, r10, i10, o10 ? [e206] : void 0, this.logService), this._restrictedConfigurations = a10 || [];
  }
  doParseRaw(e206, t10) {
    let n10 = cd.as(op.Configuration), r10 = n10.getConfigurationProperties(), i10 = n10.getExcludedConfigurationProperties(), a10 = this.filter(e206, r10, i10, true, t10);
    return e206 = a10.raw, { contents: Wf(e206, (e207) => this.logService.error(`Conflict in settings file ${this._name}: ${e207}`)), keys: Object.keys(e206), overrides: this.toOverrides(e206, (e207) => this.logService.error(`Conflict in settings file ${this._name}: ${e207}`)), restricted: a10.restricted, hasExcludedProperties: a10.hasExcludedProperties };
  }
  filter(e206, t10, n10, r10, i10) {
    let a10 = false;
    if (!i10?.scopes && !i10?.skipRestricted && !i10?.skipUnregistered && !i10?.exclude?.length) return { raw: e206, restricted: [], hasExcludedProperties: a10 };
    let o10 = {}, s10 = [];
    for (let c10 in e206) if (dp.test(c10) && r10) {
      let r11 = this.filter(e206[c10], t10, n10, false, i10);
      o10[c10] = r11.raw, a10 || (a10 = r11.hasExcludedProperties), s10.push(...r11.restricted);
    } else {
      let r11 = t10[c10];
      r11?.restricted && s10.push(c10), this.shouldInclude(c10, r11, n10, i10) ? o10[c10] = e206[c10] : a10 = true;
    }
    return { raw: o10, restricted: s10, hasExcludedProperties: a10 };
  }
  shouldInclude(e206, t10, n10, r10) {
    if (r10.exclude?.includes(e206)) return false;
    if (r10.include?.includes(e206)) return true;
    if (r10.skipRestricted && t10?.restricted || r10.skipUnregistered && !t10) return false;
    let i10 = t10 ?? n10[e206], a10 = i10 ? i10.scope === void 0 ? 4 : i10.scope : void 0;
    return a10 === void 0 || r10.scopes === void 0 ? true : r10.scopes.includes(a10);
  }
  toOverrides(e206, t10) {
    let n10 = [];
    for (let r10 of Object.keys(e206)) if (dp.test(r10)) {
      let i10 = {};
      for (let t11 in e206[r10]) i10[t11] = e206[r10][t11];
      n10.push({ identifiers: fp(r10), keys: Object.keys(i10), contents: Wf(i10, t10) });
    }
    return n10;
  }
}, zhe = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10) {
    this.key = e206, this.overrides = t10, this._value = n10, this.overrideIdentifiers = r10, this.defaultConfiguration = i10, this.policyConfiguration = a10, this.applicationConfiguration = o10, this.userConfiguration = s10, this.localUserConfiguration = c10, this.remoteUserConfiguration = l10, this.workspaceConfiguration = u10, this.folderConfigurationModel = d10, this.memoryConfigurationModel = f10;
  }
  toInspectValue(e206) {
    return e206?.value !== void 0 || e206?.override !== void 0 || e206?.overrides !== void 0 ? e206 : void 0;
  }
  get userInspectValue() {
    return this._userInspectValue || (this._userInspectValue = this.userConfiguration.inspect(this.key, this.overrides.overrideIdentifier)), this._userInspectValue;
  }
  get user() {
    return this.toInspectValue(this.userInspectValue);
  }
}, AF = class e140 {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    this._defaultConfiguration = e206, this._policyConfiguration = t10, this._applicationConfiguration = n10, this._localUserConfiguration = r10, this._remoteUserConfiguration = i10, this._workspaceConfiguration = a10, this._folderConfigurations = o10, this._memoryConfiguration = s10, this._memoryConfigurationByResource = c10, this.logService = l10, this._workspaceConsolidatedConfiguration = null, this._foldersConsolidatedConfigurations = new wd(), this._userConfiguration = null;
  }
  getValue(e206, t10, n10) {
    return this.getConsolidatedConfigurationModel(e206, t10, n10).getValue(e206);
  }
  updateValue(e206, t10, n10 = {}) {
    let r10;
    n10.resource ? (r10 = this._memoryConfigurationByResource.get(n10.resource), r10 || (r10 = kF.createEmptyModel(this.logService), this._memoryConfigurationByResource.set(n10.resource, r10))) : r10 = this._memoryConfiguration, t10 === void 0 ? r10.removeValue(e206) : r10.setValue(e206, t10), n10.resource || (this._workspaceConsolidatedConfiguration = null);
  }
  inspect(e206, t10, n10) {
    let r10 = this.getConsolidatedConfigurationModel(e206, t10, n10), i10 = this.getFolderConfigurationModelForResource(t10.resource, n10), a10 = t10.resource && this._memoryConfigurationByResource.get(t10.resource) || this._memoryConfiguration, o10 = /* @__PURE__ */ new Set();
    for (let t11 of r10.overrides) for (let n11 of t11.identifiers) r10.getOverrideValue(e206, n11) !== void 0 && o10.add(n11);
    return new zhe(e206, t10, r10.getValue(e206), o10.size ? [...o10] : void 0, this._defaultConfiguration, this._policyConfiguration.isEmpty() ? void 0 : this._policyConfiguration, this.applicationConfiguration.isEmpty() ? void 0 : this.applicationConfiguration, this.userConfiguration, this.localUserConfiguration, this.remoteUserConfiguration, n10 ? this._workspaceConfiguration : void 0, i10 || void 0, a10);
  }
  get applicationConfiguration() {
    return this._applicationConfiguration;
  }
  get userConfiguration() {
    if (!this._userConfiguration) if (this._remoteUserConfiguration.isEmpty()) this._userConfiguration = this._localUserConfiguration;
    else {
      let e206 = this._localUserConfiguration.merge(this._remoteUserConfiguration);
      this._userConfiguration = new kF(e206.contents, e206.keys, e206.overrides, void 0, this.logService);
    }
    return this._userConfiguration;
  }
  get localUserConfiguration() {
    return this._localUserConfiguration;
  }
  get remoteUserConfiguration() {
    return this._remoteUserConfiguration;
  }
  getConsolidatedConfigurationModel(e206, t10, n10) {
    let r10 = this.getConsolidatedConfigurationModelForResource(t10, n10);
    if (t10.overrideIdentifier && (r10 = r10.override(t10.overrideIdentifier)), !this._policyConfiguration.isEmpty() && this._policyConfiguration.getValue(e206) !== void 0) {
      r10 = r10.merge();
      for (let e207 of this._policyConfiguration.keys) r10.setValue(e207, this._policyConfiguration.getValue(e207));
    }
    return r10;
  }
  getConsolidatedConfigurationModelForResource({ resource: e206 }, t10) {
    let n10 = this.getWorkspaceConsolidatedConfiguration();
    if (t10 && e206) {
      let r10 = t10.getFolder(e206);
      r10 && (n10 = this.getFolderConsolidatedConfiguration(r10.uri) || n10);
      let i10 = this._memoryConfigurationByResource.get(e206);
      i10 && (n10 = n10.merge(i10));
    }
    return n10;
  }
  getWorkspaceConsolidatedConfiguration() {
    return this._workspaceConsolidatedConfiguration || (this._workspaceConsolidatedConfiguration = this._defaultConfiguration.merge(this.applicationConfiguration, this.userConfiguration, this._workspaceConfiguration, this._memoryConfiguration)), this._workspaceConsolidatedConfiguration;
  }
  getFolderConsolidatedConfiguration(e206) {
    let t10 = this._foldersConsolidatedConfigurations.get(e206);
    if (!t10) {
      let n10 = this.getWorkspaceConsolidatedConfiguration(), r10 = this._folderConfigurations.get(e206);
      r10 ? (t10 = n10.merge(r10), this._foldersConsolidatedConfigurations.set(e206, t10)) : t10 = n10;
    }
    return t10;
  }
  getFolderConfigurationModelForResource(e206, t10) {
    if (t10 && e206) {
      let n10 = t10.getFolder(e206);
      if (n10) return this._folderConfigurations.get(n10.uri);
    }
  }
  toData() {
    return { defaults: { contents: this._defaultConfiguration.contents, overrides: this._defaultConfiguration.overrides, keys: this._defaultConfiguration.keys }, policy: { contents: this._policyConfiguration.contents, overrides: this._policyConfiguration.overrides, keys: this._policyConfiguration.keys }, application: { contents: this.applicationConfiguration.contents, overrides: this.applicationConfiguration.overrides, keys: this.applicationConfiguration.keys, raw: Array.isArray(this.applicationConfiguration.raw) ? void 0 : this.applicationConfiguration.raw }, userLocal: { contents: this.localUserConfiguration.contents, overrides: this.localUserConfiguration.overrides, keys: this.localUserConfiguration.keys, raw: Array.isArray(this.localUserConfiguration.raw) ? void 0 : this.localUserConfiguration.raw }, userRemote: { contents: this.remoteUserConfiguration.contents, overrides: this.remoteUserConfiguration.overrides, keys: this.remoteUserConfiguration.keys, raw: Array.isArray(this.remoteUserConfiguration.raw) ? void 0 : this.remoteUserConfiguration.raw }, workspace: { contents: this._workspaceConfiguration.contents, overrides: this._workspaceConfiguration.overrides, keys: this._workspaceConfiguration.keys }, folders: [...this._folderConfigurations.keys()].reduce((e206, t10) => {
      let { contents: n10, overrides: r10, keys: i10 } = this._folderConfigurations.get(t10);
      return e206.push([t10, { contents: n10, overrides: r10, keys: i10 }]), e206;
    }, []) };
  }
  static parse(t10, n10) {
    return new e140(this.parseConfigurationModel(t10.defaults, n10), this.parseConfigurationModel(t10.policy, n10), this.parseConfigurationModel(t10.application, n10), this.parseConfigurationModel(t10.userLocal, n10), this.parseConfigurationModel(t10.userRemote, n10), this.parseConfigurationModel(t10.workspace, n10), t10.folders.reduce((e206, t11) => (e206.set($r.revive(t11[0]), this.parseConfigurationModel(t11[1], n10)), e206), new wd()), kF.createEmptyModel(n10), new wd(), n10);
  }
  static parseConfigurationModel(e206, t10) {
    return new kF(e206.contents, e206.keys, e206.overrides, e206.raw, t10);
  }
}, Bhe = class {
  constructor(e206, t10, n10, r10, i10) {
    this.change = e206, this.previous = t10, this.currentConfiguraiton = n10, this.currentWorkspace = r10, this.logService = i10, this._marker = `
`, this._markerCode1 = this._marker.charCodeAt(0), this._markerCode2 = 46, this.affectedKeys = /* @__PURE__ */ new Set(), this._previousConfiguration = void 0;
    for (let t11 of e206.keys) this.affectedKeys.add(t11);
    for (let [, t11] of e206.overrides) for (let e207 of t11) this.affectedKeys.add(e207);
    this._affectsConfigStr = this._marker;
    for (let e207 of this.affectedKeys) this._affectsConfigStr += e207 + this._marker;
  }
  get previousConfiguration() {
    return !this._previousConfiguration && this.previous && (this._previousConfiguration = AF.parse(this.previous.data, this.logService)), this._previousConfiguration;
  }
  affectsConfiguration(e206, t10) {
    let n10 = this._marker + e206, r10 = this._affectsConfigStr.indexOf(n10);
    if (r10 < 0) return false;
    let i10 = r10 + n10.length;
    if (i10 >= this._affectsConfigStr.length) return false;
    let a10 = this._affectsConfigStr.charCodeAt(i10);
    return a10 !== this._markerCode1 && a10 !== this._markerCode2 ? false : t10 ? !ot(this.previousConfiguration ? this.previousConfiguration.getValue(e206, t10, this.previous?.workspace) : void 0, this.currentConfiguraiton.getValue(e206, t10, this.currentWorkspace)) : true;
  }
}, jF = { kind: 0 }, Vhe = { kind: 1 };
function Hhe(e206, t10, n10) {
  return { kind: 2, commandId: e206, commandArgs: t10, isBubble: n10 };
}
var Uhe = class e141 {
  constructor(t10, n10, r10) {
    this._log = r10, this._defaultKeybindings = t10, this._defaultBoundCommands = /* @__PURE__ */ new Map();
    for (let e206 of t10) {
      let t11 = e206.command;
      t11 && t11.charAt(0) !== `-` && this._defaultBoundCommands.set(t11, true);
    }
    this._map = /* @__PURE__ */ new Map(), this._lookupMap = /* @__PURE__ */ new Map(), this._keybindings = e141.handleRemovals([].concat(t10, n10));
    for (let e206 = 0, t11 = this._keybindings.length; e206 < t11; e206++) {
      let t12 = this._keybindings[e206];
      if (t12.chords.length === 0) continue;
      let n11 = t12.when?.substituteConstants();
      n11 && n11.type === 0 || this._addKeyPress(t12.chords[0], t12);
    }
  }
  static _isTargetedForRemoval(e206, t10, n10) {
    if (t10) {
      for (let n11 = 0; n11 < t10.length; n11++) if (t10[n11] !== e206.chords[n11]) return false;
    }
    return !(n10 && n10.type !== 1 && (!e206.when || !Wne(n10, e206.when)));
  }
  static handleRemovals(e206) {
    let t10 = /* @__PURE__ */ new Map();
    for (let n11 = 0, r10 = e206.length; n11 < r10; n11++) {
      let r11 = e206[n11];
      if (r11.command && r11.command.charAt(0) === `-`) {
        let e207 = r11.command.substring(1);
        t10.has(e207) ? t10.get(e207).push(r11) : t10.set(e207, [r11]);
      }
    }
    if (t10.size === 0) return e206;
    let n10 = [];
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
      let i11 = e206[r10];
      if (!i11.command || i11.command.length === 0) {
        n10.push(i11);
        continue;
      }
      if (i11.command.charAt(0) === `-`) continue;
      let a10 = t10.get(i11.command);
      if (!a10 || !i11.isDefault) {
        n10.push(i11);
        continue;
      }
      let o10 = false;
      for (let e207 of a10) {
        let t11 = e207.when;
        if (this._isTargetedForRemoval(i11, e207.chords, t11)) {
          o10 = true;
          break;
        }
      }
      if (!o10) {
        n10.push(i11);
        continue;
      }
    }
    return n10;
  }
  _addKeyPress(t10, n10) {
    let r10 = this._map.get(t10);
    if (r10 === void 0) {
      this._map.set(t10, [n10]), this._addToLookupMap(n10);
      return;
    }
    for (let t11 = r10.length - 1; t11 >= 0; t11--) {
      let i10 = r10[t11];
      if (i10.command === n10.command) continue;
      let a10 = true;
      for (let e206 = 1; e206 < i10.chords.length && e206 < n10.chords.length; e206++) if (i10.chords[e206] !== n10.chords[e206]) {
        a10 = false;
        break;
      }
      a10 && e141.whenIsEntirelyIncluded(i10.when, n10.when) && this._removeFromLookupMap(i10);
    }
    r10.push(n10), this._addToLookupMap(n10);
  }
  _addToLookupMap(e206) {
    if (!e206.command) return;
    let t10 = this._lookupMap.get(e206.command);
    t10 === void 0 ? (t10 = [e206], this._lookupMap.set(e206.command, t10)) : t10.push(e206);
  }
  _removeFromLookupMap(e206) {
    if (!e206.command) return;
    let t10 = this._lookupMap.get(e206.command);
    if (t10 !== void 0) {
      for (let n10 = 0, r10 = t10.length; n10 < r10; n10++) if (t10[n10] === e206) {
        t10.splice(n10, 1);
        return;
      }
    }
  }
  static whenIsEntirelyIncluded(e206, t10) {
    return !t10 || t10.type === 1 ? true : !e206 || e206.type === 1 ? false : ad(e206, t10);
  }
  getKeybindings() {
    return this._keybindings;
  }
  lookupPrimaryKeybinding(e206, t10, n10 = false) {
    let r10 = this._lookupMap.get(e206);
    if (r10 === void 0 || r10.length === 0) return null;
    if (r10.length === 1 && !n10) return r10[0];
    for (let e207 = r10.length - 1; e207 >= 0; e207--) {
      let n11 = r10[e207];
      if (t10.contextMatchesRules(n11.when)) return n11;
    }
    return n10 ? null : r10[r10.length - 1];
  }
  resolve(e206, t10, n10) {
    let r10 = [...t10, n10];
    this._log(`| Resolving ${r10}`);
    let i10 = this._map.get(r10[0]);
    if (i10 === void 0) return this._log(`\\ No keybinding entries.`), jF;
    let a10 = null;
    if (r10.length < 2) a10 = i10;
    else {
      a10 = [];
      for (let e207 = 0, t11 = i10.length; e207 < t11; e207++) {
        let t12 = i10[e207];
        if (r10.length > t12.chords.length) continue;
        let n11 = true;
        for (let e208 = 1; e208 < r10.length; e208++) if (t12.chords[e208] !== r10[e208]) {
          n11 = false;
          break;
        }
        n11 && a10.push(t12);
      }
    }
    let o10 = this._findCommand(e206, a10);
    return o10 ? r10.length < o10.chords.length ? (this._log(`\\ From ${a10.length} keybinding entries, awaiting ${o10.chords.length - r10.length} more chord(s), when: ${MF(o10.when)}, source: ${NF(o10)}.`), Vhe) : (this._log(`\\ From ${a10.length} keybinding entries, matched ${o10.command}, when: ${MF(o10.when)}, source: ${NF(o10)}.`), Hhe(o10.command, o10.commandArgs, o10.bubble)) : (this._log(`\\ From ${a10.length} keybinding entries, no when clauses matched the context.`), jF);
  }
  _findCommand(t10, n10) {
    for (let r10 = n10.length - 1; r10 >= 0; r10--) {
      let i10 = n10[r10];
      if (e141._contextMatchesRules(t10, i10.when)) return i10;
    }
    return null;
  }
  static _contextMatchesRules(e206, t10) {
    return t10 ? t10.evaluate(e206) : true;
  }
};
function MF(e206) {
  return e206 ? `${e206.serialize()}` : `no when condition`;
}
function NF(e206) {
  return e206.extensionId ? e206.isBuiltinExtension ? `built-in extension ${e206.extensionId}` : `user extension ${e206.extensionId}` : e206.isDefault ? `built-in` : `user`;
}
var Whe = /^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/, Ghe = class extends D {
  get onDidUpdateKeybindings() {
    return this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : O.None;
  }
  get inChordMode() {
    return this._currentChords.length > 0;
  }
  constructor(e206, t10, n10, r10, i10) {
    super(), this._contextKeyService = e206, this._commandService = t10, this._telemetryService = n10, this._notificationService = r10, this._logService = i10, this._onDidUpdateKeybindings = this._register(new k()), this._currentChords = [], this._currentChordChecker = new ls(), this._currentChordStatusMessage = null, this._ignoreSingleModifiers = PF.EMPTY, this._currentSingleModifier = null, this._currentSingleModifierClearTimeout = new cs(), this._currentlyDispatchingCommandId = null, this._logging = false;
  }
  dispose() {
    super.dispose();
  }
  _log(e206) {
    this._logging && this._logService.info(`[KeybindingService]: ${e206}`);
  }
  getKeybindings() {
    return this._getResolver().getKeybindings();
  }
  lookupKeybinding(e206, t10, n10 = false) {
    let r10 = this._getResolver().lookupPrimaryKeybinding(e206, t10 || this._contextKeyService, n10);
    if (r10) return r10.resolvedKeybinding;
  }
  dispatchEvent(e206, t10) {
    return this._dispatch(e206, t10);
  }
  softDispatch(e206, t10) {
    this._log(`/ Soft dispatching keyboard event`);
    let n10 = this.resolveKeyboardEvent(e206);
    if (n10.hasMultipleChords()) return console.warn(`keyboard event should not be mapped to multiple chords`), jF;
    let [r10] = n10.getDispatchChords();
    if (r10 === null) return this._log(`\\ Keyboard event cannot be dispatched`), jF;
    let i10 = this._contextKeyService.getContext(t10), a10 = this._currentChords.map((({ keypress: e207 }) => e207));
    return this._getResolver().resolve(i10, a10, r10);
  }
  _scheduleLeaveChordMode() {
    let e206 = Date.now();
    this._currentChordChecker.cancelAndSet(() => {
      if (!this._documentHasFocus()) {
        this._leaveChordMode();
        return;
      }
      Date.now() - e206 > 5e3 && this._leaveChordMode();
    }, 500);
  }
  _expectAnotherChord(e206, t10) {
    switch (this._currentChords.push({ keypress: e206, label: t10 }), this._currentChords.length) {
      case 0:
        throw Oe(`impossible`);
      case 1:
        this._currentChordStatusMessage = this._notificationService.status(C(1701, `({0}) was pressed. Waiting for second key of chord...`, t10));
        break;
      default: {
        let e207 = this._currentChords.map(({ label: e208 }) => e208).join(`, `);
        this._currentChordStatusMessage = this._notificationService.status(C(1702, `({0}) was pressed. Waiting for next key of chord...`, e207));
      }
    }
    this._scheduleLeaveChordMode(), Ew.enabled && Ew.disable();
  }
  _leaveChordMode() {
    this._currentChordStatusMessage && (this._currentChordStatusMessage = (this._currentChordStatusMessage.close(), null)), this._currentChordChecker.cancel(), this._currentChords = [], Ew.enable();
  }
  _dispatch(e206, t10) {
    return this._doDispatch(this.resolveKeyboardEvent(e206), t10, false);
  }
  _singleModifierDispatch(e206, t10) {
    let n10 = this.resolveKeyboardEvent(e206), [r10] = n10.getSingleModifierDispatchChords();
    if (r10) return this._ignoreSingleModifiers.has(r10) ? (this._log(`+ Ignoring single modifier ${r10} due to it being pressed together with other keys.`), this._ignoreSingleModifiers = PF.EMPTY, this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, false) : (this._ignoreSingleModifiers = PF.EMPTY, this._currentSingleModifier === null ? (this._log(`+ Storing single modifier for possible chord ${r10}.`), this._currentSingleModifier = r10, this._currentSingleModifierClearTimeout.cancelAndSet(() => {
      this._log(`+ Clearing single modifier due to 300ms elapsed.`), this._currentSingleModifier = null;
    }, 300), false) : r10 === this._currentSingleModifier ? (this._log(`/ Dispatching single modifier chord ${r10} ${r10}`), this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, this._doDispatch(n10, t10, true)) : (this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r10}`), this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, false));
    let [i10] = n10.getChords();
    return this._ignoreSingleModifiers = new PF(i10), this._currentSingleModifier !== null && this._log(`+ Clearing single modifier due to other key up.`), this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, false;
  }
  _doDispatch(e206, t10, n10 = false) {
    let r10 = false;
    if (e206.hasMultipleChords()) return console.warn(`Unexpected keyboard event mapped to multiple chords`), false;
    let i10 = null, a10 = null;
    if (n10) {
      let [t11] = e206.getSingleModifierDispatchChords();
      i10 = t11, a10 = t11 ? [t11] : [];
    } else [i10] = e206.getDispatchChords(), a10 = this._currentChords.map(({ keypress: e207 }) => e207);
    if (i10 === null) return this._log(`\\ Keyboard event cannot be dispatched in keydown phase.`), r10;
    let o10 = this._contextKeyService.getContext(t10), s10 = e206.getLabel(), c10 = this._getResolver().resolve(o10, a10, i10);
    switch (c10.kind) {
      case 0:
        if (this._logService.trace(`KeybindingService#dispatch`, s10, `[ No matching keybinding ]`), this.inChordMode) {
          let e207 = this._currentChords.map(({ label: e208 }) => e208).join(`, `);
          this._log(`+ Leaving multi-chord mode: Nothing bound to "${e207}, ${s10}".`), this._notificationService.status(C(1703, `The key combination ({0}, {1}) is not a command.`, e207, s10), { hideAfter: 10 * 1e3 }), this._leaveChordMode(), r10 = true;
        }
        return r10;
      case 1:
        return this._logService.trace(`KeybindingService#dispatch`, s10, `[ Several keybindings match - more chords needed ]`), r10 = true, this._expectAnotherChord(i10, s10), this._log(this._currentChords.length === 1 ? `+ Entering multi-chord mode...` : `+ Continuing multi-chord mode...`), r10;
      case 2:
        if (this._logService.trace(`KeybindingService#dispatch`, s10, `[ Will dispatch command ${c10.commandId} ]`), c10.commandId === null || c10.commandId === ``) {
          if (this.inChordMode) {
            let e207 = this._currentChords.map(({ label: e208 }) => e208).join(`, `);
            this._log(`+ Leaving chord mode: Nothing bound to "${e207}, ${s10}".`), this._notificationService.status(C(1704, `The key combination ({0}, {1}) is not a command.`, e207, s10), { hideAfter: 10 * 1e3 }), this._leaveChordMode(), r10 = true;
          }
        } else {
          this.inChordMode && this._leaveChordMode(), c10.isBubble || (r10 = true), this._log(`+ Invoking command ${c10.commandId}.`), this._currentlyDispatchingCommandId = c10.commandId;
          try {
            c10.commandArgs === void 0 ? this._commandService.executeCommand(c10.commandId).then(void 0, (e207) => this._notificationService.warn(e207)) : this._commandService.executeCommand(c10.commandId, c10.commandArgs).then(void 0, (e207) => this._notificationService.warn(e207));
          } finally {
            this._currentlyDispatchingCommandId = null;
          }
          Whe.test(c10.commandId) || this._telemetryService.publicLog2(`workbenchActionExecuted`, { id: c10.commandId, from: `keybinding`, detail: e206.getUserSettingsLabel() ?? void 0 });
        }
        return r10;
    }
  }
  mightProducePrintableCharacter(e206) {
    return e206.ctrlKey || e206.metaKey ? false : e206.keyCode >= 31 && e206.keyCode <= 56 || e206.keyCode >= 21 && e206.keyCode <= 30;
  }
}, PF = (_Pa = class {
  constructor(e206) {
    this._ctrlKey = e206 ? e206.ctrlKey : false, this._shiftKey = e206 ? e206.shiftKey : false, this._altKey = e206 ? e206.altKey : false, this._metaKey = e206 ? e206.metaKey : false;
  }
  has(e206) {
    switch (e206) {
      case `ctrl`:
        return this._ctrlKey;
      case `shift`:
        return this._shiftKey;
      case `alt`:
        return this._altKey;
      case `meta`:
        return this._metaKey;
    }
  }
}, _Pa.EMPTY = new _Pa(null), _Pa), FF = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this._resolvedKeybindingItemBrand = void 0, this.resolvedKeybinding = e206, this.chords = e206 ? IF(e206.getDispatchChords()) : [], e206 && this.chords.length === 0 && (this.chords = IF(e206.getSingleModifierDispatchChords())), this.bubble = t10 ? t10.charCodeAt(0) === 94 : false, this.command = this.bubble ? t10.substr(1) : t10, this.commandArgs = n10, this.when = r10, this.isDefault = i10, this.extensionId = a10, this.isBuiltinExtension = o10;
  }
};
function IF(e206) {
  let t10 = [];
  for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
    let r11 = e206[n10];
    if (!r11) return [];
    t10.push(r11);
  }
  return t10;
}
var LF = class {
  constructor(e206, t10, n10 = t10) {
    this.modifierLabels = [null], this.modifierLabels[2] = e206, this.modifierLabels[1] = t10, this.modifierLabels[3] = n10;
  }
  toLabel(e206, t10, n10) {
    if (t10.length === 0) return null;
    let r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = n10(a11);
      if (o10 === null) return null;
      r10[i10] = Yhe(a11, o10, this.modifierLabels[e206]);
    }
    return r10.join(` `);
  }
}, RF = new LF({ ctrlKey: `\u2303`, shiftKey: `\u21E7`, altKey: `\u2325`, metaKey: `\u2318`, separator: `` }, { ctrlKey: C(35, `Ctrl`), shiftKey: C(36, `Shift`), altKey: C(37, `Alt`), metaKey: C(38, `Windows`), separator: `+` }, { ctrlKey: C(39, `Ctrl`), shiftKey: C(40, `Shift`), altKey: C(41, `Alt`), metaKey: C(42, `Super`), separator: `+` }), Khe = new LF({ ctrlKey: C(43, `Control`), shiftKey: C(44, `Shift`), altKey: C(45, `Option`), metaKey: C(46, `Command`), separator: `+` }, { ctrlKey: C(47, `Control`), shiftKey: C(48, `Shift`), altKey: C(49, `Alt`), metaKey: C(50, `Windows`), separator: `+` }, { ctrlKey: C(51, `Control`), shiftKey: C(52, `Shift`), altKey: C(53, `Alt`), metaKey: C(54, `Super`), separator: `+` }), qhe = new LF({ ctrlKey: `Ctrl`, shiftKey: `Shift`, altKey: `Alt`, metaKey: `Cmd`, separator: `+` }, { ctrlKey: `Ctrl`, shiftKey: `Shift`, altKey: `Alt`, metaKey: `Super`, separator: `+` }), Jhe = new LF({ ctrlKey: `ctrl`, shiftKey: `shift`, altKey: `alt`, metaKey: `cmd`, separator: `+` }, { ctrlKey: `ctrl`, shiftKey: `shift`, altKey: `alt`, metaKey: `win`, separator: `+` }, { ctrlKey: `ctrl`, shiftKey: `shift`, altKey: `alt`, metaKey: `meta`, separator: `+` });
function Yhe(e206, t10, n10) {
  if (t10 === null) return ``;
  let r10 = [];
  return e206.ctrlKey && r10.push(n10.ctrlKey), e206.shiftKey && r10.push(n10.shiftKey), e206.altKey && r10.push(n10.altKey), e206.metaKey && r10.push(n10.metaKey), t10 !== `` && r10.push(t10), r10.join(n10.separator);
}
var Xhe = class extends Ko {
  constructor(e206, t10) {
    if (super(), t10.length === 0) throw De(`chords`);
    this._os = e206, this._chords = t10;
  }
  getLabel() {
    return RF.toLabel(this._os, this._chords, (e206) => this._getLabel(e206));
  }
  getAriaLabel() {
    return Khe.toLabel(this._os, this._chords, (e206) => this._getAriaLabel(e206));
  }
  getElectronAccelerator() {
    return this._chords.length > 1 || this._chords[0].isDuplicateModifierCase() ? null : qhe.toLabel(this._os, this._chords, (e206) => this._getElectronAccelerator(e206));
  }
  getUserSettingsLabel() {
    return Jhe.toLabel(this._os, this._chords, (e206) => this._getUserSettingsLabel(e206));
  }
  hasMultipleChords() {
    return this._chords.length > 1;
  }
  getChords() {
    return this._chords.map((e206) => this._getChord(e206));
  }
  _getChord(e206) {
    return new Go(e206.ctrlKey, e206.shiftKey, e206.altKey, e206.metaKey, this._getLabel(e206), this._getAriaLabel(e206));
  }
  getDispatchChords() {
    return this._chords.map((e206) => this._getChordDispatch(e206));
  }
  getSingleModifierDispatchChords() {
    return this._chords.map((e206) => this._getSingleModifierChordDispatch(e206));
  }
}, zF = class e142 extends Xhe {
  constructor(e206, t10) {
    super(t10, e206);
  }
  _keyCodeToUILabel(e206) {
    if (this._os === 2) switch (e206) {
      case 15:
        return `\u2190`;
      case 16:
        return `\u2191`;
      case 17:
        return `\u2192`;
      case 18:
        return `\u2193`;
    }
    return xr.toString(e206);
  }
  _getLabel(e206) {
    return e206.isDuplicateModifierCase() ? `` : this._keyCodeToUILabel(e206.keyCode);
  }
  _getAriaLabel(e206) {
    return e206.isDuplicateModifierCase() ? `` : xr.toString(e206.keyCode);
  }
  _getElectronAccelerator(e206) {
    return xr.toElectronAccelerator(e206.keyCode);
  }
  _getUserSettingsLabel(e206) {
    if (e206.isDuplicateModifierCase()) return ``;
    let t10 = xr.toUserSettingsUS(e206.keyCode);
    return t10 && t10.toLowerCase();
  }
  _getChordDispatch(t10) {
    return e142.getDispatchStr(t10);
  }
  static getDispatchStr(e206) {
    if (e206.isModifierKey()) return null;
    let t10 = ``;
    return e206.ctrlKey && (t10 += `ctrl+`), e206.shiftKey && (t10 += `shift+`), e206.altKey && (t10 += `alt+`), e206.metaKey && (t10 += `meta+`), t10 += xr.toString(e206.keyCode), t10;
  }
  _getSingleModifierChordDispatch(e206) {
    return e206.keyCode === 5 && !e206.shiftKey && !e206.altKey && !e206.metaKey ? `ctrl` : e206.keyCode === 4 && !e206.ctrlKey && !e206.altKey && !e206.metaKey ? `shift` : e206.keyCode === 6 && !e206.ctrlKey && !e206.shiftKey && !e206.metaKey ? `alt` : e206.keyCode === 57 && !e206.ctrlKey && !e206.shiftKey && !e206.altKey ? `meta` : null;
  }
  static _scanCodeToKeyCode(e206) {
    let t10 = br[e206];
    if (t10 !== -1) return t10;
    switch (e206) {
      case 10:
        return 31;
      case 11:
        return 32;
      case 12:
        return 33;
      case 13:
        return 34;
      case 14:
        return 35;
      case 15:
        return 36;
      case 16:
        return 37;
      case 17:
        return 38;
      case 18:
        return 39;
      case 19:
        return 40;
      case 20:
        return 41;
      case 21:
        return 42;
      case 22:
        return 43;
      case 23:
        return 44;
      case 24:
        return 45;
      case 25:
        return 46;
      case 26:
        return 47;
      case 27:
        return 48;
      case 28:
        return 49;
      case 29:
        return 50;
      case 30:
        return 51;
      case 31:
        return 52;
      case 32:
        return 53;
      case 33:
        return 54;
      case 34:
        return 55;
      case 35:
        return 56;
      case 36:
        return 22;
      case 37:
        return 23;
      case 38:
        return 24;
      case 39:
        return 25;
      case 40:
        return 26;
      case 41:
        return 27;
      case 42:
        return 28;
      case 43:
        return 29;
      case 44:
        return 30;
      case 45:
        return 21;
      case 51:
        return 88;
      case 52:
        return 86;
      case 53:
        return 92;
      case 54:
        return 94;
      case 55:
        return 93;
      case 56:
        return 0;
      case 57:
        return 85;
      case 58:
        return 95;
      case 59:
        return 91;
      case 60:
        return 87;
      case 61:
        return 89;
      case 62:
        return 90;
      case 106:
        return 97;
    }
    return 0;
  }
  static _toKeyCodeChord(e206) {
    if (!e206) return null;
    if (e206 instanceof Uo) return e206;
    let t10 = this._scanCodeToKeyCode(e206.scanCode);
    return t10 === 0 ? null : new Uo(e206.ctrlKey, e206.shiftKey, e206.altKey, e206.metaKey, t10);
  }
  static resolveKeybinding(t10, n10) {
    let r10 = IF(t10.chords.map((e206) => this._toKeyCodeChord(e206)));
    return r10.length > 0 ? [new e142(r10, n10)] : [];
  }
}, BF = xu(`labelService`), VF = xu(`progressService`), HF = (_Qa = class {
  constructor(e206) {
    this.callback = e206;
  }
  report(e206) {
    this._value = e206, this.callback(this._value);
  }
}, _Qa.None = Object.freeze({ report() {
} }), _Qa), UF = xu(`editorProgressService`), Zhe = class {
  constructor() {
    this._value = ``, this._pos = 0;
  }
  reset(e206) {
    return this._value = e206, this._pos = 0, this;
  }
  next() {
    return this._pos += 1, this;
  }
  hasNext() {
    return this._pos < this._value.length - 1;
  }
  cmp(e206) {
    return e206.charCodeAt(0) - this._value.charCodeAt(this._pos);
  }
  value() {
    return this._value[this._pos];
  }
}, Qhe = class {
  constructor(e206 = true) {
    this._caseSensitive = e206;
  }
  reset(e206) {
    return this._value = e206, this._from = 0, this._to = 0, this.next();
  }
  hasNext() {
    return this._to < this._value.length;
  }
  next() {
    this._from = this._to;
    let e206 = true;
    for (; this._to < this._value.length; this._to++) if (this._value.charCodeAt(this._to) === 46) if (e206) this._from++;
    else break;
    else e206 = false;
    return this;
  }
  cmp(e206) {
    return this._caseSensitive ? Ya(e206, this._value, 0, e206.length, this._from, this._to) : Za(e206, this._value, 0, e206.length, this._from, this._to);
  }
  value() {
    return this._value.substring(this._from, this._to);
  }
}, $he = class {
  constructor(e206 = true, t10 = true) {
    this._splitOnBackslash = e206, this._caseSensitive = t10;
  }
  reset(e206) {
    this._from = 0, this._to = 0, this._value = e206, this._valueLen = e206.length;
    for (let t10 = e206.length - 1; t10 >= 0; t10--, this._valueLen--) {
      let e207 = this._value.charCodeAt(t10);
      if (!(e207 === 47 || this._splitOnBackslash && e207 === 92)) break;
    }
    return this.next();
  }
  hasNext() {
    return this._to < this._valueLen;
  }
  next() {
    this._from = this._to;
    let e206 = true;
    for (; this._to < this._valueLen; this._to++) {
      let t10 = this._value.charCodeAt(this._to);
      if (t10 === 47 || this._splitOnBackslash && t10 === 92) if (e206) this._from++;
      else break;
      else e206 = false;
    }
    return this;
  }
  cmp(e206) {
    return this._caseSensitive ? Ya(e206, this._value, 0, e206.length, this._from, this._to) : Za(e206, this._value, 0, e206.length, this._from, this._to);
  }
  value() {
    return this._value.substring(this._from, this._to);
  }
}, ege = class {
  constructor(e206, t10) {
    this._ignorePathCasing = e206, this._ignoreQueryAndFragment = t10, this._states = [], this._stateIdx = 0;
  }
  reset(e206) {
    return this._value = e206, this._states = [], this._value.scheme && this._states.push(1), this._value.authority && this._states.push(2), this._value.path && (this._pathIterator = new $he(false, !this._ignorePathCasing(e206)), this._pathIterator.reset(e206.path), this._pathIterator.value() && this._states.push(3)), this._ignoreQueryAndFragment(e206) || (this._value.query && this._states.push(4), this._value.fragment && this._states.push(5)), this._stateIdx = 0, this;
  }
  next() {
    return this._states[this._stateIdx] === 3 && this._pathIterator.hasNext() ? this._pathIterator.next() : this._stateIdx += 1, this;
  }
  hasNext() {
    return this._states[this._stateIdx] === 3 && this._pathIterator.hasNext() || this._stateIdx < this._states.length - 1;
  }
  cmp(e206) {
    if (this._states[this._stateIdx] === 1) return Xa(e206, this._value.scheme);
    if (this._states[this._stateIdx] === 2) return Xa(e206, this._value.authority);
    if (this._states[this._stateIdx] === 3) return this._pathIterator.cmp(e206);
    if (this._states[this._stateIdx] === 4) return Ja(e206, this._value.query);
    if (this._states[this._stateIdx] === 5) return Ja(e206, this._value.fragment);
    throw Error();
  }
  value() {
    if (this._states[this._stateIdx] === 1) return this._value.scheme;
    if (this._states[this._stateIdx] === 2) return this._value.authority;
    if (this._states[this._stateIdx] === 3) return this._pathIterator.value();
    if (this._states[this._stateIdx] === 4) return this._value.query;
    if (this._states[this._stateIdx] === 5) return this._value.fragment;
    throw Error();
  }
}, WF = (_Ra = class {
  static wrap(t10) {
    return t10 === void 0 ? _Ra.Val : t10;
  }
  static unwrap(t10) {
    return t10 === _Ra.Val ? void 0 : t10;
  }
}, _Ra.Val = /* @__PURE__ */ Symbol(`undefined_placeholder`), _Ra), GF = class {
  constructor() {
    this.height = 1, this.value = void 0, this.key = void 0, this.left = void 0, this.mid = void 0, this.right = void 0;
  }
  rotateLeft() {
    let e206 = this.right;
    return this.right = e206.left, e206.left = this, this.updateHeight(), e206.updateHeight(), e206;
  }
  rotateRight() {
    let e206 = this.left;
    return this.left = e206.right, e206.right = this, this.updateHeight(), e206.updateHeight(), e206;
  }
  updateHeight() {
    this.height = 1 + Math.max(this.heightLeft, this.heightRight);
  }
  balanceFactor() {
    return this.heightRight - this.heightLeft;
  }
  get heightLeft() {
    return this.left?.height ?? 0;
  }
  get heightRight() {
    return this.right?.height ?? 0;
  }
}, KF = class e143 {
  static forUris(t10 = () => false, n10 = () => false) {
    return new e143(new ege(t10, n10));
  }
  static forStrings() {
    return new e143(new Zhe());
  }
  static forConfigKeys() {
    return new e143(new Qhe());
  }
  constructor(e206) {
    this._iter = e206;
  }
  clear() {
    this._root = void 0;
  }
  set(e206, t10) {
    let n10 = this._iter.reset(e206), r10;
    this._root || (this._root = new GF(), this._root.segment = n10.value());
    let i10 = [];
    for (r10 = this._root; ; ) {
      let e207 = n10.cmp(r10.segment);
      if (e207 > 0) r10.left || (r10.left = new GF(), r10.left.segment = n10.value()), i10.push([-1, r10]), r10 = r10.left;
      else if (e207 < 0) r10.right || (r10.right = new GF(), r10.right.segment = n10.value()), i10.push([1, r10]), r10 = r10.right;
      else if (n10.hasNext()) n10.next(), r10.mid || (r10.mid = new GF(), r10.mid.segment = n10.value()), i10.push([0, r10]), r10 = r10.mid;
      else break;
    }
    let a10 = WF.unwrap(r10.value);
    r10.value = WF.wrap(t10), r10.key = e206;
    for (let e207 = i10.length - 1; e207 >= 0; e207--) {
      let t11 = i10[e207][1];
      t11.updateHeight();
      let n11 = t11.balanceFactor();
      if (n11 < -1 || n11 > 1) {
        let n12 = i10[e207][0], r11 = i10[e207 + 1][0];
        if (n12 === 1 && r11 === 1) i10[e207][1] = t11.rotateLeft();
        else if (n12 === -1 && r11 === -1) i10[e207][1] = t11.rotateRight();
        else if (n12 === 1 && r11 === -1) t11.right = i10[e207 + 1][1] = i10[e207 + 1][1].rotateRight(), i10[e207][1] = t11.rotateLeft();
        else if (n12 === -1 && r11 === 1) t11.left = i10[e207 + 1][1] = i10[e207 + 1][1].rotateLeft(), i10[e207][1] = t11.rotateRight();
        else throw Error();
        if (e207 > 0) switch (i10[e207 - 1][0]) {
          case -1:
            i10[e207 - 1][1].left = i10[e207][1];
            break;
          case 1:
            i10[e207 - 1][1].right = i10[e207][1];
            break;
          case 0:
            i10[e207 - 1][1].mid = i10[e207][1];
            break;
        }
        else this._root = i10[0][1];
      }
    }
    return a10;
  }
  get(e206) {
    return WF.unwrap(this._getNode(e206)?.value);
  }
  _getNode(e206) {
    let t10 = this._iter.reset(e206), n10 = this._root;
    for (; n10; ) {
      let e207 = t10.cmp(n10.segment);
      if (e207 > 0) n10 = n10.left;
      else if (e207 < 0) n10 = n10.right;
      else if (t10.hasNext()) t10.next(), n10 = n10.mid;
      else break;
    }
    return n10;
  }
  has(e206) {
    let t10 = this._getNode(e206);
    return !(t10?.value === void 0 && t10?.mid === void 0);
  }
  delete(e206) {
    return this._delete(e206, false);
  }
  deleteSuperstr(e206) {
    return this._delete(e206, true);
  }
  _delete(e206, t10) {
    let n10 = this._iter.reset(e206), r10 = [], i10 = this._root;
    for (; i10; ) {
      let e207 = n10.cmp(i10.segment);
      if (e207 > 0) r10.push([-1, i10]), i10 = i10.left;
      else if (e207 < 0) r10.push([1, i10]), i10 = i10.right;
      else if (n10.hasNext()) n10.next(), r10.push([0, i10]), i10 = i10.mid;
      else break;
    }
    if (i10) {
      if (t10 ? (i10.left = void 0, i10.mid = void 0, i10.right = void 0, i10.height = 1) : (i10.key = void 0, i10.value = void 0), !i10.mid && !i10.value) if (i10.left && i10.right) {
        let e207 = [[1, i10]], t11 = this._min(i10.right, e207);
        if (t11.key) {
          i10.key = t11.key, i10.value = t11.value, i10.segment = t11.segment;
          let n11 = t11.right;
          if (e207.length > 1) {
            let [t12, r11] = e207[e207.length - 1];
            switch (t12) {
              case -1:
                r11.left = n11;
                break;
              case 0:
                Pe(false);
              case 1:
                Pe(false);
            }
          } else i10.right = n11;
          let a10 = this._balanceByStack(e207);
          if (r10.length > 0) {
            let [e208, t12] = r10[r10.length - 1];
            switch (e208) {
              case -1:
                t12.left = a10;
                break;
              case 0:
                t12.mid = a10;
                break;
              case 1:
                t12.right = a10;
                break;
            }
          } else this._root = a10;
        }
      } else {
        let e207 = i10.left ?? i10.right;
        if (r10.length > 0) {
          let [t11, n11] = r10[r10.length - 1];
          switch (t11) {
            case -1:
              n11.left = e207;
              break;
            case 0:
              n11.mid = e207;
              break;
            case 1:
              n11.right = e207;
              break;
          }
        } else this._root = e207;
      }
      this._root = this._balanceByStack(r10) ?? this._root;
    }
  }
  _min(e206, t10) {
    for (; e206.left; ) t10.push([-1, e206]), e206 = e206.left;
    return e206;
  }
  _balanceByStack(e206) {
    for (let t10 = e206.length - 1; t10 >= 0; t10--) {
      let n10 = e206[t10][1];
      n10.updateHeight();
      let r10 = n10.balanceFactor();
      if (r10 > 1 ? (n10.right.balanceFactor() >= 0 || (n10.right = n10.right.rotateRight()), e206[t10][1] = n10.rotateLeft()) : r10 < -1 && (n10.left.balanceFactor() <= 0 || (n10.left = n10.left.rotateLeft()), e206[t10][1] = n10.rotateRight()), t10 > 0) switch (e206[t10 - 1][0]) {
        case -1:
          e206[t10 - 1][1].left = e206[t10][1];
          break;
        case 1:
          e206[t10 - 1][1].right = e206[t10][1];
          break;
        case 0:
          e206[t10 - 1][1].mid = e206[t10][1];
          break;
      }
      else return e206[0][1];
    }
  }
  findSubstr(e206) {
    let t10 = this._iter.reset(e206), n10 = this._root, r10;
    for (; n10; ) {
      let e207 = t10.cmp(n10.segment);
      if (e207 > 0) n10 = n10.left;
      else if (e207 < 0) n10 = n10.right;
      else if (t10.hasNext()) t10.next(), r10 = WF.unwrap(n10.value) || r10, n10 = n10.mid;
      else break;
    }
    return n10 && WF.unwrap(n10.value) || r10;
  }
  findSuperstr(e206) {
    return this._findSuperstrOrElement(e206, false);
  }
  _findSuperstrOrElement(e206, t10) {
    let n10 = this._iter.reset(e206), r10 = this._root;
    for (; r10; ) {
      let e207 = n10.cmp(r10.segment);
      if (e207 > 0) r10 = r10.left;
      else if (e207 < 0) r10 = r10.right;
      else if (n10.hasNext()) n10.next(), r10 = r10.mid;
      else if (r10.mid) return this._entries(r10.mid);
      else return t10 ? WF.unwrap(r10.value) : void 0;
    }
  }
  forEach(e206) {
    for (let [t10, n10] of this) e206(n10, t10);
  }
  *[Symbol.iterator]() {
    yield* this._entries(this._root);
  }
  _entries(e206) {
    let t10 = [];
    return this._dfsEntries(e206, t10), t10[Symbol.iterator]();
  }
  _dfsEntries(e206, t10) {
    e206 && (e206.left && this._dfsEntries(e206.left, t10), e206.value !== void 0 && t10.push([e206.key, WF.unwrap(e206.value)]), e206.mid && this._dfsEntries(e206.mid, t10), e206.right && this._dfsEntries(e206.right, t10));
  }
}, qF = xu(`contextService`);
function JF(e206) {
  let t10 = e206;
  return typeof t10?.id == `string` && $r.isUri(t10.uri);
}
function tge(e206) {
  return typeof e206?.id == `string` && !JF(e206) && !ige(e206);
}
var nge = { id: `empty-window` };
function rge(e206, t10) {
  if (typeof e206 == `string` || e206 === void 0) return typeof e206 == `string` ? { id: Yr(e206) } : nge;
  let n10 = e206;
  return n10.configuration ? { id: n10.id, configPath: n10.configuration } : n10.folders.length === 1 ? { id: n10.id, uri: n10.folders[0].uri } : { id: n10.id };
}
function ige(e206) {
  let t10 = e206;
  return typeof t10?.id == `string` && $r.isUri(t10.configPath);
}
var age = class {
  constructor(e206, t10) {
    this.raw = t10, this.uri = e206.uri, this.index = e206.index, this.name = e206.name;
  }
  toJSON() {
    return { uri: this.uri, name: this.name, index: this.index };
  }
}, oge = `code-workspace`;
C(2050, `Code Workspace`);
var YF = `4064f6ec-cb38-4ad0-af64-ee6467e63c82`;
function sge(e206) {
  return e206.id === YF;
}
var XF;
(function(e206) {
  e206.inspectTokensAction = C(786, `Developer: Inspect Tokens`);
})(XF || (XF = {}));
var ZF;
(function(e206) {
  e206.gotoLineActionLabel = C(787, `Go to Line/Column...`);
})(ZF || (ZF = {}));
var QF;
(function(e206) {
  e206.helpQuickAccessActionLabel = C(788, `Show all Quick Access Providers`);
})(QF || (QF = {}));
var $F;
(function(e206) {
  e206.quickCommandActionLabel = C(789, `Command Palette`), e206.quickCommandHelp = C(790, `Show And Run Commands`);
})($F || ($F = {}));
var eI;
(function(e206) {
  e206.quickOutlineActionLabel = C(791, `Go to Symbol...`), e206.quickOutlineByCategoryActionLabel = C(792, `Go to Symbol by Category...`);
})(eI || (eI = {}));
var tI;
(function(e206) {
  e206.editorViewAccessibleLabel = C(793, `Editor content`);
})(tI || (tI = {}));
var nI;
(function(e206) {
  e206.toggleHighContrast = C(794, `Toggle High Contrast Theme`);
})(nI || (nI = {}));
var rI;
(function(e206) {
  e206.bulkEditServiceSummary = C(795, `Made {0} edits in {1} files`);
})(rI || (rI = {}));
var iI = xu(`workspaceTrustManagementService`), aI = [], oI = [], sI = [];
function cI(e206, t10 = false) {
  cge(e206, false, t10);
}
function cge(e206, t10, n10) {
  let r10 = lge(e206, t10);
  aI.push(r10), r10.userConfigured ? sI.push(r10) : oI.push(r10), n10 && !r10.userConfigured && aI.forEach((e207) => {
    e207.mime === r10.mime || e207.userConfigured || (r10.extension && e207.extension === r10.extension && console.warn(`Overwriting extension <<${r10.extension}>> to now point to mime <<${r10.mime}>>`), r10.filename && e207.filename === r10.filename && console.warn(`Overwriting filename <<${r10.filename}>> to now point to mime <<${r10.mime}>>`), r10.filepattern && e207.filepattern === r10.filepattern && console.warn(`Overwriting filepattern <<${r10.filepattern}>> to now point to mime <<${r10.mime}>>`), r10.firstline && e207.firstline === r10.firstline && console.warn(`Overwriting firstline <<${r10.firstline}>> to now point to mime <<${r10.mime}>>`));
  });
}
function lge(e206, t10) {
  return { id: e206.id, mime: e206.mime, filename: e206.filename, extension: e206.extension, filepattern: e206.filepattern, firstline: e206.firstline, userConfigured: t10, filenameLowercase: e206.filename ? e206.filename.toLowerCase() : void 0, extensionLowercase: e206.extension ? e206.extension.toLowerCase() : void 0, filepatternLowercase: e206.filepattern ? QA(e206.filepattern.toLowerCase()) : void 0, filepatternOnPath: e206.filepattern ? e206.filepattern.indexOf(Kr.sep) >= 0 : false };
}
function uge() {
  aI = aI.filter((e206) => e206.userConfigured), oI = [];
}
function dge(e206, t10) {
  return fge(e206, t10).map((e207) => e207.id);
}
function fge(e206, t10) {
  let n10;
  if (e206) switch (e206.scheme) {
    case xs.file:
      n10 = e206.fsPath;
      break;
    case xs.data:
      n10 = Hd.parseMetaData(e206).get(Hd.META_DATA_LABEL);
      break;
    case xs.vscodeNotebookCell:
      n10 = void 0;
      break;
    default:
      n10 = e206.path;
  }
  if (!n10) return [{ id: `unknown`, mime: $f.unknown }];
  n10 = n10.toLowerCase();
  let r10 = Yr(n10), i10 = lI(n10, r10, sI);
  if (i10) return [i10, { id: hp, mime: $f.text }];
  let a10 = lI(n10, r10, oI);
  if (a10) return [a10, { id: hp, mime: $f.text }];
  if (t10) {
    let e207 = pge(t10);
    if (e207) return [e207, { id: hp, mime: $f.text }];
  }
  return [{ id: `unknown`, mime: $f.unknown }];
}
function lI(e206, t10, n10) {
  let r10, i10, a10;
  for (let o10 = n10.length - 1; o10 >= 0; o10--) {
    let s10 = n10[o10];
    if (t10 === s10.filenameLowercase) {
      r10 = s10;
      break;
    }
    if (s10.filepattern && (!i10 || s10.filepattern.length > i10.filepattern.length)) {
      let n11 = s10.filepatternOnPath ? e206 : t10;
      s10.filepatternLowercase?.(n11) && (i10 = s10);
    }
    s10.extension && (!a10 || s10.extension.length > a10.extension.length) && t10.endsWith(s10.extensionLowercase) && (a10 = s10);
  }
  if (r10) return r10;
  if (i10) return i10;
  if (a10) return a10;
}
function pge(e206) {
  if (xo(e206) && (e206 = e206.substr(1)), e206.length > 0) for (let t10 = aI.length - 1; t10 >= 0; t10--) {
    let n10 = aI[t10];
    if (!n10.firstline) continue;
    let r10 = e206.match(n10.firstline);
    if (r10 && r10.length > 0) return n10;
  }
}
var uI = Object.prototype.hasOwnProperty, dI = `vs.editor.nullLanguage`, mge = class {
  constructor() {
    this._languageIdToLanguage = [], this._languageToLanguageId = /* @__PURE__ */ new Map(), this._register(dI, 0), this._register(hp, 1), this._nextLanguageId = 2;
  }
  _register(e206, t10) {
    this._languageIdToLanguage[t10] = e206, this._languageToLanguageId.set(e206, t10);
  }
  register(e206) {
    if (this._languageToLanguageId.has(e206)) return;
    let t10 = this._nextLanguageId++;
    this._register(e206, t10);
  }
  encodeLanguageId(e206) {
    return this._languageToLanguageId.get(e206) || 0;
  }
  decodeLanguageId(e206) {
    return this._languageIdToLanguage[e206] || dI;
  }
}, hge = (_Sa = class extends D {
  constructor(t10 = true, n10 = false) {
    super(), this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, _Sa.instanceCount++, this._warnOnOverwrite = n10, this.languageIdCodec = new mge(), this._dynamicLanguages = [], this._languages = {}, this._mimeTypesMap = {}, this._nameMap = {}, this._lowercaseNameMap = {}, t10 && (this._initializeFromRegistry(), this._register(mp.onDidChangeLanguages((e206) => {
      this._initializeFromRegistry();
    })));
  }
  dispose() {
    _Sa.instanceCount--, super.dispose();
  }
  _initializeFromRegistry() {
    this._languages = {}, this._mimeTypesMap = {}, this._nameMap = {}, this._lowercaseNameMap = {}, uge();
    let e206 = [].concat(mp.getLanguages(), this._dynamicLanguages);
    this._registerLanguages(e206);
  }
  _registerLanguages(e206) {
    for (let t10 of e206) this._registerLanguage(t10);
    this._mimeTypesMap = {}, this._nameMap = {}, this._lowercaseNameMap = {}, Object.keys(this._languages).forEach((e207) => {
      let t10 = this._languages[e207];
      t10.name && (this._nameMap[t10.name] = t10.identifier), t10.aliases.forEach((e208) => {
        this._lowercaseNameMap[e208.toLowerCase()] = t10.identifier;
      }), t10.mimetypes.forEach((e208) => {
        this._mimeTypesMap[e208] = t10.identifier;
      });
    }), cd.as(op.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()), this._onDidChange.fire();
  }
  _registerLanguage(e206) {
    let t10 = e206.id, n10;
    uI.call(this._languages, t10) ? n10 = this._languages[t10] : (this.languageIdCodec.register(t10), n10 = { identifier: t10, name: null, mimetypes: [], aliases: [], extensions: [], filenames: [], configurationFiles: [], icons: [] }, this._languages[t10] = n10), this._mergeLanguage(n10, e206);
  }
  _mergeLanguage(e206, t10) {
    let n10 = t10.id, r10 = null;
    if (Array.isArray(t10.mimetypes) && t10.mimetypes.length > 0 && (e206.mimetypes.push(...t10.mimetypes), r10 = t10.mimetypes[0]), r10 || (r10 = `text/x-${n10}`, e206.mimetypes.push(r10)), Array.isArray(t10.extensions)) {
      t10.configuration ? e206.extensions = t10.extensions.concat(e206.extensions) : e206.extensions = e206.extensions.concat(t10.extensions);
      for (let e207 of t10.extensions) cI({ id: n10, mime: r10, extension: e207 }, this._warnOnOverwrite);
    }
    if (Array.isArray(t10.filenames)) for (let i11 of t10.filenames) cI({ id: n10, mime: r10, filename: i11 }, this._warnOnOverwrite), e206.filenames.push(i11);
    if (Array.isArray(t10.filenamePatterns)) for (let e207 of t10.filenamePatterns) cI({ id: n10, mime: r10, filepattern: e207 }, this._warnOnOverwrite);
    if (typeof t10.firstLine == `string` && t10.firstLine.length > 0) {
      let e207 = t10.firstLine;
      e207.charAt(0) !== `^` && (e207 = `^` + e207);
      try {
        let t11 = new RegExp(e207);
        Ua(t11) || cI({ id: n10, mime: r10, firstline: t11 }, this._warnOnOverwrite);
      } catch (n11) {
        console.warn(`[${t10.id}]: Invalid regular expression \`${e207}\`: `, n11);
      }
    }
    e206.aliases.push(n10);
    let i10 = null;
    if (t10.aliases !== void 0 && Array.isArray(t10.aliases) && (i10 = t10.aliases.length === 0 ? [null] : t10.aliases), i10 !== null) for (let t11 of i10) !t11 || t11.length === 0 || e206.aliases.push(t11);
    let a10 = i10 !== null && i10.length > 0;
    if (!(a10 && i10[0] === null)) {
      let t11 = (a10 ? i10[0] : null) || n10;
      (a10 || !e206.name) && (e206.name = t11);
    }
    t10.configuration && e206.configurationFiles.push(t10.configuration), t10.icon && e206.icons.push(t10.icon);
  }
  isRegisteredLanguageId(e206) {
    return e206 ? uI.call(this._languages, e206) : false;
  }
  getRegisteredLanguageIds() {
    return Object.keys(this._languages);
  }
  getLanguageIdByLanguageName(e206) {
    let t10 = e206.toLowerCase();
    return uI.call(this._lowercaseNameMap, t10) ? this._lowercaseNameMap[t10] : null;
  }
  getLanguageIdByMimeType(e206) {
    return e206 && uI.call(this._mimeTypesMap, e206) ? this._mimeTypesMap[e206] : null;
  }
  guessLanguageIdByFilepathOrFirstLine(e206, t10) {
    return !e206 && !t10 ? [] : dge(e206, t10);
  }
}, _Sa.instanceCount = 0, _Sa), gge = (_Ta = class extends D {
  constructor(t10 = false) {
    super(), this._onDidRequestBasicLanguageFeatures = this._register(new k()), this.onDidRequestBasicLanguageFeatures = this._onDidRequestBasicLanguageFeatures.event, this._onDidRequestRichLanguageFeatures = this._register(new k()), this.onDidRequestRichLanguageFeatures = this._onDidRequestRichLanguageFeatures.event, this._onDidChange = this._register(new k({ leakWarningThreshold: 200 })), this.onDidChange = this._onDidChange.event, this._requestedBasicLanguages = /* @__PURE__ */ new Set(), this._requestedRichLanguages = /* @__PURE__ */ new Set(), _Ta.instanceCount++, this._registry = this._register(new hge(true, t10)), this.languageIdCodec = this._registry.languageIdCodec, this._register(this._registry.onDidChange(() => this._onDidChange.fire()));
  }
  dispose() {
    _Ta.instanceCount--, super.dispose();
  }
  isRegisteredLanguageId(e206) {
    return this._registry.isRegisteredLanguageId(e206);
  }
  getLanguageIdByLanguageName(e206) {
    return this._registry.getLanguageIdByLanguageName(e206);
  }
  getLanguageIdByMimeType(e206) {
    return this._registry.getLanguageIdByMimeType(e206);
  }
  guessLanguageIdByFilepathOrFirstLine(e206, t10) {
    return this._registry.guessLanguageIdByFilepathOrFirstLine(e206, t10).at(0) ?? null;
  }
  createById(e206) {
    return new fI(this.onDidChange, () => this._createAndGetLanguageIdentifier(e206));
  }
  createByFilepathOrFirstLine(e206, t10) {
    return new fI(this.onDidChange, () => {
      let n10 = this.guessLanguageIdByFilepathOrFirstLine(e206, t10);
      return this._createAndGetLanguageIdentifier(n10);
    });
  }
  _createAndGetLanguageIdentifier(e206) {
    return (!e206 || !this.isRegisteredLanguageId(e206)) && (e206 = hp), e206;
  }
  requestBasicLanguageFeatures(e206) {
    this._requestedBasicLanguages.has(e206) || (this._requestedBasicLanguages.add(e206), this._onDidRequestBasicLanguageFeatures.fire(e206));
  }
  requestRichLanguageFeatures(e206) {
    this._requestedRichLanguages.has(e206) || (this._requestedRichLanguages.add(e206), this.requestBasicLanguageFeatures(e206), Pi.getOrCreate(e206), this._onDidRequestRichLanguageFeatures.fire(e206));
  }
}, _Ta.instanceCount = 0, _Ta), fI = class {
  constructor(e206, t10) {
    this._value = Tc(this, e206, () => t10()), this.onDidChange = O.fromObservable(this._value);
  }
  get languageId() {
    return this._value.get();
  }
};
function pI(e206) {
  return e206;
}
function mI(e206, t10) {
  if (e206 !== void 0) {
    let n10 = e206.match(/^\s*var\((.+)\)$/);
    if (n10) {
      let e207 = n10[1].split(`,`, 2);
      return e207.length === 2 && (t10 = mI(e207[1].trim(), t10)), `var(${e207[0]}, ${t10})`;
    }
    return e206;
  }
  return t10;
}
function hI(e206) {
  let t10 = e206.replaceAll(/[^_\-a-z0-9]/gi, ``);
  return t10 !== e206 && console.warn(`CSS ident value ${e206} modified to ${t10} to be safe for CSS`), pI(t10);
}
function gI(e206) {
  return pI(`'${e206.replaceAll(/'/g, `\\000027`)}'`);
}
function _I2(e206) {
  return e206 ? yI`url('${pI(CSS.escape(Es.uriToBrowserUri(e206).toString(true)))}')` : pI(`url('')`);
}
function vI(e206, t10 = false) {
  let n10 = CSS.escape(e206);
  return !t10 && n10 !== e206 && console.warn(`CSS class name ${e206} modified to ${n10} to be safe for CSS`), pI(n10);
}
function yI(e206, ...t10) {
  return pI(e206.reduce((e207, n10, r10) => {
    let i10 = t10[r10] || ``;
    return e207 + n10 + i10;
  }, ``));
}
var bI = class {
  constructor() {
    this._parts = [];
  }
  push(...e206) {
    this._parts.push(...e206);
  }
  join(e206 = `
`) {
    return pI(this._parts.join(e206));
  }
}, xI = { RESOURCES: `ResourceURLs`, TEXT: $f.text, INTERNAL_URI_LIST: `application/vnd.code.uri-list` }, SI = () => ({ get delay() {
  return -1;
}, dispose: () => {
}, showHover: () => {
} }), _ge = new Fa(() => SI(`mouse`, false)), vge = new Fa(() => SI(`element`, false));
function yge(e206) {
  SI = e206;
}
function CI(e206) {
  return e206 === `element` ? vge.value : _ge.value;
}
function wI() {
  return SI(`element`, true);
}
var TI = { showInstantHover: () => void 0, showDelayedHover: () => void 0, setupDelayedHover: () => D.None, setupDelayedHoverAtMouse: () => D.None, hideHover: () => void 0, showAndFocusLastHover: () => void 0, setupManagedHover: () => ({ dispose: () => void 0, show: () => void 0, hide: () => void 0, update: () => void 0 }), showManagedHover: () => void 0 };
function bge(e206) {
  TI = e206;
}
function EI() {
  return TI;
}
var xge = class {
  constructor(e206) {
    this.spliceables = e206;
  }
  splice(e206, t10, n10) {
    this.spliceables.forEach((r10) => r10.splice(e206, t10, n10));
  }
}, DI = class extends Error {
  constructor(e206, t10) {
    super(`ListError [${e206}] ${t10}`);
  }
};
function OI(e206, t10) {
  let n10 = [];
  for (let r10 of t10) {
    if (e206.start >= r10.range.end) continue;
    if (e206.end < r10.range.start) break;
    let t11 = WP.intersect(e206, r10.range);
    WP.isEmpty(t11) || n10.push({ range: t11, size: r10.size });
  }
  return n10;
}
function kI({ start: e206, end: t10 }, n10) {
  return { start: e206 + n10, end: t10 + n10 };
}
function Sge(e206) {
  let t10 = [], n10 = null;
  for (let r10 of e206) {
    let e207 = r10.range.start, i10 = r10.range.end, a10 = r10.size;
    if (n10 && a10 === n10.size) {
      n10.range.end = i10;
      continue;
    }
    n10 = { range: { start: e207, end: i10 }, size: a10 }, t10.push(n10);
  }
  return t10;
}
function Cge(...e206) {
  return Sge(e206.reduce((e207, t10) => e207.concat(t10), []));
}
var wge = class {
  get paddingTop() {
    return this._paddingTop;
  }
  set paddingTop(e206) {
    this._size = this._size + e206 - this._paddingTop, this._paddingTop = e206;
  }
  constructor(e206) {
    this.groups = [], this._size = 0, this._paddingTop = 0, this._paddingTop = e206 ?? 0, this._size = this._paddingTop;
  }
  splice(e206, t10, n10 = []) {
    let r10 = n10.length - t10, i10 = OI({ start: 0, end: e206 }, this.groups), a10 = OI({ start: e206 + t10, end: 1 / 0 }, this.groups).map((e207) => ({ range: kI(e207.range, r10), size: e207.size }));
    this.groups = Cge(i10, n10.map((t11, n11) => ({ range: { start: e206 + n11, end: e206 + n11 + 1 }, size: t11.size })), a10), this._size = this._paddingTop + this.groups.reduce((e207, t11) => e207 + t11.size * (t11.range.end - t11.range.start), 0);
  }
  get count() {
    let e206 = this.groups.length;
    return e206 ? this.groups[e206 - 1].range.end : 0;
  }
  get size() {
    return this._size;
  }
  indexAt(e206) {
    if (e206 < 0) return -1;
    if (e206 < this._paddingTop) return 0;
    let t10 = 0, n10 = this._paddingTop;
    for (let r10 of this.groups) {
      let i10 = r10.range.end - r10.range.start, a10 = n10 + i10 * r10.size;
      if (e206 < a10) return t10 + Math.floor((e206 - n10) / r10.size);
      t10 += i10, n10 = a10;
    }
    return t10;
  }
  indexAfter(e206) {
    return Math.min(this.indexAt(e206) + 1, this.count);
  }
  positionAt(e206) {
    if (e206 < 0) return -1;
    let t10 = 0, n10 = 0;
    for (let r10 of this.groups) {
      let i10 = r10.range.end - r10.range.start, a10 = n10 + i10;
      if (e206 < a10) return this._paddingTop + t10 + (e206 - n10) * r10.size;
      t10 += i10 * r10.size, n10 = a10;
    }
    return -1;
  }
}, Tge = class {
  constructor(e206) {
    this.renderers = e206, this.cache = /* @__PURE__ */ new Map(), this.transactionNodesPendingRemoval = /* @__PURE__ */ new Set(), this.inTransaction = false;
  }
  alloc(e206) {
    let t10 = this.getTemplateCache(e206).pop(), n10 = false;
    if (t10) n10 = this.transactionNodesPendingRemoval.has(t10.domNode), n10 && this.transactionNodesPendingRemoval.delete(t10.domNode);
    else {
      let n11 = B(`.monaco-list-row`);
      t10 = { domNode: n11, templateId: e206, templateData: this.getRenderer(e206).renderTemplate(n11) };
    }
    return { row: t10, isReusingConnectedDomNode: n10 };
  }
  release(e206) {
    e206 && this.releaseRow(e206);
  }
  transact(e206) {
    if (this.inTransaction) throw Error(`Already in transaction`);
    this.inTransaction = true;
    try {
      e206();
    } finally {
      for (let e207 of this.transactionNodesPendingRemoval) this.doRemoveNode(e207);
      this.transactionNodesPendingRemoval.clear(), this.inTransaction = false;
    }
  }
  releaseRow(e206) {
    let { domNode: t10, templateId: n10 } = e206;
    t10 && (this.inTransaction ? this.transactionNodesPendingRemoval.add(t10) : this.doRemoveNode(t10)), this.getTemplateCache(n10).push(e206);
  }
  doRemoveNode(e206) {
    e206.classList.remove(`scrolling`), e206.remove();
  }
  getTemplateCache(e206) {
    let t10 = this.cache.get(e206);
    return t10 || (t10 = [], this.cache.set(e206, t10)), t10;
  }
  dispose() {
    this.cache.forEach((e206, t10) => {
      for (let n10 of e206) this.getRenderer(t10).disposeTemplate(n10.templateData), n10.templateData = null;
    }), this.cache.clear(), this.transactionNodesPendingRemoval.clear();
  }
  getRenderer(e206) {
    let t10 = this.renderers.get(e206);
    if (!t10) throw Error(`No renderer found for ${e206}`);
    return t10;
  }
};
function Ege(e206, t10, n10, r10 = []) {
  if (!e206.dataTransfer) return;
  let i10 = B(`.monaco-drag-image`);
  i10.textContent = n10, i10.classList.add(...r10), ((e207) => {
    for (; e207 && !e207.classList.contains(`monaco-workbench`); ) e207 = e207.parentElement;
    return e207 || t10.ownerDocument.body;
  })(t10).appendChild(i10), e206.dataTransfer.setDragImage(i10, -10, -10), setTimeout(() => i10.remove(), 0);
}
var AI = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, jI = { CurrentDragAndDropData: void 0 }, MI = { useShadows: true, verticalScrollMode: 1, setRowLineHeight: true, setRowHeight: true, supportDynamicHeights: false, dnd: { getDragElements(e206) {
  return [e206];
}, getDragURI() {
  return null;
}, onDragStart() {
}, onDragOver() {
  return false;
}, drop() {
}, dispose() {
} }, horizontalScrolling: false, transformOptimization: true, alwaysConsumeMouseWheel: true }, NI = class {
  constructor(e206) {
    this.elements = e206;
  }
  update() {
  }
  getData() {
    return this.elements;
  }
}, Dge = class {
  constructor(e206) {
    this.elements = e206;
  }
  update() {
  }
  getData() {
    return this.elements;
  }
}, Oge = class {
  constructor() {
    this.types = [], this.files = [];
  }
  update(e206) {
    if (e206.types && this.types.splice(0, this.types.length, ...e206.types), e206.files) {
      this.files.splice(0, this.files.length);
      for (let t10 = 0; t10 < e206.files.length; t10++) {
        let n10 = e206.files.item(t10);
        n10 && (n10.size || n10.type) && this.files.push(n10);
      }
    }
  }
  getData() {
    return { types: this.types, files: this.files };
  }
};
function kge(e206, t10) {
  return Array.isArray(e206) && Array.isArray(t10) ? o(e206, t10) : e206 === t10;
}
var Age = class {
  constructor(e206) {
    e206?.getSetSize ? this.getSetSize = e206.getSetSize.bind(e206) : this.getSetSize = (e207, t10, n10) => n10, e206?.getPosInSet ? this.getPosInSet = e206.getPosInSet.bind(e206) : this.getPosInSet = (e207, t10) => t10 + 1, e206?.getRole ? this.getRole = e206.getRole.bind(e206) : this.getRole = (e207) => `listitem`, e206?.isChecked ? this.isChecked = e206.isChecked.bind(e206) : this.isChecked = (e207) => void 0;
  }
}, PI = (_Ua = class {
  get contentHeight() {
    return this.rangeMap.size;
  }
  get onDidScroll() {
    return this.scrollableElement.onScroll;
  }
  get scrollableElementDomNode() {
    return this.scrollableElement.getDomNode();
  }
  get horizontalScrolling() {
    return this._horizontalScrolling;
  }
  set horizontalScrolling(e206) {
    if (e206 !== this._horizontalScrolling) {
      if (e206 && this.supportDynamicHeights) throw Error(`Horizontal scrolling and dynamic heights not supported simultaneously`);
      if (this._horizontalScrolling = e206, this.domNode.classList.toggle(`horizontal-scrolling`, this._horizontalScrolling), this._horizontalScrolling) {
        for (let e207 of this.items) this.measureItemWidth(e207);
        this.updateScrollWidth(), this.scrollableElement.setScrollDimensions({ width: bl(this.domNode) }), this.rowsContainer.style.width = `${Math.max(this.scrollWidth || 0, this.renderWidth)}px`;
      } else this.scrollableElementWidthDelayer.cancel(), this.scrollableElement.setScrollDimensions({ width: this.renderWidth, scrollWidth: this.renderWidth }), this.rowsContainer.style.width = ``;
    }
  }
  constructor(t10, n10, r10, i10 = MI) {
    if (this.virtualDelegate = n10, this.domId = `list_id_${++_Ua.InstanceCount}`, this.renderers = /* @__PURE__ */ new Map(), this.renderWidth = 0, this._scrollHeight = 0, this.scrollableElementUpdateDisposable = null, this.scrollableElementWidthDelayer = new ns(50), this.splicing = false, this.dragOverAnimationStopDisposable = D.None, this.dragOverMouseY = 0, this.canDrop = false, this.currentDragFeedbackDisposable = D.None, this.onDragLeaveTimeout = D.None, this.currentSelectionDisposable = D.None, this.disposables = new E(), this._onDidChangeContentHeight = new k(), this._onDidChangeContentWidth = new k(), this.onDidChangeContentHeight = O.latch(this._onDidChangeContentHeight.event, void 0, this.disposables), this._horizontalScrolling = false, i10.horizontalScrolling && i10.supportDynamicHeights) throw Error(`Horizontal scrolling and dynamic heights not supported simultaneously`);
    this.items = [], this.itemId = 0, this.rangeMap = this.createRangeMap(i10.paddingTop ?? 0);
    for (let e206 of r10) this.renderers.set(e206.templateId, e206);
    if (this.cache = this.disposables.add(new Tge(this.renderers)), this.lastRenderTop = 0, this.lastRenderHeight = 0, this.domNode = document.createElement(`div`), this.domNode.className = `monaco-list`, this.domNode.classList.add(this.domId), this.domNode.tabIndex = 0, this.domNode.classList.toggle(`mouse-support`, typeof i10.mouseSupport == `boolean` ? i10.mouseSupport : true), this._horizontalScrolling = i10.horizontalScrolling ?? MI.horizontalScrolling, this.domNode.classList.toggle(`horizontal-scrolling`, this._horizontalScrolling), this.paddingBottom = i10.paddingBottom === void 0 ? 0 : i10.paddingBottom, this.accessibilityProvider = new Age(i10.accessibilityProvider), this.rowsContainer = document.createElement(`div`), this.rowsContainer.className = `monaco-list-rows`, (i10.transformOptimization ?? MI.transformOptimization) && (this.rowsContainer.style.transform = `translate3d(0px, 0px, 0px)`, this.rowsContainer.style.overflow = `hidden`, this.rowsContainer.style.contain = `strict`), this.disposables.add(nx.addTarget(this.rowsContainer)), this.scrollable = this.disposables.add(new ox({ forceIntegerValues: true, smoothScrollDuration: i10.smoothScrolling ?? false ? 125 : 0, scheduleAtNextAnimationFrame: (e206) => cl(Vc(this.domNode), e206) })), this.scrollableElement = this.disposables.add(new mx(this.rowsContainer, { alwaysConsumeMouseWheel: i10.alwaysConsumeMouseWheel ?? MI.alwaysConsumeMouseWheel, horizontal: 1, vertical: i10.verticalScrollMode ?? MI.verticalScrollMode, useShadows: i10.useShadows ?? MI.useShadows, mouseWheelScrollSensitivity: i10.mouseWheelScrollSensitivity, fastScrollSensitivity: i10.fastScrollSensitivity, scrollByPage: i10.scrollByPage }, this.scrollable)), this.domNode.appendChild(this.scrollableElement.getDomNode()), t10.appendChild(this.domNode), this.scrollableElement.onScroll(this.onScroll, this, this.disposables), this.disposables.add(L(this.rowsContainer, tx.Change, (e206) => this.onTouchChange(e206))), this.disposables.add(L(this.scrollableElement.getDomNode(), `scroll`, (e206) => {
      let t11 = e206.target, n11 = t11.scrollTop;
      t11.scrollTop = 0, i10.scrollToActiveElement && this.setScrollTop(this.scrollTop + n11);
    })), this.disposables.add(L(this.domNode, `dragover`, (e206) => this.onDragOver(this.toDragEvent(e206)))), this.disposables.add(L(this.domNode, `drop`, (e206) => this.onDrop(this.toDragEvent(e206)))), this.disposables.add(L(this.domNode, `dragleave`, (e206) => this.onDragLeave(this.toDragEvent(e206)))), this.disposables.add(L(this.domNode, `dragend`, (e206) => this.onDragEnd(e206))), i10.userSelection) {
      if (i10.dnd) throw Error(`DND and user selection cannot be used simultaneously`);
      this.disposables.add(L(this.domNode, `mousedown`, (e206) => this.onPotentialSelectionStart(e206)));
    }
    this.setRowLineHeight = i10.setRowLineHeight ?? MI.setRowLineHeight, this.setRowHeight = i10.setRowHeight ?? MI.setRowHeight, this.supportDynamicHeights = i10.supportDynamicHeights ?? MI.supportDynamicHeights, this.dnd = i10.dnd ?? this.disposables.add(MI.dnd), this.layout(i10.initialSize?.height, i10.initialSize?.width), i10.scrollToActiveElement && this._setupFocusObserver(t10);
  }
  _setupFocusObserver(e206) {
    this.disposables.add(L(e206, `focus`, () => {
      let t10 = kl();
      this.activeElement !== t10 && t10 !== null && (this.activeElement = t10, this._scrollToActiveElement(this.activeElement, e206));
    }, true));
  }
  _scrollToActiveElement(e206, t10) {
    let n10 = t10.getBoundingClientRect(), r10 = e206.getBoundingClientRect().top - n10.top;
    r10 < 0 && this.setScrollTop(this.scrollTop + r10);
  }
  updateOptions(e206) {
    e206.paddingBottom !== void 0 && (this.paddingBottom = e206.paddingBottom, this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight })), e206.smoothScrolling !== void 0 && this.scrollable.setSmoothScrollDuration(e206.smoothScrolling ? 125 : 0), e206.horizontalScrolling !== void 0 && (this.horizontalScrolling = e206.horizontalScrolling);
    let t10;
    if (e206.scrollByPage !== void 0 && (t10 = { ...t10 ?? {}, scrollByPage: e206.scrollByPage }), e206.mouseWheelScrollSensitivity !== void 0 && (t10 = { ...t10 ?? {}, mouseWheelScrollSensitivity: e206.mouseWheelScrollSensitivity }), e206.fastScrollSensitivity !== void 0 && (t10 = { ...t10 ?? {}, fastScrollSensitivity: e206.fastScrollSensitivity }), t10 && this.scrollableElement.updateOptions(t10), e206.paddingTop !== void 0 && e206.paddingTop !== this.rangeMap.paddingTop) {
      let t11 = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight), n10 = e206.paddingTop - this.rangeMap.paddingTop;
      this.rangeMap.paddingTop = e206.paddingTop, this.render(t11, Math.max(0, this.lastRenderTop + n10), this.lastRenderHeight, void 0, void 0, true), this.setScrollTop(this.lastRenderTop), this.eventuallyUpdateScrollDimensions(), this.supportDynamicHeights && this._rerender(this.lastRenderTop, this.lastRenderHeight);
    }
  }
  createRangeMap(e206) {
    return new wge(e206);
  }
  splice(e206, t10, n10 = []) {
    if (this.splicing) throw Error(`Can't run recursive splices.`);
    this.splicing = true;
    try {
      return this._splice(e206, t10, n10);
    } finally {
      this.splicing = false, this._onDidChangeContentHeight.fire(this.contentHeight);
    }
  }
  _splice(e206, t10, n10 = []) {
    let r10 = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight), i10 = { start: e206, end: e206 + t10 }, a10 = WP.intersect(r10, i10), o10 = /* @__PURE__ */ new Map();
    for (let e207 = a10.end - 1; e207 >= a10.start; e207--) {
      let t11 = this.items[e207];
      if (t11.dragStartDisposable.dispose(), t11.checkedDisposable.dispose(), t11.row) {
        let n11 = o10.get(t11.templateId);
        n11 || (n11 = [], o10.set(t11.templateId, n11));
        let r11 = this.renderers.get(t11.templateId);
        r11 && r11.disposeElement && r11.disposeElement(t11.element, e207, t11.row.templateData, { height: t11.size }), n11.unshift(t11.row);
      }
      t11.row = null, t11.stale = true;
    }
    let s10 = { start: e206 + t10, end: this.items.length }, c10 = WP.intersect(s10, r10), l10 = WP.relativeComplement(s10, r10), u10 = n10.map((e207) => ({ id: String(this.itemId++), element: e207, templateId: this.virtualDelegate.getTemplateId(e207), size: this.virtualDelegate.getHeight(e207), width: void 0, hasDynamicHeight: !!this.virtualDelegate.hasDynamicHeight && this.virtualDelegate.hasDynamicHeight(e207), lastDynamicHeightWidth: void 0, row: null, uri: void 0, dropTarget: false, dragStartDisposable: D.None, checkedDisposable: D.None, stale: false })), d10;
    e206 === 0 && t10 >= this.items.length ? (this.rangeMap = this.createRangeMap(this.rangeMap.paddingTop), this.rangeMap.splice(0, 0, u10), d10 = this.items, this.items = u10) : (this.rangeMap.splice(e206, t10, u10), d10 = ae(this.items, e206, t10, u10));
    let f10 = n10.length - t10, p10 = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight), m10 = kI(c10, f10), h10 = WP.intersect(p10, m10);
    for (let e207 = h10.start; e207 < h10.end; e207++) this.updateItemInDOM(this.items[e207], e207);
    let g10 = WP.relativeComplement(m10, p10);
    for (let e207 of g10) for (let t11 = e207.start; t11 < e207.end; t11++) this.removeItemFromDOM(t11);
    let _10 = l10.map((e207) => kI(e207, f10)), v10 = [{ start: e206, end: e206 + n10.length }, ..._10].map((e207) => WP.intersect(p10, e207)).reverse();
    for (let e207 of v10) for (let t11 = e207.end - 1; t11 >= e207.start; t11--) {
      let e208 = this.items[t11], n11 = o10.get(e208.templateId)?.pop();
      this.insertItemInDOM(t11, n11);
    }
    for (let e207 of o10.values()) for (let t11 of e207) this.cache.release(t11);
    return this.eventuallyUpdateScrollDimensions(), this.supportDynamicHeights && this._rerender(this.scrollTop, this.renderHeight), d10.map((e207) => e207.element);
  }
  eventuallyUpdateScrollDimensions() {
    this._scrollHeight = this.contentHeight, this.rowsContainer.style.height = `${this._scrollHeight}px`, this.scrollableElementUpdateDisposable || (this.scrollableElementUpdateDisposable = cl(Vc(this.domNode), () => {
      this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }), this.updateScrollWidth(), this.scrollableElementUpdateDisposable = null;
    }));
  }
  eventuallyUpdateScrollWidth() {
    if (!this.horizontalScrolling) {
      this.scrollableElementWidthDelayer.cancel();
      return;
    }
    this.scrollableElementWidthDelayer.trigger(() => this.updateScrollWidth());
  }
  updateScrollWidth() {
    if (!this.horizontalScrolling) return;
    let e206 = 0;
    for (let t10 of this.items) t10.width !== void 0 && (e206 = Math.max(e206, t10.width));
    this.scrollWidth = e206, this.scrollableElement.setScrollDimensions({ scrollWidth: e206 === 0 ? 0 : e206 + 10 }), this._onDidChangeContentWidth.fire(this.scrollWidth);
  }
  rerender() {
    if (this.supportDynamicHeights) {
      for (let e206 of this.items) e206.lastDynamicHeightWidth = void 0;
      this._rerender(this.lastRenderTop, this.lastRenderHeight);
    }
  }
  get length() {
    return this.items.length;
  }
  get renderHeight() {
    return this.scrollableElement.getScrollDimensions().height;
  }
  get firstVisibleIndex() {
    return this.getVisibleRange(this.lastRenderTop, this.lastRenderHeight).start;
  }
  element(e206) {
    return this.items[e206].element;
  }
  indexOf(e206) {
    return this.items.findIndex((t10) => t10.element === e206);
  }
  domElement(e206) {
    let t10 = this.items[e206].row;
    return t10 && t10.domNode;
  }
  elementHeight(e206) {
    return this.items[e206].size;
  }
  elementTop(e206) {
    return this.rangeMap.positionAt(e206);
  }
  indexAt(e206) {
    return this.rangeMap.indexAt(e206);
  }
  indexAfter(e206) {
    return this.rangeMap.indexAfter(e206);
  }
  layout(e206, t10) {
    let n10 = { height: typeof e206 == `number` ? e206 : xl(this.domNode) };
    this.scrollableElementUpdateDisposable && (this.scrollableElementUpdateDisposable.dispose(), this.scrollableElementUpdateDisposable = null, n10.scrollHeight = this.scrollHeight), this.scrollableElement.setScrollDimensions(n10), t10 !== void 0 && (this.renderWidth = t10, this.supportDynamicHeights && this._rerender(this.scrollTop, this.renderHeight)), this.horizontalScrolling && this.scrollableElement.setScrollDimensions({ width: typeof t10 == `number` ? t10 : bl(this.domNode) });
  }
  render(e206, t10, n10, r10, i10, a10 = false, o10 = false) {
    let s10 = this.getRenderRange(t10, n10), c10 = WP.relativeComplement(s10, e206).reverse(), l10 = WP.relativeComplement(e206, s10);
    if (a10) {
      let t11 = WP.intersect(e206, s10);
      for (let e207 = t11.start; e207 < t11.end; e207++) this.updateItemInDOM(this.items[e207], e207);
    }
    this.cache.transact(() => {
      for (let e207 of l10) for (let t11 = e207.start; t11 < e207.end; t11++) this.removeItemFromDOM(t11, o10);
      for (let e207 of c10) for (let t11 = e207.end - 1; t11 >= e207.start; t11--) this.insertItemInDOM(t11);
    }), r10 !== void 0 && (this.rowsContainer.style.left = `-${r10}px`), this.rowsContainer.style.top = `-${t10}px`, this.horizontalScrolling && i10 !== void 0 && (this.rowsContainer.style.width = `${Math.max(i10, this.renderWidth)}px`), this.lastRenderTop = t10, this.lastRenderHeight = n10;
  }
  insertItemInDOM(e206, t10) {
    let n10 = this.items[e206];
    if (!n10.row) if (t10) n10.row = t10, n10.stale = true;
    else {
      let e207 = this.cache.alloc(n10.templateId);
      n10.row = e207.row, n10.stale || (n10.stale = e207.isReusingConnectedDomNode);
    }
    let r10 = this.accessibilityProvider.getRole(n10.element) || `listitem`;
    n10.row.domNode.setAttribute(`role`, r10);
    let i10 = this.accessibilityProvider.isChecked(n10.element), a10 = (e207) => e207 === `mixed` ? `mixed` : String(!!e207);
    if (typeof i10 == `boolean` || i10 === `mixed`) n10.row.domNode.setAttribute(`aria-checked`, a10(i10));
    else if (i10) {
      let e207 = (e208) => n10.row.domNode.setAttribute(`aria-checked`, a10(e208));
      e207(i10.value), n10.checkedDisposable = i10.onDidChange(() => e207(i10.value));
    }
    if (n10.stale || !n10.row.domNode.parentElement) {
      let t11 = this.items.at(e206 + 1)?.row?.domNode ?? null;
      (n10.row.domNode.parentElement !== this.rowsContainer || n10.row.domNode.nextElementSibling !== t11) && this.rowsContainer.insertBefore(n10.row.domNode, t11), n10.stale = false;
    }
    this.updateItemInDOM(n10, e206);
    let o10 = this.renderers.get(n10.templateId);
    if (!o10) throw Error(`No renderer found for template id ${n10.templateId}`);
    o10?.renderElement(n10.element, e206, n10.row.templateData, { height: n10.size });
    let s10 = this.dnd.getDragURI(n10.element);
    n10.dragStartDisposable.dispose(), n10.row.domNode.draggable = !!s10, s10 && (n10.dragStartDisposable = L(n10.row.domNode, `dragstart`, (e207) => this.onDragStart(n10.element, s10, e207))), this.horizontalScrolling && (this.measureItemWidth(n10), this.eventuallyUpdateScrollWidth());
  }
  measureItemWidth(e206) {
    if (!e206.row || !e206.row.domNode) return;
    e206.row.domNode.style.width = `fit-content`, e206.width = bl(e206.row.domNode);
    let t10 = Vc(e206.row.domNode).getComputedStyle(e206.row.domNode);
    t10.paddingLeft && (e206.width += parseFloat(t10.paddingLeft)), t10.paddingRight && (e206.width += parseFloat(t10.paddingRight)), e206.row.domNode.style.width = ``;
  }
  updateItemInDOM(e206, t10) {
    e206.row.domNode.style.top = `${this.elementTop(t10)}px`, this.setRowHeight && (e206.row.domNode.style.height = `${e206.size}px`), this.setRowLineHeight && (e206.row.domNode.style.lineHeight = `${e206.size}px`), e206.row.domNode.setAttribute(`data-index`, `${t10}`), e206.row.domNode.setAttribute(`data-last-element`, t10 === this.length - 1 ? `true` : `false`), e206.row.domNode.setAttribute(`data-parity`, t10 % 2 == 0 ? `even` : `odd`), e206.row.domNode.setAttribute(`aria-setsize`, String(this.accessibilityProvider.getSetSize(e206.element, t10, this.length))), e206.row.domNode.setAttribute(`aria-posinset`, String(this.accessibilityProvider.getPosInSet(e206.element, t10))), e206.row.domNode.setAttribute(`id`, this.getElementDomId(t10)), e206.row.domNode.classList.toggle(`drop-target`, e206.dropTarget);
  }
  removeItemFromDOM(e206, t10) {
    let n10 = this.items[e206];
    if (n10.dragStartDisposable.dispose(), n10.checkedDisposable.dispose(), n10.row) {
      let r10 = this.renderers.get(n10.templateId);
      r10 && r10.disposeElement && r10.disposeElement(n10.element, e206, n10.row.templateData, { height: n10.size, onScroll: t10 }), this.cache.release(n10.row), n10.row = null;
    }
    this.horizontalScrolling && this.eventuallyUpdateScrollWidth();
  }
  getScrollTop() {
    return this.scrollableElement.getScrollPosition().scrollTop;
  }
  setScrollTop(e206, t10) {
    this.scrollableElementUpdateDisposable && (this.scrollableElementUpdateDisposable.dispose(), this.scrollableElementUpdateDisposable = null, this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight })), this.scrollableElement.setScrollPosition({ scrollTop: e206, reuseAnimation: t10 });
  }
  get scrollTop() {
    return this.getScrollTop();
  }
  set scrollTop(e206) {
    this.setScrollTop(e206);
  }
  get scrollHeight() {
    return this._scrollHeight + (this.horizontalScrolling ? 10 : 0) + this.paddingBottom;
  }
  get onMouseClick() {
    return O.map(this.disposables.add(new yx(this.domNode, `click`)).event, (e206) => this.toMouseEvent(e206), this.disposables);
  }
  get onMouseDblClick() {
    return O.map(this.disposables.add(new yx(this.domNode, `dblclick`)).event, (e206) => this.toMouseEvent(e206), this.disposables);
  }
  get onMouseMiddleClick() {
    return O.filter(O.map(this.disposables.add(new yx(this.domNode, `auxclick`)).event, (e206) => this.toMouseEvent(e206), this.disposables), (e206) => e206.browserEvent.button === 1, this.disposables);
  }
  get onMouseDown() {
    return O.map(this.disposables.add(new yx(this.domNode, `mousedown`)).event, (e206) => this.toMouseEvent(e206), this.disposables);
  }
  get onMouseOver() {
    return O.map(this.disposables.add(new yx(this.domNode, `mouseover`)).event, (e206) => this.toMouseEvent(e206), this.disposables);
  }
  get onMouseOut() {
    return O.map(this.disposables.add(new yx(this.domNode, `mouseout`)).event, (e206) => this.toMouseEvent(e206), this.disposables);
  }
  get onContextMenu() {
    return O.any(O.map(this.disposables.add(new yx(this.domNode, `contextmenu`)).event, (e206) => this.toMouseEvent(e206), this.disposables), O.map(this.disposables.add(new yx(this.domNode, tx.Contextmenu)).event, (e206) => this.toGestureEvent(e206), this.disposables));
  }
  get onTouchStart() {
    return O.map(this.disposables.add(new yx(this.domNode, `touchstart`)).event, (e206) => this.toTouchEvent(e206), this.disposables);
  }
  get onTap() {
    return O.map(this.disposables.add(new yx(this.rowsContainer, tx.Tap)).event, (e206) => this.toGestureEvent(e206), this.disposables);
  }
  toMouseEvent(e206) {
    let t10 = this.getItemIndexFromEventTarget(e206.target || null), n10 = t10 === void 0 ? void 0 : this.items[t10];
    return { browserEvent: e206, index: t10, element: n10 && n10.element };
  }
  toTouchEvent(e206) {
    let t10 = this.getItemIndexFromEventTarget(e206.target || null), n10 = t10 === void 0 ? void 0 : this.items[t10];
    return { browserEvent: e206, index: t10, element: n10 && n10.element };
  }
  toGestureEvent(e206) {
    let t10 = this.getItemIndexFromEventTarget(e206.initialTarget || null), n10 = t10 === void 0 ? void 0 : this.items[t10];
    return { browserEvent: e206, index: t10, element: n10 && n10.element };
  }
  toDragEvent(e206) {
    let t10 = this.getItemIndexFromEventTarget(e206.target || null), n10 = t10 === void 0 ? void 0 : this.items[t10];
    return { browserEvent: e206, index: t10, element: n10 && n10.element, sector: this.getTargetSector(e206, t10) };
  }
  onScroll(e206) {
    try {
      let t10 = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
      this.render(t10, e206.scrollTop, e206.height, e206.scrollLeft, e206.scrollWidth, void 0, true), this.supportDynamicHeights && this._rerender(e206.scrollTop, e206.height, e206.inSmoothScrolling);
    } catch (t10) {
      throw console.error(`Got bad scroll event:`, e206), t10;
    }
  }
  onTouchChange(e206) {
    e206.preventDefault(), e206.stopPropagation(), this.scrollTop -= e206.translationY;
  }
  onDragStart(e206, t10, n10) {
    if (!n10.dataTransfer) return;
    let r10 = this.dnd.getDragElements(e206);
    n10.dataTransfer.effectAllowed = `copyMove`, n10.dataTransfer.setData(xI.TEXT, t10);
    let i10;
    this.dnd.getDragLabel && (i10 = this.dnd.getDragLabel(r10, n10)), i10 === void 0 && (i10 = String(r10.length)), Ege(n10, this.domNode, i10, [this.domId]), this.domNode.classList.add(`dragging`), this.currentDragData = new NI(r10), jI.CurrentDragAndDropData = new Dge(r10), this.dnd.onDragStart?.(this.currentDragData, n10);
  }
  onPotentialSelectionStart(e206) {
    this.currentSelectionDisposable.dispose();
    let t10 = Hc(this.domNode), n10 = this.currentSelectionDisposable = new E(), r10 = n10.add(new E());
    r10.add(L(this.domNode, `selectstart`, () => {
      r10.add(L(t10, `mousemove`, (e207) => {
        t10.getSelection()?.isCollapsed === false && this.setupDragAndDropScrollTopAnimation(e207);
      })), n10.add(T(() => {
        let e207 = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
        this.currentSelectionBounds = void 0, this.render(e207, this.lastRenderTop, this.lastRenderHeight, void 0, void 0);
      })), n10.add(L(t10, `selectionchange`, () => {
        let e207 = t10.getSelection();
        if (!e207 || e207.isCollapsed) {
          r10.isDisposed && n10.dispose();
          return;
        }
        let i10 = this.getIndexOfListElement(e207.anchorNode), a10 = this.getIndexOfListElement(e207.focusNode);
        i10 !== void 0 && a10 !== void 0 && (a10 < i10 && ([i10, a10] = [a10, i10]), this.currentSelectionBounds = { start: i10, end: a10 });
      }));
    })), r10.add(L(t10, `mouseup`, () => {
      r10.dispose(), this.teardownDragAndDropScrollTopAnimation(), t10.getSelection()?.isCollapsed !== false && n10.dispose();
    }));
  }
  getIndexOfListElement(e206) {
    if (!(!e206 || !this.domNode.contains(e206))) for (; e206 && e206 !== this.domNode; ) {
      if (e206.dataset?.index) return Number(e206.dataset.index);
      e206 = e206.parentElement;
    }
  }
  onDragOver(e206) {
    if (e206.browserEvent.preventDefault(), this.onDragLeaveTimeout.dispose(), jI.CurrentDragAndDropData && jI.CurrentDragAndDropData.getData() === `vscode-ui` || (this.setupDragAndDropScrollTopAnimation(e206.browserEvent), !e206.browserEvent.dataTransfer)) return false;
    if (!this.currentDragData) if (jI.CurrentDragAndDropData) this.currentDragData = jI.CurrentDragAndDropData;
    else {
      if (!e206.browserEvent.dataTransfer.types) return false;
      this.currentDragData = new Oge();
    }
    let t10 = this.dnd.onDragOver(this.currentDragData, e206.element, e206.index, e206.sector, e206.browserEvent);
    if (this.canDrop = typeof t10 == `boolean` ? t10 : t10.accept, !this.canDrop) return this.currentDragFeedback = void 0, this.currentDragFeedbackDisposable.dispose(), false;
    e206.browserEvent.dataTransfer.dropEffect = typeof t10 != `boolean` && t10.effect?.type === 0 ? `copy` : `move`;
    let n10;
    n10 = typeof t10 != `boolean` && t10.feedback ? t10.feedback : e206.index === void 0 ? [-1] : [e206.index], n10 = y(n10).filter((e207) => e207 >= -1 && e207 < this.length).sort((e207, t11) => e207 - t11), n10 = n10[0] === -1 ? [-1] : n10;
    let r10 = typeof t10 != `boolean` && t10.effect && t10.effect.position ? t10.effect.position : `drop-target`;
    if (kge(this.currentDragFeedback, n10) && this.currentDragFeedbackPosition === r10) return true;
    if (this.currentDragFeedback = n10, this.currentDragFeedbackPosition = r10, this.currentDragFeedbackDisposable.dispose(), n10[0] === -1) this.domNode.classList.add(r10), this.rowsContainer.classList.add(r10), this.currentDragFeedbackDisposable = T(() => {
      this.domNode.classList.remove(r10), this.rowsContainer.classList.remove(r10);
    });
    else {
      if (n10.length > 1 && r10 !== `drop-target`) throw Error(`Can't use multiple feedbacks with position different than 'over'`);
      r10 === `drop-target-after` && n10[0] < this.length - 1 && (n10[0] += 1, r10 = `drop-target-before`);
      for (let e207 of n10) {
        let t11 = this.items[e207];
        t11.dropTarget = true, t11.row?.domNode.classList.add(r10);
      }
      this.currentDragFeedbackDisposable = T(() => {
        for (let e207 of n10) {
          let t11 = this.items[e207];
          t11.dropTarget = false, t11.row?.domNode.classList.remove(r10);
        }
      });
    }
    return true;
  }
  onDragLeave(e206) {
    this.onDragLeaveTimeout.dispose(), this.onDragLeaveTimeout = as(() => this.clearDragOverFeedback(), 100, this.disposables), this.currentDragData && this.dnd.onDragLeave?.(this.currentDragData, e206.element, e206.index, e206.browserEvent);
  }
  onDrop(e206) {
    if (!this.canDrop) return;
    let t10 = this.currentDragData;
    this.teardownDragAndDropScrollTopAnimation(), this.clearDragOverFeedback(), this.domNode.classList.remove(`dragging`), this.currentDragData = void 0, jI.CurrentDragAndDropData = void 0, !(!t10 || !e206.browserEvent.dataTransfer) && (e206.browserEvent.preventDefault(), t10.update(e206.browserEvent.dataTransfer), this.dnd.drop(t10, e206.element, e206.index, e206.sector, e206.browserEvent));
  }
  onDragEnd(e206) {
    this.canDrop = false, this.teardownDragAndDropScrollTopAnimation(), this.clearDragOverFeedback(), this.domNode.classList.remove(`dragging`), this.currentDragData = void 0, jI.CurrentDragAndDropData = void 0, this.dnd.onDragEnd?.(e206);
  }
  clearDragOverFeedback() {
    this.currentDragFeedback = void 0, this.currentDragFeedbackPosition = void 0, this.currentDragFeedbackDisposable.dispose(), this.currentDragFeedbackDisposable = D.None;
  }
  setupDragAndDropScrollTopAnimation(e206) {
    if (!this.dragOverAnimationDisposable) {
      let e207 = hl(this.domNode).top;
      this.dragOverAnimationDisposable = _ne(Vc(this.domNode), this.animateDragAndDropScrollTop.bind(this, e207));
    }
    this.dragOverAnimationStopDisposable.dispose(), this.dragOverAnimationStopDisposable = as(() => {
      this.dragOverAnimationDisposable && (this.dragOverAnimationDisposable = (this.dragOverAnimationDisposable.dispose(), void 0));
    }, 1e3, this.disposables), this.dragOverMouseY = e206.pageY;
  }
  animateDragAndDropScrollTop(e206) {
    if (this.dragOverMouseY === void 0) return;
    let t10 = this.dragOverMouseY - e206, n10 = this.renderHeight - 35;
    t10 < 35 ? this.scrollTop += Math.max(-14, Math.floor(0.3 * (t10 - 35))) : t10 > n10 && (this.scrollTop += Math.min(14, Math.floor(0.3 * (t10 - n10))));
  }
  teardownDragAndDropScrollTopAnimation() {
    this.dragOverAnimationStopDisposable.dispose(), this.dragOverAnimationDisposable && (this.dragOverAnimationDisposable = (this.dragOverAnimationDisposable.dispose(), void 0));
  }
  getTargetSector(e206, t10) {
    if (t10 === void 0) return;
    let n10 = e206.offsetY / this.items[t10].size;
    return rA(Math.floor(n10 / 0.25), 0, 3);
  }
  getItemIndexFromEventTarget(e206) {
    let t10 = this.scrollableElement.getDomNode(), n10 = e206;
    for (; (Fl(n10) || Ll(n10)) && n10 !== this.rowsContainer && t10.contains(n10); ) {
      let e207 = n10.getAttribute(`data-index`);
      if (e207) {
        let t11 = Number(e207);
        if (!isNaN(t11)) return t11;
      }
      n10 = n10.parentElement;
    }
  }
  getVisibleRange(e206, t10) {
    return { start: this.rangeMap.indexAt(e206), end: this.rangeMap.indexAfter(e206 + t10 - 1) };
  }
  getRenderRange(e206, t10) {
    let n10 = this.getVisibleRange(e206, t10);
    if (this.currentSelectionBounds) {
      let e207 = this.rangeMap.count;
      n10.start = Math.min(n10.start, this.currentSelectionBounds.start, e207), n10.end = Math.min(Math.max(n10.end, this.currentSelectionBounds.end + 1), e207);
    }
    return n10;
  }
  _rerender(e206, t10, n10) {
    let r10 = this.getRenderRange(e206, t10), i10, a10;
    e206 === this.elementTop(r10.start) ? (i10 = r10.start, a10 = 0) : r10.end - r10.start > 1 && (i10 = r10.start + 1, a10 = this.elementTop(i10) - e206);
    let o10 = 0;
    for (; ; ) {
      let s10 = this.getRenderRange(e206, t10), c10 = false;
      for (let e207 = s10.start; e207 < s10.end; e207++) {
        let t11 = this.probeDynamicHeight(e207);
        t11 !== 0 && this.rangeMap.splice(e207, 1, [this.items[e207]]), o10 += t11, c10 || (c10 = t11 !== 0);
      }
      if (!c10) {
        o10 !== 0 && this.eventuallyUpdateScrollDimensions();
        let t11 = WP.relativeComplement(r10, s10);
        for (let e207 of t11) for (let t12 = e207.start; t12 < e207.end; t12++) this.items[t12].row && this.removeItemFromDOM(t12);
        let c11 = WP.relativeComplement(s10, r10).reverse();
        for (let e207 of c11) for (let t12 = e207.end - 1; t12 >= e207.start; t12--) this.insertItemInDOM(t12);
        for (let e207 = s10.start; e207 < s10.end; e207++) this.items[e207].row && this.updateItemInDOM(this.items[e207], e207);
        if (typeof i10 == `number`) {
          let t12 = this.scrollable.getFutureScrollPosition().scrollTop - e206, r11 = this.elementTop(i10) - a10 + t12;
          this.setScrollTop(r11, n10);
        }
        this._onDidChangeContentHeight.fire(this.contentHeight);
        return;
      }
    }
  }
  probeDynamicHeight(e206) {
    let t10 = this.items[e206];
    if (this.virtualDelegate.getDynamicHeight) {
      let e207 = this.virtualDelegate.getDynamicHeight(t10.element);
      if (e207 !== null) {
        let n11 = t10.size;
        return t10.size = e207, t10.lastDynamicHeightWidth = this.renderWidth, e207 - n11;
      }
    }
    if (!t10.hasDynamicHeight || t10.lastDynamicHeightWidth === this.renderWidth || this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(t10.element)) return 0;
    let n10 = t10.size;
    if (t10.row) return t10.row.domNode.style.height = ``, t10.size = t10.row.domNode.offsetHeight, t10.size === 0 && !Cl(t10.row.domNode, Vc(t10.row.domNode).document.body) && console.warn(`Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!`, Error().stack), t10.lastDynamicHeightWidth = this.renderWidth, t10.size - n10;
    let { row: r10 } = this.cache.alloc(t10.templateId);
    r10.domNode.style.height = ``, this.rowsContainer.appendChild(r10.domNode);
    let i10 = this.renderers.get(t10.templateId);
    if (!i10) throw new je(`Missing renderer for templateId: ` + t10.templateId);
    return i10.renderElement(t10.element, e206, r10.templateData), t10.size = r10.domNode.offsetHeight, i10.disposeElement?.(t10.element, e206, r10.templateData), this.virtualDelegate.setDynamicHeight?.(t10.element, t10.size), t10.lastDynamicHeightWidth = this.renderWidth, r10.domNode.remove(), this.cache.release(r10), t10.size - n10;
  }
  getElementDomId(e206) {
    return `${this.domId}_${e206}`;
  }
  dispose() {
    for (let e206 of this.items) if (e206.dragStartDisposable.dispose(), e206.checkedDisposable.dispose(), e206.row) {
      let t10 = this.renderers.get(e206.row.templateId);
      t10 && (t10.disposeElement?.(e206.element, -1, e206.row.templateData, void 0), t10.disposeTemplate(e206.row.templateData));
    }
    this.items = [], this.domNode?.remove(), this.dragOverAnimationDisposable?.dispose(), this.disposables.dispose();
  }
}, _Ua.InstanceCount = 0, _Ua);
AI([ex], PI.prototype, `onMouseClick`, null), AI([ex], PI.prototype, `onMouseDblClick`, null), AI([ex], PI.prototype, `onMouseMiddleClick`, null), AI([ex], PI.prototype, `onMouseDown`, null), AI([ex], PI.prototype, `onMouseOver`, null), AI([ex], PI.prototype, `onMouseOut`, null), AI([ex], PI.prototype, `onContextMenu`, null), AI([ex], PI.prototype, `onTouchStart`, null), AI([ex], PI.prototype, `onTap`, null);
function FI(e206) {
  return new jge(e206);
}
var jge = class extends oc {
  constructor(e206) {
    super(), this.value = e206;
  }
  get debugName() {
    return this.toString();
  }
  get() {
    return this.value;
  }
  addObserver(e206) {
  }
  removeObserver(e206) {
  }
  toString() {
    return `Const: ${this.value}`;
  }
}, II = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Mge = class {
  constructor(e206) {
    this.trait = e206, this.renderedElements = [];
  }
  get templateId() {
    return `template:${this.trait.name}`;
  }
  renderTemplate(e206) {
    return e206;
  }
  renderElement(e206, t10, n10) {
    let r10 = this.renderedElements.findIndex((e207) => e207.templateData === n10);
    if (r10 >= 0) {
      let e207 = this.renderedElements[r10];
      this.trait.unrender(n10), e207.index = t10;
    } else {
      let e207 = { index: t10, templateData: n10 };
      this.renderedElements.push(e207);
    }
    this.trait.renderIndex(t10, n10);
  }
  splice(e206, t10, n10) {
    let r10 = [];
    for (let i10 of this.renderedElements) i10.index < e206 ? r10.push(i10) : i10.index >= e206 + t10 && r10.push({ index: i10.index + n10 - t10, templateData: i10.templateData });
    this.renderedElements = r10;
  }
  renderIndexes(e206) {
    for (let { index: t10, templateData: n10 } of this.renderedElements) e206.indexOf(t10) > -1 && this.trait.renderIndex(t10, n10);
  }
  disposeTemplate(e206) {
    let t10 = this.renderedElements.findIndex((t11) => t11.templateData === e206);
    t10 < 0 || this.renderedElements.splice(t10, 1);
  }
}, LI = class {
  get onChange() {
    return this._onChange.event;
  }
  get name() {
    return this._trait;
  }
  get renderer() {
    return new Mge(this);
  }
  constructor(e206) {
    this._trait = e206, this.indexes = [], this.sortedIndexes = [], this._onChange = new k();
  }
  splice(e206, t10, n10) {
    let r10 = n10.length - t10, i10 = e206 + t10, a10 = [], o10 = 0;
    for (; o10 < this.sortedIndexes.length && this.sortedIndexes[o10] < e206; ) a10.push(this.sortedIndexes[o10++]);
    for (let t11 = 0; t11 < n10.length; t11++) n10[t11] && a10.push(t11 + e206);
    for (; o10 < this.sortedIndexes.length && this.sortedIndexes[o10] >= i10; ) a10.push(this.sortedIndexes[o10++] + r10);
    this.renderer.splice(e206, t10, n10.length), this._set(a10, a10);
  }
  renderIndex(e206, t10) {
    t10.classList.toggle(this._trait, this.contains(e206));
  }
  unrender(e206) {
    e206.classList.remove(this._trait);
  }
  set(e206, t10) {
    return this._set(e206, [...e206].sort(QI), t10);
  }
  _set(e206, t10, n10) {
    let r10 = this.indexes, i10 = this.sortedIndexes;
    this.indexes = e206, this.sortedIndexes = t10;
    let a10 = ZI(i10, e206);
    return this.renderer.renderIndexes(a10), this._onChange.fire({ indexes: e206, browserEvent: n10 }), r10;
  }
  get() {
    return this.indexes;
  }
  contains(e206) {
    return c(this.sortedIndexes, e206, QI) >= 0;
  }
  dispose() {
    Kt(this._onChange);
  }
};
II([ex], LI.prototype, `renderer`, null);
var Nge = class extends LI {
  constructor(e206) {
    super(`selected`), this.setAriaSelected = e206;
  }
  renderIndex(e206, t10) {
    super.renderIndex(e206, t10), this.setAriaSelected && (this.contains(e206) ? t10.setAttribute(`aria-selected`, `true`) : t10.setAttribute(`aria-selected`, `false`));
  }
}, RI = class {
  constructor(e206, t10, n10) {
    this.trait = e206, this.view = t10, this.identityProvider = n10;
  }
  splice(e206, t10, n10) {
    if (!this.identityProvider) return this.trait.splice(e206, t10, Array(n10.length).fill(false));
    let r10 = this.trait.get().map((e207) => this.identityProvider.getId(this.view.element(e207)).toString());
    if (r10.length === 0) return this.trait.splice(e206, t10, Array(n10.length).fill(false));
    let i10 = new Set(r10), a10 = n10.map((e207) => i10.has(this.identityProvider.getId(e207).toString()));
    this.trait.splice(e206, t10, a10);
  }
};
function zI(e206, t10) {
  return e206.classList.contains(t10) ? true : e206.classList.contains(`monaco-list`) || !e206.parentElement ? false : zI(e206.parentElement, t10);
}
function BI(e206) {
  return zI(e206, `monaco-editor`);
}
function Pge(e206) {
  return zI(e206, `monaco-custom-toggle`);
}
function Fge(e206) {
  return zI(e206, `action-item`);
}
function VI(e206) {
  return zI(e206, `monaco-tree-sticky-row`);
}
function HI(e206) {
  return e206.classList.contains(`monaco-tree-sticky-container`);
}
function UI(e206) {
  return e206.tagName === `A` && e206.classList.contains(`monaco-button`) || e206.tagName === `DIV` && e206.classList.contains(`monaco-button-dropdown`) ? true : e206.classList.contains(`monaco-list`) || !e206.parentElement ? false : UI(e206.parentElement);
}
var WI = class {
  get onKeyDown() {
    return O.chain(this.disposables.add(new yx(this.view.domNode, `keydown`)).event, (e206) => e206.filter((e207) => !iu(e207.target)).map((e207) => new Jo(e207)));
  }
  constructor(e206, t10, n10) {
    this.list = e206, this.view = t10, this.disposables = new E(), this.multipleSelectionDisposables = new E(), this.multipleSelectionSupport = n10.multipleSelectionSupport, this.disposables.add(this.onKeyDown((e207) => {
      switch (e207.keyCode) {
        case 3:
          return this.onEnter(e207);
        case 16:
          return this.onUpArrow(e207);
        case 18:
          return this.onDownArrow(e207);
        case 11:
          return this.onPageUpArrow(e207);
        case 12:
          return this.onPageDownArrow(e207);
        case 9:
          return this.onEscape(e207);
        case 31:
          this.multipleSelectionSupport && (Tt ? e207.metaKey : e207.ctrlKey) && this.onCtrlA(e207);
      }
    }));
  }
  updateOptions(e206) {
    e206.multipleSelectionSupport !== void 0 && (this.multipleSelectionSupport = e206.multipleSelectionSupport);
  }
  onEnter(e206) {
    e206.preventDefault(), e206.stopPropagation(), this.list.setSelection(this.list.getFocus(), e206.browserEvent);
  }
  onUpArrow(e206) {
    e206.preventDefault(), e206.stopPropagation(), this.list.focusPrevious(1, false, e206.browserEvent);
    let t10 = this.list.getFocus()[0];
    this.list.setAnchor(t10), this.list.reveal(t10), this.view.domNode.focus();
  }
  onDownArrow(e206) {
    e206.preventDefault(), e206.stopPropagation(), this.list.focusNext(1, false, e206.browserEvent);
    let t10 = this.list.getFocus()[0];
    this.list.setAnchor(t10), this.list.reveal(t10), this.view.domNode.focus();
  }
  onPageUpArrow(e206) {
    e206.preventDefault(), e206.stopPropagation(), this.list.focusPreviousPage(e206.browserEvent);
    let t10 = this.list.getFocus()[0];
    this.list.setAnchor(t10), this.list.reveal(t10), this.view.domNode.focus();
  }
  onPageDownArrow(e206) {
    e206.preventDefault(), e206.stopPropagation(), this.list.focusNextPage(e206.browserEvent);
    let t10 = this.list.getFocus()[0];
    this.list.setAnchor(t10), this.list.reveal(t10), this.view.domNode.focus();
  }
  onCtrlA(e206) {
    e206.preventDefault(), e206.stopPropagation(), this.list.setSelection(b(this.list.length), e206.browserEvent), this.list.setAnchor(void 0), this.view.domNode.focus();
  }
  onEscape(e206) {
    this.list.getSelection().length && (e206.preventDefault(), e206.stopPropagation(), this.list.setSelection([], e206.browserEvent), this.list.setAnchor(void 0), this.view.domNode.focus());
  }
  dispose() {
    this.disposables.dispose(), this.multipleSelectionDisposables.dispose();
  }
};
II([ex], WI.prototype, `onKeyDown`, null);
var GI;
(function(e206) {
  e206[e206.Automatic = 0] = `Automatic`, e206[e206.Trigger = 1] = `Trigger`;
})(GI || (GI = {}));
var KI;
(function(e206) {
  e206[e206.Idle = 0] = `Idle`, e206[e206.Typing = 1] = `Typing`;
})(KI || (KI = {}));
var Ige = new class {
  mightProducePrintableCharacter(e206) {
    return e206.ctrlKey || e206.metaKey || e206.altKey ? false : e206.keyCode >= 31 && e206.keyCode <= 56 || e206.keyCode >= 21 && e206.keyCode <= 30 || e206.keyCode >= 98 && e206.keyCode <= 107 || e206.keyCode >= 85 && e206.keyCode <= 95;
  }
}(), Lge = class {
  constructor(e206, t10, n10, r10, i10) {
    this.list = e206, this.view = t10, this.keyboardNavigationLabelProvider = n10, this.keyboardNavigationEventFilter = r10, this.delegate = i10, this.enabled = false, this.state = KI.Idle, this.mode = GI.Automatic, this.triggered = false, this.previouslyFocused = -1, this.enabledDisposables = new E(), this.disposables = new E(), this.updateOptions(e206.options);
  }
  updateOptions(e206) {
    e206.typeNavigationEnabled ?? true ? this.enable() : this.disable(), this.mode = e206.typeNavigationMode ?? GI.Automatic;
  }
  enable() {
    if (this.enabled) return;
    let e206 = false, t10 = O.chain(this.enabledDisposables.add(new yx(this.view.domNode, `keydown`)).event, (t11) => t11.filter((e207) => !iu(e207.target)).filter(() => this.mode === GI.Automatic || this.triggered).map((e207) => new Jo(e207)).filter((t12) => e206 || this.keyboardNavigationEventFilter(t12)).filter((e207) => this.delegate.mightProducePrintableCharacter(e207)).forEach((e207) => Vl.stop(e207, true)).map((e207) => e207.browserEvent.key)), n10 = O.debounce(t10, () => null, 800, void 0, void 0, void 0, this.enabledDisposables);
    O.reduce(O.any(t10, n10), (e207, t11) => t11 === null ? null : (e207 || ``) + t11, void 0, this.enabledDisposables)(this.onInput, this, this.enabledDisposables), n10(this.onClear, this, this.enabledDisposables), t10(() => e206 = true, void 0, this.enabledDisposables), n10(() => e206 = false, void 0, this.enabledDisposables), this.enabled = true, this.triggered = false;
  }
  disable() {
    this.enabled && (this.enabledDisposables.clear(), this.enabled = false, this.triggered = false);
  }
  onClear() {
    let e206 = this.list.getFocus();
    if (e206.length > 0 && e206[0] === this.previouslyFocused) {
      let t10 = this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e206[0]));
      typeof t10 == `string` ? Wg(t10) : t10 && Wg(t10.get());
    }
    this.previouslyFocused = -1;
  }
  onInput(e206) {
    if (!e206) {
      this.state = KI.Idle, this.triggered = false;
      return;
    }
    let t10 = this.list.getFocus(), n10 = t10.length > 0 ? t10[0] : 0, r10 = +(this.state === KI.Idle);
    this.state = KI.Typing;
    for (let t11 = 0; t11 < this.list.length; t11++) {
      let i10 = (n10 + t11 + r10) % this.list.length, a10 = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(i10)), o10 = a10 && a10.toString();
      if (this.list.options.typeNavigationEnabled) {
        if (o10 !== void 0) {
          if (Mj(e206, o10)) {
            this.previouslyFocused = n10, this.list.setFocus([i10]), this.list.reveal(i10);
            return;
          }
          let t12 = cM(e206, o10);
          if (t12 && t12[0].end - t12[0].start > 1 && t12.length === 1) {
            this.previouslyFocused = n10, this.list.setFocus([i10]), this.list.reveal(i10);
            return;
          }
        }
      } else if (o10 === void 0 || Mj(e206, o10)) {
        this.previouslyFocused = n10, this.list.setFocus([i10]), this.list.reveal(i10);
        return;
      }
    }
  }
  dispose() {
    this.disable(), this.enabledDisposables.dispose(), this.disposables.dispose();
  }
}, Rge = class {
  constructor(e206, t10) {
    this.list = e206, this.view = t10, this.disposables = new E();
    let n10 = O.chain(this.disposables.add(new yx(t10.domNode, `keydown`)).event, (e207) => e207.filter((e208) => !iu(e208.target)).map((e208) => new Jo(e208)));
    O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 2 && !e208.ctrlKey && !e208.metaKey && !e208.shiftKey && !e208.altKey))(this.onTab, this, this.disposables);
  }
  onTab(e206) {
    if (e206.target !== this.view.domNode) return;
    let t10 = this.list.getFocus();
    if (t10.length === 0) return;
    let n10 = this.view.domElement(t10[0]);
    if (!n10) return;
    let r10 = n10.querySelector(`[tabIndex]`);
    if (!r10 || !Fl(r10) || r10.tabIndex === -1) return;
    let i10 = Vc(r10).getComputedStyle(r10);
    i10.visibility === `hidden` || i10.display === `none` || (e206.preventDefault(), e206.stopPropagation(), r10.focus());
  }
  dispose() {
    this.disposables.dispose();
  }
};
function qI(e206) {
  return Tt ? e206.browserEvent.metaKey : e206.browserEvent.ctrlKey;
}
function JI(e206) {
  return e206.browserEvent.shiftKey;
}
function zge(e206) {
  return Rl(e206) && e206.button === 2;
}
var YI = { isSelectionSingleChangeEvent: qI, isSelectionRangeChangeEvent: JI }, XI = class {
  get onPointer() {
    return this._onPointer.event;
  }
  constructor(e206) {
    this.list = e206, this.disposables = new E(), this._onPointer = this.disposables.add(new k()), e206.options.multipleSelectionSupport !== false && (this.multipleSelectionController = this.list.options.multipleSelectionController || YI), this.mouseSupport = e206.options.mouseSupport === void 0 || !!e206.options.mouseSupport, this.mouseSupport && (e206.onMouseDown(this.onMouseDown, this, this.disposables), e206.onContextMenu(this.onContextMenu, this, this.disposables), e206.onMouseDblClick(this.onDoubleClick, this, this.disposables), e206.onTouchStart(this.onMouseDown, this, this.disposables), this.disposables.add(nx.addTarget(e206.getHTMLElement()))), O.any(e206.onMouseClick, e206.onMouseMiddleClick, e206.onTap)(this.onViewPointer, this, this.disposables);
  }
  updateOptions(e206) {
    e206.multipleSelectionSupport !== void 0 && (this.multipleSelectionController = void 0, e206.multipleSelectionSupport && (this.multipleSelectionController = this.list.options.multipleSelectionController || YI));
  }
  isSelectionSingleChangeEvent(e206) {
    return this.multipleSelectionController ? this.multipleSelectionController.isSelectionSingleChangeEvent(e206) : false;
  }
  isSelectionRangeChangeEvent(e206) {
    return this.multipleSelectionController ? this.multipleSelectionController.isSelectionRangeChangeEvent(e206) : false;
  }
  isSelectionChangeEvent(e206) {
    return this.isSelectionSingleChangeEvent(e206) || this.isSelectionRangeChangeEvent(e206);
  }
  onMouseDown(e206) {
    BI(e206.browserEvent.target) || kl() !== e206.browserEvent.target && this.list.domFocus();
  }
  onContextMenu(e206) {
    if (iu(e206.browserEvent.target) || BI(e206.browserEvent.target)) return;
    let t10 = e206.index === void 0 ? [] : [e206.index];
    this.list.setFocus(t10, e206.browserEvent);
  }
  onViewPointer(e206) {
    if (!this.mouseSupport || iu(e206.browserEvent.target) || BI(e206.browserEvent.target) || e206.browserEvent.isHandledByList) return;
    e206.browserEvent.isHandledByList = true;
    let t10 = e206.index;
    if (t10 === void 0) {
      this.list.setFocus([], e206.browserEvent), this.list.setSelection([], e206.browserEvent), this.list.setAnchor(void 0);
      return;
    }
    if (this.isSelectionChangeEvent(e206)) return this.changeSelection(e206);
    this.list.setFocus([t10], e206.browserEvent), this.list.setAnchor(t10), zge(e206.browserEvent) || this.list.setSelection([t10], e206.browserEvent), this._onPointer.fire(e206);
  }
  onDoubleClick(e206) {
    if (iu(e206.browserEvent.target) || BI(e206.browserEvent.target) || this.isSelectionChangeEvent(e206) || e206.browserEvent.isHandledByList) return;
    e206.browserEvent.isHandledByList = true;
    let t10 = this.list.getFocus();
    this.list.setSelection(t10, e206.browserEvent);
  }
  changeSelection(e206) {
    let t10 = e206.index, n10 = this.list.getAnchor();
    if (this.isSelectionRangeChangeEvent(e206)) {
      n10 === void 0 && (n10 = this.list.getFocus()[0] ?? t10, this.list.setAnchor(n10));
      let r10 = b(Math.min(n10, t10), Math.max(n10, t10) + 1), i10 = this.list.getSelection(), a10 = Uge(ZI(i10, [n10]), n10);
      if (a10.length === 0) return;
      let o10 = ZI(r10, Wge(i10, a10));
      this.list.setSelection(o10, e206.browserEvent), this.list.setFocus([t10], e206.browserEvent);
    } else if (this.isSelectionSingleChangeEvent(e206)) {
      let n11 = this.list.getSelection(), r10 = n11.filter((e207) => e207 !== t10);
      this.list.setFocus([t10]), this.list.setAnchor(t10), n11.length === r10.length ? this.list.setSelection([...r10, t10], e206.browserEvent) : this.list.setSelection(r10, e206.browserEvent);
    }
  }
  dispose() {
    this.disposables.dispose();
  }
}, Bge = class {
  constructor(e206, t10) {
    this.styleElement = e206, this.selectorSuffix = t10;
  }
  style(e206) {
    let t10 = this.selectorSuffix && `.${this.selectorSuffix}`, n10 = [];
    e206.listBackground && n10.push(`.monaco-list${t10} .monaco-list-rows { background: ${e206.listBackground}; }`), e206.listFocusBackground && (n10.push(`.monaco-list${t10}:focus .monaco-list-row.focused { background-color: ${e206.listFocusBackground}; }`), n10.push(`.monaco-list${t10}:focus .monaco-list-row.focused:hover { background-color: ${e206.listFocusBackground}; }`)), e206.listFocusForeground && n10.push(`.monaco-list${t10}:focus .monaco-list-row.focused { color: ${e206.listFocusForeground}; }`), e206.listActiveSelectionBackground && (n10.push(`.monaco-list${t10}:focus .monaco-list-row.selected { background-color: ${e206.listActiveSelectionBackground}; }`), n10.push(`.monaco-list${t10}:focus .monaco-list-row.selected:hover { background-color: ${e206.listActiveSelectionBackground}; }`)), e206.listActiveSelectionForeground && n10.push(`.monaco-list${t10}:focus .monaco-list-row.selected { color: ${e206.listActiveSelectionForeground}; }`), e206.listActiveSelectionIconForeground && n10.push(`.monaco-list${t10}:focus .monaco-list-row.selected .codicon { color: ${e206.listActiveSelectionIconForeground}; }`), e206.listFocusAndSelectionBackground && n10.push(`
				.monaco-drag-image${t10},
				.monaco-list${t10}:focus .monaco-list-row.selected.focused { background-color: ${e206.listFocusAndSelectionBackground}; }
			`), e206.listFocusAndSelectionForeground && n10.push(`
				.monaco-drag-image${t10},
				.monaco-list${t10}:focus .monaco-list-row.selected.focused { color: ${e206.listFocusAndSelectionForeground}; }
			`), e206.listInactiveFocusForeground && (n10.push(`.monaco-list${t10} .monaco-list-row.focused { color:  ${e206.listInactiveFocusForeground}; }`), n10.push(`.monaco-list${t10} .monaco-list-row.focused:hover { color:  ${e206.listInactiveFocusForeground}; }`)), e206.listInactiveSelectionIconForeground && n10.push(`.monaco-list${t10} .monaco-list-row.focused .codicon { color:  ${e206.listInactiveSelectionIconForeground}; }`), e206.listInactiveFocusBackground && (n10.push(`.monaco-list${t10} .monaco-list-row.focused { background-color:  ${e206.listInactiveFocusBackground}; }`), n10.push(`.monaco-list${t10} .monaco-list-row.focused:hover { background-color:  ${e206.listInactiveFocusBackground}; }`)), e206.listInactiveSelectionBackground && (n10.push(`.monaco-list${t10} .monaco-list-row.selected { background-color:  ${e206.listInactiveSelectionBackground}; }`), n10.push(`.monaco-list${t10} .monaco-list-row.selected:hover { background-color:  ${e206.listInactiveSelectionBackground}; }`)), e206.listInactiveSelectionForeground && n10.push(`.monaco-list${t10} .monaco-list-row.selected { color: ${e206.listInactiveSelectionForeground}; }`), e206.listHoverBackground && n10.push(`.monaco-list${t10}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e206.listHoverBackground}; }`), e206.listHoverForeground && n10.push(`.monaco-list${t10}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color:  ${e206.listHoverForeground}; }`);
    let r10 = mI(e206.listFocusAndSelectionOutline, mI(e206.listSelectionOutline, e206.listFocusOutline ?? ``));
    r10 && n10.push(`.monaco-list${t10}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r10}; outline-offset: -1px;}`), e206.listFocusOutline && n10.push(`
				.monaco-drag-image${t10},
				.monaco-list${t10}:focus .monaco-list-row.focused,
				.context-menu-visible .monaco-list${t10}.last-focused .monaco-list-row.focused { outline: 1px solid ${e206.listFocusOutline}; outline-offset: -1px; }
			`);
    let i10 = mI(e206.listSelectionOutline, e206.listInactiveFocusOutline ?? ``);
    i10 && n10.push(`.monaco-list${t10} .monaco-list-row.focused.selected { outline: 1px dotted ${i10}; outline-offset: -1px; }`), e206.listSelectionOutline && n10.push(`.monaco-list${t10} .monaco-list-row.selected { outline: 1px dotted ${e206.listSelectionOutline}; outline-offset: -1px; }`), e206.listInactiveFocusOutline && n10.push(`.monaco-list${t10} .monaco-list-row.focused { outline: 1px dotted ${e206.listInactiveFocusOutline}; outline-offset: -1px; }`), e206.listHoverOutline && n10.push(`.monaco-list${t10} .monaco-list-row:hover { outline: 1px dashed ${e206.listHoverOutline}; outline-offset: -1px; }`), e206.listDropOverBackground && n10.push(`
				.monaco-list${t10}.drop-target,
				.monaco-list${t10} .monaco-list-rows.drop-target,
				.monaco-list${t10} .monaco-list-row.drop-target { background-color: ${e206.listDropOverBackground} !important; color: inherit !important; }
			`), e206.listDropBetweenBackground && (n10.push(`
			.monaco-list${t10} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,
			.monaco-list${t10} .monaco-list-row.drop-target-before::before {
				content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;
				background-color: ${e206.listDropBetweenBackground};
			}`), n10.push(`
			.monaco-list${t10} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,
			.monaco-list${t10} .monaco-list-row.drop-target-after::after {
				content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;
				background-color: ${e206.listDropBetweenBackground};
			}`)), e206.tableColumnsBorder && n10.push(`
				.monaco-table > .monaco-split-view2,
				.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
				.monaco-enable-motion .monaco-table:hover > .monaco-split-view2,
				.monaco-enable-motion .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
					border-color: ${e206.tableColumnsBorder};
				}

				.monaco-enable-motion .monaco-table > .monaco-split-view2,
				.monaco-enable-motion .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
					border-color: transparent;
				}
			`), e206.tableOddRowsBackgroundColor && n10.push(`
				.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
				.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
				.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
					background-color: ${e206.tableOddRowsBackgroundColor};
				}
			`), this.styleElement.textContent = n10.join(`
`);
  }
}, Vge = { listFocusBackground: `#7FB0D0`, listActiveSelectionBackground: `#0E639C`, listActiveSelectionForeground: `#FFFFFF`, listActiveSelectionIconForeground: `#FFFFFF`, listFocusAndSelectionOutline: `#90C2F9`, listFocusAndSelectionBackground: `#094771`, listFocusAndSelectionForeground: `#FFFFFF`, listInactiveSelectionBackground: `#3F3F46`, listInactiveSelectionIconForeground: `#FFFFFF`, listHoverBackground: `#2A2D2E`, listDropOverBackground: `#383B3D`, listDropBetweenBackground: `#EEEEEE`, treeIndentGuidesStroke: `#a9a9a9`, treeInactiveIndentGuidesStroke: Y.fromHex(`#a9a9a9`).transparent(0.4).toString(), tableColumnsBorder: Y.fromHex(`#cccccc`).transparent(0.2).toString(), tableOddRowsBackgroundColor: Y.fromHex(`#cccccc`).transparent(0.04).toString(), listBackground: void 0, listFocusForeground: void 0, listInactiveSelectionForeground: void 0, listInactiveFocusForeground: void 0, listInactiveFocusBackground: void 0, listHoverForeground: void 0, listFocusOutline: void 0, listInactiveFocusOutline: void 0, listSelectionOutline: void 0, listHoverOutline: void 0, treeStickyScrollBackground: void 0, treeStickyScrollBorder: void 0, treeStickyScrollShadow: void 0 }, Hge = { keyboardSupport: true, mouseSupport: true, multipleSelectionSupport: true, dnd: { getDragURI() {
  return null;
}, onDragStart() {
}, onDragOver() {
  return false;
}, drop() {
}, dispose() {
} } };
function Uge(e206, t10) {
  let n10 = e206.indexOf(t10);
  if (n10 === -1) return [];
  let r10 = [], i10 = n10 - 1;
  for (; i10 >= 0 && e206[i10] === t10 - (n10 - i10); ) r10.push(e206[i10--]);
  for (r10.reverse(), i10 = n10; i10 < e206.length && e206[i10] === t10 + (i10 - n10); ) r10.push(e206[i10++]);
  return r10;
}
function ZI(e206, t10) {
  let n10 = [], r10 = 0, i10 = 0;
  for (; r10 < e206.length || i10 < t10.length; ) if (r10 >= e206.length) n10.push(t10[i10++]);
  else if (i10 >= t10.length) n10.push(e206[r10++]);
  else if (e206[r10] === t10[i10]) {
    n10.push(e206[r10]), r10++, i10++;
    continue;
  } else e206[r10] < t10[i10] ? n10.push(e206[r10++]) : n10.push(t10[i10++]);
  return n10;
}
function Wge(e206, t10) {
  let n10 = [], r10 = 0, i10 = 0;
  for (; r10 < e206.length || i10 < t10.length; ) if (r10 >= e206.length) n10.push(t10[i10++]);
  else if (i10 >= t10.length) n10.push(e206[r10++]);
  else if (e206[r10] === t10[i10]) {
    r10++, i10++;
    continue;
  } else e206[r10] < t10[i10] ? n10.push(e206[r10++]) : i10++;
  return n10;
}
var QI = (e206, t10) => e206 - t10, Gge = class {
  constructor(e206, t10) {
    this._templateId = e206, this.renderers = t10;
  }
  get templateId() {
    return this._templateId;
  }
  renderTemplate(e206) {
    return this.renderers.map((t10) => t10.renderTemplate(e206));
  }
  renderElement(e206, t10, n10, r10) {
    let i10 = 0;
    for (let a10 of this.renderers) a10.renderElement(e206, t10, n10[i10++], r10);
  }
  disposeElement(e206, t10, n10, r10) {
    let i10 = 0;
    for (let a10 of this.renderers) a10.disposeElement?.(e206, t10, n10[i10], r10), i10 += 1;
  }
  disposeTemplate(e206) {
    let t10 = 0;
    for (let n10 of this.renderers) n10.disposeTemplate(e206[t10++]);
  }
}, Kge = class {
  constructor(e206) {
    this.accessibilityProvider = e206, this.templateId = `a18n`;
  }
  renderTemplate(e206) {
    return { container: e206, disposables: new E() };
  }
  renderElement(e206, t10, n10) {
    let r10 = this.accessibilityProvider.getAriaLabel(e206), i10 = r10 && typeof r10 != `string` ? r10 : FI(r10);
    n10.disposables.add(hc((e207) => {
      this.setAriaLabel(e207.readObservable(i10), n10.container);
    }));
    let a10 = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(e206);
    typeof a10 == `number` ? n10.container.setAttribute(`aria-level`, `${a10}`) : n10.container.removeAttribute(`aria-level`);
  }
  setAriaLabel(e206, t10) {
    e206 ? t10.setAttribute(`aria-label`, e206) : t10.removeAttribute(`aria-label`);
  }
  disposeElement(e206, t10, n10) {
    n10.disposables.clear();
  }
  disposeTemplate(e206) {
    e206.disposables.dispose();
  }
}, qge = class {
  constructor(e206, t10) {
    this.list = e206, this.dnd = t10;
  }
  getDragElements(e206) {
    let t10 = this.list.getSelectedElements();
    return t10.indexOf(e206) > -1 ? t10 : [e206];
  }
  getDragURI(e206) {
    return this.dnd.getDragURI(e206);
  }
  getDragLabel(e206, t10) {
    if (this.dnd.getDragLabel) return this.dnd.getDragLabel(e206, t10);
  }
  onDragStart(e206, t10) {
    this.dnd.onDragStart?.(e206, t10);
  }
  onDragOver(e206, t10, n10, r10, i10) {
    return this.dnd.onDragOver(e206, t10, n10, r10, i10);
  }
  onDragLeave(e206, t10, n10, r10) {
    this.dnd.onDragLeave?.(e206, t10, n10, r10);
  }
  onDragEnd(e206) {
    this.dnd.onDragEnd?.(e206);
  }
  drop(e206, t10, n10, r10, i10) {
    this.dnd.drop(e206, t10, n10, r10, i10);
  }
  dispose() {
    this.dnd.dispose();
  }
}, $I = class {
  get onDidChangeFocus() {
    return O.map(this.eventBufferer.wrapEvent(this.focus.onChange), (e206) => this.toListEvent(e206), this.disposables);
  }
  get onDidChangeSelection() {
    return O.map(this.eventBufferer.wrapEvent(this.selection.onChange), (e206) => this.toListEvent(e206), this.disposables);
  }
  get domId() {
    return this.view.domId;
  }
  get onDidScroll() {
    return this.view.onDidScroll;
  }
  get onMouseClick() {
    return this.view.onMouseClick;
  }
  get onMouseDblClick() {
    return this.view.onMouseDblClick;
  }
  get onMouseMiddleClick() {
    return this.view.onMouseMiddleClick;
  }
  get onPointer() {
    return this.mouseController.onPointer;
  }
  get onMouseDown() {
    return this.view.onMouseDown;
  }
  get onMouseOver() {
    return this.view.onMouseOver;
  }
  get onMouseOut() {
    return this.view.onMouseOut;
  }
  get onTouchStart() {
    return this.view.onTouchStart;
  }
  get onTap() {
    return this.view.onTap;
  }
  get onContextMenu() {
    let e206 = false, t10 = O.chain(this.disposables.add(new yx(this.view.domNode, `keydown`)).event, (t11) => t11.map((e207) => new Jo(e207)).filter((t12) => e206 = t12.keyCode === 58 || t12.shiftKey && t12.keyCode === 68).map((e207) => Vl.stop(e207, true)).filter(() => false)), n10 = O.chain(this.disposables.add(new yx(this.view.domNode, `keyup`)).event, (t11) => t11.forEach(() => e206 = false).map((e207) => new Jo(e207)).filter((e207) => e207.keyCode === 58 || e207.shiftKey && e207.keyCode === 68).map((e207) => Vl.stop(e207, true)).map(({ browserEvent: e207 }) => {
      let t12 = this.getFocus(), n11 = t12.length ? t12[0] : void 0;
      return { index: n11, element: n11 === void 0 ? void 0 : this.view.element(n11), anchor: n11 === void 0 ? this.view.domNode : this.view.domElement(n11), browserEvent: e207 };
    })), r10 = O.chain(this.view.onContextMenu, (t11) => t11.filter((t12) => !e206).map(({ element: e207, index: t12, browserEvent: n11 }) => ({ element: e207, index: t12, anchor: new Xo(Vc(this.view.domNode), n11), browserEvent: n11 })));
    return O.any(t10, n10, r10);
  }
  get onKeyDown() {
    return this.disposables.add(new yx(this.view.domNode, `keydown`)).event;
  }
  get onDidFocus() {
    return O.signal(this.disposables.add(new yx(this.view.domNode, `focus`, true)).event);
  }
  get onDidBlur() {
    return O.signal(this.disposables.add(new yx(this.view.domNode, `blur`, true)).event);
  }
  constructor(e206, t10, n10, r10, i10 = Hge) {
    this.user = e206, this._options = i10, this.focus = new LI(`focused`), this.anchor = new LI(`anchor`), this.eventBufferer = new dn(), this._ariaLabel = ``, this.disposables = new E(), this._onDidDispose = new k(), this.onDidDispose = this._onDidDispose.event;
    let a10 = this._options.accessibilityProvider && this._options.accessibilityProvider.getWidgetRole ? this._options.accessibilityProvider?.getWidgetRole() : `list`;
    this.selection = new Nge(a10 !== `listbox`);
    let o10 = [this.focus.renderer, this.selection.renderer];
    this.accessibilityProvider = i10.accessibilityProvider, this.accessibilityProvider && (o10.push(new Kge(this.accessibilityProvider)), this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant, this, this.disposables)), r10 = r10.map((e207) => new Gge(e207.templateId, [...o10, e207]));
    let s10 = { ...i10, dnd: i10.dnd && new qge(this, i10.dnd) };
    if (this.view = this.createListView(t10, n10, r10, s10), this.view.domNode.setAttribute(`role`, a10), i10.styleController ? this.styleController = i10.styleController(this.view.domId) : this.styleController = new Bge(g_(this.view.domNode), this.view.domId), this.spliceable = new xge([new RI(this.focus, this.view, i10.identityProvider), new RI(this.selection, this.view, i10.identityProvider), new RI(this.anchor, this.view, i10.identityProvider), this.view]), this.disposables.add(this.focus), this.disposables.add(this.selection), this.disposables.add(this.anchor), this.disposables.add(this.view), this.disposables.add(this._onDidDispose), this.disposables.add(new Rge(this, this.view)), (typeof i10.keyboardSupport != `boolean` || i10.keyboardSupport) && (this.keyboardController = new WI(this, this.view, i10), this.disposables.add(this.keyboardController)), i10.keyboardNavigationLabelProvider) {
      let e207 = i10.keyboardNavigationDelegate || Ige;
      this.typeNavigationController = new Lge(this, this.view, i10.keyboardNavigationLabelProvider, i10.keyboardNavigationEventFilter ?? (() => true), e207), this.disposables.add(this.typeNavigationController);
    }
    if (this.mouseController = this.createMouseController(i10), this.disposables.add(this.mouseController), this.onDidChangeFocus(this._onFocusChange, this, this.disposables), this.onDidChangeSelection(this._onSelectionChange, this, this.disposables), this.accessibilityProvider) {
      let e207 = this.accessibilityProvider.getWidgetAriaLabel(), t11 = e207 && typeof e207 != `string` ? e207 : FI(e207);
      this.disposables.add(hc((e208) => {
        this.ariaLabel = e208.readObservable(t11);
      }));
    }
    this._options.multipleSelectionSupport !== false && this.view.domNode.setAttribute(`aria-multiselectable`, `true`);
  }
  createListView(e206, t10, n10, r10) {
    return new PI(e206, t10, n10, r10);
  }
  createMouseController(e206) {
    return new XI(this);
  }
  updateOptions(e206 = {}) {
    this._options = { ...this._options, ...e206 }, this.typeNavigationController?.updateOptions(this._options), this._options.multipleSelectionController !== void 0 && (this._options.multipleSelectionSupport ? this.view.domNode.setAttribute(`aria-multiselectable`, `true`) : this.view.domNode.removeAttribute(`aria-multiselectable`)), this.mouseController.updateOptions(e206), this.keyboardController?.updateOptions(e206), this.view.updateOptions(e206);
  }
  get options() {
    return this._options;
  }
  splice(e206, t10, n10 = []) {
    if (e206 < 0 || e206 > this.view.length) throw new DI(this.user, `Invalid start index: ${e206}`);
    if (t10 < 0) throw new DI(this.user, `Invalid delete count: ${t10}`);
    t10 === 0 && n10.length === 0 || this.eventBufferer.bufferEvents(() => this.spliceable.splice(e206, t10, n10));
  }
  rerender() {
    this.view.rerender();
  }
  element(e206) {
    return this.view.element(e206);
  }
  indexOf(e206) {
    return this.view.indexOf(e206);
  }
  indexAt(e206) {
    return this.view.indexAt(e206);
  }
  get length() {
    return this.view.length;
  }
  get contentHeight() {
    return this.view.contentHeight;
  }
  get onDidChangeContentHeight() {
    return this.view.onDidChangeContentHeight;
  }
  get scrollTop() {
    return this.view.getScrollTop();
  }
  set scrollTop(e206) {
    this.view.setScrollTop(e206);
  }
  get scrollHeight() {
    return this.view.scrollHeight;
  }
  get renderHeight() {
    return this.view.renderHeight;
  }
  get firstVisibleIndex() {
    return this.view.firstVisibleIndex;
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  set ariaLabel(e206) {
    this._ariaLabel = e206, this.view.domNode.setAttribute(`aria-label`, e206);
  }
  domFocus() {
    this.view.domNode.focus({ preventScroll: true });
  }
  layout(e206, t10) {
    this.view.layout(e206, t10);
  }
  setSelection(e206, t10) {
    for (let t11 of e206) if (t11 < 0 || t11 >= this.length) throw new DI(this.user, `Invalid index ${t11}`);
    this.selection.set(e206, t10);
  }
  getSelection() {
    return this.selection.get();
  }
  getSelectedElements() {
    return this.getSelection().map((e206) => this.view.element(e206));
  }
  setAnchor(e206) {
    if (e206 === void 0) {
      this.anchor.set([]);
      return;
    }
    if (e206 < 0 || e206 >= this.length) throw new DI(this.user, `Invalid index ${e206}`);
    this.anchor.set([e206]);
  }
  getAnchor() {
    return this.anchor.get().at(0);
  }
  getAnchorElement() {
    let e206 = this.getAnchor();
    return e206 === void 0 ? void 0 : this.element(e206);
  }
  setFocus(e206, t10) {
    for (let t11 of e206) if (t11 < 0 || t11 >= this.length) throw new DI(this.user, `Invalid index ${t11}`);
    this.focus.set(e206, t10);
  }
  focusNext(e206 = 1, t10 = false, n10, r10) {
    if (this.length === 0) return;
    let i10 = this.focus.get(), a10 = this.findNextIndex(i10.length > 0 ? i10[0] + e206 : 0, t10, r10);
    a10 > -1 && this.setFocus([a10], n10);
  }
  focusPrevious(e206 = 1, t10 = false, n10, r10) {
    if (this.length === 0) return;
    let i10 = this.focus.get(), a10 = this.findPreviousIndex(i10.length > 0 ? i10[0] - e206 : 0, t10, r10);
    a10 > -1 && this.setFocus([a10], n10);
  }
  async focusNextPage(e206, t10) {
    let n10 = this.view.indexAt(this.view.getScrollTop() + this.view.renderHeight);
    n10 = n10 === 0 ? 0 : n10 - 1;
    let r10 = this.getFocus()[0];
    if (r10 !== n10 && (r10 === void 0 || n10 > r10)) {
      let i10 = this.findPreviousIndex(n10, false, t10);
      i10 > -1 && r10 !== i10 ? this.setFocus([i10], e206) : this.setFocus([n10], e206);
    } else {
      let i10 = this.view.getScrollTop(), a10 = i10 + this.view.renderHeight;
      n10 > r10 && (a10 -= this.view.elementHeight(n10)), this.view.setScrollTop(a10), this.view.getScrollTop() !== i10 && (this.setFocus([]), await is(0), await this.focusNextPage(e206, t10));
    }
  }
  async focusPreviousPage(e206, t10, n10 = () => 0) {
    let r10, i10 = n10(), a10 = this.view.getScrollTop() + i10;
    r10 = a10 === 0 ? this.view.indexAt(a10) : this.view.indexAfter(a10 - 1);
    let o10 = this.getFocus()[0];
    if (o10 !== r10 && (o10 === void 0 || o10 >= r10)) {
      let n11 = this.findNextIndex(r10, false, t10);
      n11 > -1 && o10 !== n11 ? this.setFocus([n11], e206) : this.setFocus([r10], e206);
    } else {
      let r11 = a10;
      this.view.setScrollTop(a10 - this.view.renderHeight - i10), this.view.getScrollTop() + n10() !== r11 && (this.setFocus([]), await is(0), await this.focusPreviousPage(e206, t10, n10));
    }
  }
  focusLast(e206, t10) {
    if (this.length === 0) return;
    let n10 = this.findPreviousIndex(this.length - 1, false, t10);
    n10 > -1 && this.setFocus([n10], e206);
  }
  focusFirst(e206, t10) {
    this.focusNth(0, e206, t10);
  }
  focusNth(e206, t10, n10) {
    if (this.length === 0) return;
    let r10 = this.findNextIndex(e206, false, n10);
    r10 > -1 && this.setFocus([r10], t10);
  }
  findNextIndex(e206, t10 = false, n10) {
    for (let r10 = 0; r10 < this.length; r10++) {
      if (e206 >= this.length && !t10) return -1;
      if (e206 %= this.length, !n10 || n10(this.element(e206))) return e206;
      e206++;
    }
    return -1;
  }
  findPreviousIndex(e206, t10 = false, n10) {
    for (let r10 = 0; r10 < this.length; r10++) {
      if (e206 < 0 && !t10) return -1;
      if (e206 = (this.length + e206 % this.length) % this.length, !n10 || n10(this.element(e206))) return e206;
      e206--;
    }
    return -1;
  }
  getFocus() {
    return this.focus.get();
  }
  getFocusedElements() {
    return this.getFocus().map((e206) => this.view.element(e206));
  }
  reveal(e206, t10, n10 = 0) {
    if (e206 < 0 || e206 >= this.length) throw new DI(this.user, `Invalid index ${e206}`);
    let r10 = this.view.getScrollTop(), i10 = this.view.elementTop(e206), a10 = this.view.elementHeight(e206);
    if (He(t10)) {
      let e207 = a10 - this.view.renderHeight + n10;
      this.view.setScrollTop(e207 * rA(t10, 0, 1) + i10 - n10);
    } else {
      let e207 = i10 + a10, t11 = r10 + this.view.renderHeight;
      i10 < r10 + n10 && e207 >= t11 || (i10 < r10 + n10 || e207 >= t11 && a10 >= this.view.renderHeight ? this.view.setScrollTop(i10 - n10) : e207 >= t11 && this.view.setScrollTop(e207 - this.view.renderHeight));
    }
  }
  getRelativeTop(e206, t10 = 0) {
    if (e206 < 0 || e206 >= this.length) throw new DI(this.user, `Invalid index ${e206}`);
    let n10 = this.view.getScrollTop(), r10 = this.view.elementTop(e206), i10 = this.view.elementHeight(e206);
    if (r10 < n10 + t10 || r10 + i10 > n10 + this.view.renderHeight) return null;
    let a10 = i10 - this.view.renderHeight + t10;
    return Math.abs((n10 + t10 - r10) / a10);
  }
  getHTMLElement() {
    return this.view.domNode;
  }
  getScrollableElement() {
    return this.view.scrollableElementDomNode;
  }
  getElementID(e206) {
    return this.view.getElementDomId(e206);
  }
  getElementTop(e206) {
    return this.view.elementTop(e206);
  }
  style(e206) {
    this.styleController.style(e206);
  }
  toListEvent({ indexes: e206, browserEvent: t10 }) {
    return { indexes: e206, elements: e206.map((e207) => this.view.element(e207)), browserEvent: t10 };
  }
  _onFocusChange() {
    let e206 = this.focus.get();
    this.view.domNode.classList.toggle(`element-focused`, e206.length > 0), this.onDidChangeActiveDescendant();
  }
  onDidChangeActiveDescendant() {
    let e206 = this.focus.get();
    if (e206.length > 0) {
      let t10;
      this.accessibilityProvider?.getActiveDescendantId && (t10 = this.accessibilityProvider.getActiveDescendantId(this.view.element(e206[0]))), this.view.domNode.setAttribute(`aria-activedescendant`, t10 || this.view.getElementDomId(e206[0]));
    } else this.view.domNode.removeAttribute(`aria-activedescendant`);
  }
  _onSelectionChange() {
    let e206 = this.selection.get();
    this.view.domNode.classList.toggle(`selection-none`, e206.length === 0), this.view.domNode.classList.toggle(`selection-single`, e206.length === 1), this.view.domNode.classList.toggle(`selection-multiple`, e206.length > 1);
  }
  dispose() {
    this._onDidDispose.fire(), this.disposables.dispose(), this._onDidDispose.dispose();
  }
};
II([ex], $I.prototype, `onDidChangeFocus`, null), II([ex], $I.prototype, `onDidChangeSelection`, null), II([ex], $I.prototype, `onContextMenu`, null), II([ex], $I.prototype, `onKeyDown`, null), II([ex], $I.prototype, `onDidFocus`, null), II([ex], $I.prototype, `onDidBlur`, null);
var eL = B, tL = `selectOption.entry.template`, Jge = class {
  get templateId() {
    return tL;
  }
  renderTemplate(e206) {
    let t10 = /* @__PURE__ */ Object.create(null);
    return t10.root = e206, t10.text = z(e206, eL(`.option-text`)), t10.detail = z(e206, eL(`.option-detail`)), t10.decoratorRight = z(e206, eL(`.option-decorator-right`)), t10;
  }
  renderElement(e206, t10, n10) {
    let r10 = n10, i10 = e206.text, a10 = e206.detail, o10 = e206.decoratorRight, s10 = e206.isDisabled;
    r10.text.textContent = i10, r10.detail.textContent = a10 || ``, r10.decoratorRight.textContent = o10 || ``, s10 ? r10.root.classList.add(`option-disabled`) : r10.root.classList.remove(`option-disabled`);
  }
  disposeTemplate(e206) {
  }
}, Yge = (_Va = class extends D {
  constructor(t10, n10, r10, i10, a10) {
    super(), this.options = [], this._currentSelection = 0, this._hasDetails = false, this._selectionDetailsDisposables = this._register(new E()), this._skipLayout = false, this._sticky = false, this._isVisible = false, this.styles = i10, this.selectBoxOptions = a10 || /* @__PURE__ */ Object.create(null), typeof this.selectBoxOptions.minBottomMargin == `number` ? this.selectBoxOptions.minBottomMargin < 0 && (this.selectBoxOptions.minBottomMargin = 0) : this.selectBoxOptions.minBottomMargin = _Va.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN, this.selectElement = document.createElement(`select`), this.selectElement.className = `monaco-select-box monaco-select-box-dropdown-padding`, typeof this.selectBoxOptions.ariaLabel == `string` && this.selectElement.setAttribute(`aria-label`, this.selectBoxOptions.ariaLabel), typeof this.selectBoxOptions.ariaDescription == `string` && this.selectElement.setAttribute(`aria-description`, this.selectBoxOptions.ariaDescription), this._onDidSelect = new k(), this._register(this._onDidSelect), this.registerListeners(), this.constructSelectDropDown(r10), this.selected = n10 || 0, t10 && this.setOptions(t10, n10), this.initStyleSheet();
  }
  setTitle(e206) {
    !this._hover && e206 ? this._hover = this._register(EI().setupManagedHover(CI(`mouse`), this.selectElement, e206)) : this._hover && this._hover.update(e206);
  }
  getHeight() {
    return 22;
  }
  getTemplateId() {
    return tL;
  }
  constructSelectDropDown(e206) {
    this.contextViewProvider = e206, this.selectDropDownContainer = B(`.monaco-select-box-dropdown-container`), this.selectDropDownContainer.classList.add(`monaco-select-box-dropdown-padding`), this.selectionDetailsPane = z(this.selectDropDownContainer, eL(`.select-box-details-pane`));
    let t10 = z(z(this.selectDropDownContainer, eL(`.select-box-dropdown-container-width-control`)), eL(`.width-control-div`));
    this.widthControlElement = document.createElement(`span`), this.widthControlElement.className = `option-text-width-control`, z(t10, this.widthControlElement), this._dropDownPosition = 0, this.styleElement = g_(this.selectDropDownContainer), this.selectDropDownContainer.setAttribute(`draggable`, `true`), this._register(L(this.selectDropDownContainer, R.DRAG_START, (e207) => {
      Vl.stop(e207, true);
    }));
  }
  registerListeners() {
    this._register(el(this.selectElement, `change`, (e207) => {
      this.selected = e207.target.selectedIndex, this._onDidSelect.fire({ index: e207.target.selectedIndex, selected: e207.target.value }), this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text);
    })), this._register(L(this.selectElement, R.CLICK, (e207) => {
      Vl.stop(e207), this._isVisible ? this.hideSelectDropDown(true) : this.showSelectDropDown();
    })), this._register(L(this.selectElement, R.MOUSE_DOWN, (e207) => {
      Vl.stop(e207);
    }));
    let e206;
    this._register(L(this.selectElement, `touchstart`, (t10) => {
      e206 = this._isVisible;
    })), this._register(L(this.selectElement, `touchend`, (t10) => {
      Vl.stop(t10), e206 ? this.hideSelectDropDown(true) : this.showSelectDropDown();
    })), this._register(L(this.selectElement, R.KEY_DOWN, (e207) => {
      let t10 = new Jo(e207), n10 = false;
      Tt ? (t10.keyCode === 18 || t10.keyCode === 16 || t10.keyCode === 10 || t10.keyCode === 3) && (n10 = true) : (t10.keyCode === 18 && t10.altKey || t10.keyCode === 16 && t10.altKey || t10.keyCode === 10 || t10.keyCode === 3) && (n10 = true), n10 && (this.showSelectDropDown(), Vl.stop(e207, true));
    }));
  }
  get onDidSelect() {
    return this._onDidSelect.event;
  }
  setOptions(e206, t10) {
    o(this.options, e206) || (this.options = e206, this.selectElement.options.length = 0, this._hasDetails = false, this._cachedMaxDetailsHeight = void 0, this.options.forEach((e207, t11) => {
      this.selectElement.add(this.createOption(e207.text, t11, e207.isDisabled)), typeof e207.description == `string` && (this._hasDetails = true);
    })), t10 !== void 0 && (this.select(t10), this._currentSelection = this.selected);
  }
  setOptionsList() {
    this.selectList?.splice(0, this.selectList.length, this.options);
  }
  select(e206) {
    e206 >= 0 && e206 < this.options.length ? this.selected = e206 : e206 > this.options.length - 1 ? this.select(this.options.length - 1) : this.selected < 0 && (this.selected = 0), this.selectElement.selectedIndex = this.selected, this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text);
  }
  focus() {
    this.selectElement && (this.selectElement.tabIndex = 0, this.selectElement.focus());
  }
  blur() {
    this.selectElement && (this.selectElement.tabIndex = -1, this.selectElement.blur());
  }
  setFocusable(e206) {
    this.selectElement.tabIndex = e206 ? 0 : -1;
  }
  render(e206) {
    this.container = e206, e206.classList.add(`select-container`), e206.appendChild(this.selectElement), this.styleSelectElement();
  }
  initStyleSheet() {
    let e206 = [];
    this.styles.listFocusBackground && e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`), this.styles.listFocusForeground && e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`), this.styles.decoratorRightForeground && e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`), this.styles.selectBackground && this.styles.selectBorder && this.styles.selectBorder !== this.styles.selectBackground ? (e206.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `), e206.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `), e206.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)) : this.styles.selectListBorder && (e206.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `), e206.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)), this.styles.listHoverForeground && e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`), this.styles.listHoverBackground && e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`), this.styles.listFocusOutline && e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`), this.styles.listHoverOutline && e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`), e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }`), e206.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }`), this.styleElement.textContent = e206.join(`
`);
  }
  styleSelectElement() {
    let e206 = this.styles.selectBackground ?? ``, t10 = this.styles.selectForeground ?? ``, n10 = this.styles.selectBorder ?? ``;
    this.selectElement.style.backgroundColor = e206, this.selectElement.style.color = t10, this.selectElement.style.borderColor = n10;
  }
  styleList() {
    let e206 = this.styles.selectBackground ?? ``, t10 = mI(this.styles.selectListBackground, e206);
    this.selectDropDownListContainer.style.backgroundColor = t10, this.selectionDetailsPane.style.backgroundColor = t10;
    let n10 = this.styles.focusBorder ?? ``;
    this.selectDropDownContainer.style.outlineColor = n10, this.selectDropDownContainer.style.outlineOffset = `-1px`, this.selectList.style(this.styles);
  }
  createOption(e206, t10, n10) {
    let r10 = document.createElement(`option`);
    return r10.value = e206, r10.text = e206, r10.disabled = !!n10, r10;
  }
  showSelectDropDown() {
    this.selectionDetailsPane.textContent = ``, !(!this.contextViewProvider || this._isVisible) && (this.createSelectList(this.selectDropDownContainer), this.setOptionsList(), this.contextViewProvider.showContextView({ getAnchor: () => this.selectElement, render: (e206) => this.renderSelectDropDown(e206, true), layout: () => {
      this.layoutSelectDropDown();
    }, onHide: () => {
      this.selectDropDownContainer.classList.remove(`visible`), this.selectElement.classList.remove(`synthetic-focus`);
    }, anchorPosition: this._dropDownPosition }, this.selectBoxOptions.optionsAsChildren ? this.container : void 0), this._isVisible = true, this.hideSelectDropDown(false), this.contextViewProvider.showContextView({ getAnchor: () => this.selectElement, render: (e206) => this.renderSelectDropDown(e206), layout: () => this.layoutSelectDropDown(), onHide: () => {
      this.selectDropDownContainer.classList.remove(`visible`), this.selectElement.classList.remove(`synthetic-focus`);
    }, anchorPosition: this._dropDownPosition }, this.selectBoxOptions.optionsAsChildren ? this.container : void 0), this._currentSelection = this.selected, this._isVisible = true, this.selectElement.setAttribute(`aria-expanded`, `true`));
  }
  hideSelectDropDown(e206) {
    !this.contextViewProvider || !this._isVisible || (this._isVisible = false, this.selectElement.setAttribute(`aria-expanded`, `false`), e206 && this.selectElement.focus(), this.contextViewProvider.hideContextView());
  }
  renderSelectDropDown(e206, t10) {
    return e206.appendChild(this.selectDropDownContainer), this.layoutSelectDropDown(t10), { dispose: () => {
      this.selectDropDownContainer.remove();
    } };
  }
  measureMaxDetailsHeight() {
    let e206 = 0;
    return this.options.forEach((t10, n10) => {
      this.updateDetail(n10), this.selectionDetailsPane.offsetHeight > e206 && (e206 = this.selectionDetailsPane.offsetHeight);
    }), e206;
  }
  layoutSelectDropDown(t10) {
    if (this._skipLayout) return false;
    if (this.selectList) {
      this.selectDropDownContainer.classList.add(`visible`);
      let n10 = Vc(this.selectElement), r10 = _l2(this.selectElement), i10 = Vc(this.selectElement).getComputedStyle(this.selectElement), a10 = parseFloat(i10.getPropertyValue(`--dropdown-padding-top`)) + parseFloat(i10.getPropertyValue(`--dropdown-padding-bottom`)), o10 = n10.innerHeight - r10.top - r10.height - (this.selectBoxOptions.minBottomMargin || 0), s10 = r10.top - _Va.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN, c10 = this.selectElement.offsetWidth, l10 = this.setWidthControlElement(this.widthControlElement), u10 = Math.max(l10, Math.round(c10)).toString() + `px`;
      this.selectDropDownContainer.style.width = u10, this.selectList.getHTMLElement().style.height = ``, this.selectList.layout();
      let d10 = this.selectList.contentHeight;
      this._hasDetails && this._cachedMaxDetailsHeight === void 0 && (this._cachedMaxDetailsHeight = this.measureMaxDetailsHeight());
      let f10 = this._hasDetails ? this._cachedMaxDetailsHeight : 0, p10 = d10 + a10 + f10, m10 = Math.floor((o10 - a10 - f10) / this.getHeight()), h10 = Math.floor((s10 - a10 - f10) / this.getHeight());
      if (t10) return r10.top + r10.height > n10.innerHeight - 22 || r10.top < _Va.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN || m10 < 1 && h10 < 1 ? false : (m10 < _Va.DEFAULT_MINIMUM_VISIBLE_OPTIONS && h10 > m10 && this.options.length > m10 ? (this._dropDownPosition = 1, this.selectDropDownListContainer.remove(), this.selectionDetailsPane.remove(), this.selectDropDownContainer.appendChild(this.selectionDetailsPane), this.selectDropDownContainer.appendChild(this.selectDropDownListContainer), this.selectionDetailsPane.classList.remove(`border-top`), this.selectionDetailsPane.classList.add(`border-bottom`)) : (this._dropDownPosition = 0, this.selectDropDownListContainer.remove(), this.selectionDetailsPane.remove(), this.selectDropDownContainer.appendChild(this.selectDropDownListContainer), this.selectDropDownContainer.appendChild(this.selectionDetailsPane), this.selectionDetailsPane.classList.remove(`border-bottom`), this.selectionDetailsPane.classList.add(`border-top`)), true);
      if (r10.top + r10.height > n10.innerHeight - 22 || r10.top < _Va.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN || this._dropDownPosition === 0 && m10 < 1 || this._dropDownPosition === 1 && h10 < 1) return this.hideSelectDropDown(true), false;
      if (this._dropDownPosition === 0) {
        if (this._isVisible && m10 + h10 < 1) return this.hideSelectDropDown(true), false;
        p10 > o10 && (d10 = m10 * this.getHeight());
      } else p10 > s10 && (d10 = h10 * this.getHeight());
      return this.selectList.layout(d10), this.selectList.domFocus(), this.selectList.length > 0 && (this.selectList.setFocus([this.selected || 0]), this.selectList.reveal(this.selectList.getFocus()[0] || 0)), this._hasDetails ? (this.selectList.getHTMLElement().style.height = d10 + a10 + `px`, this.selectDropDownContainer.style.height = ``) : this.selectDropDownContainer.style.height = d10 + a10 + `px`, this.updateDetail(this.selected), this.selectDropDownContainer.style.width = u10, this.selectDropDownListContainer.setAttribute(`tabindex`, `0`), this.selectElement.classList.add(`synthetic-focus`), this.selectDropDownContainer.classList.add(`synthetic-focus`), true;
    } else return false;
  }
  setWidthControlElement(e206) {
    let t10 = 0;
    if (e206) {
      let n10 = 0, r10 = 0;
      this.options.forEach((e207, t11) => {
        let i10 = e207.detail ? e207.detail.length : 0, a10 = e207.decoratorRight ? e207.decoratorRight.length : 0, o10 = e207.text.length + i10 + a10;
        o10 > r10 && (n10 = t11, r10 = o10);
      }), e206.textContent = this.options[n10].text + (this.options[n10].decoratorRight ? this.options[n10].decoratorRight + ` ` : ``), t10 = yl(e206);
    }
    return t10;
  }
  createSelectList(e206) {
    if (this.selectList) return;
    this.selectDropDownListContainer = z(e206, eL(`.select-box-dropdown-list-container`)), this.listRenderer = new Jge(), this.selectList = this._register(new $I(`SelectBoxCustom`, this.selectDropDownListContainer, this, [this.listRenderer], { useShadows: false, verticalScrollMode: 3, keyboardSupport: false, mouseSupport: false, accessibilityProvider: { getAriaLabel: (e207) => {
      let t11 = e207.text;
      return e207.detail && (t11 += `. ${e207.detail}`), e207.decoratorRight && (t11 += `. ${e207.decoratorRight}`), e207.description && (t11 += `. ${e207.description}`), t11;
    }, getWidgetAriaLabel: () => C(16, `Select Box`), getRole: () => Tt ? `` : `option`, getWidgetRole: () => `listbox` } })), this.selectBoxOptions.ariaLabel && (this.selectList.ariaLabel = this.selectBoxOptions.ariaLabel);
    let t10 = this._register(new yx(this.selectDropDownListContainer, `keydown`)), n10 = O.chain(t10.event, (e207) => e207.filter(() => this.selectList.length > 0).map((e208) => new Jo(e208)));
    this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 3))(this.onEnter, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 2))(this.onEnter, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 9))(this.onEscape, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 16))(this.onUpArrow, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 18))(this.onDownArrow, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 12))(this.onPageDown, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 11))(this.onPageUp, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 14))(this.onHome, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode === 13))(this.onEnd, this)), this._register(O.chain(n10, (e207) => e207.filter((e208) => e208.keyCode >= 21 && e208.keyCode <= 56 || e208.keyCode >= 85 && e208.keyCode <= 113))(this.onCharacter, this)), this._register(L(this.selectList.getHTMLElement(), R.POINTER_UP, (e207) => this.onPointerUp(e207))), this._register(this.selectList.onMouseOver((e207) => e207.index !== void 0 && this.selectList.setFocus([e207.index]))), this._register(this.selectList.onDidChangeFocus((e207) => this.onListFocus(e207))), this._register(L(this.selectDropDownContainer, R.FOCUS_OUT, (e207) => {
      !this._isVisible || Cl(e207.relatedTarget, this.selectDropDownContainer) || this.onListBlur();
    })), this.selectList.getHTMLElement().setAttribute(`aria-label`, this.selectBoxOptions.ariaLabel || ``), this.selectList.getHTMLElement().setAttribute(`aria-expanded`, `true`), this.styleList();
  }
  onPointerUp(e206) {
    if (!this.selectList.length) return;
    Vl.stop(e206);
    let t10 = e206.target;
    if (!t10 || t10.classList.contains(`slider`)) return;
    let n10 = t10.closest(`.monaco-list-row`);
    if (!n10) return;
    let r10 = Number(n10.getAttribute(`data-index`)), i10 = n10.classList.contains(`option-disabled`);
    r10 >= 0 && r10 < this.options.length && !i10 && (this.selected = r10, this.select(this.selected), this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selectList.getFocus()[0]), this.selected !== this._currentSelection && (this._currentSelection = this.selected, this._onDidSelect.fire({ index: this.selectElement.selectedIndex, selected: this.options[this.selected].text }), this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text)), this.hideSelectDropDown(true));
  }
  onListBlur() {
    this._sticky || (this.selected !== this._currentSelection && this.select(this._currentSelection), this.hideSelectDropDown(false));
  }
  renderDescriptionMarkdown(e206, t10) {
    let n10 = (e207) => {
      for (let t11 = 0; t11 < e207.childNodes.length; t11++) {
        let r11 = e207.childNodes.item(t11);
        (r11.tagName && r11.tagName.toLowerCase()) === `img` ? r11.remove() : n10(r11);
      }
    }, r10 = EP({ value: e206, supportThemeIcons: true }, { actionHandler: t10 });
    return r10.element.classList.add(`select-box-description-markdown`), n10(r10.element), r10;
  }
  onListFocus(e206) {
    !this._isVisible || !this._hasDetails || this.updateDetail(e206.indexes[0]);
  }
  updateDetail(e206) {
    this._selectionDetailsDisposables.clear(), this.selectionDetailsPane.textContent = ``;
    let t10 = this.options[e206], n10 = t10?.description ?? ``, r10 = t10?.descriptionIsMarkdown ?? false;
    if (n10) {
      if (r10) {
        let e207 = t10.descriptionMarkdownActionHandler, r11 = this._selectionDetailsDisposables.add(this.renderDescriptionMarkdown(n10, e207));
        this.selectionDetailsPane.appendChild(r11.element);
      } else this.selectionDetailsPane.textContent = n10;
      this.selectionDetailsPane.style.display = `block`;
    } else this.selectionDetailsPane.style.display = `none`;
    this._skipLayout = true, this.contextViewProvider.layout(), this._skipLayout = false;
  }
  onEscape(e206) {
    Vl.stop(e206), this.select(this._currentSelection), this.hideSelectDropDown(true);
  }
  onEnter(e206) {
    Vl.stop(e206), this.selected !== this._currentSelection && (this._currentSelection = this.selected, this._onDidSelect.fire({ index: this.selectElement.selectedIndex, selected: this.options[this.selected].text }), this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text)), this.hideSelectDropDown(true);
  }
  onDownArrow(e206) {
    if (this.selected < this.options.length - 1) {
      Vl.stop(e206, true);
      let t10 = this.options[this.selected + 1].isDisabled;
      if (t10 && this.options.length > this.selected + 2) this.selected += 2;
      else if (t10) return;
      else this.selected++;
      this.select(this.selected), this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selectList.getFocus()[0]);
    }
  }
  onUpArrow(e206) {
    this.selected > 0 && (Vl.stop(e206, true), this.options[this.selected - 1].isDisabled && this.selected > 1 ? this.selected -= 2 : this.selected--, this.select(this.selected), this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selectList.getFocus()[0]));
  }
  onPageUp(e206) {
    Vl.stop(e206), this.selectList.focusPreviousPage(), setTimeout(() => {
      this.selected = this.selectList.getFocus()[0], this.options[this.selected].isDisabled && this.selected < this.options.length - 1 && (this.selected++, this.selectList.setFocus([this.selected])), this.selectList.reveal(this.selected), this.select(this.selected);
    }, 1);
  }
  onPageDown(e206) {
    Vl.stop(e206), this.selectList.focusNextPage(), setTimeout(() => {
      this.selected = this.selectList.getFocus()[0], this.options[this.selected].isDisabled && this.selected > 0 && (this.selected--, this.selectList.setFocus([this.selected])), this.selectList.reveal(this.selected), this.select(this.selected);
    }, 1);
  }
  onHome(e206) {
    Vl.stop(e206), !(this.options.length < 2) && (this.selected = 0, this.options[this.selected].isDisabled && this.selected > 1 && this.selected++, this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selected), this.select(this.selected));
  }
  onEnd(e206) {
    Vl.stop(e206), !(this.options.length < 2) && (this.selected = this.options.length - 1, this.options[this.selected].isDisabled && this.selected > 1 && this.selected--, this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selected), this.select(this.selected));
  }
  onCharacter(e206) {
    let t10 = xr.toString(e206.keyCode), n10 = -1;
    for (let r10 = 0; r10 < this.options.length - 1; r10++) if (n10 = (r10 + this.selected + 1) % this.options.length, this.options[n10].text.charAt(0).toUpperCase() === t10 && !this.options[n10].isDisabled) {
      this.select(n10), this.selectList.setFocus([n10]), this.selectList.reveal(this.selectList.getFocus()[0]), Vl.stop(e206);
      break;
    }
  }
  dispose() {
    this.hideSelectDropDown(false), super.dispose();
  }
}, _Va.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN = 32, _Va.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN = 2, _Va.DEFAULT_MINIMUM_VISIBLE_OPTIONS = 3, _Va), Xge = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this.selected = 0, this.selectBoxOptions = r10 || /* @__PURE__ */ Object.create(null), this.options = [], this.selectElement = document.createElement(`select`), this.selectElement.className = `monaco-select-box`, typeof this.selectBoxOptions.ariaLabel == `string` && this.selectElement.setAttribute(`aria-label`, this.selectBoxOptions.ariaLabel), typeof this.selectBoxOptions.ariaDescription == `string` && this.selectElement.setAttribute(`aria-description`, this.selectBoxOptions.ariaDescription), this._onDidSelect = this._register(new k()), this.styles = n10, this.registerListeners(), this.setOptions(e206, t10);
  }
  registerListeners() {
    this._register(nx.addTarget(this.selectElement)), [tx.Tap].forEach((e206) => {
      this._register(L(this.selectElement, e206, (e207) => {
        this.selectElement.focus();
      }));
    }), this._register(el(this.selectElement, `click`, (e206) => {
      Vl.stop(e206, true);
    })), this._register(el(this.selectElement, `change`, (e206) => {
      this.selectElement.title = e206.target.value, this._onDidSelect.fire({ index: e206.target.selectedIndex, selected: e206.target.value });
    })), this._register(el(this.selectElement, `keydown`, (e206) => {
      let t10 = false;
      Tt ? (e206.keyCode === 18 || e206.keyCode === 16 || e206.keyCode === 10) && (t10 = true) : (e206.keyCode === 18 && e206.altKey || e206.keyCode === 10 || e206.keyCode === 3) && (t10 = true), t10 && e206.stopPropagation();
    }));
  }
  get onDidSelect() {
    return this._onDidSelect.event;
  }
  setOptions(e206, t10) {
    (!this.options || !o(this.options, e206)) && (this.options = e206, this.selectElement.options.length = 0, this.options.forEach((e207, t11) => {
      this.selectElement.add(this.createOption(e207.text, t11, e207.isDisabled));
    })), t10 !== void 0 && this.select(t10);
  }
  select(e206) {
    this.options.length === 0 ? this.selected = 0 : e206 >= 0 && e206 < this.options.length ? this.selected = e206 : e206 > this.options.length - 1 ? this.select(this.options.length - 1) : this.selected < 0 && (this.selected = 0), this.selectElement.selectedIndex = this.selected, this.selected < this.options.length && typeof this.options[this.selected].text == `string` ? this.selectElement.title = this.options[this.selected].text : this.selectElement.title = ``;
  }
  focus() {
    this.selectElement && (this.selectElement.tabIndex = 0, this.selectElement.focus());
  }
  blur() {
    this.selectElement && (this.selectElement.tabIndex = -1, this.selectElement.blur());
  }
  setFocusable(e206) {
    this.selectElement.tabIndex = e206 ? 0 : -1;
  }
  render(e206) {
    e206.classList.add(`select-container`), e206.appendChild(this.selectElement), this.setOptions(this.options, this.selected), this.applyStyles();
  }
  applyStyles() {
    this.selectElement && (this.selectElement.style.backgroundColor = this.styles.selectBackground ?? ``, this.selectElement.style.color = this.styles.selectForeground ?? ``, this.selectElement.style.borderColor = this.styles.selectBorder ?? ``);
  }
  createOption(e206, t10, n10) {
    let r10 = document.createElement(`option`);
    return r10.value = e206, r10.text = e206, r10.disabled = !!n10, r10;
  }
}, Zge = class extends rx {
  constructor(e206, t10, n10, r10, i10) {
    super(), Tt && !i10?.useCustomDrawn ? this.selectBoxDelegate = new Xge(e206, t10, r10, i10) : this.selectBoxDelegate = new Yge(e206, t10, n10, r10, i10), this._register(this.selectBoxDelegate);
  }
  get onDidSelect() {
    return this.selectBoxDelegate.onDidSelect;
  }
  setOptions(e206, t10) {
    this.selectBoxDelegate.setOptions(e206, t10);
  }
  select(e206) {
    this.selectBoxDelegate.select(e206);
  }
  focus() {
    this.selectBoxDelegate.focus();
  }
  blur() {
    this.selectBoxDelegate.blur();
  }
  setFocusable(e206) {
    this.selectBoxDelegate.setFocusable(e206);
  }
  render(e206) {
    this.selectBoxDelegate.render(e206);
  }
}, nL = class extends D {
  get action() {
    return this._action;
  }
  constructor(e206, t10, n10 = {}) {
    super(), this.options = n10, this._context = e206 || this, this._action = t10, t10 instanceof Tu && this._register(t10.onDidChange((e207) => {
      this.element && this.handleActionChangeEvent(e207);
    }));
  }
  handleActionChangeEvent(e206) {
    e206.enabled !== void 0 && this.updateEnabled(), e206.checked !== void 0 && this.updateChecked(), e206.class !== void 0 && this.updateClass(), e206.label !== void 0 && (this.updateLabel(), this.updateTooltip()), e206.tooltip !== void 0 && this.updateTooltip();
  }
  get actionRunner() {
    return this._actionRunner || (this._actionRunner = this._register(new Eu())), this._actionRunner;
  }
  set actionRunner(e206) {
    this._actionRunner = e206;
  }
  isEnabled() {
    return this._action.enabled;
  }
  setActionContext(e206) {
    this._context = e206;
  }
  render(e206) {
    let t10 = this.element = e206;
    this._register(nx.addTarget(e206));
    let n10 = this.options && this.options.draggable;
    n10 && (e206.draggable = true, Mo && this._register(L(e206, R.DRAG_START, (e207) => e207.dataTransfer?.setData(xI.TEXT, this._action.label)))), this._register(L(t10, tx.Tap, (e207) => this.onClick(e207, true))), this._register(L(t10, R.MOUSE_DOWN, (e207) => {
      n10 || Vl.stop(e207, true), this._action.enabled && e207.button === 0 && t10.classList.add(`active`);
    })), Tt && this._register(L(t10, R.CONTEXT_MENU, (e207) => {
      e207.button === 0 && e207.ctrlKey === true && this.onClick(e207);
    })), this._register(L(t10, R.CLICK, (e207) => {
      Vl.stop(e207, true), this.options && this.options.isMenu || this.onClick(e207);
    })), this._register(L(t10, R.DBLCLICK, (e207) => {
      Vl.stop(e207, true);
    })), [R.MOUSE_UP, R.MOUSE_OUT].forEach((e207) => {
      this._register(L(t10, e207, (e208) => {
        Vl.stop(e208), t10.classList.remove(`active`);
      }));
    });
  }
  onClick(e206, t10 = false) {
    Vl.stop(e206, true);
    let n10 = qe(this._context) ? this.options?.useEventAsContext ? e206 : { preserveFocus: t10 } : this._context;
    this.actionRunner.run(this._action, n10);
  }
  focus() {
    this.element && (this.element.tabIndex = 0, this.element.focus(), this.element.classList.add(`focused`));
  }
  blur() {
    this.element && (this.element.blur(), this.element.tabIndex = -1, this.element.classList.remove(`focused`));
  }
  setFocusable(e206) {
    this.element && (this.element.tabIndex = e206 ? 0 : -1);
  }
  get trapsArrowNavigation() {
    return false;
  }
  updateEnabled() {
  }
  updateLabel() {
  }
  getClass() {
    return this.action.class;
  }
  getTooltip() {
    return this.action.tooltip;
  }
  getHoverContents() {
    return this.getTooltip();
  }
  updateTooltip() {
    if (!this.element) return;
    let e206 = this.getHoverContents() ?? ``;
    if (this.updateAriaLabel(), !this.customHover && e206 !== ``) {
      let t10 = this.options.hoverDelegate ?? CI(`element`);
      this.customHover = this._store.add(EI().setupManagedHover(t10, this.element, e206));
    } else this.customHover && this.customHover.update(e206);
  }
  updateAriaLabel() {
    if (this.element) {
      let e206 = this.getTooltip() ?? ``;
      this.element.setAttribute(`aria-label`, e206);
    }
  }
  updateClass() {
  }
  updateChecked() {
  }
  dispose() {
    this.element && (this.element = (this.element.remove(), void 0)), this._context = void 0, super.dispose();
  }
}, rL = class extends nL {
  constructor(e206, t10, n10) {
    n10 = { ...n10, icon: n10.icon === void 0 ? false : n10.icon, label: n10.label === void 0 ? true : n10.label }, super(e206, t10, n10), this.options = n10, this.cssClass = ``;
  }
  render(e206) {
    super.render(e206), Je(this.element);
    let t10 = document.createElement(`a`);
    if (t10.classList.add(`action-label`), t10.setAttribute(`role`, this.getDefaultAriaRole()), this.label = t10, this.element.appendChild(t10), this.options.label && this.options.keybinding && !this.options.keybindingNotRenderedWithLabel) {
      let e207 = document.createElement(`span`);
      e207.classList.add(`keybinding`), e207.textContent = this.options.keybinding, this.element.appendChild(e207);
    }
    this.updateClass(), this.updateLabel(), this.updateTooltip(), this.updateEnabled(), this.updateChecked();
  }
  getDefaultAriaRole() {
    return this._action.id === Du.ID ? `presentation` : this.options.isMenu ? `menuitem` : this.options.isTabList ? `tab` : `button`;
  }
  focus() {
    this.label && (this.label.tabIndex = 0, this.label.focus());
  }
  blur() {
    this.label && (this.label.tabIndex = -1);
  }
  setFocusable(e206) {
    this.label && (this.label.tabIndex = e206 ? 0 : -1);
  }
  updateLabel() {
    this.options.label && this.label && (this.label.textContent = this.action.label);
  }
  getTooltip() {
    let e206 = null;
    return this.action.tooltip ? e206 = this.action.tooltip : this.action.label && (e206 = this.action.label, this.options.keybinding && (e206 = C(0, `{0} ({1})`, e206, this.options.keybinding))), e206 ?? void 0;
  }
  updateClass() {
    this.cssClass && this.label && this.label.classList.remove(...this.cssClass.split(` `)), this.options.icon ? (this.cssClass = this.getClass(), this.label && (this.label.classList.add(`codicon`), this.cssClass && this.label.classList.add(...this.cssClass.split(` `))), this.updateEnabled()) : this.label?.classList.remove(`codicon`);
  }
  updateEnabled() {
    this.action.enabled ? (this.label && (this.label.removeAttribute(`aria-disabled`), this.label.classList.remove(`disabled`)), this.element?.classList.remove(`disabled`)) : (this.label && (this.label.setAttribute(`aria-disabled`, `true`), this.label.classList.add(`disabled`)), this.element?.classList.add(`disabled`));
  }
  updateAriaLabel() {
    if (this.label) {
      let e206 = this.getTooltip() ?? ``;
      this.label.setAttribute(`aria-label`, e206);
    }
  }
  updateChecked() {
    this.label && (this.action.checked === void 0 ? (this.label.classList.remove(`checked`), this.label.removeAttribute(this.options.isTabList ? `aria-selected` : `aria-checked`), this.label.setAttribute(`role`, this.getDefaultAriaRole())) : (this.label.classList.toggle(`checked`, this.action.checked), this.options.isTabList ? this.label.setAttribute(`aria-selected`, this.action.checked ? `true` : `false`) : (this.label.setAttribute(`aria-checked`, this.action.checked ? `true` : `false`), this.label.setAttribute(`role`, `checkbox`))));
  }
}, Qge = class extends nL {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(e206, t10), this.selectBox = new Zge(n10, r10, i10, a10, o10), this.selectBox.setFocusable(false), this._register(this.selectBox), this.registerListeners();
  }
  select(e206) {
    this.selectBox.select(e206);
  }
  registerListeners() {
    this._register(this.selectBox.onDidSelect((e206) => this.runAction(e206.selected, e206.index)));
  }
  runAction(e206, t10) {
    this.actionRunner.run(this._action, this.getActionContext(e206, t10));
  }
  getActionContext(e206, t10) {
    return e206;
  }
  setFocusable(e206) {
    this.selectBox.setFocusable(e206);
  }
  focus() {
    this.selectBox?.focus();
  }
  blur() {
    this.selectBox?.blur();
  }
  render(e206) {
    this.selectBox.render(e206);
  }
}, $ge = class extends Eu {
  constructor(e206, t10) {
    super(), this._onDidChangeVisibility = this._register(new k()), this.onDidChangeVisibility = this._onDidChangeVisibility.event, this._element = z(e206, B(`.monaco-dropdown`)), this._label = z(this._element, B(`.dropdown-label`));
    let n10 = t10.labelRenderer;
    n10 || (n10 = (e207) => (e207.textContent = t10.label || ``, null));
    for (let e207 of [R.CLICK, R.MOUSE_DOWN, tx.Tap]) this._register(L(this.element, e207, (e208) => Vl.stop(e208, true)));
    for (let e207 of [R.MOUSE_DOWN, tx.Tap]) this._register(L(this._label, e207, (e208) => {
      Rl(e208) && e208.button !== 0 || (this.visible ? this.hide() : this.show());
    }));
    this._register(L(this._label, R.KEY_DOWN, (e207) => {
      let t11 = new Jo(e207);
      (t11.equals(3) || t11.equals(10)) && (Vl.stop(e207, true), this.visible ? this.hide() : this.show());
    }));
    let r10 = n10(this._label);
    r10 && this._register(r10), this._register(nx.addTarget(this._label));
  }
  get element() {
    return this._element;
  }
  show() {
    this.visible || (this.visible = true, this._onDidChangeVisibility.fire(true));
  }
  hide() {
    this.visible && (this.visible = false, this._onDidChangeVisibility.fire(false));
  }
  dispose() {
    super.dispose(), this.hide(), this.boxContainer && (this.boxContainer = (this.boxContainer.remove(), void 0)), this.contents && (this.contents = (this.contents.remove(), void 0)), this._label && (this._label = (this._label.remove(), void 0));
  }
}, e_e = class extends $ge {
  constructor(e206, t10) {
    super(e206, t10), this._options = t10, this._actions = [], this.actions = t10.actions || [];
  }
  set menuOptions(e206) {
    this._menuOptions = e206;
  }
  get menuOptions() {
    return this._menuOptions;
  }
  get actions() {
    return this._options.actionProvider ? this._options.actionProvider.getActions() : this._actions;
  }
  set actions(e206) {
    this._actions = e206;
  }
  show() {
    super.show(), this.element.classList.add(`active`), this._options.contextMenuProvider.showContextMenu({ getAnchor: () => this.element, getActions: () => this.actions, getActionsContext: () => this.menuOptions ? this.menuOptions.context : null, getActionViewItem: (e206, t10) => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(e206, t10) : void 0, getKeyBinding: (e206) => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(e206) : void 0, getMenuClassName: () => this._options.menuClassName || ``, onHide: () => this.onHide(), actionRunner: this.menuOptions ? this.menuOptions.actionRunner : void 0, anchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : 0, domForShadowRoot: this._options.menuAsChild ? this.element : void 0, skipTelemetry: this._options.skipTelemetry });
  }
  hide() {
    super.hide();
  }
  onHide() {
    this.hide(), this.element.classList.remove(`active`);
  }
}, iL = class extends nL {
  get onDidChangeVisibility() {
    return this._onDidChangeVisibility.event;
  }
  constructor(e206, t10, n10, r10 = /* @__PURE__ */ Object.create(null)) {
    super(null, e206, r10), this.actionItem = null, this._onDidChangeVisibility = this._register(new k()), this.menuActionsOrProvider = t10, this.contextMenuProvider = n10, this.options = r10, this.options.actionRunner && (this.actionRunner = this.options.actionRunner);
  }
  render(e206) {
    this.actionItem = e206;
    let t10 = (e207) => (this.element = z(e207, B(`a.action-label`)), this.renderLabel(this.element)), n10 = Array.isArray(this.menuActionsOrProvider), r10 = { contextMenuProvider: this.contextMenuProvider, labelRenderer: t10, menuAsChild: this.options.menuAsChild, actions: n10 ? this.menuActionsOrProvider : void 0, actionProvider: n10 ? void 0 : this.menuActionsOrProvider, skipTelemetry: this.options.skipTelemetry };
    if (this.dropdownMenu = this._register(new e_e(e206, r10)), this._register(this.dropdownMenu.onDidChangeVisibility((e207) => {
      this.element?.setAttribute(`aria-expanded`, `${e207}`), this._onDidChangeVisibility.fire(e207);
    })), this.dropdownMenu.menuOptions = { actionViewItemProvider: this.options.actionViewItemProvider, actionRunner: this.actionRunner, getKeyBinding: this.options.keybindingProvider, context: this._context }, this.options.anchorAlignmentProvider) {
      let e207 = this;
      this.dropdownMenu.menuOptions = { ...this.dropdownMenu.menuOptions, get anchorAlignment() {
        return e207.options.anchorAlignmentProvider();
      } };
    }
    this.updateTooltip(), this.updateEnabled();
  }
  renderLabel(e206) {
    let t10 = [];
    return typeof this.options.classNames == `string` ? t10 = this.options.classNames.split(/\s+/g).filter((e207) => !!e207) : this.options.classNames && (t10 = this.options.classNames), t10.find((e207) => e207 === `icon`) || t10.push(`codicon`), e206.classList.add(...t10), this._action.label && this._register(EI().setupManagedHover(this.options.hoverDelegate ?? CI(`mouse`), e206, this._action.label)), null;
  }
  getTooltip() {
    let e206 = null;
    return this.action.tooltip ? e206 = this.action.tooltip : this.action.label && (e206 = this.action.label), e206 ?? void 0;
  }
  setActionContext(e206) {
    super.setActionContext(e206), this.dropdownMenu && (this.dropdownMenu.menuOptions ? this.dropdownMenu.menuOptions.context = e206 : this.dropdownMenu.menuOptions = { context: e206 });
  }
  show() {
    this.dropdownMenu?.show();
  }
  updateEnabled() {
    let e206 = !this.action.enabled;
    this.actionItem?.classList.toggle(`disabled`, e206), this.element?.classList.toggle(`disabled`, e206);
  }
};
function t_e(e206) {
  return !!e206 && typeof e206 == `object` && typeof e206.original == `string` && typeof e206.value == `string`;
}
function n_e(e206) {
  return e206 ? e206.condition !== void 0 : false;
}
function r_e(e206, t10) {
  let n10 = { ...t10 };
  for (let t11 in e206) {
    let r10 = e206[t11];
    n10[t11] = r10 === void 0 ? void 0 : Z(r10);
  }
  return n10;
}
var aL = { keybindingLabelBackground: Z(Iae), keybindingLabelForeground: Z(Lae), keybindingLabelBorder: Z(Rae), keybindingLabelBottomBorder: Z(zae), keybindingLabelShadow: Z(Uv) }, i_e = { buttonForeground: Z(zy), buttonSeparator: Z(By), buttonBackground: Z(Vy), buttonHoverBackground: Z(Hy), buttonSecondaryForeground: Z(Wy), buttonSecondaryBackground: Z(Gy), buttonSecondaryHoverBackground: Z(Ky), buttonBorder: Z(Uy) }, a_e = { progressBarBackground: Z(nv) }, oL = { inputActiveOptionBorder: Z(Sy), inputActiveOptionForeground: Z(Ty), inputActiveOptionBackground: Z(wy) };
Z(qy), Z(Jy), Z(Yy), Z(Xy), Z(Zy), Z(Qy), Z($y);
var sL = { checkboxBackground: Z(eb), checkboxBorder: Z(nb), checkboxForeground: Z(tb), checkboxDisabledBackground: Z(rb), checkboxDisabledForeground: Z(ib) };
Z(av), Z(ov), Z(Uv), Z(Wv), Z(cy), Z(ly), Z(uy), Z(Y_);
var cL = { inputBackground: Z(yy), inputForeground: Z(by), inputBorder: Z(xy), inputValidationInfoBorder: Z(Oy), inputValidationInfoBackground: Z(Ey), inputValidationInfoForeground: Z(Dy), inputValidationWarningBorder: Z(jy), inputValidationWarningBackground: Z(ky), inputValidationWarningForeground: Z(Ay), inputValidationErrorBorder: Z(Py), inputValidationErrorBackground: Z(My), inputValidationErrorForeground: Z(Ny) }, o_e = { listFilterWidgetBackground: Z(Qae), listFilterWidgetOutline: Z($ae), listFilterWidgetNoMatchesOutline: Z(eoe), listFilterWidgetShadow: Z(toe), inputBoxStyles: cL, toggleStyles: oL }, lL = { badgeBackground: Z(X_), badgeForeground: Z(Z_), badgeBorder: Z(q_) };
Z(qv), Z(Kv), Z(Jv), Z(Jv), Z(Yv);
var uL = { listBackground: void 0, listInactiveFocusForeground: void 0, listFocusBackground: Z(Bae), listFocusForeground: Z(Vae), listFocusOutline: Z(Hae), listActiveSelectionBackground: Z(ab), listActiveSelectionForeground: Z(ob), listActiveSelectionIconForeground: Z(sb), listFocusAndSelectionOutline: Z(Uae), listFocusAndSelectionBackground: Z(ab), listFocusAndSelectionForeground: Z(ob), listInactiveSelectionBackground: Z(Wae), listInactiveSelectionIconForeground: Z(Kae), listInactiveSelectionForeground: Z(Gae), listInactiveFocusBackground: Z(qae), listInactiveFocusOutline: Z(Jae), listHoverBackground: Z(cb), listHoverForeground: Z(lb), listDropOverBackground: Z(Yae), listDropBetweenBackground: Z(Xae), listSelectionOutline: Z(J_), listHoverOutline: Z(J_), treeIndentGuidesStroke: Z(db), treeInactiveIndentGuidesStroke: Z(noe), treeStickyScrollBackground: void 0, treeStickyScrollBorder: void 0, treeStickyScrollShadow: Z(Q_), tableColumnsBorder: Z(roe), tableOddRowsBackgroundColor: Z(ioe) };
function dL(e206) {
  return r_e(e206, uL);
}
var s_e = { selectBackground: Z(Fy), selectListBackground: Z(Iy), selectForeground: Z(Ly), decoratorRightForeground: Z(pb), selectBorder: Z(Ry), focusBorder: Z(K_), listFocusBackground: Z(_b2), listInactiveSelectionIconForeground: Z(gb), listFocusForeground: Z(hb), listFocusOutline: D_(J_, Y.transparent.toString()), listHoverBackground: Z(cb), listHoverForeground: Z(lb), listHoverOutline: Z(J_), selectListBorder: Z(sv), listBackground: void 0, listActiveSelectionBackground: void 0, listActiveSelectionForeground: void 0, listActiveSelectionIconForeground: void 0, listFocusAndSelectionBackground: void 0, listDropOverBackground: void 0, listDropBetweenBackground: void 0, listInactiveSelectionBackground: void 0, listInactiveSelectionForeground: void 0, listInactiveFocusBackground: void 0, listInactiveFocusOutline: void 0, listSelectionOutline: void 0, listFocusAndSelectionForeground: void 0, listFocusAndSelectionOutline: void 0, listInactiveFocusForeground: void 0, tableColumnsBorder: void 0, tableOddRowsBackgroundColor: void 0, treeIndentGuidesStroke: void 0, treeInactiveIndentGuidesStroke: void 0, treeStickyScrollBackground: void 0, treeStickyScrollBorder: void 0, treeStickyScrollShadow: void 0 }, c_e = { shadowColor: Z(Uv), borderColor: Z(ooe), foregroundColor: Z(soe), backgroundColor: Z(coe), selectionForegroundColor: Z(loe), selectionBackgroundColor: Z(uoe), selectionBorderColor: Z(doe), separatorColor: Z(foe), scrollbarShadow: Z(Q_), scrollbarSliderBackground: Z($_), scrollbarSliderHoverBackground: Z(ev), scrollbarSliderActiveBackground: Z(tv) };
function l_e(e206, t10) {
  if (Ot) return false;
  let n10 = u_e(e206, t10), r10 = e206.getValue(`window`);
  return r10?.menuStyle === `native` ? !(!Tt && !n10) : r10?.menuStyle === `custom` ? false : n10;
}
function u_e(e206, t10) {
  return t10 || (t10 = fL(e206)), t10 === `native`;
}
function fL(e206) {
  if (Ot) return `custom`;
  let t10 = e206.getValue(`window`);
  if (t10) {
    if (Tt && t10.nativeTabs === true || Tt && t10.nativeFullScreen === false) return `native`;
    let e207 = t10.titleBarStyle;
    if (e207 === `native` || e207 === `custom`) return e207;
  }
  return `custom`;
}
function d_e(e206) {
  if (Ot || Tt || fL(e206) === `native`) return `native`;
  let t10 = e206.getValue(`window`)?.controlsStyle;
  return t10 === `custom` || t10 === `hidden` ? t10 : `native`;
}
var pL = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, mL = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
};
function f_e(e206, t10) {
  let n10 = [];
  return p_e(e206, n10), n10;
}
function p_e(e206, t10, n10) {
  let r10 = tu.getInstance();
  _L2(e206, t10, r10.keyStatus.altKey || (wt || Et) && r10.keyStatus.shiftKey, (e207) => e207 === `navigation`);
}
function hL(e206, t10, n10, r10) {
  let i10 = { primary: [], secondary: [] };
  return gL(e206, i10, t10, n10, r10), i10;
}
function m_e(e206, t10, n10, r10) {
  let i10 = [];
  return gL(e206, i10, t10, n10, r10), i10;
}
function gL(e206, t10, n10, r10, i10) {
  _L2(e206, t10, false, typeof n10 == `string` ? (e207) => e207 === n10 : n10, r10, i10);
}
function _L2(e206, t10, n10, r10 = (e207) => e207 === `navigation`, i10 = () => false, a10 = false) {
  let o10, s10;
  Array.isArray(t10) ? (o10 = t10, s10 = t10) : (o10 = t10.primary, s10 = t10.secondary);
  let c10 = /* @__PURE__ */ new Set();
  for (let [t11, i11] of e206) {
    let e207;
    r10(t11) ? (e207 = o10, e207.length > 0 && a10 && e207.push(new Du())) : (e207 = s10, e207.length > 0 && e207.push(new Du()));
    for (let r11 of i11) {
      n10 && (r11 = r11 instanceof _d2 && r11.alt ? r11.alt : r11);
      let i12 = e207.push(r11);
      r11 instanceof Ou && c10.add({ group: t11, action: r11, index: i12 - 1 });
    }
  }
  for (let { group: e207, action: t11, index: n11 } of c10) {
    let a11 = r10(e207) ? o10 : s10, c11 = t11.actions;
    i10(t11, e207, a11.length) && a11.splice(n11, 1, ...c11);
  }
}
var vL = class extends rL {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(void 0, e206, { icon: !!(e206.class || e206.item.icon), label: !e206.class && !e206.item.icon, draggable: t10?.draggable, keybinding: t10?.keybinding, hoverDelegate: t10?.hoverDelegate, keybindingNotRenderedWithLabel: t10?.keybindingNotRenderedWithLabel }), this._options = t10, this._keybindingService = n10, this._notificationService = r10, this._contextKeyService = i10, this._themeService = a10, this._contextMenuService = o10, this._accessibilityService = s10, this._wantsAltCommand = false, this._itemClassDispose = this._register(new Jt()), this._altKey = tu.getInstance();
  }
  get _menuItemAction() {
    return this._action;
  }
  get _commandAction() {
    return this._wantsAltCommand && this._menuItemAction.alt || this._menuItemAction;
  }
  async onClick(e206) {
    e206.preventDefault(), e206.stopPropagation();
    try {
      await this.actionRunner.run(this._commandAction, this._context);
    } catch (e207) {
      this._notificationService.error(e207);
    }
  }
  render(e206) {
    if (super.render(e206), e206.classList.add(`menu-entry`), this.options.icon && this._updateItemClass(this._menuItemAction.item), this._menuItemAction.alt) {
      let t10 = false, n10 = () => {
        let e207 = !!this._menuItemAction.alt?.enabled && (!this._accessibilityService.isMotionReduced() || t10) && (this._altKey.keyStatus.altKey || this._altKey.keyStatus.shiftKey && t10);
        e207 !== this._wantsAltCommand && (this._wantsAltCommand = e207, this.updateLabel(), this.updateTooltip(), this.updateClass());
      };
      this._register(this._altKey.event(n10)), this._register(L(e206, `mouseleave`, (e207) => {
        t10 = false, n10();
      })), this._register(L(e206, `mouseenter`, (e207) => {
        t10 = true, n10();
      })), n10();
    }
  }
  updateLabel() {
    this.options.label && this.label && (this.label.textContent = this._commandAction.label);
  }
  getTooltip() {
    let e206 = this._keybindingService.lookupKeybinding(this._commandAction.id, this._contextKeyService), t10 = e206 && e206.getLabel(), n10 = this._commandAction.tooltip || this._commandAction.label, r10 = t10 ? C(1644, `{0} ({1})`, n10, t10) : n10;
    if (!this._wantsAltCommand && this._menuItemAction.alt?.enabled) {
      let e207 = this._menuItemAction.alt.tooltip || this._menuItemAction.alt.label, t11 = this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id, this._contextKeyService), n11 = t11 && t11.getLabel(), i10 = n11 ? C(1645, `{0} ({1})`, e207, n11) : e207;
      r10 = C(1646, `{0}
[{1}] {2}`, r10, RF.modifierLabels[Pt].altKey, i10);
    }
    return r10;
  }
  updateClass() {
    this.options.icon && (this._commandAction === this._menuItemAction ? this._updateItemClass(this._menuItemAction.item) : this._menuItemAction.alt && this._updateItemClass(this._menuItemAction.alt.item));
  }
  _updateItemClass(e206) {
    this._itemClassDispose.value = void 0;
    let { element: t10, label: n10 } = this;
    if (!t10 || !n10) return;
    let r10 = this._commandAction.checked && n_e(e206.toggled) && e206.toggled.icon ? e206.toggled.icon : e206.icon;
    if (r10) if (ju.isThemeIcon(r10)) {
      let e207 = ju.asClassNameArray(r10);
      n10.classList.add(...e207), this._itemClassDispose.value = T(() => {
        n10.classList.remove(...e207);
      });
    } else n10.style.backgroundImage = Ib(this._themeService.getColorTheme().type) ? _I2(r10.dark) : _I2(r10.light), n10.classList.add(`icon`), this._itemClassDispose.value = qt(T(() => {
      n10.style.backgroundImage = ``, n10.classList.remove(`icon`);
    }), this._themeService.onDidColorThemeChange(() => {
      this.updateClass();
    }));
  }
};
vL = pL([mL(2, Dw), mL(3, dw), mL(4, nd), mL(5, US), mL(6, mj), mL(7, e_)], vL);
var h_e = class e144 extends vL {
  render(e206) {
    this.options.label = true, this.options.icon = false, super.render(e206), e206.classList.add(`text-only`), e206.classList.toggle(`use-comma`, this._options?.useComma ?? false);
  }
  updateLabel() {
    let t10 = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService);
    if (!t10) return super.updateLabel();
    if (this.label) {
      let n10 = e144._symbolPrintEnter(t10);
      this._options?.conversational ? this.label.textContent = C(1647, `{1} to {0}`, this._action.label, n10) : this.label.textContent = C(1648, `{0} ({1})`, this._action.label, n10);
    }
  }
  static _symbolPrintEnter(e206) {
    return e206.getLabel()?.replace(/\benter\b/gi, `\u23CE`).replace(/\bEscape\b/gi, `Esc`);
  }
}, yL = class extends iL {
  constructor(e206, t10, n10, r10, i10) {
    let a10 = { ...t10, menuAsChild: t10?.menuAsChild ?? false, classNames: t10?.classNames ?? (ju.isThemeIcon(e206.item.icon) ? ju.asClassName(e206.item.icon) : void 0), keybindingProvider: t10?.keybindingProvider ?? ((e207) => n10.lookupKeybinding(e207.id)) };
    super(e206, { getActions: () => e206.actions }, r10, a10), this._keybindingService = n10, this._contextMenuService = r10, this._themeService = i10;
  }
  render(e206) {
    super.render(e206), Je(this.element), e206.classList.add(`menu-entry`);
    let { icon: t10 } = this._action.item;
    if (t10 && !ju.isThemeIcon(t10)) {
      this.element.classList.add(`icon`);
      let e207 = () => {
        this.element && (this.element.style.backgroundImage = Ib(this._themeService.getColorTheme().type) ? _I2(t10.dark) : _I2(t10.light));
      };
      e207(), this._register(this._themeService.onDidColorThemeChange(() => {
        e207();
      }));
    }
  }
};
yL = pL([mL(2, Dw), mL(3, mj), mL(4, US)], yL);
var bL = class extends nL {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(null, e206), this._keybindingService = n10, this._notificationService = r10, this._contextMenuService = i10, this._menuService = a10, this._instaService = o10, this._storageService = s10, this._defaultActionDisposables = this._register(new E()), this._container = null, this._options = t10, this._storageKey = `${e206.item.submenu.id}_lastActionId`;
    let c10, l10 = t10?.togglePrimaryAction ? s10.get(this._storageKey, 1) : void 0;
    l10 && (c10 = e206.actions.find((e207) => l10 === e207.id)), c10 || (c10 = e206.actions[0]), this._defaultAction = this._defaultActionDisposables.add(this._instaService.createInstance(vL, c10, { keybinding: this._getDefaultActionKeybindingLabel(c10) }));
    let u10 = { keybindingProvider: (e207) => this._keybindingService.lookupKeybinding(e207.id), ...t10, menuAsChild: t10?.menuAsChild ?? true, classNames: t10?.classNames ?? [`codicon`, `codicon-chevron-down`], actionRunner: t10?.actionRunner ?? this._register(new Eu()) };
    this._dropdown = this._register(new iL(e206, e206.actions, this._contextMenuService, u10)), t10?.togglePrimaryAction && this._register(this._dropdown.actionRunner.onDidRun((e207) => {
      e207.action instanceof _d2 && this.update(e207.action);
    }));
  }
  update(e206) {
    this._options?.togglePrimaryAction && this._storageService.store(this._storageKey, e206.id, 1, 1), this._defaultActionDisposables.clear(), this._defaultAction = this._defaultActionDisposables.add(this._instaService.createInstance(vL, e206, { keybinding: this._getDefaultActionKeybindingLabel(e206) })), this._defaultAction.actionRunner = this._defaultActionDisposables.add(new class extends Eu {
      async runAction(e207, t10) {
        await e207.run(void 0);
      }
    }()), this._container && this._defaultAction.render(ql(this._container, B(`.action-container`)));
  }
  _getDefaultActionKeybindingLabel(e206) {
    let t10;
    if (this._options?.renderKeybindingWithDefaultActionLabel) {
      let n10 = this._keybindingService.lookupKeybinding(e206.id);
      n10 && (t10 = `(${n10.getLabel()})`);
    }
    return t10;
  }
  setActionContext(e206) {
    super.setActionContext(e206), this._defaultAction.setActionContext(e206), this._dropdown.setActionContext(e206);
  }
  set actionRunner(e206) {
    super.actionRunner = e206, this._defaultAction.actionRunner = e206, this._dropdown.actionRunner = e206;
  }
  get actionRunner() {
    return super.actionRunner;
  }
  render(e206) {
    this._container = e206, super.render(this._container), this._container.classList.add(`monaco-dropdown-with-default`);
    let t10 = B(`.action-container`);
    this._defaultAction.render(z(this._container, t10)), this._register(L(t10, R.KEY_DOWN, (e207) => {
      let t11 = new Jo(e207);
      t11.equals(17) && (this._defaultAction.element.tabIndex = -1, this._dropdown.focus(), t11.stopPropagation());
    }));
    let n10 = B(`.dropdown-action-container`);
    this._dropdown.render(z(this._container, n10)), this._register(L(n10, R.KEY_DOWN, (e207) => {
      let t11 = new Jo(e207);
      t11.equals(15) && (this._defaultAction.element.tabIndex = 0, this._dropdown.setFocusable(false), this._defaultAction.element?.focus(), t11.stopPropagation());
    }));
  }
  focus(e206) {
    e206 ? this._dropdown.focus() : (this._defaultAction.element.tabIndex = 0, this._defaultAction.element.focus());
  }
  blur() {
    this._defaultAction.element.tabIndex = -1, this._dropdown.blur(), this._container.blur();
  }
  setFocusable(e206) {
    e206 ? this._defaultAction.element.tabIndex = 0 : (this._defaultAction.element.tabIndex = -1, this._dropdown.setFocusable(false));
  }
};
bL = pL([mL(2, Dw), mL(3, dw), mL(4, mj), mL(5, pd), mL(6, V), mL(7, dF)], bL);
var xL = class extends Qge {
  constructor(e206, t10, n10) {
    super(null, e206, e206.actions.map((e207) => ({ text: e207.id === Du.ID ? `\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500` : e207.label, isDisabled: !e207.enabled })), 0, t10, s_e, { ariaLabel: e206.tooltip, optionsAsChildren: true, useCustomDrawn: !l_e(n10) }), this.select(Math.max(0, e206.actions.findIndex((e207) => e207.checked)));
  }
  render(e206) {
    super.render(e206), e206.style.borderColor = Z(Ry);
  }
  runAction(e206, t10) {
    let n10 = this.action.actions[t10];
    n10 && this.actionRunner.run(n10);
  }
};
xL = pL([mL(1, pj), mL(2, Uf)], xL);
function SL(e206, t10, n10) {
  if (t10 instanceof _d2) return e206.createInstance(vL, t10, n10);
  if (t10 instanceof gd) return t10.item.isSelection ? e206.createInstance(xL, t10) : t10.item.isSplitButton ? e206.createInstance(bL, t10, { ...n10, togglePrimaryAction: typeof t10.item.isSplitButton == `boolean` ? false : t10.item.isSplitButton.togglePrimaryAction }) : e206.createInstance(yL, t10, n10);
}
var CL = class extends D {
  get onDidBlur() {
    return this._onDidBlur.event;
  }
  get onDidCancel() {
    return this._onDidCancel.event;
  }
  get onDidRun() {
    return this._onDidRun.event;
  }
  get onWillRun() {
    return this._onWillRun.event;
  }
  constructor(e206, t10 = {}) {
    super(), this._actionRunnerDisposables = this._register(new E()), this.viewItemDisposables = this._register(new Xt()), this.triggerKeyDown = false, this.focusable = true, this._onDidBlur = this._register(new k()), this._onDidCancel = this._register(new k({ onWillAddFirstListener: () => this.cancelHasListener = true })), this.cancelHasListener = false, this._onDidRun = this._register(new k()), this._onWillRun = this._register(new k()), this.options = t10, this._context = t10.context ?? null, this._orientation = this.options.orientation ?? 0, this._triggerKeys = { keyDown: this.options.triggerKeys?.keyDown ?? false, keys: this.options.triggerKeys?.keys ?? [3, 10] }, this._hoverDelegate = t10.hoverDelegate ?? this._register(wI()), this.options.actionRunner ? this._actionRunner = this.options.actionRunner : (this._actionRunner = new Eu(), this._actionRunnerDisposables.add(this._actionRunner)), this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e207) => this._onDidRun.fire(e207))), this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e207) => this._onWillRun.fire(e207))), this.viewItems = [], this.focusedItem = void 0, this.domNode = document.createElement(`div`), this.domNode.className = `monaco-action-bar`;
    let n10, r10;
    switch (this._orientation) {
      case 0:
        n10 = [15], r10 = [17];
        break;
      case 1:
        n10 = [16], r10 = [18], this.domNode.className += ` vertical`;
        break;
    }
    this._register(L(this.domNode, R.KEY_DOWN, (e207) => {
      let t11 = new Jo(e207), i10 = true, a10 = typeof this.focusedItem == `number` ? this.viewItems[this.focusedItem] : void 0;
      n10 && (t11.equals(n10[0]) || t11.equals(n10[1])) ? i10 = this.focusPrevious() : r10 && (t11.equals(r10[0]) || t11.equals(r10[1])) ? i10 = this.focusNext() : t11.equals(9) && this.cancelHasListener ? this._onDidCancel.fire() : t11.equals(14) ? i10 = this.focusFirst() : t11.equals(13) ? i10 = this.focusLast() : t11.equals(2) && a10 instanceof nL && a10.trapsArrowNavigation ? i10 = this.focusNext(void 0, true) : this.isTriggerKeyEvent(t11) ? this._triggerKeys.keyDown ? this.doTrigger(t11) : this.triggerKeyDown = true : i10 = false, i10 && (t11.preventDefault(), t11.stopPropagation());
    })), this._register(L(this.domNode, R.KEY_UP, (e207) => {
      let t11 = new Jo(e207);
      this.isTriggerKeyEvent(t11) ? (!this._triggerKeys.keyDown && this.triggerKeyDown && (this.triggerKeyDown = false, this.doTrigger(t11)), t11.preventDefault(), t11.stopPropagation()) : (t11.equals(2) || t11.equals(1026) || t11.equals(16) || t11.equals(18) || t11.equals(15) || t11.equals(17)) && this.updateFocusedItem();
    })), this.focusTracker = this._register(Gl(this.domNode)), this._register(this.focusTracker.onDidBlur(() => {
      (kl() === this.domNode || !Cl(kl(), this.domNode)) && (this._onDidBlur.fire(), this.previouslyFocusedItem = this.focusedItem, this.focusedItem = void 0, this.triggerKeyDown = false);
    })), this._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem())), this.actionsList = document.createElement(`ul`), this.actionsList.className = `actions-container`, this.options.highlightToggledItems && this.actionsList.classList.add(`highlight-toggled`), this.actionsList.setAttribute(`role`, this.options.ariaRole || `toolbar`), this.options.ariaLabel && this.actionsList.setAttribute(`aria-label`, this.options.ariaLabel), this.domNode.appendChild(this.actionsList), e206.appendChild(this.domNode);
  }
  refreshRole() {
    this.length() >= 1 ? this.actionsList.setAttribute(`role`, this.options.ariaRole || `toolbar`) : this.actionsList.setAttribute(`role`, `presentation`);
  }
  setFocusable(e206) {
    if (this.focusable = e206, this.focusable) {
      let e207 = this.viewItems.find((e208) => e208 instanceof nL && e208.isEnabled());
      e207 instanceof nL && e207.setFocusable(true);
    } else this.viewItems.forEach((e207) => {
      e207 instanceof nL && e207.setFocusable(false);
    });
  }
  isTriggerKeyEvent(e206) {
    let t10 = false;
    return this._triggerKeys.keys.forEach((n10) => {
      t10 || (t10 = e206.equals(n10));
    }), t10;
  }
  updateFocusedItem() {
    for (let e206 = 0; e206 < this.actionsList.children.length; e206++) {
      let t10 = this.actionsList.children[e206];
      if (Cl(kl(), t10)) {
        this.focusedItem = e206, this.viewItems[this.focusedItem]?.showHover?.();
        break;
      }
    }
  }
  get context() {
    return this._context;
  }
  set context(e206) {
    this._context = e206, this.viewItems.forEach((t10) => t10.setActionContext(e206));
  }
  get actionRunner() {
    return this._actionRunner;
  }
  set actionRunner(e206) {
    this._actionRunner = e206, this._actionRunnerDisposables.clear(), this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e207) => this._onDidRun.fire(e207))), this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e207) => this._onWillRun.fire(e207))), this.viewItems.forEach((t10) => t10.actionRunner = e206);
  }
  getContainer() {
    return this.domNode;
  }
  getAction(e206) {
    if (typeof e206 == `number`) return this.viewItems[e206]?.action;
    if (Fl(e206)) {
      for (; e206.parentElement !== this.actionsList; ) {
        if (!e206.parentElement) return;
        e206 = e206.parentElement;
      }
      for (let t10 = 0; t10 < this.actionsList.childNodes.length; t10++) if (this.actionsList.childNodes[t10] === e206) return this.viewItems[t10].action;
    }
  }
  push(e206, t10 = {}) {
    let n10 = Array.isArray(e206) ? e206 : [e206], r10 = He(t10.index) ? t10.index : null;
    if (n10.forEach((e207) => {
      let n11 = document.createElement(`li`);
      n11.className = `action-item`, n11.setAttribute(`role`, `presentation`);
      let i10, a10 = { hoverDelegate: this._hoverDelegate, ...t10, isTabList: this.options.ariaRole === `tablist` };
      this.options.actionViewItemProvider && (i10 = this.options.actionViewItemProvider(e207, a10)), i10 || (i10 = new rL(this.context, e207, a10)), this.options.allowContextMenu || this.viewItemDisposables.set(i10, L(n11, R.CONTEXT_MENU, (e208) => {
        Vl.stop(e208, true);
      })), i10.actionRunner = this._actionRunner, i10.setActionContext(this.context), i10.render(n11), r10 === null || r10 < 0 || r10 >= this.actionsList.children.length ? (this.actionsList.appendChild(n11), this.viewItems.push(i10)) : (this.actionsList.insertBefore(n11, this.actionsList.children[r10]), this.viewItems.splice(r10, 0, i10), r10++);
    }), this.focusable) {
      let e207 = false;
      for (let t11 of this.viewItems) {
        if (!(t11 instanceof nL)) continue;
        let n11;
        n11 = e207 || t11.action.id === Du.ID ? false : !(!t11.isEnabled() && this.options.focusOnlyEnabledItems), n11 ? (t11.setFocusable(true), e207 = true) : t11.setFocusable(false);
      }
    }
    typeof this.focusedItem == `number` && this.focus(this.focusedItem), this.refreshRole();
  }
  getWidth(e206) {
    if (e206 >= 0 && e206 < this.actionsList.children.length) {
      let t10 = this.actionsList.children.item(e206);
      if (t10) return t10.clientWidth;
    }
    return 0;
  }
  pull(e206) {
    e206 >= 0 && e206 < this.viewItems.length && (this.actionsList.childNodes[e206].remove(), this.viewItemDisposables.deleteAndDispose(this.viewItems[e206]), Kt(this.viewItems.splice(e206, 1)), this.refreshRole());
  }
  clear() {
    this.isEmpty() || (this.viewItems = Kt(this.viewItems), this.viewItemDisposables.clearAndDisposeAll(), Xc(this.actionsList), this.refreshRole());
  }
  length() {
    return this.viewItems.length;
  }
  isEmpty() {
    return this.viewItems.length === 0;
  }
  focus(e206) {
    let t10 = false, n10;
    if (e206 === void 0 ? t10 = true : typeof e206 == `number` ? n10 = e206 : typeof e206 == `boolean` && (t10 = e206), t10 && this.focusedItem === void 0) {
      let e207 = this.viewItems.findIndex((e208) => e208.isEnabled());
      this.focusedItem = e207 === -1 ? void 0 : e207, this.updateFocus(void 0, void 0, true);
    } else n10 !== void 0 && (this.focusedItem = n10), this.updateFocus(void 0, void 0, true);
  }
  focusFirst() {
    return this.focusedItem = this.length() - 1, this.focusNext(true);
  }
  focusLast() {
    return this.focusedItem = 0, this.focusPrevious(true);
  }
  focusNext(e206, t10) {
    if (this.focusedItem === void 0) this.focusedItem = this.viewItems.length - 1;
    else if (this.viewItems.length <= 1) return false;
    let n10 = this.focusedItem, r10;
    do {
      if (!e206 && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) return this.focusedItem = n10, false;
      this.focusedItem = (this.focusedItem + 1) % this.viewItems.length, r10 = this.viewItems[this.focusedItem];
    } while (this.focusedItem !== n10 && (this.options.focusOnlyEnabledItems && !r10.isEnabled() || r10.action.id === Du.ID));
    return this.updateFocus(void 0, void 0, t10), true;
  }
  focusPrevious(e206) {
    if (this.focusedItem === void 0) this.focusedItem = 0;
    else if (this.viewItems.length <= 1) return false;
    let t10 = this.focusedItem, n10;
    do {
      if (--this.focusedItem, this.focusedItem < 0) {
        if (!e206 && this.options.preventLoopNavigation) return this.focusedItem = t10, false;
        this.focusedItem = this.viewItems.length - 1;
      }
      n10 = this.viewItems[this.focusedItem];
    } while (this.focusedItem !== t10 && (this.options.focusOnlyEnabledItems && !n10.isEnabled() || n10.action.id === Du.ID));
    return this.updateFocus(true), true;
  }
  updateFocus(e206, t10, n10 = false) {
    this.focusedItem === void 0 && this.actionsList.focus({ preventScroll: t10 }), this.previouslyFocusedItem !== void 0 && this.previouslyFocusedItem !== this.focusedItem && this.viewItems[this.previouslyFocusedItem]?.blur();
    let r10 = this.focusedItem === void 0 ? void 0 : this.viewItems[this.focusedItem];
    if (r10) {
      let i10 = true;
      Xe(r10.focus) || (i10 = false), this.options.focusOnlyEnabledItems && Xe(r10.isEnabled) && !r10.isEnabled() && (i10 = false), r10.action.id === Du.ID && (i10 = false), i10 ? (n10 || this.previouslyFocusedItem !== this.focusedItem) && (r10.focus(e206), this.previouslyFocusedItem = this.focusedItem) : (this.actionsList.focus({ preventScroll: t10 }), this.previouslyFocusedItem = void 0), i10 && r10.showHover?.();
    }
  }
  doTrigger(e206) {
    if (this.focusedItem === void 0) return;
    let t10 = this.viewItems[this.focusedItem];
    if (t10 instanceof nL) {
      let n10 = t10._context === null || t10._context === void 0 ? e206 : t10._context;
      this.run(t10._action, n10);
    }
  }
  async run(e206, t10) {
    await this._actionRunner.run(e206, t10);
  }
  dispose() {
    this._context = void 0, this.viewItems = Kt(this.viewItems), this.getContainer().remove(), super.dispose();
  }
}, wL = /\(&([^\s&])\)|(^|[^&])&([^\s&])/, TL = /(&amp;)?(&amp;)([^\s&])/g, EL;
(function(e206) {
  e206[e206.Right = 0] = `Right`, e206[e206.Left = 1] = `Left`;
})(EL || (EL = {}));
var DL;
(function(e206) {
  e206[e206.Above = 0] = `Above`, e206[e206.Below = 1] = `Below`;
})(DL || (DL = {}));
var OL = class e145 extends CL {
  constructor(e206, t10, n10, r10) {
    e206.classList.add(`monaco-menu-container`), e206.setAttribute(`role`, `presentation`);
    let i10 = document.createElement(`div`);
    i10.classList.add(`monaco-menu`), i10.setAttribute(`role`, `presentation`), super(i10, { orientation: 1, actionViewItemProvider: (e207) => this.doGetActionViewItem(e207, n10, a10), context: n10.context, actionRunner: n10.actionRunner, ariaLabel: n10.ariaLabel, ariaRole: `menu`, focusOnlyEnabledItems: true, triggerKeys: { keys: [3, ...Tt || Et ? [10] : []], keyDown: true } }), this.menuStyles = r10, this.menuElement = i10, this.actionsList.tabIndex = 0, this.initializeOrUpdateStyleSheet(e206, r10), this._register(nx.addTarget(i10)), this._register(L(i10, R.KEY_DOWN, (e207) => {
      new Jo(e207).equals(2) && e207.preventDefault();
    })), n10.enableMnemonics && this._register(L(i10, R.KEY_DOWN, (e207) => {
      let t11 = e207.key.toLocaleLowerCase();
      if (this.mnemonics.has(t11)) {
        Vl.stop(e207, true);
        let n11 = this.mnemonics.get(t11);
        if (n11.length === 1 && (n11[0] instanceof AL && n11[0].container && this.focusItemByElement(n11[0].container), n11[0].onClick(e207)), n11.length > 1) {
          let e208 = n11.shift();
          e208 && e208.container && (this.focusItemByElement(e208.container), n11.push(e208)), this.mnemonics.set(t11, n11);
        }
      }
    })), Et && this._register(L(i10, R.KEY_DOWN, (e207) => {
      let t11 = new Jo(e207);
      t11.equals(14) || t11.equals(11) ? (this.focusedItem = this.viewItems.length - 1, this.focusNext(), Vl.stop(e207, true)) : (t11.equals(13) || t11.equals(12)) && (this.focusedItem = 0, this.focusPrevious(), Vl.stop(e207, true));
    })), this._register(L(this.domNode, R.MOUSE_OUT, (e207) => {
      let t11 = e207.relatedTarget;
      Cl(t11, this.domNode) || (this.focusedItem = void 0, this.updateFocus(), e207.stopPropagation());
    })), this._register(L(this.actionsList, R.MOUSE_OVER, (e207) => {
      let t11 = e207.target;
      if (!(!t11 || !Cl(t11, this.actionsList) || t11 === this.actionsList)) {
        for (; t11.parentElement !== this.actionsList && t11.parentElement !== null; ) t11 = t11.parentElement;
        if (t11.classList.contains(`action-item`)) {
          let e208 = this.focusedItem;
          this.setFocusedItem(t11), e208 !== this.focusedItem && this.updateFocus();
        }
      }
    })), this._register(nx.addTarget(this.actionsList)), this._register(L(this.actionsList, tx.Tap, (e207) => {
      let t11 = e207.initialTarget;
      if (!(!t11 || !Cl(t11, this.actionsList) || t11 === this.actionsList)) {
        for (; t11.parentElement !== this.actionsList && t11.parentElement !== null; ) t11 = t11.parentElement;
        if (t11.classList.contains(`action-item`)) {
          let e208 = this.focusedItem;
          this.setFocusedItem(t11), e208 !== this.focusedItem && this.updateFocus();
        }
      }
    }));
    let a10 = { parent: this };
    this.mnemonics = /* @__PURE__ */ new Map(), this.scrollableElement = this._register(new hx(i10, { alwaysConsumeMouseWheel: true, horizontal: 2, vertical: 3, verticalScrollbarSize: 7, handleMouseWheel: true, useShadows: true }));
    let o10 = this.scrollableElement.getDomNode();
    o10.style.position = ``, this.styleScrollElement(o10, r10), this._register(L(i10, tx.Change, (e207) => {
      Vl.stop(e207, true);
      let t11 = this.scrollableElement.getScrollPosition().scrollTop;
      this.scrollableElement.setScrollPosition({ scrollTop: t11 - e207.translationY });
    })), this._register(L(o10, R.MOUSE_UP, (e207) => {
      e207.preventDefault();
    }));
    let s10 = Vc(e206);
    i10.style.maxHeight = `${Math.max(10, s10.innerHeight - e206.getBoundingClientRect().top - 35)}px`, t10 = t10.filter((e207, r11) => n10.submenuIds?.has(e207.id) ? (console.warn(`Found submenu cycle: ${e207.id}`), false) : !(e207 instanceof Du && (r11 === t10.length - 1 || r11 === 0 || t10[r11 - 1] instanceof Du))), this.push(t10, { icon: true, label: true, isMenu: true }), e206.appendChild(this.scrollableElement.getDomNode()), this.scrollableElement.scanDomNode(), this.viewItems.filter((e207) => !(e207 instanceof jL)).forEach((e207, t11, n11) => {
      e207.updatePositionInSet(t11 + 1, n11.length);
    });
  }
  initializeOrUpdateStyleSheet(t10, n10) {
    this.styleSheet || (Dl(t10) ? this.styleSheet = g_(t10) : (e145.globalStyleSheet || (e145.globalStyleSheet = g_()), this.styleSheet = e145.globalStyleSheet)), this.styleSheet.textContent = __e(n10, Dl(t10));
  }
  styleScrollElement(e206, t10) {
    let n10 = t10.foregroundColor ?? ``, r10 = t10.backgroundColor ?? ``, i10 = t10.borderColor ? `1px solid ${t10.borderColor}` : ``, a10 = t10.shadowColor ? `0 2px 8px ${t10.shadowColor}` : ``;
    e206.style.outline = i10, e206.style.borderRadius = `5px`, e206.style.color = n10, e206.style.backgroundColor = r10, e206.style.boxShadow = a10;
  }
  getContainer() {
    return this.scrollableElement.getDomNode();
  }
  get onScroll() {
    return this.scrollableElement.onScroll;
  }
  focusItemByElement(e206) {
    let t10 = this.focusedItem;
    this.setFocusedItem(e206), t10 !== this.focusedItem && this.updateFocus();
  }
  setFocusedItem(e206) {
    for (let t10 = 0; t10 < this.actionsList.children.length; t10++) if (e206 === this.actionsList.children[t10]) {
      this.focusedItem = t10;
      break;
    }
  }
  updateFocus(e206) {
    super.updateFocus(e206, true, true), this.focusedItem !== void 0 && this.scrollableElement.setScrollPosition({ scrollTop: Math.round(this.menuElement.scrollTop) });
  }
  doGetActionViewItem(e206, t10, n10) {
    if (e206 instanceof Du) return new jL(t10.context, e206, { icon: true }, this.menuStyles);
    if (e206 instanceof Ou) {
      let r10 = new AL(e206, e206.actions, n10, { ...t10, submenuIds: /* @__PURE__ */ new Set([...t10.submenuIds || [], e206.id]) }, this.menuStyles);
      if (t10.enableMnemonics) {
        let e207 = r10.getMnemonic();
        if (e207 && r10.isEnabled()) {
          let t11 = [];
          this.mnemonics.has(e207) && (t11 = this.mnemonics.get(e207)), t11.push(r10), this.mnemonics.set(e207, t11);
        }
      }
      return r10;
    } else {
      let n11 = t10.getKeyBinding?.(e206)?.getLabel(), r10 = { enableMnemonics: t10.enableMnemonics, useEventAsContext: t10.useEventAsContext, keybinding: n11 }, i10 = new kL(t10.context, e206, r10, this.menuStyles);
      if (t10.enableMnemonics) {
        let e207 = i10.getMnemonic();
        if (e207 && i10.isEnabled()) {
          let t11 = [];
          this.mnemonics.has(e207) && (t11 = this.mnemonics.get(e207)), t11.push(i10), this.mnemonics.set(e207, t11);
        }
      }
      return i10;
    }
  }
}, kL = class extends nL {
  constructor(e206, t10, n10, r10) {
    if (n10 = { ...n10, isMenu: true, icon: n10.icon === void 0 ? false : n10.icon, label: n10.label === void 0 ? true : n10.label }, super(t10, t10, n10), this.menuStyle = r10, this.options = n10, this.cssClass = ``, this.options.label && n10.enableMnemonics) {
      let e207 = this.action.label;
      if (e207) {
        let t11 = wL.exec(e207);
        t11 && (this.mnemonic = (t11[1] ? t11[1] : t11[3]).toLocaleLowerCase());
      }
    }
    this.runOnceToEnableMouseUp = new us(() => {
      this.element && (this._register(L(this.element, R.MOUSE_UP, (e207) => {
        if (Vl.stop(e207, true), Mo) {
          if (new Xo(Vc(this.element), e207).rightButton) return;
          this.onClick(e207);
        } else setTimeout(() => {
          this.onClick(e207);
        }, 0);
      })), this._register(L(this.element, R.CONTEXT_MENU, (e207) => {
        Vl.stop(e207, true);
      })));
    }, 100), this._register(this.runOnceToEnableMouseUp);
  }
  render(e206) {
    super.render(e206), this.element && (this.container = e206, this.item = z(this.element, B(`a.action-menu-item`)), this._action.id === Du.ID ? this.item.setAttribute(`role`, `presentation`) : (this.item.setAttribute(`role`, `menuitem`), this.mnemonic && this.item.setAttribute(`aria-keyshortcuts`, `${this.mnemonic}`)), this.check = z(this.item, B(`span.menu-item-check` + ju.asCSSSelector(F.menuSelection))), this.check.setAttribute(`role`, `none`), this.label = z(this.item, B(`span.action-label`)), this.options.label && this.options.keybinding && (z(this.item, B(`span.keybinding`)).textContent = this.options.keybinding), this.runOnceToEnableMouseUp.schedule(), this.updateClass(), this.updateLabel(), this.updateTooltip(), this.updateEnabled(), this.updateChecked(), this.applyStyle());
  }
  blur() {
    super.blur(), this.applyStyle();
  }
  focus() {
    super.focus(), this.item?.focus(), this.applyStyle();
  }
  updatePositionInSet(e206, t10) {
    this.item && (this.item.setAttribute(`aria-posinset`, `${e206}`), this.item.setAttribute(`aria-setsize`, `${t10}`));
  }
  updateLabel() {
    if (this.label && this.options.label) {
      Xc(this.label);
      let e206 = kM(this.action.label);
      if (e206) {
        let t10 = g_e(e206);
        this.options.enableMnemonics || (e206 = t10), this.label.setAttribute(`aria-label`, t10.replace(/&&/g, `&`));
        let n10 = wL.exec(e206);
        if (n10) {
          e206 = Ra(e206), TL.lastIndex = 0;
          let t11 = TL.exec(e206);
          for (; t11 && t11[1]; ) t11 = TL.exec(e206);
          let r10 = (e207) => e207.replace(/&amp;&amp;/g, `&amp;`);
          t11 ? this.label.append(Ba(r10(e206.substr(0, t11.index)), ` `), B(`u`, { "aria-hidden": `true` }, t11[3]), Va(r10(e206.substr(t11.index + t11[0].length)), ` `)) : this.label.textContent = r10(e206).trim(), this.item?.setAttribute(`aria-keyshortcuts`, (n10[1] ? n10[1] : n10[3]).toLocaleLowerCase());
        } else this.label.textContent = e206.replace(/&&/g, `&`).trim();
      }
    }
  }
  updateTooltip() {
  }
  updateClass() {
    this.cssClass && this.item && this.item.classList.remove(...this.cssClass.split(` `)), this.options.icon && this.label ? (this.cssClass = this.action.class || ``, this.label.classList.add(`icon`), this.cssClass && this.label.classList.add(...this.cssClass.split(` `)), this.updateEnabled()) : this.label && this.label.classList.remove(`icon`);
  }
  updateEnabled() {
    this.action.enabled ? (this.element && (this.element.classList.remove(`disabled`), this.element.removeAttribute(`aria-disabled`)), this.item && (this.item.classList.remove(`disabled`), this.item.removeAttribute(`aria-disabled`), this.item.tabIndex = 0)) : (this.element && (this.element.classList.add(`disabled`), this.element.setAttribute(`aria-disabled`, `true`)), this.item && (this.item.classList.add(`disabled`), this.item.setAttribute(`aria-disabled`, `true`)));
  }
  updateChecked() {
    if (!this.item) return;
    let e206 = this.action.checked;
    this.item.classList.toggle(`checked`, !!e206), e206 === void 0 ? (this.item.setAttribute(`role`, `menuitem`), this.item.setAttribute(`aria-checked`, ``)) : (this.item.setAttribute(`role`, `menuitemcheckbox`), this.item.setAttribute(`aria-checked`, e206 ? `true` : `false`));
  }
  getMnemonic() {
    return this.mnemonic;
  }
  applyStyle() {
    let e206 = this.element && this.element.classList.contains(`focused`), t10 = e206 && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor, n10 = e206 && this.menuStyle.selectionBackgroundColor ? this.menuStyle.selectionBackgroundColor : void 0, r10 = e206 && this.menuStyle.selectionBorderColor ? `1px solid ${this.menuStyle.selectionBorderColor}` : ``, i10 = e206 && this.menuStyle.selectionBorderColor ? `-1px` : ``;
    this.item && (this.item.style.color = t10 ?? ``, this.item.style.backgroundColor = n10 ?? ``, this.item.style.outline = r10, this.item.style.outlineOffset = i10), this.check && (this.check.style.color = t10 ?? ``);
  }
}, AL = class extends kL {
  constructor(e206, t10, n10, r10, i10) {
    super(e206, e206, r10, i10), this.submenuActions = t10, this.parentData = n10, this.submenuOptions = r10, this.mysubmenu = null, this.submenuDisposables = this._register(new E()), this.mouseOver = false, this.expandDirection = r10 && r10.expandDirection !== void 0 ? r10.expandDirection : { horizontal: EL.Right, vertical: DL.Below }, this.showScheduler = new us(() => {
      this.mouseOver && (this.cleanupExistingSubmenu(false), this.createSubmenu(false));
    }, 250), this.hideScheduler = new us(() => {
      this.element && !Cl(kl(), this.element) && this.parentData.submenu === this.mysubmenu && (this.parentData.parent.focus(false), this.cleanupExistingSubmenu(true));
    }, 750);
  }
  render(e206) {
    super.render(e206), this.element && (this.item && (this.item.classList.add(`monaco-submenu-item`), this.item.tabIndex = 0, this.item.setAttribute(`aria-haspopup`, `true`), this.updateAriaExpanded(`false`), this.submenuIndicator = z(this.item, B(`span.submenu-indicator` + ju.asCSSSelector(F.menuSubmenu))), this.submenuIndicator.setAttribute(`aria-hidden`, `true`)), this._register(L(this.element, R.KEY_UP, (e207) => {
      let t10 = new Jo(e207);
      (t10.equals(17) || t10.equals(3)) && (Vl.stop(e207, true), this.createSubmenu(true));
    })), this._register(L(this.element, R.KEY_DOWN, (e207) => {
      let t10 = new Jo(e207);
      kl() === this.item && (t10.equals(17) || t10.equals(3)) && Vl.stop(e207, true);
    })), this._register(L(this.element, R.MOUSE_OVER, (e207) => {
      this.mouseOver || (this.mouseOver = true, this.showScheduler.schedule());
    })), this._register(L(this.element, R.MOUSE_LEAVE, (e207) => {
      this.mouseOver = false;
    })), this._register(L(this.element, R.FOCUS_OUT, (e207) => {
      this.element && !Cl(kl(), this.element) && this.hideScheduler.schedule();
    })), this._register(this.parentData.parent.onScroll(() => {
      this.parentData.submenu === this.mysubmenu && (this.parentData.parent.focus(false), this.cleanupExistingSubmenu(true));
    })));
  }
  updateEnabled() {
  }
  onClick(e206) {
    Vl.stop(e206, true), this.cleanupExistingSubmenu(false), this.createSubmenu(true);
  }
  cleanupExistingSubmenu(e206) {
    if (this.parentData.submenu && (e206 || this.parentData.submenu !== this.mysubmenu)) {
      try {
        this.parentData.submenu.dispose();
      } catch {
      }
      this.parentData.submenu = void 0, this.updateAriaExpanded(`false`), this.submenuContainer && (this.submenuContainer = (this.submenuDisposables.clear(), void 0));
    }
  }
  calculateSubmenuMenuLayout(e206, t10, n10, r10) {
    let i10 = { top: 0, left: 0 };
    return i10.left = KP(e206.width, t10.width, { position: r10.horizontal === EL.Right ? 0 : 1, offset: n10.left, size: n10.width }), i10.left >= n10.left && i10.left < n10.left + n10.width && (n10.left + 10 + t10.width <= e206.width && (i10.left = n10.left + 10), n10.top += 10, n10.height = 0), i10.top = KP(e206.height, t10.height, { position: 0, offset: n10.top, size: 0 }), i10.top + t10.height === n10.top && i10.top + n10.height + t10.height <= e206.height && (i10.top += n10.height), i10;
  }
  createSubmenu(e206 = true) {
    if (this.element) if (this.parentData.submenu) this.parentData.submenu.focus(false);
    else {
      this.updateAriaExpanded(`true`), this.submenuContainer = z(this.element, B(`div.monaco-submenu`)), this.submenuContainer.classList.add(`menubar-menu-items-holder`, `context-view`);
      let t10 = Vc(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode), n10 = parseFloat(t10.paddingTop || `0`) || 0;
      this.submenuContainer.style.position = `fixed`, this.submenuContainer.style.top = `0`, this.submenuContainer.style.left = `0`, this.submenuContainer.style.zIndex = `1`, this.parentData.submenu = new OL(this.submenuContainer, this.submenuActions.length ? this.submenuActions : [new jne()], this.submenuOptions, this.menuStyle);
      let r10 = this.element.getBoundingClientRect(), i10 = { top: r10.top - n10, left: r10.left, height: r10.height + 2 * n10, width: r10.width }, a10 = this.submenuContainer.getBoundingClientRect(), o10 = Vc(this.element), { top: s10, left: c10 } = this.calculateSubmenuMenuLayout(new ml(o10.innerWidth, o10.innerHeight), ml.lift(a10), i10, this.expandDirection);
      this.submenuContainer.style.left = `${c10 - a10.left}px`, this.submenuContainer.style.top = `${s10 - a10.top}px`, this.submenuDisposables.add(L(this.submenuContainer, R.KEY_UP, (e207) => {
        new Jo(e207).equals(15) && (Vl.stop(e207, true), this.parentData.parent.focus(), this.cleanupExistingSubmenu(true));
      })), this.submenuDisposables.add(L(this.submenuContainer, R.KEY_DOWN, (e207) => {
        new Jo(e207).equals(15) && Vl.stop(e207, true);
      })), this.submenuDisposables.add(this.parentData.submenu.onDidCancel(() => {
        this.parentData.parent.focus(), this.cleanupExistingSubmenu(true);
      })), this.parentData.submenu.focus(e206), this.mysubmenu = this.parentData.submenu;
    }
  }
  updateAriaExpanded(e206) {
    this.item && this.item?.setAttribute(`aria-expanded`, e206);
  }
  applyStyle() {
    super.applyStyle();
    let e206 = this.element && this.element.classList.contains(`focused`) && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor;
    this.submenuIndicator && (this.submenuIndicator.style.color = e206 ?? ``);
  }
  dispose() {
    super.dispose(), this.hideScheduler.dispose(), this.mysubmenu && (this.mysubmenu = (this.mysubmenu.dispose(), null)), this.submenuContainer && (this.submenuContainer = void 0);
  }
}, jL = class extends rL {
  constructor(e206, t10, n10, r10) {
    super(e206, t10, n10), this.menuStyles = r10;
  }
  render(e206) {
    super.render(e206), this.label && (this.label.style.borderBottomColor = this.menuStyles.separatorColor ? `${this.menuStyles.separatorColor}` : ``);
  }
};
function g_e(e206) {
  let t10 = wL, n10 = t10.exec(e206);
  if (!n10) return e206;
  let r10 = !n10[1];
  return e206.replace(t10, r10 ? `$2$3` : ``).trim();
}
function ML(e206) {
  let t10 = ui()[e206.id];
  return `.codicon-${e206.id}:before { content: '\\${t10.toString(16)}'; }`;
}
function __e(e206, t10) {
  let n10 = `
.monaco-menu {
	font-size: 13px;
	border-radius: 5px;
	min-width: 160px;
}

${ML(F.menuSelection)}
${ML(F.menuSubmenu)}

.monaco-menu .monaco-action-bar {
	text-align: right;
	overflow: hidden;
	white-space: nowrap;
}

.monaco-menu .monaco-action-bar .actions-container {
	display: flex;
	margin: 0 auto;
	padding: 0;
	width: 100%;
	justify-content: flex-end;
}

.monaco-menu .monaco-action-bar.vertical .actions-container {
	display: inline-block;
}

.monaco-menu .monaco-action-bar.reverse .actions-container {
	flex-direction: row-reverse;
}

.monaco-menu .monaco-action-bar .action-item {
	cursor: pointer;
	display: inline-block;
	transition: transform 50ms ease;
	position: relative;  /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}

.monaco-menu .monaco-action-bar .action-item.disabled {
	cursor: default;
}

.monaco-menu .monaco-action-bar .action-item .icon,
.monaco-menu .monaco-action-bar .action-item .codicon {
	display: inline-block;
}

.monaco-menu .monaco-action-bar .action-item .codicon {
	display: flex;
	align-items: center;
}

.monaco-menu .monaco-action-bar .action-label {
	font-size: 11px;
	margin-right: 4px;
}

.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
	color: var(--vscode-disabledForeground);
}

/* Vertical actions */

.monaco-menu .monaco-action-bar.vertical {
	text-align: left;
}

.monaco-menu .monaco-action-bar.vertical .action-item {
	display: block;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator {
	display: block;
	border-bottom: 1px solid var(--vscode-menu-separatorBackground);
	padding-top: 1px;
	padding: 30px;
}

.monaco-menu .secondary-actions .monaco-action-bar .action-label {
	margin-left: 6px;
}

/* Action Items */
.monaco-menu .monaco-action-bar .action-item.select-container {
	overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
	flex: 1;
	max-width: 170px;
	min-width: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 10px;
}

.monaco-menu .monaco-action-bar.vertical {
	margin-left: 0;
	overflow: visible;
}

.monaco-menu .monaco-action-bar.vertical .actions-container {
	display: block;
}

.monaco-menu .monaco-action-bar.vertical .action-item {
	padding: 0;
	transform: none;
	display: flex;
}

.monaco-menu .monaco-action-bar.vertical .action-item.active {
	transform: none;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item {
	flex: 1 1 auto;
	display: flex;
	height: 2em;
	align-items: center;
	position: relative;
	margin: 0 4px;
	border-radius: 4px;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
	opacity: unset;
}

.monaco-menu .monaco-action-bar.vertical .action-label {
	flex: 1 1 auto;
	text-decoration: none;
	padding: 0 1em;
	background: none;
	font-size: 12px;
	line-height: 1;
}

.monaco-menu .monaco-action-bar.vertical .keybinding,
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	display: inline-block;
	flex: 2 1 auto;
	padding: 0 1em;
	text-align: right;
	font-size: 12px;
	line-height: 1;
	opacity: 0.7;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	height: 100%;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
	font-size: 16px !important;
	display: flex;
	align-items: center;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
	margin-left: auto;
	margin-right: -20px;
}

.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
	opacity: 0.4;
}

.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
	display: inline-block;
	box-sizing: border-box;
	margin: 0;
}

.monaco-menu .monaco-action-bar.vertical .action-item {
	position: static;
	overflow: visible;
}

.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
	position: absolute;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator {
	width: 100%;
	height: 0px !important;
	opacity: 1;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
	padding: 0.7em 1em 0.1em 1em;
	font-weight: bold;
	opacity: 1;
}

.monaco-menu .monaco-action-bar.vertical .action-label:hover {
	color: inherit;
}

.monaco-menu .monaco-action-bar.vertical .menu-item-check {
	position: absolute;
	visibility: hidden;
	width: 1em;
	height: 100%;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
	visibility: visible;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Context Menu */

.context-view.monaco-menu-container {
	outline: 0;
	border: none;
	animation: fadeIn 0.083s linear;
	-webkit-app-region: no-drag;
}

.context-view.monaco-menu-container :focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
	outline: 0;
}

.hc-black .context-view.monaco-menu-container,
.hc-light .context-view.monaco-menu-container,
:host-context(.hc-black) .context-view.monaco-menu-container,
:host-context(.hc-light) .context-view.monaco-menu-container {
	box-shadow: none;
}

.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
	background: none;
}

/* Vertical Action Bar Styles */

.monaco-menu .monaco-action-bar.vertical {
	padding: 4px 0;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item {
	height: 2em;
}

.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
.monaco-menu .monaco-action-bar.vertical .keybinding {
	font-size: inherit;
	padding: 0 2em;
	max-height: 100%;
}

.monaco-menu .monaco-action-bar.vertical .menu-item-check {
	font-size: inherit;
	width: 2em;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator {
	font-size: inherit;
	margin: 5px 0 !important;
	padding: 0;
	border-radius: 0;
}

.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
	margin-left: 0;
	margin-right: 0;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	font-size: 60%;
	padding: 0 1.8em;
}

.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	height: 100%;
	mask-size: 10px 10px;
	-webkit-mask-size: 10px 10px;
}

.monaco-menu .action-item {
	cursor: default;
}`;
  if (t10) {
    n10 += `
			/* Arrows */
			.monaco-scrollable-element > .scrollbar > .scra {
				cursor: pointer;
				font-size: 11px !important;
			}

			.monaco-scrollable-element > .visible {
				opacity: 1;

				/* Background rule added for IE9 - to allow clicks on dom node */
				background:rgba(0,0,0,0);

				transition: opacity 100ms linear;
			}
			.monaco-scrollable-element > .invisible {
				opacity: 0;
				pointer-events: none;
			}
			.monaco-scrollable-element > .invisible.fade {
				transition: opacity 800ms linear;
			}

			/* Scrollable Content Inset Shadow */
			.monaco-scrollable-element > .shadow {
				position: absolute;
				display: none;
			}
			.monaco-scrollable-element > .shadow.top {
				display: block;
				top: 0;
				left: 3px;
				height: 3px;
				width: 100%;
			}
			.monaco-scrollable-element > .shadow.left {
				display: block;
				top: 3px;
				left: 0;
				height: 100%;
				width: 3px;
			}
			.monaco-scrollable-element > .shadow.top-left-corner {
				display: block;
				top: 0;
				left: 0;
				height: 3px;
				width: 3px;
			}
			/* Fix for https://github.com/microsoft/vscode/issues/103170 */
			.monaco-menu .action-item .monaco-submenu {
				z-index: 1;
			}
		`;
    let t11 = e206.scrollbarShadow;
    t11 && (n10 += `
				.monaco-scrollable-element > .shadow.top {
					box-shadow: ${t11} 0 6px 6px -6px inset;
				}

				.monaco-scrollable-element > .shadow.left {
					box-shadow: ${t11} 6px 0 6px -6px inset;
				}

				.monaco-scrollable-element > .shadow.top.left {
					box-shadow: ${t11} 6px 6px 6px -6px inset;
				}
			`);
    let r10 = e206.scrollbarSliderBackground;
    r10 && (n10 += `
				.monaco-scrollable-element > .scrollbar > .slider {
					background: ${r10};
				}
			`);
    let i10 = e206.scrollbarSliderHoverBackground;
    i10 && (n10 += `
				.monaco-scrollable-element > .scrollbar > .slider:hover {
					background: ${i10};
				}
			`);
    let a10 = e206.scrollbarSliderActiveBackground;
    a10 && (n10 += `
				.monaco-scrollable-element > .scrollbar > .slider.active {
					background: ${a10};
				}
			`);
  }
  return n10;
}
var v_e = class {
  constructor(e206, t10, n10, r10) {
    this.contextViewService = e206, this.telemetryService = t10, this.notificationService = n10, this.keybindingService = r10, this.focusToReturn = null, this.lastContainer = null, this.block = null, this.blockDisposable = null, this.options = { blockMouse: true };
  }
  configure(e206) {
    this.options = e206;
  }
  showContextMenu(e206) {
    let t10 = e206.getActions();
    if (!t10.length) return;
    this.focusToReturn = kl();
    let n10, r10 = Fl(e206.domForShadowRoot) ? e206.domForShadowRoot : void 0;
    this.contextViewService.showContextView({ getAnchor: () => e206.getAnchor(), canRelayout: false, anchorAlignment: e206.anchorAlignment, anchorAxisAlignment: e206.anchorAxisAlignment, layer: e206.layer, render: (r11) => {
      this.lastContainer = r11;
      let i10 = e206.getMenuClassName ? e206.getMenuClassName() : ``;
      i10 && (r11.className += ` ` + i10), this.options.blockMouse && (this.block = r11.appendChild(B(`.context-view-block`)), this.block.style.position = `fixed`, this.block.style.cursor = `initial`, this.block.style.left = `0`, this.block.style.top = `0`, this.block.style.width = `100%`, this.block.style.height = `100%`, this.block.style.zIndex = `-1`, this.blockDisposable?.dispose(), this.blockDisposable = L(this.block, R.MOUSE_DOWN, (e207) => e207.stopPropagation()));
      let a10 = new E(), o10 = e206.actionRunner || a10.add(new Eu());
      o10.onWillRun((t11) => this.onActionRun(t11, !e206.skipTelemetry), this, a10), o10.onDidRun(this.onDidActionRun, this, a10), n10 = new OL(r11, t10, { actionViewItemProvider: e206.getActionViewItem, context: e206.getActionsContext ? e206.getActionsContext() : null, actionRunner: o10, getKeyBinding: e206.getKeyBinding ? e206.getKeyBinding : (e207) => this.keybindingService.lookupKeybinding(e207.id) }, c_e), n10.onDidCancel(() => this.contextViewService.hideContextView(true), null, a10), n10.onDidBlur(() => this.contextViewService.hideContextView(true), null, a10);
      let s10 = Vc(r11);
      return a10.add(L(s10, R.BLUR, () => this.contextViewService.hideContextView(true))), a10.add(L(s10, R.MOUSE_DOWN, (e207) => {
        if (e207.defaultPrevented) return;
        let t11 = new Xo(s10, e207), n11 = t11.target;
        if (!t11.rightButton) {
          for (; n11; ) {
            if (n11 === r11) return;
            n11 = n11.parentElement;
          }
          this.contextViewService.hideContextView(true);
        }
      })), qt(a10, n10);
    }, focus: () => {
      n10?.focus(!!e206.autoSelectFirstItem);
    }, onHide: (t11) => {
      e206.onHide?.(!!t11), this.block && (this.block = (this.block.remove(), null)), this.blockDisposable?.dispose(), this.blockDisposable = null, this.lastContainer && (kl() === this.lastContainer || Cl(kl(), this.lastContainer)) && this.focusToReturn?.focus(), this.lastContainer = null;
    } }, r10, !!r10);
  }
  onActionRun(e206, t10) {
    t10 && this.telemetryService.publicLog2(`workbenchActionExecuted`, { id: e206.action.id, from: `contextMenu` }), this.contextViewService.hideContextView(false);
  }
  onDidActionRun(e206) {
    e206.error && !we(e206.error) && this.notificationService.error(e206.error);
  }
}, y_e = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, NL = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, PL = class extends D {
  get contextMenuHandler() {
    return this._contextMenuHandler || (this._contextMenuHandler = new v_e(this.contextViewService, this.telemetryService, this.notificationService, this.keybindingService)), this._contextMenuHandler;
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this.telemetryService = e206, this.notificationService = t10, this.contextViewService = n10, this.keybindingService = r10, this.menuService = i10, this.contextKeyService = a10, this._contextMenuHandler = void 0, this._onDidShowContextMenu = this._store.add(new k()), this.onDidShowContextMenu = this._onDidShowContextMenu.event, this._onDidHideContextMenu = this._store.add(new k()), this.onDidHideContextMenu = this._onDidHideContextMenu.event;
  }
  configure(e206) {
    this.contextMenuHandler.configure(e206);
  }
  showContextMenu(e206) {
    e206 = FL.transform(e206, this.menuService, this.contextKeyService), this.contextMenuHandler.showContextMenu({ ...e206, onHide: (t10) => {
      e206.onHide?.(t10), this._onDidHideContextMenu.fire();
    } }), tu.getInstance().resetKeyStatus(), this._onDidShowContextMenu.fire();
  }
};
PL = y_e([NL(0, bd), NL(1, dw), NL(2, pj), NL(3, Dw), NL(4, pd), NL(5, nd)], PL);
var FL;
(function(e206) {
  function t10(e207) {
    return e207 && e207.menuId instanceof W;
  }
  function n10(e207, n11, r10) {
    if (!t10(e207)) return e207;
    let { menuId: i10, menuActionOptions: a10, contextKeyService: o10 } = e207;
    return { ...e207, getActions: () => {
      let t11 = [];
      return i10 && (t11 = f_e(n11.getMenuActions(i10, o10 ?? r10, a10))), e207.getActions ? Du.join(e207.getActions(), t11) : t11;
    } };
  }
  e206.transform = n10;
})(FL || (FL = {}));
var IL;
(function(e206) {
  e206[e206.API = 0] = `API`, e206[e206.USER = 1] = `USER`;
})(IL || (IL = {}));
var LL = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, RL = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, zL = class {
  constructor(e206) {
    this._commandService = e206;
  }
  async open(e206, t10) {
    if (!Ss(e206, xs.command)) return false;
    if (!t10?.allowCommands || (typeof e206 == `string` && (e206 = $r.parse(e206)), Array.isArray(t10.allowCommands) && !t10.allowCommands.includes(e206.path))) return true;
    let n10 = [];
    try {
      n10 = jN(decodeURIComponent(e206.query));
    } catch {
      try {
        n10 = jN(e206.query);
      } catch {
      }
    }
    return Array.isArray(n10) || (n10 = [n10]), await this._commandService.executeCommand(e206.path, ...n10), true;
  }
};
zL = LL([RL(0, Mu)], zL);
var BL = class {
  constructor(e206) {
    this._editorService = e206;
  }
  async open(e206, t10) {
    typeof e206 == `string` && (e206 = $r.parse(e206));
    let { selection: n10, uri: r10 } = lhe(e206);
    return e206 = r10, e206.scheme === xs.file && (e206 = are(e206)), await this._editorService.openCodeEditor({ resource: e206, options: { selection: n10, source: t10?.fromUserGesture ? IL.USER : IL.API, ...t10?.editorOptions } }, this._editorService.getFocusedCodeEditor(), t10?.openToSide), true;
  }
};
BL = LL([RL(0, Su)], BL);
var VL = class {
  constructor(e206, t10) {
    this._openers = new Qt(), this._validators = new Qt(), this._resolvers = new Qt(), this._resolvedUriTargets = new wd((e207) => e207.with({ path: null, fragment: null, query: null }).toString()), this._externalOpeners = new Qt(), this._defaultExternalOpener = { openExternal: async (e207) => (Cs(e207, xs.http, xs.https) ? eu(e207) : Aa.location.href = e207, true) }, this._openers.push({ open: async (e207, t11) => t11?.openExternal || Cs(e207, xs.mailto, xs.http, xs.https, xs.vsls) ? (await this._doOpenExternal(e207, t11), true) : false }), this._openers.push(new zL(t10)), this._openers.push(new BL(e206));
  }
  registerOpener(e206) {
    return { dispose: this._openers.unshift(e206) };
  }
  async open(e206, t10) {
    if (!t10?.skipValidation) {
      let n10 = typeof e206 == `string` ? $r.parse(e206) : e206, r10 = this._resolvedUriTargets.get(n10) ?? e206;
      for (let e207 of this._validators) if (!await e207.shouldOpen(r10, t10)) return false;
    }
    for (let n10 of this._openers) if (await n10.open(e206, t10)) return true;
    return false;
  }
  async resolveExternalUri(e206, t10) {
    for (let n10 of this._resolvers) try {
      let r10 = await n10.resolveExternalUri(e206, t10);
      if (r10) return this._resolvedUriTargets.has(r10.resolved) || this._resolvedUriTargets.set(r10.resolved, e206), r10;
    } catch {
    }
    throw Error(`Could not resolve external URI: ` + e206.toString());
  }
  async _doOpenExternal(e206, t10) {
    let n10 = typeof e206 == `string` ? $r.parse(e206) : e206, r10;
    try {
      r10 = (await this.resolveExternalUri(n10, t10)).resolved;
    } catch {
      r10 = n10;
    }
    let i10;
    if (i10 = typeof e206 == `string` && n10.toString() === r10.toString() ? e206 : encodeURI(r10.toString(true)), t10?.allowContributedOpeners) {
      let e207 = typeof t10?.allowContributedOpeners == `string` ? t10?.allowContributedOpeners : void 0;
      for (let t11 of this._externalOpeners) if (await t11.openExternal(i10, { sourceUri: n10, preferredOpenerId: e207 }, dr.None)) return true;
    }
    return this._defaultExternalOpener.openExternal(i10, { sourceUri: n10 }, dr.None);
  }
  dispose() {
    this._validators.clear();
  }
};
VL = LL([RL(0, Su), RL(1, Mu)], VL);
var HL = xu(`editorWorkerService`), UL;
(function(e206) {
  e206[e206.Hint = 1] = `Hint`, e206[e206.Info = 2] = `Info`, e206[e206.Warning = 4] = `Warning`, e206[e206.Error = 8] = `Error`;
})(UL || (UL = {})), (function(e206) {
  function t10(e207, t11) {
    return t11 - e207;
  }
  e206.compare = t10;
  let n10 = /* @__PURE__ */ Object.create(null);
  n10[e206.Error] = C(1732, `Error`), n10[e206.Warning] = C(1733, `Warning`), n10[e206.Info] = C(1734, `Info`);
  function r10(e207) {
    return n10[e207] || ``;
  }
  e206.toString = r10;
  let i10 = /* @__PURE__ */ Object.create(null);
  i10[e206.Error] = C(1735, `Errors`), i10[e206.Warning] = C(1736, `Warnings`), i10[e206.Info] = C(1737, `Infos`);
  function a10(e207) {
    return i10[e207] || ``;
  }
  e206.toStringPlural = a10;
  function o10(t11) {
    switch (t11) {
      case lw.Error:
        return e206.Error;
      case lw.Warning:
        return e206.Warning;
      case lw.Info:
        return e206.Info;
      case lw.Ignore:
        return e206.Hint;
    }
  }
  e206.fromSeverity = o10;
  function s10(t11) {
    switch (t11) {
      case e206.Error:
        return lw.Error;
      case e206.Warning:
        return lw.Warning;
      case e206.Info:
        return lw.Info;
      case e206.Hint:
        return lw.Ignore;
    }
  }
  e206.toSeverity = s10;
})(UL || (UL = {}));
var WL;
(function(e206) {
  function t10(e207) {
    return n10(e207, true);
  }
  e206.makeKey = t10;
  function n10(e207, t11) {
    let n11 = [``];
    return e207.source ? n11.push(e207.source.replace(`\xA6`, `\\\xA6`)) : n11.push(``), e207.code ? typeof e207.code == `string` ? n11.push(e207.code.replace(`\xA6`, `\\\xA6`)) : n11.push(e207.code.value.replace(`\xA6`, `\\\xA6`)) : n11.push(``), e207.severity !== void 0 && e207.severity !== null ? n11.push(UL.toString(e207.severity)) : n11.push(``), e207.message && t11 ? n11.push(e207.message.replace(`\xA6`, `\\\xA6`)) : n11.push(``), e207.startLineNumber !== void 0 && e207.startLineNumber !== null ? n11.push(e207.startLineNumber.toString()) : n11.push(``), e207.startColumn !== void 0 && e207.startColumn !== null ? n11.push(e207.startColumn.toString()) : n11.push(``), e207.endLineNumber !== void 0 && e207.endLineNumber !== null ? n11.push(e207.endLineNumber.toString()) : n11.push(``), e207.endColumn !== void 0 && e207.endColumn !== null ? n11.push(e207.endColumn.toString()) : n11.push(``), n11.push(``), n11.join(`\xA6`);
  }
  e206.makeKeyOptionalMessage = n10;
})(WL || (WL = {}));
var GL = xu(`markerService`), b_e = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, KL = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, qL = class extends D {
  constructor(e206, t10) {
    super(), this._markerService = t10, this._onDidChangeMarker = this._register(new k()), this._suppressedRanges = new wd(), this._markerDecorations = new wd(), e206.getModels().forEach((e207) => this._onModelAdded(e207)), this._register(e206.onModelAdded(this._onModelAdded, this)), this._register(e206.onModelRemoved(this._onModelRemoved, this)), this._register(this._markerService.onMarkerChanged(this._handleMarkerChange, this));
  }
  dispose() {
    super.dispose(), this._markerDecorations.forEach((e206) => e206.dispose()), this._markerDecorations.clear();
  }
  getMarker(e206, t10) {
    let n10 = this._markerDecorations.get(e206);
    return n10 && n10.getMarker(t10) || null;
  }
  _handleMarkerChange(e206) {
    e206.forEach((e207) => {
      let t10 = this._markerDecorations.get(e207);
      t10 && this._updateDecorations(t10);
    });
  }
  _onModelAdded(e206) {
    let t10 = new x_e(e206);
    this._markerDecorations.set(e206.uri, t10), this._updateDecorations(t10);
  }
  _onModelRemoved(e206) {
    let t10 = this._markerDecorations.get(e206.uri);
    t10 && (t10.dispose(), this._markerDecorations.delete(e206.uri)), (e206.uri.scheme === xs.inMemory || e206.uri.scheme === xs.internal || e206.uri.scheme === xs.vscode) && this._markerService?.read({ resource: e206.uri }).map((e207) => e207.owner).forEach((t11) => this._markerService.remove(t11, [e206.uri]));
  }
  _updateDecorations(e206) {
    let t10 = this._markerService.read({ resource: e206.model.uri, take: 500 }), n10 = this._suppressedRanges.get(e206.model.uri);
    n10 && (t10 = t10.filter((e207) => !Ut.some(n10, (t11) => M.areIntersectingOrTouching(t11, e207)))), e206.update(t10) && this._onDidChangeMarker.fire(e206.model);
  }
};
qL = b_e([KL(0, Cu), KL(1, GL)], qL);
var x_e = class extends D {
  constructor(e206) {
    super(), this.model = e206, this._map = new ere(), this._register(T(() => {
      this.model.deltaDecorations([...this._map.values()], []), this._map.clear();
    }));
  }
  update(e206) {
    let { added: t10, removed: n10 } = Pde(new Set(this._map.keys()), new Set(e206));
    if (t10.length === 0 && n10.length === 0) return false;
    let r10 = n10.map((e207) => this._map.get(e207)), i10 = t10.map((e207) => ({ range: this._createDecorationRange(this.model, e207), options: this._createDecorationOption(e207) })), a10 = this.model.deltaDecorations(r10, i10);
    for (let e207 of n10) this._map.delete(e207);
    for (let e207 = 0; e207 < a10.length; e207++) this._map.set(t10[e207], a10[e207]);
    return true;
  }
  getMarker(e206) {
    return this._map.getKey(e206.id);
  }
  _createDecorationRange(e206, t10) {
    let n10 = M.lift(t10);
    if (t10.severity === UL.Hint && !this._hasMarkerTag(t10, 1) && !this._hasMarkerTag(t10, 2) && (n10 = n10.setEndPosition(n10.startLineNumber, n10.startColumn + 2)), n10 = e206.validateRange(n10), n10.isEmpty()) {
      let t11 = e206.getLineLastNonWhitespaceColumn(n10.startLineNumber) || e206.getLineMaxColumn(n10.startLineNumber);
      if (t11 === 1 || n10.endColumn >= t11) return n10;
      let r10 = e206.getWordAtPosition(n10.getStartPosition());
      r10 && (n10 = new M(n10.startLineNumber, r10.startColumn, n10.endLineNumber, r10.endColumn));
    } else if (t10.endColumn === Number.MAX_VALUE && t10.startColumn === 1 && n10.startLineNumber === n10.endLineNumber) {
      let r10 = e206.getLineFirstNonWhitespaceColumn(t10.startLineNumber);
      r10 < n10.endColumn && (n10 = new M(n10.startLineNumber, r10, n10.endLineNumber, n10.endColumn), t10.startColumn = r10);
    }
    return n10;
  }
  _createDecorationOption(e206) {
    let t10, n10, r10, i10, a10;
    switch (e206.severity) {
      case UL.Hint:
        t10 = this._hasMarkerTag(e206, 2) ? void 0 : this._hasMarkerTag(e206, 1) ? `squiggly-unnecessary` : `squiggly-hint`, r10 = 0;
        break;
      case UL.Info:
        t10 = `squiggly-info`, n10 = WS(mce), r10 = 10, a10 = { color: WS(my), position: 1 };
        break;
      case UL.Warning:
        t10 = `squiggly-warning`, n10 = WS(pce), r10 = 20, a10 = { color: WS(hy), position: 1 };
        break;
      case UL.Error:
      default:
        t10 = `squiggly-error`, n10 = WS(fce), r10 = 30, a10 = { color: WS(gy), position: 1 };
        break;
    }
    return e206.tags && (e206.tags.indexOf(1) !== -1 && (i10 = `squiggly-inline-unnecessary`), e206.tags.indexOf(2) !== -1 && (i10 = `squiggly-inline-deprecated`)), { description: `marker-decoration`, stickiness: 1, className: t10, showIfCollapsed: true, overviewRuler: { color: n10, position: Qp.Right }, minimap: a10, zIndex: r10, inlineClassName: i10 };
  }
  _hasMarkerTag(e206, t10) {
    return e206.tags ? e206.tags.indexOf(t10) >= 0 : false;
  }
}, S_e = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, JL = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, YL;
function XL(e206) {
  return e206.toString();
}
var C_e = class {
  constructor(e206, t10, n10) {
    this.model = e206, this._modelEventListeners = new E(), this.model = e206, this._modelEventListeners.add(e206.onWillDispose(() => t10(e206))), this._modelEventListeners.add(e206.onDidChangeLanguage((t11) => n10(e206, t11)));
  }
  dispose() {
    this._modelEventListeners.dispose();
  }
}, w_e = Et || Tt ? 1 : 2, T_e = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this.uri = e206, this.initialUndoRedoSnapshot = t10, this.time = n10, this.sharesUndoRedoStack = r10, this.heapSize = i10, this.sha1 = a10, this.versionId = o10, this.alternativeVersionId = s10;
  }
}, ZL = (_Wa = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._configurationService = e206, this._resourcePropertiesService = t10, this._undoRedoService = n10, this._instantiationService = r10, this._onModelAdded = this._register(new k()), this.onModelAdded = this._onModelAdded.event, this._onModelRemoved = this._register(new k()), this.onModelRemoved = this._onModelRemoved.event, this._onModelModeChanged = this._register(new k()), this.onModelLanguageChanged = this._onModelModeChanged.event, this._modelCreationOptionsByLanguageAndResource = /* @__PURE__ */ Object.create(null), this._models = {}, this._disposedModels = /* @__PURE__ */ new Map(), this._disposedModelsHeapSize = 0, this._register(this._configurationService.onDidChangeConfiguration((e207) => this._updateModelOptions(e207))), this._updateModelOptions(void 0);
  }
  static _readModelOptions(e206, t10) {
    let n10 = vn.tabSize;
    e206.editor && e206.editor.tabSize !== void 0 && (n10 = Fn(e206.editor.tabSize, vn.tabSize, 1, 100));
    let r10 = `tabSize`;
    e206.editor && e206.editor.indentSize !== void 0 && e206.editor.indentSize !== `tabSize` && (r10 = Fn(e206.editor.indentSize, `tabSize`, 1, 100));
    let i10 = vn.insertSpaces;
    e206.editor && e206.editor.insertSpaces !== void 0 && (i10 = e206.editor.insertSpaces === `false` ? false : !!e206.editor.insertSpaces);
    let a10 = w_e, o10 = e206.eol;
    o10 === `\r
` ? a10 = 2 : o10 === `
` && (a10 = 1);
    let s10 = vn.trimAutoWhitespace;
    e206.editor && e206.editor.trimAutoWhitespace !== void 0 && (s10 = e206.editor.trimAutoWhitespace === `false` ? false : !!e206.editor.trimAutoWhitespace);
    let c10 = vn.detectIndentation;
    e206.editor && e206.editor.detectIndentation !== void 0 && (c10 = e206.editor.detectIndentation === `false` ? false : !!e206.editor.detectIndentation);
    let l10 = vn.largeFileOptimizations;
    e206.editor && e206.editor.largeFileOptimizations !== void 0 && (l10 = e206.editor.largeFileOptimizations === `false` ? false : !!e206.editor.largeFileOptimizations);
    let u10 = vn.bracketPairColorizationOptions;
    if (e206.editor?.bracketPairColorization && typeof e206.editor.bracketPairColorization == `object`) {
      let t11 = e206.editor.bracketPairColorization;
      u10 = { enabled: !!t11.enabled, independentColorPoolPerBracketType: !!t11.independentColorPoolPerBracketType };
    }
    return { isForSimpleWidget: t10, tabSize: n10, indentSize: r10, insertSpaces: i10, detectIndentation: c10, defaultEOL: a10, trimAutoWhitespace: s10, largeFileOptimizations: l10, bracketPairColorizationOptions: u10 };
  }
  _getEOL(e206, t10) {
    if (e206) return this._resourcePropertiesService.getEOL(e206, t10);
    let n10 = this._configurationService.getValue(`files.eol`, { overrideIdentifier: t10 });
    return n10 && typeof n10 == `string` && n10 !== `auto` ? n10 : Pt === 3 || Pt === 2 ? `
` : `\r
`;
  }
  _shouldRestoreUndoStack() {
    let e206 = this._configurationService.getValue(`files.restoreUndoStack`);
    return typeof e206 == `boolean` ? e206 : true;
  }
  getCreationOptions(e206, t10, n10) {
    let r10 = typeof e206 == `string` ? e206 : e206.languageId, i10 = this._modelCreationOptionsByLanguageAndResource[r10 + t10];
    if (!i10) {
      let e207 = this._configurationService.getValue(`editor`, { overrideIdentifier: r10, resource: t10 }), a10 = this._getEOL(t10, r10);
      i10 = YL._readModelOptions({ editor: e207, eol: a10 }, n10), this._modelCreationOptionsByLanguageAndResource[r10 + t10] = i10;
    }
    return i10;
  }
  _updateModelOptions(e206) {
    let t10 = this._modelCreationOptionsByLanguageAndResource;
    this._modelCreationOptionsByLanguageAndResource = /* @__PURE__ */ Object.create(null);
    let n10 = Object.keys(this._models);
    for (let r10 = 0, i10 = n10.length; r10 < i10; r10++) {
      let i11 = n10[r10], a10 = this._models[i11], o10 = a10.model.getLanguageId(), s10 = a10.model.uri;
      if (e206 && !e206.affectsConfiguration(`editor`, { overrideIdentifier: o10, resource: s10 }) && !e206.affectsConfiguration(`files.eol`, { overrideIdentifier: o10, resource: s10 })) continue;
      let c10 = t10[o10 + s10], l10 = this.getCreationOptions(o10, s10, a10.model.isForSimpleWidget);
      YL._setModelOptionsForModel(a10.model, l10, c10);
    }
  }
  static _setModelOptionsForModel(e206, t10, n10) {
    n10 && n10.defaultEOL !== t10.defaultEOL && e206.getLineCount() === 1 && e206.setEOL(t10.defaultEOL === 1 ? 0 : 1), !(n10 && n10.detectIndentation === t10.detectIndentation && n10.insertSpaces === t10.insertSpaces && n10.tabSize === t10.tabSize && n10.indentSize === t10.indentSize && n10.trimAutoWhitespace === t10.trimAutoWhitespace && ot(n10.bracketPairColorizationOptions, t10.bracketPairColorizationOptions)) && (t10.detectIndentation ? (e206.detectIndentation(t10.insertSpaces, t10.tabSize), e206.updateOptions({ trimAutoWhitespace: t10.trimAutoWhitespace, bracketColorizationOptions: t10.bracketPairColorizationOptions })) : e206.updateOptions({ insertSpaces: t10.insertSpaces, tabSize: t10.tabSize, indentSize: t10.indentSize, trimAutoWhitespace: t10.trimAutoWhitespace, bracketColorizationOptions: t10.bracketPairColorizationOptions }));
  }
  _insertDisposedModel(e206) {
    this._disposedModels.set(XL(e206.uri), e206), this._disposedModelsHeapSize += e206.heapSize;
  }
  _removeDisposedModel(e206) {
    let t10 = this._disposedModels.get(XL(e206));
    return t10 && (this._disposedModelsHeapSize -= t10.heapSize), this._disposedModels.delete(XL(e206)), t10;
  }
  _ensureDisposedModelsHeapSize(e206) {
    if (this._disposedModelsHeapSize > e206) {
      let t10 = [];
      for (this._disposedModels.forEach((e207) => {
        e207.sharesUndoRedoStack || t10.push(e207);
      }), t10.sort((e207, t11) => e207.time - t11.time); t10.length > 0 && this._disposedModelsHeapSize > e206; ) {
        let e207 = t10.shift();
        this._removeDisposedModel(e207.uri), e207.initialUndoRedoSnapshot !== null && this._undoRedoService.restoreSnapshot(e207.initialUndoRedoSnapshot);
      }
    }
  }
  _createModelData(e206, t10, n10, r10) {
    let i10 = this.getCreationOptions(t10, n10, r10), a10 = this._instantiationService.createInstance(FO, e206, t10, i10, n10);
    if (n10 && this._disposedModels.has(XL(n10))) {
      let e207 = this._removeDisposedModel(n10), t11 = this._undoRedoService.getElements(n10), r11 = this._getSHA1Computer(), i11 = r11.canComputeSHA1(a10) ? r11.computeSHA1(a10) === e207.sha1 : false;
      if (i11 || e207.sharesUndoRedoStack) {
        for (let e208 of t11.past) SE(e208) && e208.matchesResource(n10) && e208.setModel(a10);
        for (let e208 of t11.future) SE(e208) && e208.matchesResource(n10) && e208.setModel(a10);
        this._undoRedoService.setElementsValidFlag(n10, true, (e208) => SE(e208) && e208.matchesResource(n10)), i11 && (a10._overwriteVersionId(e207.versionId), a10._overwriteAlternativeVersionId(e207.alternativeVersionId), a10._overwriteInitialUndoRedoSnapshot(e207.initialUndoRedoSnapshot));
      } else e207.initialUndoRedoSnapshot !== null && this._undoRedoService.restoreSnapshot(e207.initialUndoRedoSnapshot);
    }
    let o10 = XL(a10.uri);
    if (this._models[o10]) throw Error(`ModelService: Cannot add model because it already exists!`);
    let s10 = new C_e(a10, (e207) => this._onWillDispose(e207), (e207, t11) => this._onDidChangeLanguage(e207, t11));
    return this._models[o10] = s10, s10;
  }
  createModel(e206, t10, n10, r10 = false) {
    let i10;
    return i10 = t10 ? this._createModelData(e206, t10, n10, r10) : this._createModelData(e206, hp, n10, r10), this._onModelAdded.fire(i10.model), i10.model;
  }
  getModels() {
    let e206 = [], t10 = Object.keys(this._models);
    for (let n10 = 0, r10 = t10.length; n10 < r10; n10++) {
      let r11 = t10[n10];
      e206.push(this._models[r11].model);
    }
    return e206;
  }
  getModel(e206) {
    let t10 = XL(e206), n10 = this._models[t10];
    return n10 ? n10.model : null;
  }
  _schemaShouldMaintainUndoRedoElements(e206) {
    return e206.scheme === xs.file || e206.scheme === xs.vscodeRemote || e206.scheme === xs.vscodeUserData || e206.scheme === xs.vscodeNotebookCell || e206.scheme === `fake-fs`;
  }
  _onWillDispose(e206) {
    let t10 = XL(e206.uri), n10 = this._models[t10], r10 = this._undoRedoService.getUriComparisonKey(e206.uri) !== e206.uri.toString(), i10 = false, a10 = 0;
    if (r10 || this._shouldRestoreUndoStack() && this._schemaShouldMaintainUndoRedoElements(e206.uri)) {
      let t11 = this._undoRedoService.getElements(e206.uri);
      if (t11.past.length > 0 || t11.future.length > 0) {
        for (let n11 of t11.past) SE(n11) && n11.matchesResource(e206.uri) && (i10 = true, a10 += n11.heapSize(e206.uri), n11.setModel(e206.uri));
        for (let n11 of t11.future) SE(n11) && n11.matchesResource(e206.uri) && (i10 = true, a10 += n11.heapSize(e206.uri), n11.setModel(e206.uri));
      }
    }
    let o10 = YL.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK, s10 = this._getSHA1Computer();
    if (!i10) {
      if (!r10) {
        let e207 = n10.model.getInitialUndoRedoSnapshot();
        e207 !== null && this._undoRedoService.restoreSnapshot(e207);
      }
    } else if (!r10 && (a10 > o10 || !s10.canComputeSHA1(e206))) {
      let e207 = n10.model.getInitialUndoRedoSnapshot();
      e207 !== null && this._undoRedoService.restoreSnapshot(e207);
    } else this._ensureDisposedModelsHeapSize(o10 - a10), this._undoRedoService.setElementsValidFlag(e206.uri, false, (t11) => SE(t11) && t11.matchesResource(e206.uri)), this._insertDisposedModel(new T_e(e206.uri, n10.model.getInitialUndoRedoSnapshot(), Date.now(), r10, a10, s10.computeSHA1(e206), e206.getVersionId(), e206.getAlternativeVersionId()));
    delete this._models[t10], n10.dispose(), delete this._modelCreationOptionsByLanguageAndResource[e206.getLanguageId() + e206.uri], this._onModelRemoved.fire(e206);
  }
  _onDidChangeLanguage(e206, t10) {
    let n10 = t10.oldLanguage, r10 = e206.getLanguageId(), i10 = this.getCreationOptions(n10, e206.uri, e206.isForSimpleWidget), a10 = this.getCreationOptions(r10, e206.uri, e206.isForSimpleWidget);
    YL._setModelOptionsForModel(e206, a10, i10), this._onModelModeChanged.fire({ model: e206, oldLanguageId: n10 });
  }
  _getSHA1Computer() {
    return new E_e();
  }
}, YL = _Wa, _Wa.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK = 20 * 1024 * 1024, _Wa);
ZL = YL = S_e([JL(0, Uf), JL(1, Wh), JL(2, wO), JL(3, V)], ZL);
var E_e = (_Xa = class {
  canComputeSHA1(t10) {
    return t10.getValueLength() <= _Xa.MAX_MODEL_SIZE;
  }
  computeSHA1(e206) {
    let t10 = new qte(), n10 = e206.createSnapshot(), r10;
    for (; r10 = n10.read(); ) t10.update(r10);
    return t10.digest();
  }
}, _Xa.MAX_MODEL_SIZE = 10 * 1024 * 1024, _Xa), QL;
(function(e206) {
  e206[e206.PRESERVE = 0] = `PRESERVE`, e206[e206.LAST = 1] = `LAST`;
})(QL || (QL = {}));
var $L = { Quickaccess: `workbench.contributions.quickaccess` }, D_e = class {
  constructor() {
    this.providers = [], this.defaultProvider = void 0;
  }
  registerQuickAccessProvider(e206) {
    return e206.prefix.length === 0 ? this.defaultProvider = e206 : this.providers.push(e206), this.providers.sort((e207, t10) => t10.prefix.length - e207.prefix.length), T(() => {
      this.providers.splice(this.providers.indexOf(e206), 1), this.defaultProvider === e206 && (this.defaultProvider = void 0);
    });
  }
  getQuickAccessProviders() {
    return h([this.defaultProvider, ...this.providers]);
  }
  getQuickAccessProvider(e206) {
    return e206 && this.providers.find((t10) => e206.startsWith(t10.prefix)) || this.defaultProvider;
  }
};
cd.add($L.Quickaccess, new D_e());
var O_e = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, eR = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, tR = class extends D {
  constructor(e206, t10) {
    super(), this.quickInputService = e206, this.instantiationService = t10, this.registry = cd.as($L.Quickaccess), this.mapProviderToDescriptor = /* @__PURE__ */ new Map(), this.lastAcceptedPickerValues = /* @__PURE__ */ new Map(), this.visibleQuickAccess = void 0, this._register(T(() => {
      for (let e207 of this.mapProviderToDescriptor.values()) Gt(e207) && e207.dispose();
      this.visibleQuickAccess?.picker.dispose();
    }));
  }
  show(e206 = ``, t10) {
    this.doShowOrPick(e206, false, t10);
  }
  doShowOrPick(e206, t10, n10) {
    let [r10, i10] = this.getOrInstantiateProvider(e206, n10?.enabledProviderPrefixes), a10 = this.visibleQuickAccess, o10 = a10?.descriptor;
    if (a10 && i10 && o10 === i10) {
      e206 !== i10.prefix && !n10?.preserveValue && (a10.picker.value = e206), this.adjustValueSelection(a10.picker, i10, n10);
      return;
    }
    if (i10 && !n10?.preserveValue) {
      let t11;
      if (a10 && o10 && o10 !== i10) {
        let e207 = a10.value.substr(o10.prefix.length);
        e207 && (t11 = `${i10.prefix}${e207}`);
      }
      if (!t11) {
        let e207 = r10?.defaultFilterValue;
        e207 === QL.LAST ? t11 = this.lastAcceptedPickerValues.get(i10) : typeof e207 == `string` && (t11 = `${i10.prefix}${e207}`);
      }
      typeof t11 == `string` && (e206 = t11);
    }
    let s10 = a10?.picker?.valueSelection, c10 = a10?.picker?.value, l10 = new E(), u10 = l10.add(this.quickInputService.createQuickPick({ useSeparators: true }));
    u10.value = e206, this.adjustValueSelection(u10, i10, n10), u10.placeholder = n10?.placeholder ?? i10?.placeholder, u10.quickNavigate = n10?.quickNavigateConfiguration, u10.hideInput = !!u10.quickNavigate && !a10, (typeof n10?.itemActivation == `number` || n10?.quickNavigateConfiguration) && (u10.itemActivation = n10?.itemActivation ?? nF.SECOND), u10.contextKey = i10?.contextKey, u10.filterValue = (e207) => e207.substring(i10 ? i10.prefix.length : 0);
    let d10;
    t10 && (d10 = new hs(), l10.add(O.once(u10.onWillAccept)((e207) => {
      e207.veto(), u10.hide();
    }))), l10.add(this.registerPickerListeners(u10, r10, i10, e206, n10));
    let f10 = l10.add(new pr());
    if (r10 && l10.add(r10.provide(u10, f10.token, n10?.providerOptions)), O.once(u10.onDidHide)(() => {
      u10.selectedItems.length === 0 && f10.cancel(), l10.dispose(), d10?.complete(u10.selectedItems.slice(0));
    }), u10.show(), s10 && c10 === e206 && (u10.valueSelection = s10), t10) return d10?.p;
  }
  adjustValueSelection(e206, t10, n10) {
    let r10;
    r10 = n10?.preserveValue ? [e206.value.length, e206.value.length] : [t10?.prefix.length ?? 0, e206.value.length], e206.valueSelection = r10;
  }
  registerPickerListeners(e206, t10, n10, r10, i10) {
    let a10 = new E(), o10 = this.visibleQuickAccess = { picker: e206, descriptor: n10, value: r10 };
    return a10.add(T(() => {
      o10 === this.visibleQuickAccess && (this.visibleQuickAccess = void 0);
    })), a10.add(e206.onDidChangeValue((e207) => {
      let [n11] = this.getOrInstantiateProvider(e207, i10?.enabledProviderPrefixes);
      n11 === t10 ? o10.value = e207 : this.show(e207, { enabledProviderPrefixes: i10?.enabledProviderPrefixes, preserveValue: true, providerOptions: i10?.providerOptions });
    })), n10 && a10.add(e206.onDidAccept(() => {
      this.lastAcceptedPickerValues.set(n10, e206.value);
    })), a10;
  }
  getOrInstantiateProvider(e206, t10) {
    let n10 = this.registry.getQuickAccessProvider(e206);
    if (!n10 || t10 && !t10?.includes(n10.prefix)) return [void 0, void 0];
    let r10 = this.mapProviderToDescriptor.get(n10);
    return r10 || (r10 = this.instantiationService.createInstance(n10.ctor), this.mapProviderToDescriptor.set(n10, r10)), [r10, n10];
  }
};
tR = O_e([eR(0, aF), eR(1, V)], tR);
var nR = { inputActiveOptionBorder: `#007ACC00`, inputActiveOptionForeground: `#FFFFFF`, inputActiveOptionBackground: `#0E639C50` }, rR = class extends rx {
  get onChange() {
    return this._onChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  constructor(e206) {
    super(), this._onChange = this._register(new k()), this._onKeyDown = this._register(new k()), this._opts = e206, this._title = this._opts.title, this._checked = this._opts.isChecked;
    let t10 = [`monaco-custom-toggle`];
    this._opts.icon && (this._icon = this._opts.icon, t10.push(...ju.asClassNameArray(this._icon))), this._opts.actionClassName && t10.push(...this._opts.actionClassName.split(` `)), this._checked && t10.push(`checked`), this.domNode = document.createElement(`div`), this._register(EI().setupDelayedHover(this.domNode, () => ({ content: this._title, style: 1 }), this._opts.hoverLifecycleOptions)), this.domNode.classList.add(...t10), this._opts.notFocusable || (this.domNode.tabIndex = 0), this.domNode.setAttribute(`role`, `checkbox`), this.domNode.setAttribute(`aria-checked`, String(this._checked)), this.setTitle(this._opts.title), this.applyStyles(), this.onclick(this.domNode, (e207) => {
      this.enabled && (this.checked = !this._checked, this._onChange.fire(false), e207.preventDefault());
    }), this._register(this.ignoreGesture(this.domNode)), this.onkeydown(this.domNode, (e207) => {
      if (this.enabled) {
        if (e207.keyCode === 10 || e207.keyCode === 3) {
          this.checked = !this._checked, this._onChange.fire(true), e207.preventDefault(), e207.stopPropagation();
          return;
        }
        this._onKeyDown.fire(e207);
      }
    });
  }
  get enabled() {
    return this.domNode.getAttribute(`aria-disabled`) !== `true`;
  }
  focus() {
    this.domNode.focus();
  }
  get checked() {
    return this._checked;
  }
  set checked(e206) {
    this._checked = e206, this.domNode.setAttribute(`aria-checked`, String(this._checked)), this.domNode.classList.toggle(`checked`, this._checked), this.applyStyles();
  }
  setIcon(e206) {
    this._icon && this.domNode.classList.remove(...ju.asClassNameArray(this._icon)), this._icon = e206, this._icon && this.domNode.classList.add(...ju.asClassNameArray(this._icon));
  }
  width() {
    return 22;
  }
  applyStyles() {
    this.domNode && (this.domNode.style.borderColor = this._checked && this._opts.inputActiveOptionBorder || ``, this.domNode.style.color = this._checked && this._opts.inputActiveOptionForeground || `inherit`, this.domNode.style.backgroundColor = this._checked && this._opts.inputActiveOptionBackground || ``);
  }
  enable() {
    this.domNode.setAttribute(`aria-disabled`, `false`), this.domNode.classList.remove(`disabled`);
  }
  disable() {
    this.domNode.setAttribute(`aria-disabled`, `true`), this.domNode.classList.add(`disabled`);
  }
  setTitle(e206) {
    this._title = e206, this.domNode.setAttribute(`aria-label`, e206);
  }
  set visible(e206) {
    this.domNode.style.display = e206 ? `` : `none`;
  }
  get visible() {
    return this.domNode.style.display !== `none`;
  }
}, iR = (_Ya = class extends rx {
  constructor(e206, t10, n10) {
    super(), this.checkbox = e206, this.domNode = t10, this.styles = n10, this._onChange = this._register(new k()), this.onChange = this._onChange.event, this.applyStyles();
  }
  get enabled() {
    return this.checkbox.enabled;
  }
  enable() {
    this.checkbox.enable(), this.applyStyles(true);
  }
  disable() {
    this.checkbox.disable(), this.applyStyles(false);
  }
  setTitle(e206) {
    this.checkbox.setTitle(e206);
  }
  applyStyles(e206 = this.enabled) {
    this.domNode.style.color = (e206 ? this.styles.checkboxForeground : this.styles.checkboxDisabledForeground) || ``, this.domNode.style.backgroundColor = (e206 ? this.styles.checkboxBackground : this.styles.checkboxDisabledBackground) || ``, this.domNode.style.borderColor = (e206 ? this.styles.checkboxBorder : this.styles.checkboxDisabledBackground) || ``;
    let t10 = this.styles.size || 18;
    this.domNode.style.width = this.domNode.style.height = this.domNode.style.fontSize = `${t10}px`, this.domNode.style.fontSize = `${t10 - 2}px`;
  }
}, _Ya.CLASS_NAME = `monaco-checkbox`, _Ya), aR = class extends iR {
  constructor(e206, t10, n10) {
    let r10 = new rR({ title: e206, isChecked: t10, icon: F.check, actionClassName: iR.CLASS_NAME, hoverLifecycleOptions: n10.hoverLifecycleOptions, ...nR });
    super(r10, r10.domNode, n10), this._register(r10), this._register(this.checkbox.onChange((e207) => {
      this.applyStyles(), this._onChange.fire(e207);
    }));
  }
  get checked() {
    return this.checkbox.checked;
  }
  set checked(e206) {
    this.checkbox.checked = e206, this.applyStyles();
  }
  applyStyles(e206) {
    this.checkbox.checked ? this.checkbox.setIcon(F.check) : this.checkbox.setIcon(void 0), super.applyStyles(e206);
  }
}, oR = class extends iR {
  constructor(e206, t10, n10) {
    let r10;
    switch (t10) {
      case true:
        r10 = F.check;
        break;
      case `mixed`:
        r10 = F.dash;
        break;
      case false:
        r10 = void 0;
        break;
    }
    let i10 = new rR({ title: e206, isChecked: t10 === true, icon: r10, actionClassName: aR.CLASS_NAME, hoverLifecycleOptions: n10.hoverLifecycleOptions, ...nR });
    super(i10, i10.domNode, n10), this._state = t10, this._register(i10), this._register(this.checkbox.onChange((e207) => {
      this._state = this.checkbox.checked, this.applyStyles(), this._onChange.fire(e207);
    }));
  }
  get checked() {
    return this._state;
  }
  set checked(e206) {
    this._state !== e206 && (this._state = e206, this.checkbox.checked = e206 === true, this.applyStyles());
  }
  applyStyles(e206) {
    switch (this._state) {
      case true:
        this.checkbox.setIcon(F.check);
        break;
      case `mixed`:
        this.checkbox.setIcon(F.dash);
        break;
      case false:
        this.checkbox.setIcon(void 0);
        break;
    }
    super.applyStyles(e206);
  }
}, k_e = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, sR = class {
  constructor(e206) {
    this.nodes = e206;
  }
  toString() {
    return this.nodes.map((e206) => typeof e206 == `string` ? e206 : e206.label).join(``);
  }
};
k_e([ex], sR.prototype, `toString`, null);
var A_e = /\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;
function j_e(e206) {
  let t10 = [], n10 = 0, r10;
  for (; r10 = A_e.exec(e206); ) {
    r10.index - n10 > 0 && t10.push(e206.substring(n10, r10.index));
    let [, i10, a10, , o10] = r10;
    o10 ? t10.push({ label: i10, href: a10, title: o10 }) : t10.push({ label: i10, href: a10 }), n10 = r10.index + r10[0].length;
  }
  return n10 < e206.length && t10.push(e206.substring(n10)), new sR(t10);
}
var cR = {}, M_e = new BM(`quick-input-button-icon-`);
function N_e(e206) {
  if (!e206) return;
  let t10, n10 = e206.dark.toString();
  return cR[n10] ? t10 = cR[n10] : (t10 = M_e.nextId(), x_(`.${t10}, .hc-light .${t10}`, `background-image: ${_I2(e206.light || e206.dark)}`), x_(`.vs-dark .${t10}, .hc-black .${t10}`, `background-image: ${_I2(e206.dark)}`), cR[n10] = t10), t10;
}
function lR(e206, t10, n10) {
  let r10 = e206.iconClass || N_e(e206.iconPath);
  return e206.alwaysVisible && (r10 = r10 ? `${r10} always-visible` : `always-visible`), { id: t10, label: ``, tooltip: e206.tooltip || ``, class: r10, enabled: true, run: n10 };
}
function P_e(e206, t10, n10) {
  Jl(t10);
  let r10 = j_e(e206), i10 = 0;
  for (let e207 of r10.nodes) if (typeof e207 == `string`) t10.append(...CP(e207));
  else {
    let r11 = e207.title;
    !r11 && e207.href.startsWith(`command:`) ? r11 = C(1771, `Click to execute command '{0}'`, e207.href.substring(8)) : r11 || (r11 = e207.href);
    let a10 = B(`a`, { href: e207.href, title: r11, tabIndex: i10++ }, e207.label);
    a10.style.textDecoration = `underline`;
    let o10 = (t11) => {
      Bl(t11) && Vl.stop(t11, true), n10.callback(e207.href);
    }, s10 = n10.disposables.add(new yx(a10, R.CLICK)).event, c10 = n10.disposables.add(new yx(a10, R.KEY_DOWN)).event, l10 = O.chain(c10, (e208) => e208.filter((e209) => {
      let t11 = new Jo(e209);
      return t11.equals(10) || t11.equals(3);
    }));
    n10.disposables.add(nx.addTarget(a10));
    let u10 = n10.disposables.add(new yx(a10, tx.Tap)).event;
    O.any(s10, u10, l10)(o10, null, n10.disposables), t10.appendChild(a10);
  }
}
var F_e = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, uR = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, dR = `inQuickInput`, I_e = new U(dR, false, C(1748, `Whether keyboard focus is inside the quick input control`)), fR = H.has(dR), L_e = new U(`quickInputAlignment`, `top`, C(1749, `The alignment of the quick input`)), pR = `quickInputType`, R_e = new U(pR, void 0, C(1750, `The type of the currently visible quick input`)), mR = `cursorAtEndOfQuickInputBox`, z_e = new U(mR, false, C(1751, `Whether the cursor in the quick input is at the end of the input box`)), B_e = H.has(mR), hR = { iconClass: ju.asClassName(F.quickInputBack), tooltip: C(1752, `Back`) }, gR = (_Za = class extends D {
  constructor(t10) {
    super(), this.ui = t10, this._visible = Ic(`visible`, false), this._widgetUpdated = false, this._enabled = true, this._busy = false, this._ignoreFocusOut = false, this._leftButtons = [], this._rightButtons = [], this._inlineButtons = [], this.buttonsUpdated = false, this._toggles = [], this.togglesUpdated = false, this.noValidationMessage = _Za.noPromptMessage, this._severity = lw.Ignore, this.onDidTriggerButtonEmitter = this._register(new k()), this.onDidHideEmitter = this._register(new k()), this.onWillHideEmitter = this._register(new k()), this.onDisposeEmitter = this._register(new k()), this.visibleDisposables = this._register(new E()), this.onDidHide = this.onDidHideEmitter.event;
  }
  get visible() {
    return this._visible.get();
  }
  get title() {
    return this._title;
  }
  set title(e206) {
    this._title = e206, this.update();
  }
  get description() {
    return this._description;
  }
  set description(e206) {
    this._description = e206, this.update();
  }
  get step() {
    return this._steps;
  }
  set step(e206) {
    this._steps = e206, this.update();
  }
  get totalSteps() {
    return this._totalSteps;
  }
  set totalSteps(e206) {
    this._totalSteps = e206, this.update();
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e206) {
    this._enabled = e206, this.update();
  }
  get contextKey() {
    return this._contextKey;
  }
  set contextKey(e206) {
    this._contextKey = e206, this.update();
  }
  get busy() {
    return this._busy;
  }
  set busy(e206) {
    this._busy = e206, this.update();
  }
  get ignoreFocusOut() {
    return this._ignoreFocusOut;
  }
  set ignoreFocusOut(e206) {
    let t10 = this._ignoreFocusOut !== e206 && !kt;
    this._ignoreFocusOut = e206 && !kt, t10 && this.update();
  }
  get titleButtons() {
    return this._leftButtons.length ? [...this._leftButtons, this._rightButtons] : this._rightButtons;
  }
  get buttons() {
    return [...this._leftButtons, ...this._rightButtons, ...this._inlineButtons];
  }
  set buttons(e206) {
    this._leftButtons = e206.filter((e207) => e207 === hR), this._rightButtons = e206.filter((e207) => e207 !== hR && e207.location !== iF.Inline), this._inlineButtons = e206.filter((e207) => e207.location === iF.Inline), this.buttonsUpdated = true, this.update();
  }
  get toggles() {
    return this._toggles;
  }
  set toggles(e206) {
    this._toggles = e206 ?? [], this.togglesUpdated = true, this.update();
  }
  get validationMessage() {
    return this._validationMessage;
  }
  set validationMessage(e206) {
    this._validationMessage = e206, this.update();
  }
  get severity() {
    return this._severity;
  }
  set severity(e206) {
    this._severity = e206, this.update();
  }
  show() {
    this.visible || (this.visibleDisposables.add(this.ui.onDidTriggerButton((e206) => {
      this.buttons.indexOf(e206) !== -1 && this.onDidTriggerButtonEmitter.fire(e206);
    })), this.ui.show(this), this._visible.set(true, void 0), this._lastValidationMessage = void 0, this._lastSeverity = void 0, this.buttons.length && (this.buttonsUpdated = true), this.toggles.length && (this.togglesUpdated = true), this.update());
  }
  hide() {
    this.visible && this.ui.hide();
  }
  didHide(e206 = tF.Other) {
    this._visible.set(false, void 0), this.visibleDisposables.clear(), this.onDidHideEmitter.fire({ reason: e206 });
  }
  willHide(e206 = tF.Other) {
    this.onWillHideEmitter.fire({ reason: e206 });
  }
  update() {
    if (!this.visible) return;
    let e206 = this.getTitle();
    e206 && this.ui.title.textContent !== e206 ? this.ui.title.textContent = e206 : !e206 && this.ui.title.innerHTML !== `&nbsp;` && (this.ui.title.innerText = `\xA0`);
    let t10 = this.getDescription();
    if (this.ui.description1.textContent !== t10 && (this.ui.description1.textContent = t10), this.ui.description2.textContent !== t10 && (this.ui.description2.textContent = t10), this._widgetUpdated && (this._widgetUpdated = false, this._widget ? Jl(this.ui.widget, this._widget) : Jl(this.ui.widget)), this.busy && !this.busyDelay && (this.busyDelay = new cs(), this.busyDelay.setIfNotSet(() => {
      this.visible && (this.ui.progressBar.infinite(), this.ui.progressBar.getContainer().removeAttribute(`aria-hidden`));
    }, 800)), !this.busy && this.busyDelay && (this.ui.progressBar.stop(), this.ui.progressBar.getContainer().setAttribute(`aria-hidden`, `true`), this.busyDelay.cancel(), this.busyDelay = void 0), this.buttonsUpdated) {
      this.buttonsUpdated = false, this.ui.leftActionBar.clear();
      let e207 = this._leftButtons.map((e208, t12) => lR(e208, `id-${t12}`, async () => this.onDidTriggerButtonEmitter.fire(e208)));
      this.ui.leftActionBar.push(e207, { icon: true, label: false }), this.ui.rightActionBar.clear();
      let t11 = this._rightButtons.map((e208, t12) => lR(e208, `id-${t12}`, async () => this.onDidTriggerButtonEmitter.fire(e208)));
      this.ui.rightActionBar.push(t11, { icon: true, label: false }), this.ui.inlineActionBar.clear();
      let n11 = this._inlineButtons.map((e208, t12) => lR(e208, `id-${t12}`, async () => this.onDidTriggerButtonEmitter.fire(e208)));
      this.ui.inlineActionBar.push(n11, { icon: true, label: false });
    }
    if (this.togglesUpdated) {
      this.togglesUpdated = false;
      let e207 = this.toggles?.filter((e208) => e208 instanceof rR) ?? [];
      this.ui.inputBox.toggles = e207;
      let t11 = e207.length * 22;
      this.ui.countContainer.style.right = t11 > 0 ? `${4 + t11}px` : `4px`, this.ui.visibleCountContainer.style.right = t11 > 0 ? `${4 + t11}px` : `4px`;
    }
    this.ui.ignoreFocusOut = this.ignoreFocusOut, this.ui.setEnabled(this.enabled), this.ui.setContextKey(this.contextKey);
    let n10 = this.validationMessage || this.noValidationMessage;
    this._lastValidationMessage !== n10 && (this._lastValidationMessage = n10, Jl(this.ui.message), n10 && P_e(n10, this.ui.message, { callback: (e207) => {
      this.ui.linkOpenerDelegate(e207);
    }, disposables: this.visibleDisposables })), this._lastSeverity !== this.severity && (this._lastSeverity = this.severity, this.showMessageDecoration(this.severity));
  }
  getTitle() {
    return this.title && this.step ? `${this.title} (${this.getSteps()})` : this.title ? this.title : this.step ? this.getSteps() : ``;
  }
  getDescription() {
    return this.description || ``;
  }
  getSteps() {
    return this.step && this.totalSteps ? C(1754, `{0}/{1}`, this.step, this.totalSteps) : this.step ? String(this.step) : ``;
  }
  showMessageDecoration(e206) {
    if (this.ui.inputBox.showDecoration(e206), e206 !== lw.Ignore) {
      let t10 = this.ui.inputBox.stylesForType(e206);
      this.ui.message.style.color = t10.foreground ? `${t10.foreground}` : ``, this.ui.message.style.backgroundColor = t10.background ? `${t10.background}` : ``, this.ui.message.style.border = t10.border ? `1px solid ${t10.border}` : ``, this.ui.message.style.marginBottom = `-2px`;
    } else this.ui.message.style.color = ``, this.ui.message.style.backgroundColor = ``, this.ui.message.style.border = ``, this.ui.message.style.marginBottom = ``;
  }
  dispose() {
    this.hide(), this.onDisposeEmitter.fire(), super.dispose();
  }
}, _Za.noPromptMessage = C(1753, `Press 'Enter' to confirm your input or 'Escape' to cancel`), _Za), _R2 = (__a = class extends gR {
  constructor(e206) {
    super(e206), this._value = ``, this.onDidChangeValueEmitter = this._register(new k()), this.onWillAcceptEmitter = this._register(new k()), this.onDidAcceptEmitter = this._register(new k()), this.onDidCustomEmitter = this._register(new k()), this._items = [], this.itemsUpdated = false, this._canSelectMany = false, this._canAcceptInBackground = false, this._matchOnDescription = false, this._matchOnDetail = false, this._matchOnLabel = true, this._matchOnLabelMode = `fuzzy`, this._sortByLabel = true, this._keepScrollPosition = false, this._itemActivation = nF.FIRST, this._activeItems = [], this.activeItemsUpdated = false, this.activeItemsToConfirm = [], this.onDidChangeActiveEmitter = this._register(new k()), this._selectedItems = [], this.selectedItemsUpdated = false, this.selectedItemsToConfirm = [], this.onDidChangeSelectionEmitter = this._register(new k()), this.onDidTriggerItemButtonEmitter = this._register(new k()), this.onDidTriggerSeparatorButtonEmitter = this._register(new k()), this.valueSelectionUpdated = true, this._ok = `default`, this._customButton = false, this._focusEventBufferer = new dn(), this.type = `quickPick`, this.filterValue = (e207) => e207, this.onDidChangeValue = this.onDidChangeValueEmitter.event, this.onWillAccept = this.onWillAcceptEmitter.event, this.onDidAccept = this.onDidAcceptEmitter.event, this.onDidChangeActive = this.onDidChangeActiveEmitter.event, this.onDidChangeSelection = this.onDidChangeSelectionEmitter.event, this.onDidTriggerItemButton = this.onDidTriggerItemButtonEmitter.event, this.onDidTriggerSeparatorButton = this.onDidTriggerSeparatorButtonEmitter.event, this.noValidationMessage = void 0;
  }
  get quickNavigate() {
    return this._quickNavigate;
  }
  set quickNavigate(e206) {
    this._quickNavigate = e206, this.update();
  }
  get value() {
    return this._value;
  }
  set value(e206) {
    this.doSetValue(e206);
  }
  doSetValue(e206, t10) {
    this._value !== e206 && (this._value = e206, t10 || this.update(), this.visible && this.ui.list.filter(this.filterValue(this._value)) && this.trySelectFirst(), this.onDidChangeValueEmitter.fire(this._value));
  }
  set ariaLabel(e206) {
    this._ariaLabel = e206, this.update();
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e206) {
    this._placeholder = e206, this.update();
  }
  get prompt() {
    return this.noValidationMessage;
  }
  set prompt(e206) {
    this.noValidationMessage = e206, this.update();
  }
  get items() {
    return this._items;
  }
  get scrollTop() {
    return this.ui.list.scrollTop;
  }
  set scrollTop(e206) {
    this.ui.list.scrollTop = e206;
  }
  set items(e206) {
    this._items = e206, this.itemsUpdated = true, this.update();
  }
  get canSelectMany() {
    return this._canSelectMany;
  }
  set canSelectMany(e206) {
    this._canSelectMany = e206, this.update();
  }
  get canAcceptInBackground() {
    return this._canAcceptInBackground;
  }
  set canAcceptInBackground(e206) {
    this._canAcceptInBackground = e206;
  }
  get matchOnDescription() {
    return this._matchOnDescription;
  }
  set matchOnDescription(e206) {
    this._matchOnDescription = e206, this.update();
  }
  get matchOnDetail() {
    return this._matchOnDetail;
  }
  set matchOnDetail(e206) {
    this._matchOnDetail = e206, this.update();
  }
  get matchOnLabel() {
    return this._matchOnLabel;
  }
  set matchOnLabel(e206) {
    this._matchOnLabel = e206, this.update();
  }
  get matchOnLabelMode() {
    return this._matchOnLabelMode;
  }
  set matchOnLabelMode(e206) {
    this._matchOnLabelMode = e206, this.update();
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e206) {
    this._sortByLabel = e206, this.update();
  }
  get keepScrollPosition() {
    return this._keepScrollPosition;
  }
  set keepScrollPosition(e206) {
    this._keepScrollPosition = e206;
  }
  get itemActivation() {
    return this._itemActivation;
  }
  set itemActivation(e206) {
    this._itemActivation = e206;
  }
  get activeItems() {
    return this._activeItems;
  }
  set activeItems(e206) {
    this._activeItems = e206, this.activeItemsUpdated = true, this.update();
  }
  get selectedItems() {
    return this._selectedItems;
  }
  set selectedItems(e206) {
    this._selectedItems = e206, this.selectedItemsUpdated = true, this.update();
  }
  get keyMods() {
    return this._quickNavigate ? Ehe : this.ui.keyMods;
  }
  get valueSelection() {
    let e206 = this.ui.inputBox.getSelection();
    if (e206) return [e206.start, e206.end];
  }
  set valueSelection(e206) {
    this._valueSelection = e206, this.valueSelectionUpdated = true, this.update();
  }
  get customButton() {
    return this._customButton;
  }
  set customButton(e206) {
    this._customButton = e206, this.update();
  }
  get customLabel() {
    return this._customButtonLabel;
  }
  set customLabel(e206) {
    this._customButtonLabel = e206, this.update();
  }
  get customHover() {
    return this._customButtonHover;
  }
  set customHover(e206) {
    this._customButtonHover = e206, this.update();
  }
  get ok() {
    return this._ok;
  }
  set ok(e206) {
    this._ok = e206, this.update();
  }
  get okLabel() {
    return this._okLabel ?? C(1756, `OK`);
  }
  set okLabel(e206) {
    this._okLabel = e206, this.update();
  }
  get hideInput() {
    return !!this._hideInput;
  }
  set hideInput(e206) {
    this._hideInput = e206, this.update();
  }
  trySelectFirst() {
    this.canSelectMany || this.ui.list.focus(rF.First);
  }
  show() {
    this.visible || (this.visibleDisposables.add(this.ui.inputBox.onDidChange((e206) => {
      this.doSetValue(e206, true);
    })), this.visibleDisposables.add(this.ui.onDidAccept(() => {
      this.canSelectMany ? this.ui.list.getCheckedElements().length || (this._selectedItems = [], this.onDidChangeSelectionEmitter.fire(this.selectedItems)) : this.activeItems[0] && (this._selectedItems = [this.activeItems[0]], this.onDidChangeSelectionEmitter.fire(this.selectedItems)), this.handleAccept(false);
    })), this.visibleDisposables.add(this.ui.onDidCustom(() => {
      this.onDidCustomEmitter.fire();
    })), this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus, (e206, t10) => t10)((e206) => {
      this.activeItemsUpdated || this.activeItemsToConfirm !== this._activeItems && o(e206, this._activeItems, (e207, t10) => e207 === t10) || (this._activeItems = e206, this.onDidChangeActiveEmitter.fire(e206));
    })), this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({ items: e206, event: t10 }) => {
      if (this.canSelectMany && !e206.some((e207) => e207.pickable === false)) {
        e206.length && this.ui.list.setSelectedElements([]);
        return;
      }
      this.selectedItemsToConfirm !== this._selectedItems && o(e206, this._selectedItems, (e207, t11) => e207 === t11) || (this._selectedItems = e206, this.onDidChangeSelectionEmitter.fire(e206), e206.length && this.handleAccept(Rl(t10) && t10.button === 1));
    })), this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e206) => {
      !this.canSelectMany || !this.visible || this.selectedItemsToConfirm !== this._selectedItems && o(e206, this._selectedItems, (e207, t10) => e207 === t10) || (this._selectedItems = e206, this.onDidChangeSelectionEmitter.fire(e206));
    })), this.visibleDisposables.add(this.ui.list.onButtonTriggered((e206) => this.onDidTriggerItemButtonEmitter.fire(e206))), this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered((e206) => this.onDidTriggerSeparatorButtonEmitter.fire(e206))), this.visibleDisposables.add(this.registerQuickNavigation()), this.valueSelectionUpdated = true), super.show();
  }
  handleAccept(e206) {
    let t10 = false;
    this.onWillAcceptEmitter.fire({ veto: () => t10 = true }), t10 || this.onDidAcceptEmitter.fire({ inBackground: e206 });
  }
  registerQuickNavigation() {
    return L(this.ui.container, R.KEY_UP, (e206) => {
      if (this.canSelectMany || !this._quickNavigate) return;
      let t10 = new Jo(e206), n10 = t10.keyCode;
      this._quickNavigate.keybindings.some((e207) => {
        let r10 = e207.getChords();
        return r10.length > 1 ? false : r10[0].shiftKey && n10 === 4 ? !(t10.ctrlKey || t10.altKey || t10.metaKey) : !!(r10[0].altKey && n10 === 6 || r10[0].ctrlKey && n10 === 5 || r10[0].metaKey && n10 === 57);
      }) && (this.activeItems[0] && (this._selectedItems = [this.activeItems[0]], this.onDidChangeSelectionEmitter.fire(this.selectedItems), this.handleAccept(false)), this._quickNavigate = void 0);
    });
  }
  update() {
    if (!this.visible) return;
    let t10 = this.keepScrollPosition ? this.scrollTop : 0, n10 = !!this.description, r10 = { title: !!this.title || !!this.step || !!this.titleButtons.length, description: n10, checkAll: this.canSelectMany && !this._hideCheckAll, checkBox: this.canSelectMany, inputBox: !this._hideInput, progressBar: !this._hideInput || n10, visibleCount: true, count: this.canSelectMany && !this._hideCountBadge, ok: this.ok === `default` ? this.canSelectMany : this.ok, list: true, message: !!this.validationMessage || !!this.prompt, customButton: this.customButton };
    this.ui.setVisibilities(r10), super.update(), this.ui.inputBox.value !== this.value && (this.ui.inputBox.value = this.value), this.valueSelectionUpdated && (this.valueSelectionUpdated = false, this.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] })), this.ui.inputBox.placeholder !== (this.placeholder || ``) && (this.ui.inputBox.placeholder = this.placeholder || ``);
    let i10 = this.ariaLabel;
    !i10 && r10.inputBox && (i10 = this.placeholder, this.title && (i10 = i10 ? `${i10} - ${this.title}` : this.title), i10 || (i10 = __a.DEFAULT_ARIA_LABEL)), this.ui.list.ariaLabel !== i10 && (this.ui.list.ariaLabel = i10 ?? null), this.ui.inputBox.ariaLabel !== i10 && (this.ui.inputBox.ariaLabel = i10 ?? `input`), this.ui.list.matchOnDescription = this.matchOnDescription, this.ui.list.matchOnDetail = this.matchOnDetail, this.ui.list.matchOnLabel = this.matchOnLabel, this.ui.list.matchOnLabelMode = this.matchOnLabelMode, this.ui.list.sortByLabel = this.sortByLabel, this.itemsUpdated && (this.itemsUpdated = false, this._focusEventBufferer.bufferEvents(() => {
      switch (this.ui.list.setElements(this.items), this.ui.list.shouldLoop = !this.canSelectMany, this.ui.list.filter(this.filterValue(this.ui.inputBox.value)), this._itemActivation) {
        case nF.NONE:
          this._itemActivation = nF.FIRST;
          break;
        case nF.SECOND:
          this.ui.list.focus(rF.Second), this._itemActivation = nF.FIRST;
          break;
        case nF.LAST:
          this.ui.list.focus(rF.Last), this._itemActivation = nF.FIRST;
          break;
        default:
          this.trySelectFirst();
          break;
      }
    })), this.ui.container.classList.contains(`show-checkboxes`) !== !!this.canSelectMany && (this.canSelectMany ? this.ui.list.clearFocus() : this.trySelectFirst()), this.activeItemsUpdated && (this.activeItemsUpdated = false, this.activeItemsToConfirm = this._activeItems, this.ui.list.setFocusedElements(this.activeItems), this.activeItemsToConfirm === this._activeItems && (this.activeItemsToConfirm = null)), this.selectedItemsUpdated && (this.selectedItemsUpdated = false, this.selectedItemsToConfirm = this._selectedItems, this.canSelectMany ? this.ui.list.setCheckedElements(this.selectedItems) : this.ui.list.setSelectedElements(this.selectedItems), this.selectedItemsToConfirm === this._selectedItems && (this.selectedItemsToConfirm = null)), this.ui.ok.label = this.okLabel || ``, this.ui.customButton.label = this.customLabel || ``, this.ui.customButton.element.title = this.customHover || ``, r10.inputBox || (this.ui.list.domFocus(), this.canSelectMany && this.ui.list.focus(rF.First)), this.keepScrollPosition && (this.scrollTop = t10);
  }
  focus(e206) {
    this.ui.list.focus(e206), this.canSelectMany && this.ui.list.domFocus();
  }
  accept(e206) {
    e206 && !this._canAcceptInBackground || (this.activeItems[0] && !this._canSelectMany && (this._selectedItems = [this.activeItems[0]], this.onDidChangeSelectionEmitter.fire(this.selectedItems)), this.handleAccept(e206 ?? false));
  }
}, __a.DEFAULT_ARIA_LABEL = C(1755, `Type to narrow down results.`), __a), V_e = class extends gR {
  constructor() {
    super(...arguments), this._value = ``, this.valueSelectionUpdated = true, this._password = false, this.onDidValueChangeEmitter = this._register(new k()), this.onDidAcceptEmitter = this._register(new k()), this.type = `inputBox`, this.onDidChangeValue = this.onDidValueChangeEmitter.event, this.onDidAccept = this.onDidAcceptEmitter.event;
  }
  get value() {
    return this._value;
  }
  set value(e206) {
    this._value = e206 || ``, this.update();
  }
  get valueSelection() {
    let e206 = this.ui.inputBox.getSelection();
    if (e206) return [e206.start, e206.end];
  }
  set valueSelection(e206) {
    this._valueSelection = e206, this.valueSelectionUpdated = true, this.update();
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e206) {
    this._placeholder = e206, this.update();
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  set ariaLabel(e206) {
    this._ariaLabel = e206, this.update();
  }
  get password() {
    return this._password;
  }
  set password(e206) {
    this._password = e206, this.update();
  }
  get prompt() {
    return this._prompt;
  }
  set prompt(e206) {
    this._prompt = e206, this.noValidationMessage = e206 ? C(1757, `{0} (Press 'Enter' to confirm or 'Escape' to cancel)`, e206) : gR.noPromptMessage, this.update();
  }
  show() {
    this.visible || (this.visibleDisposables.add(this.ui.inputBox.onDidChange((e206) => {
      e206 !== this.value && (this._value = e206, this.onDidValueChangeEmitter.fire(e206));
    })), this.visibleDisposables.add(this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire())), this.valueSelectionUpdated = true), super.show();
  }
  accept() {
    this.onDidAcceptEmitter.fire();
  }
  update() {
    if (!this.visible) return;
    this.ui.container.classList.remove(`hidden-input`);
    let e206 = { title: !!this.title || !!this.step || !!this.titleButtons.length, description: !!this.description || !!this.step, inputBox: true, message: true, progressBar: true };
    this.ui.setVisibilities(e206), super.update(), this.ui.inputBox.value !== this.value && (this.ui.inputBox.value = this.value), this.valueSelectionUpdated && (this.valueSelectionUpdated = false, this.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] })), this.ui.inputBox.placeholder !== (this.placeholder || ``) && (this.ui.inputBox.placeholder = this.placeholder || ``), this.ui.inputBox.password !== this.password && (this.ui.inputBox.password = this.password);
    let t10 = this.ariaLabel;
    !t10 && e206.inputBox && (t10 = this.placeholder ? this.title ? `${this.placeholder} - ${this.title}` : this.placeholder : this.title ? this.title : `input`), this.ui.inputBox.ariaLabel !== t10 && (this.ui.inputBox.ariaLabel = t10 || `input`);
  }
}, vR = class extends dj {
  constructor(e206, t10) {
    super(`mouse`, void 0, (e207) => this.getOverrideOptions(e207), e206, t10);
  }
  getOverrideOptions(e206) {
    return { persistence: { hideOnKeyDown: false }, appearance: { showHoverHint: (Fl(e206.content) ? e206.content.textContent ?? `` : typeof e206.content == `string` ? e206.content : e206.content.value).includes(`
`), skipFadeInAnimation: true } };
  }
};
vR = F_e([uR(0, Uf), uR(1, uj)], vR), Y.white.toString(), Y.white.toString();
var H_e = Object.freeze({ allowedTags: { override: [`b`, `i`, `u`, `code`, `span`] }, allowedAttributes: { override: [`class`] } }), yR = class extends D {
  get onDidClick() {
    return this._onDidClick.event;
  }
  constructor(e206, t10) {
    super(), this._label = ``, this._onDidClick = this._register(new k()), this._onDidEscape = this._register(new k()), this.options = t10, this._element = document.createElement(`a`), this._element.classList.add(`monaco-button`), this._element.tabIndex = 0, this._element.setAttribute(`role`, `button`), this._element.classList.toggle(`secondary`, !!t10.secondary);
    let n10 = t10.secondary ? t10.buttonSecondaryBackground : t10.buttonBackground, r10 = t10.secondary ? t10.buttonSecondaryForeground : t10.buttonForeground;
    this._element.style.color = r10 || ``, this._element.style.backgroundColor = n10 || ``, t10.supportShortLabel && (this._labelShortElement = document.createElement(`div`), this._labelShortElement.classList.add(`monaco-button-label-short`), this._element.appendChild(this._labelShortElement), this._labelElement = document.createElement(`div`), this._labelElement.classList.add(`monaco-button-label`), this._element.appendChild(this._labelElement), this._element.classList.add(`monaco-text-button-with-short-label`)), typeof t10.title == `string` && this.setTitle(t10.title), typeof t10.ariaLabel == `string` && this._element.setAttribute(`aria-label`, t10.ariaLabel), e206.appendChild(this._element), this.enabled = !t10.disabled, this._register(nx.addTarget(this._element)), [R.CLICK, tx.Tap].forEach((e207) => {
      this._register(L(this._element, e207, (e208) => {
        if (!this.enabled) {
          Vl.stop(e208);
          return;
        }
        this._onDidClick.fire(e208);
      }));
    }), this._register(L(this._element, R.KEY_DOWN, (e207) => {
      let t11 = new Jo(e207), n11 = false;
      this.enabled && (t11.equals(3) || t11.equals(10)) ? (this._onDidClick.fire(e207), n11 = true) : t11.equals(9) && (this._onDidEscape.fire(e207), this._element.blur(), n11 = true), n11 && Vl.stop(t11, true);
    })), this._register(L(this._element, R.MOUSE_OVER, (e207) => {
      this._element.classList.contains(`disabled`) || this.updateBackground(true);
    })), this._register(L(this._element, R.MOUSE_OUT, (e207) => {
      this.updateBackground(false);
    })), this.focusTracker = this._register(Gl(this._element)), this._register(this.focusTracker.onDidFocus(() => {
      this.enabled && this.updateBackground(true);
    })), this._register(this.focusTracker.onDidBlur(() => {
      this.enabled && this.updateBackground(false);
    }));
  }
  dispose() {
    super.dispose(), this._element.remove();
  }
  getContentElements(e206) {
    let t10 = [];
    for (let n10 of CP(e206)) if (typeof n10 == `string`) {
      if (n10 = n10.trim(), n10 === ``) continue;
      let e207 = document.createElement(`span`);
      e207.textContent = n10, t10.push(e207);
    } else t10.push(n10);
    return t10;
  }
  updateBackground(e206) {
    let t10;
    t10 = this.options.secondary ? e206 ? this.options.buttonSecondaryHoverBackground : this.options.buttonSecondaryBackground : e206 ? this.options.buttonHoverBackground : this.options.buttonBackground, t10 && (this._element.style.backgroundColor = t10);
  }
  get element() {
    return this._element;
  }
  set label(e206) {
    if (this._label === e206 || IM(this._label) && IM(e206) && Tpe(this._label, e206)) return;
    this._element.classList.add(`monaco-text-button`);
    let t10 = this.options.supportShortLabel ? this._labelElement : this._element;
    if (IM(e206)) {
      let n11 = EP(e206, void 0, document.createElement(`span`));
      n11.dispose();
      let r10 = n11.element.querySelector(`p`)?.innerHTML;
      r10 ? SP(t10, r10, H_e) : Jl(t10);
    } else this.options.supportIcons ? Jl(t10, ...this.getContentElements(e206)) : t10.textContent = e206;
    let n10 = ``;
    typeof this.options.title == `string` ? n10 = this.options.title : this.options.title && (n10 = Ume(e206)), this.setTitle(n10), this._setAriaLabel(), this._label = e206;
  }
  get label() {
    return this._label;
  }
  _setAriaLabel() {
    typeof this.options.ariaLabel == `string` ? this._element.setAttribute(`aria-label`, this.options.ariaLabel) : typeof this.options.title == `string` && this._element.setAttribute(`aria-label`, this.options.title);
  }
  set icon(e206) {
    this._setAriaLabel();
    let t10 = Array.from(this._element.classList).filter((e207) => e207.startsWith(`codicon-`));
    this._element.classList.remove(...t10), this._element.classList.add(...ju.asClassNameArray(e206));
  }
  set enabled(e206) {
    e206 ? (this._element.classList.remove(`disabled`), this._element.setAttribute(`aria-disabled`, `false`), this._element.tabIndex = 0) : (this._element.classList.add(`disabled`), this._element.setAttribute(`aria-disabled`, `true`));
  }
  get enabled() {
    return !this._element.classList.contains(`disabled`);
  }
  setTitle(e206) {
    !this._hover && e206 !== `` ? this._hover = this._register(EI().setupManagedHover(this.options.hoverDelegate ?? CI(`element`), this._element, e206)) : this._hover && this._hover.update(e206);
  }
}, bR = class extends D {
  constructor(e206, t10, n10) {
    super(), this.options = t10, this.styles = n10, this.count = 0, this.hover = this._register(new Jt()), this.element = z(e206, B(`.monaco-count-badge`)), this._register(T(() => e206.removeChild(this.element))), this.countFormat = this.options.countFormat || `{0}`, this.titleFormat = this.options.titleFormat || ``, this.setCount(this.options.count || 0), this.updateHover();
  }
  setCount(e206) {
    this.count = e206, this.render();
  }
  setTitleFormat(e206) {
    this.titleFormat = e206, this.updateHover(), this.render();
  }
  updateHover() {
    this.titleFormat !== `` && !this.hover.value ? this.hover.value = EI().setupDelayedHoverAtMouse(this.element, () => ({ content: La(this.titleFormat, this.count), appearance: { compact: true } })) : this.titleFormat === `` && this.hover.value && (this.hover.value = void 0);
  }
  render() {
    this.element.textContent = La(this.countFormat, this.count), this.element.style.backgroundColor = this.styles.badgeBackground ?? ``, this.element.style.color = this.styles.badgeForeground ?? ``, this.styles.badgeBorder && (this.element.style.border = `1px solid ${this.styles.badgeBorder}`);
  }
}, xR = `done`, SR = `active`, CR = `infinite`, wR = `infinite-long-running`, TR = `discrete`, U_e = (_$a = class extends D {
  constructor(t10, n10) {
    super(), this.progressSignal = this._register(new Jt()), this.workedVal = 0, this.showDelayedScheduler = this._register(new us(() => Zl(this.element), 0)), this.longRunningScheduler = this._register(new us(() => this.infiniteLongRunning(), _$a.LONG_RUNNING_INFINITE_THRESHOLD)), this.create(t10, n10);
  }
  create(e206, t10) {
    this.element = document.createElement(`div`), this.element.classList.add(`monaco-progress-container`), this.element.setAttribute(`role`, `progressbar`), this.element.setAttribute(`aria-valuemin`, `0`), e206.appendChild(this.element), this.bit = document.createElement(`div`), this.bit.classList.add(`progress-bit`), this.bit.style.backgroundColor = t10?.progressBarBackground || `#0E70C0`, this.element.appendChild(this.bit);
  }
  off() {
    this.bit.style.width = `inherit`, this.bit.style.opacity = `1`, this.element.classList.remove(SR, CR, wR, TR), this.workedVal = 0, this.totalWork = void 0, this.longRunningScheduler.cancel(), this.progressSignal.clear();
  }
  stop() {
    return this.doDone(false);
  }
  doDone(e206) {
    return this.element.classList.add(xR), this.element.classList.contains(CR) ? (this.bit.style.opacity = `0`, e206 ? setTimeout(() => this.off(), 200) : this.off()) : (this.bit.style.width = `inherit`, e206 ? setTimeout(() => this.off(), 200) : this.off()), this;
  }
  infinite() {
    return this.bit.style.width = `2%`, this.bit.style.opacity = `1`, this.element.classList.remove(TR, xR, wR), this.element.classList.add(SR, CR), this.longRunningScheduler.schedule(), this;
  }
  infiniteLongRunning() {
    this.element.classList.add(wR);
  }
  getContainer() {
    return this.element;
  }
}, _$a.LONG_RUNNING_INFINITE_THRESHOLD = 1e4, _$a), W_e = C(2, `Match Case`), G_e = C(3, `Match Whole Word`), K_e = C(4, `Use Regular Expression`), ER = class extends rR {
  constructor(e206) {
    super({ icon: F.caseSensitive, title: W_e + e206.appendTitle, isChecked: e206.isChecked, hoverLifecycleOptions: e206.hoverLifecycleOptions, inputActiveOptionBorder: e206.inputActiveOptionBorder, inputActiveOptionForeground: e206.inputActiveOptionForeground, inputActiveOptionBackground: e206.inputActiveOptionBackground });
  }
}, DR = class extends rR {
  constructor(e206) {
    super({ icon: F.wholeWord, title: G_e + e206.appendTitle, isChecked: e206.isChecked, hoverLifecycleOptions: e206.hoverLifecycleOptions, inputActiveOptionBorder: e206.inputActiveOptionBorder, inputActiveOptionForeground: e206.inputActiveOptionForeground, inputActiveOptionBackground: e206.inputActiveOptionBackground });
  }
}, OR = class extends rR {
  constructor(e206) {
    super({ icon: F.regex, title: K_e + e206.appendTitle, isChecked: e206.isChecked, hoverLifecycleOptions: e206.hoverLifecycleOptions, inputActiveOptionBorder: e206.inputActiveOptionBorder, inputActiveOptionForeground: e206.inputActiveOptionForeground, inputActiveOptionBackground: e206.inputActiveOptionBackground });
  }
};
function q_e(e206, t10, n10) {
  let r10 = n10 ?? document.createElement(`div`);
  return r10.textContent = e206, r10;
}
function kR(e206, t10, n10) {
  let r10 = n10 ?? document.createElement(`div`);
  return r10.textContent = ``, jR(r10, MR(e206), t10?.actionHandler, t10?.renderCodeSegments), r10;
}
var AR = class {
  constructor(e206) {
    this.source = e206, this.index = 0;
  }
  eos() {
    return this.index >= this.source.length;
  }
  next() {
    let e206 = this.peek();
    return this.advance(), e206;
  }
  peek() {
    return this.source[this.index];
  }
  advance() {
    this.index++;
  }
};
function jR(e206, t10, n10, r10) {
  let i10;
  if (t10.type === 2) i10 = document.createTextNode(t10.content || ``);
  else if (t10.type === 3) i10 = document.createElement(`b`);
  else if (t10.type === 4) i10 = document.createElement(`i`);
  else if (t10.type === 7 && r10) i10 = document.createElement(`code`);
  else if (t10.type === 5 && n10) {
    let e207 = document.createElement(`a`);
    n10.disposables.add(el(e207, `click`, (e208) => {
      n10.callback(String(t10.index), e208);
    })), i10 = e207;
  } else t10.type === 8 ? i10 = document.createElement(`br`) : t10.type === 1 && (i10 = e206);
  i10 && e206 !== i10 && e206.appendChild(i10), i10 && Array.isArray(t10.children) && t10.children.forEach((e207) => {
    jR(i10, e207, n10, r10);
  });
}
function MR(e206, t10) {
  let n10 = { type: 1, children: [] }, r10 = 0, i10 = n10, a10 = [], o10 = new AR(e206);
  for (; !o10.eos(); ) {
    let e207 = o10.next(), t11 = e207 === `\\` && PR(o10.peek()) !== 0;
    if (t11 && (e207 = o10.next()), !t11 && NR(e207) && e207 === o10.peek()) {
      o10.advance(), i10.type === 2 && (i10 = a10.pop());
      let t12 = PR(e207);
      if (i10.type === t12 || i10.type === 5 && t12 === 6) i10 = a10.pop();
      else {
        let e208 = { type: t12, children: [] };
        t12 === 5 && (e208.index = r10, r10++), i10.children.push(e208), a10.push(i10), i10 = e208;
      }
    } else if (e207 === `
`) i10.type === 2 && (i10 = a10.pop()), i10.children.push({ type: 8 });
    else if (i10.type !== 2) {
      let t12 = { type: 2, content: e207 };
      i10.children.push(t12), a10.push(i10), i10 = t12;
    } else i10.content += e207;
  }
  return i10.type === 2 && (i10 = a10.pop()), n10;
}
function NR(e206, t10) {
  return PR(e206) !== 0;
}
function PR(e206, t10) {
  switch (e206) {
    case `*`:
      return 3;
    case `_`:
      return 4;
    case `[`:
      return 5;
    case `]`:
      return 6;
    case "`":
      return 0;
    default:
      return 0;
  }
}
var FR = class {
  constructor(e206, t10 = 0, n10 = e206.length, r10 = t10 - 1) {
    this.items = e206, this.start = t10, this.end = n10, this.index = r10;
  }
  current() {
    return this.index === this.start - 1 || this.index === this.end ? null : this.items[this.index];
  }
  next() {
    return this.index = Math.min(this.index + 1, this.end), this.current();
  }
  previous() {
    return this.index = Math.max(this.index - 1, this.start - 1), this.current();
  }
  first() {
    return this.index = this.start, this.current();
  }
  last() {
    return this.index = this.end - 1, this.current();
  }
}, IR = class {
  constructor(e206 = /* @__PURE__ */ new Set(), t10 = 10) {
    this._history = e206, this._limit = t10, this._onChange(), this._history.onDidChange && (this._disposable = this._history.onDidChange(() => this._onChange()));
  }
  getHistory() {
    return this._elements;
  }
  add(e206) {
    this._history.delete(e206), this._history.add(e206), this._onChange();
  }
  next() {
    return this._navigator.next();
  }
  previous() {
    return this._currentPosition() === 0 ? null : this._navigator.previous();
  }
  current() {
    return this._navigator.current();
  }
  first() {
    return this._navigator.first();
  }
  last() {
    return this._navigator.last();
  }
  isLast() {
    return this._currentPosition() >= this._elements.length - 1;
  }
  isNowhere() {
    return this._navigator.current() === null;
  }
  has(e206) {
    return this._history.has(e206);
  }
  _onChange() {
    this._reduceToLimit();
    let e206 = this._elements;
    this._navigator = new FR(e206, 0, e206.length, e206.length);
  }
  _reduceToLimit() {
    let e206 = this._elements;
    if (e206.length > this._limit) {
      let t10 = e206.slice(e206.length - this._limit);
      this._history.replace ? this._history.replace(t10) : this._history = new Set(t10);
    }
  }
  _currentPosition() {
    let e206 = this._navigator.current();
    return e206 ? this._elements.indexOf(e206) : -1;
  }
  get _elements() {
    let e206 = [];
    return this._history.forEach((t10) => e206.push(t10)), e206;
  }
  dispose() {
    this._disposable && (this._disposable = (this._disposable.dispose(), void 0));
  }
}, LR = B, RR = class extends rx {
  get onDidChange() {
    return this._onDidChange.event;
  }
  get onDidHeightChange() {
    return this._onDidHeightChange.event;
  }
  constructor(e206, t10, n10) {
    super(), this.state = `idle`, this.maxHeight = 1 / 0, this.hover = this._register(new Jt()), this._onDidChange = this._register(new k()), this._onDidHeightChange = this._register(new k()), this.contextViewProvider = t10, this.options = n10, this.message = null, this.placeholder = this.options.placeholder || ``, this.tooltip = this.options.tooltip ?? (this.placeholder || ``), this.ariaLabel = this.options.ariaLabel || ``, this.options.validationOptions && (this.validation = this.options.validationOptions.validation), this.element = z(e206, LR(`.monaco-inputbox.idle`));
    let r10 = this.options.flexibleHeight ? `textarea` : `input`, i10 = z(this.element, LR(`.ibwrapper`));
    if (this.input = z(i10, LR(r10 + `.input.empty`)), this.input.setAttribute(`autocorrect`, `off`), this.input.setAttribute(`autocapitalize`, `off`), this.input.setAttribute(`spellcheck`, `false`), this.onfocus(this.input, () => this.element.classList.add(`synthetic-focus`)), this.onblur(this.input, () => this.element.classList.remove(`synthetic-focus`)), this.options.flexibleHeight) {
      this.maxHeight = typeof this.options.flexibleMaxHeight == `number` ? this.options.flexibleMaxHeight : 1 / 0, this.mirror = z(i10, LR(`div.mirror`)), this.mirror.innerText = `\xA0`, this.scrollableElement = new px(this.element, { vertical: 1 }), this.options.flexibleWidth && (this.input.setAttribute(`wrap`, `off`), this.mirror.style.whiteSpace = `pre`, this.mirror.style.wordWrap = `initial`), z(e206, this.scrollableElement.getDomNode()), this._register(this.scrollableElement), this._register(this.scrollableElement.onScroll((e207) => this.input.scrollTop = e207.scrollTop));
      let t11 = this._register(new yx(e206.ownerDocument, `selectionchange`)), n11 = O.filter(t11.event, () => e206.ownerDocument.getSelection()?.anchorNode === i10);
      this._register(n11(this.updateScrollDimensions, this)), this._register(this.onDidHeightChange(this.updateScrollDimensions, this));
    } else this.input.type = this.options.type || `text`, this.input.setAttribute(`wrap`, `off`);
    this.ariaLabel && this.input.setAttribute(`aria-label`, this.ariaLabel), this.placeholder && !this.options.showPlaceholderOnFocus && this.setPlaceHolder(this.placeholder), this.tooltip && this.setTooltip(this.tooltip), this.oninput(this.input, () => this.onValueChange()), this.onblur(this.input, () => this.onBlur()), this.onfocus(this.input, () => this.onFocus()), this._register(this.ignoreGesture(this.input)), setTimeout(() => this.updateMirror(), 0), this.options.actions && (this.actionbar = this._register(new CL(this.element)), this.actionbar.push(this.options.actions, { icon: true, label: false })), this.applyStyles();
  }
  onBlur() {
    this._hideMessage(), this.options.showPlaceholderOnFocus && this.input.setAttribute(`placeholder`, ``);
  }
  onFocus() {
    this._showMessage(), this.options.showPlaceholderOnFocus && this.input.setAttribute(`placeholder`, this.placeholder || ``);
  }
  setPlaceHolder(e206) {
    this.placeholder = e206, this.input.setAttribute(`placeholder`, e206);
  }
  setTooltip(e206) {
    this.tooltip = e206, this.hover.value || (this.hover.value = this._register(EI().setupDelayedHoverAtMouse(this.input, () => ({ content: this.tooltip, appearance: { compact: true } }))));
  }
  get inputElement() {
    return this.input;
  }
  get value() {
    return this.input.value;
  }
  set value(e206) {
    this.input.value !== e206 && (this.input.value = e206, this.onValueChange());
  }
  get height() {
    return typeof this.cachedHeight == `number` ? this.cachedHeight : Sl(this.element);
  }
  focus() {
    this.input.focus();
  }
  blur() {
    this.input.blur();
  }
  hasFocus() {
    return Al(this.input);
  }
  select(e206 = null) {
    this.input.select(), e206 && (this.input.setSelectionRange(e206.start, e206.end), e206.end === this.input.value.length && (this.input.scrollLeft = this.input.scrollWidth));
  }
  isSelectionAtEnd() {
    return this.input.selectionEnd === this.input.value.length && this.input.selectionStart === this.input.selectionEnd;
  }
  getSelection() {
    let e206 = this.input.selectionStart;
    return e206 === null ? null : { start: e206, end: this.input.selectionEnd ?? e206 };
  }
  enable() {
    this.input.removeAttribute(`disabled`);
  }
  disable() {
    this.blur(), this.input.disabled = true, this._hideMessage();
  }
  set paddingRight(e206) {
    this.input.style.width = `calc(100% - ${e206}px)`, this.mirror && (this.mirror.style.paddingRight = e206 + `px`);
  }
  updateScrollDimensions() {
    if (typeof this.cachedContentHeight != `number` || typeof this.cachedHeight != `number` || !this.scrollableElement) return;
    let e206 = this.cachedContentHeight, t10 = this.cachedHeight, n10 = this.input.scrollTop;
    this.scrollableElement.setScrollDimensions({ scrollHeight: e206, height: t10 }), this.scrollableElement.setScrollPosition({ scrollTop: n10 });
  }
  showMessage(e206, t10) {
    if (this.state === `open` && ot(this.message, e206)) return;
    this.message = e206, this.element.classList.remove(`idle`), this.element.classList.remove(`info`), this.element.classList.remove(`warning`), this.element.classList.remove(`error`), this.element.classList.add(this.classForType(e206.type));
    let n10 = this.stylesForType(this.message.type);
    this.element.style.border = `1px solid ${mI(n10.border, `transparent`)}`, this.message.content && (this.hasFocus() || t10) && this._showMessage();
  }
  hideMessage() {
    this.message = null, this.element.classList.remove(`info`), this.element.classList.remove(`warning`), this.element.classList.remove(`error`), this.element.classList.add(`idle`), this._hideMessage(), this.applyStyles();
  }
  validate() {
    let e206 = null;
    return this.validation && (e206 = this.validation(this.value), e206 ? (this.inputElement.setAttribute(`aria-invalid`, `true`), this.showMessage(e206)) : this.inputElement.hasAttribute(`aria-invalid`) && (this.inputElement.removeAttribute(`aria-invalid`), this.hideMessage())), e206?.type;
  }
  stylesForType(e206) {
    let t10 = this.options.inputBoxStyles;
    switch (e206) {
      case 1:
        return { border: t10.inputValidationInfoBorder, background: t10.inputValidationInfoBackground, foreground: t10.inputValidationInfoForeground };
      case 2:
        return { border: t10.inputValidationWarningBorder, background: t10.inputValidationWarningBackground, foreground: t10.inputValidationWarningForeground };
      default:
        return { border: t10.inputValidationErrorBorder, background: t10.inputValidationErrorBackground, foreground: t10.inputValidationErrorForeground };
    }
  }
  classForType(e206) {
    switch (e206) {
      case 1:
        return `info`;
      case 2:
        return `warning`;
      default:
        return `error`;
    }
  }
  _showMessage() {
    if (!this.contextViewProvider || !this.message) return;
    let e206, t10 = () => e206.style.width = yl(this.element) + `px`;
    this.contextViewProvider.showContextView({ getAnchor: () => this.element, anchorAlignment: 1, render: (n11) => {
      if (!this.message) return null;
      e206 = z(n11, LR(`.monaco-inputbox-container`)), t10();
      let r10 = LR(`span.monaco-inputbox-message`);
      this.message.formatContent ? kR(this.message.content, void 0, r10) : q_e(this.message.content, void 0, r10), r10.classList.add(this.classForType(this.message.type));
      let i10 = this.stylesForType(this.message.type);
      return r10.style.backgroundColor = i10.background ?? ``, r10.style.color = i10.foreground ?? ``, r10.style.border = i10.border ? `1px solid ${i10.border}` : ``, z(e206, r10), null;
    }, onHide: () => {
      this.state = `closed`;
    }, layout: t10 });
    let n10;
    n10 = this.message.type === 3 ? C(9, `Error: {0}`, this.message.content) : this.message.type === 2 ? C(10, `Warning: {0}`, this.message.content) : C(11, `Info: {0}`, this.message.content), Wg(n10), this.state = `open`;
  }
  _hideMessage() {
    this.contextViewProvider && (this.state === `open` && this.contextViewProvider.hideContextView(), this.state = `idle`);
  }
  onValueChange() {
    this._onDidChange.fire(this.value), this.validate(), this.updateMirror(), this.input.classList.toggle(`empty`, !this.value), this.state === `open` && this.contextViewProvider && this.contextViewProvider.layout();
  }
  updateMirror() {
    if (!this.mirror) return;
    let e206 = this.value, t10 = e206.charCodeAt(e206.length - 1) === 10 ? ` ` : ``;
    (e206 + t10).replace(/\u000c/g, ``) ? this.mirror.textContent = e206 + t10 : this.mirror.innerText = `\xA0`, this.layout();
  }
  applyStyles() {
    let e206 = this.options.inputBoxStyles, t10 = e206.inputBackground ?? ``, n10 = e206.inputForeground ?? ``, r10 = e206.inputBorder ?? ``;
    this.element.style.backgroundColor = t10, this.element.style.color = n10, this.input.style.backgroundColor = `inherit`, this.input.style.color = n10, this.element.style.border = `1px solid ${mI(r10, `transparent`)}`;
  }
  layout() {
    if (!this.mirror) return;
    let e206 = this.cachedContentHeight;
    this.cachedContentHeight = Sl(this.mirror), e206 !== this.cachedContentHeight && (this.cachedHeight = Math.min(this.cachedContentHeight, this.maxHeight), this.input.style.height = this.cachedHeight + `px`, this._onDidHeightChange.fire(this.cachedContentHeight));
  }
  insertAtCursor(e206) {
    let t10 = this.inputElement, n10 = t10.selectionStart, r10 = t10.selectionEnd, i10 = t10.value;
    n10 !== null && r10 !== null && (this.value = i10.substr(0, n10) + e206 + i10.substr(r10), t10.setSelectionRange(n10 + 1, n10 + 1), this.layout());
  }
  dispose() {
    this._hideMessage(), this.message = null, this.actionbar?.dispose(), super.dispose();
  }
}, zR = class extends RR {
  constructor(e206, t10, n10) {
    let r10 = C(12, ` or {0} for history`, `\u21C5`), i10 = C(13, ` ({0} for history)`, `\u21C5`);
    super(e206, t10, n10), this._onDidFocus = this._register(new k()), this.onDidFocus = this._onDidFocus.event, this._onDidBlur = this._register(new k()), this.onDidBlur = this._onDidBlur.event, this.history = this._register(new IR(n10.history, 100));
    let a10 = () => {
      if (n10.showHistoryHint && n10.showHistoryHint() && !this.placeholder.endsWith(r10) && !this.placeholder.endsWith(i10) && this.history.getHistory().length) {
        let e207 = this.placeholder.endsWith(`)`) ? r10 : i10, t11 = this.placeholder + e207;
        n10.showPlaceholderOnFocus && !Al(this.input) ? this.placeholder = t11 : this.setPlaceHolder(t11);
      }
    };
    this.observer = new MutationObserver((e207, t11) => {
      e207.forEach((e208) => {
        e208.target.textContent || a10();
      });
    }), this.observer.observe(this.input, { attributeFilter: [`class`] }), this.onfocus(this.input, () => a10()), this.onblur(this.input, () => {
      let e207 = (e208) => {
        if (this.placeholder.endsWith(e208)) {
          let t11 = this.placeholder.slice(0, this.placeholder.length - e208.length);
          return n10.showPlaceholderOnFocus ? this.placeholder = t11 : this.setPlaceHolder(t11), true;
        } else return false;
      };
      e207(i10) || e207(r10);
    });
  }
  dispose() {
    super.dispose(), this.observer && (this.observer = (this.observer.disconnect(), void 0));
  }
  addToHistory(e206) {
    this.value && (e206 || this.value !== this.getCurrentValue()) && this.history.add(this.value);
  }
  isAtLastInHistory() {
    return this.history.isLast();
  }
  isNowhereInHistory() {
    return this.history.isNowhere();
  }
  showNextValue() {
    this.history.has(this.value) || this.addToHistory();
    let e206 = this.getNextValue();
    e206 && (e206 = e206 === this.value ? this.getNextValue() : e206), this.value = e206 ?? ``, Gg(this.value ? this.value : C(14, `Cleared Input`));
  }
  showPreviousValue() {
    this.history.has(this.value) || this.addToHistory();
    let e206 = this.getPreviousValue();
    e206 && (e206 = e206 === this.value ? this.getPreviousValue() : e206), e206 && (this.value = e206, Gg(this.value));
  }
  setPlaceHolder(e206) {
    super.setPlaceHolder(e206), this.setTooltip(e206);
  }
  onBlur() {
    super.onBlur(), this._onDidBlur.fire();
  }
  onFocus() {
    super.onFocus(), this._onDidFocus.fire();
  }
  getCurrentValue() {
    let e206 = this.history.current();
    return e206 || (e206 = this.history.last(), this.history.next()), e206;
  }
  getPreviousValue() {
    return this.history.previous() || this.history.first();
  }
  getNextValue() {
    return this.history.next();
  }
}, BR = C(1, `input`), VR = class extends rx {
  get onDidOptionChange() {
    return this._onDidOptionChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  get onMouseDown() {
    return this._onMouseDown.event;
  }
  get onCaseSensitiveKeyDown() {
    return this._onCaseSensitiveKeyDown.event;
  }
  get onRegexKeyDown() {
    return this._onRegexKeyDown.event;
  }
  constructor(e206, t10, n10) {
    super(), this.fixFocusOnOptionClickEnabled = true, this.imeSessionInProgress = false, this.additionalTogglesDisposables = this._register(new Jt()), this.additionalToggles = [], this._onDidOptionChange = this._register(new k()), this._onKeyDown = this._register(new k()), this._onMouseDown = this._register(new k()), this._onInput = this._register(new k()), this._onKeyUp = this._register(new k()), this._onCaseSensitiveKeyDown = this._register(new k()), this._onRegexKeyDown = this._register(new k()), this._lastHighlightFindOptions = 0, this.placeholder = n10.placeholder || ``, this.validation = n10.validation, this.label = n10.label || BR, this.showCommonFindToggles = !!n10.showCommonFindToggles;
    let r10 = n10.appendCaseSensitiveLabel || ``, i10 = n10.appendWholeWordsLabel || ``, a10 = n10.appendRegexLabel || ``, o10 = !!n10.flexibleHeight, s10 = !!n10.flexibleWidth, c10 = n10.flexibleMaxHeight;
    if (this.domNode = document.createElement(`div`), this.domNode.classList.add(`monaco-findInput`), this.inputBox = this._register(new zR(this.domNode, t10, { placeholder: this.placeholder || ``, ariaLabel: this.label || ``, validationOptions: { validation: this.validation }, showHistoryHint: n10.showHistoryHint, flexibleHeight: o10, flexibleWidth: s10, flexibleMaxHeight: c10, inputBoxStyles: n10.inputBoxStyles, history: n10.history })), this.showCommonFindToggles) {
      let e207 = n10?.hoverLifecycleOptions || { groupId: `find-input` };
      this.regex = this._register(new OR({ appendTitle: a10, isChecked: false, hoverLifecycleOptions: e207, ...n10.toggleStyles })), this._register(this.regex.onChange((e208) => {
        this._onDidOptionChange.fire(e208), !e208 && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
      })), this._register(this.regex.onKeyDown((e208) => {
        this._onRegexKeyDown.fire(e208);
      })), this.wholeWords = this._register(new DR({ appendTitle: i10, isChecked: false, hoverLifecycleOptions: e207, ...n10.toggleStyles })), this._register(this.wholeWords.onChange((e208) => {
        this._onDidOptionChange.fire(e208), !e208 && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
      })), this.caseSensitive = this._register(new ER({ appendTitle: r10, isChecked: false, hoverLifecycleOptions: e207, ...n10.toggleStyles })), this._register(this.caseSensitive.onChange((e208) => {
        this._onDidOptionChange.fire(e208), !e208 && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
      })), this._register(this.caseSensitive.onKeyDown((e208) => {
        this._onCaseSensitiveKeyDown.fire(e208);
      }));
      let t11 = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode];
      this.onkeydown(this.domNode, (e208) => {
        if (e208.equals(15) || e208.equals(17) || e208.equals(9)) {
          let n11 = t11.indexOf(this.domNode.ownerDocument.activeElement);
          if (n11 >= 0) {
            let r11 = -1;
            e208.equals(17) ? r11 = (n11 + 1) % t11.length : e208.equals(15) && (r11 = n11 === 0 ? t11.length - 1 : n11 - 1), e208.equals(9) ? (t11[n11].blur(), this.inputBox.focus()) : r11 >= 0 && t11[r11].focus(), Vl.stop(e208, true);
          }
        }
      });
    }
    this.controls = document.createElement(`div`), this.controls.className = `controls`, this.controls.style.display = this.showCommonFindToggles ? `` : `none`, this.caseSensitive && this.controls.append(this.caseSensitive.domNode), this.wholeWords && this.controls.appendChild(this.wholeWords.domNode), this.regex && this.controls.appendChild(this.regex.domNode), this.setAdditionalToggles(n10?.additionalToggles), this.controls && this.domNode.appendChild(this.controls), e206?.appendChild(this.domNode), this._register(L(this.inputBox.inputElement, `compositionstart`, (e207) => {
      this.imeSessionInProgress = true;
    })), this._register(L(this.inputBox.inputElement, `compositionend`, (e207) => {
      this.imeSessionInProgress = false, this._onInput.fire();
    })), this.onkeydown(this.inputBox.inputElement, (e207) => this._onKeyDown.fire(e207)), this.onkeyup(this.inputBox.inputElement, (e207) => this._onKeyUp.fire(e207)), this.oninput(this.inputBox.inputElement, (e207) => this._onInput.fire()), this.onmousedown(this.inputBox.inputElement, (e207) => this._onMouseDown.fire(e207));
  }
  get onDidChange() {
    return this.inputBox.onDidChange;
  }
  layout(e206) {
    this.inputBox.layout(), this.updateInputBoxPadding(e206.collapsedFindWidget);
  }
  enable() {
    this.domNode.classList.remove(`disabled`), this.inputBox.enable(), this.regex?.enable(), this.wholeWords?.enable(), this.caseSensitive?.enable();
    for (let e206 of this.additionalToggles) e206.enable();
  }
  disable() {
    this.domNode.classList.add(`disabled`), this.inputBox.disable(), this.regex?.disable(), this.wholeWords?.disable(), this.caseSensitive?.disable();
    for (let e206 of this.additionalToggles) e206.disable();
  }
  setFocusInputOnOptionClick(e206) {
    this.fixFocusOnOptionClickEnabled = e206;
  }
  setEnabled(e206) {
    e206 ? this.enable() : this.disable();
  }
  setAdditionalToggles(e206) {
    for (let e207 of this.additionalToggles) e207.domNode.remove();
    this.additionalToggles = [], this.additionalTogglesDisposables.value = new E();
    for (let t10 of e206 ?? []) this.additionalTogglesDisposables.value.add(t10), this.controls.appendChild(t10.domNode), this.additionalTogglesDisposables.value.add(t10.onChange((e207) => {
      this._onDidOptionChange.fire(e207), !e207 && this.fixFocusOnOptionClickEnabled && this.inputBox.focus();
    })), this.additionalToggles.push(t10);
    this.additionalToggles.length > 0 && (this.controls.style.display = ``), this.updateInputBoxPadding();
  }
  updateInputBoxPadding(e206 = false) {
    e206 ? this.inputBox.paddingRight = 0 : this.inputBox.paddingRight = (this.caseSensitive?.width() ?? 0) + (this.wholeWords?.width() ?? 0) + (this.regex?.width() ?? 0) + this.additionalToggles.reduce((e207, t10) => e207 + t10.width(), 0);
  }
  getValue() {
    return this.inputBox.value;
  }
  setValue(e206) {
    this.inputBox.value !== e206 && (this.inputBox.value = e206);
  }
  select() {
    this.inputBox.select();
  }
  focus() {
    this.inputBox.focus();
  }
  getCaseSensitive() {
    return this.caseSensitive?.checked ?? false;
  }
  setCaseSensitive(e206) {
    this.caseSensitive && (this.caseSensitive.checked = e206);
  }
  getWholeWords() {
    return this.wholeWords?.checked ?? false;
  }
  setWholeWords(e206) {
    this.wholeWords && (this.wholeWords.checked = e206);
  }
  getRegex() {
    return this.regex?.checked ?? false;
  }
  setRegex(e206) {
    this.regex && (this.regex.checked = e206, this.validate());
  }
  focusOnCaseSensitive() {
    this.caseSensitive?.focus();
  }
  highlightFindOptions() {
    this.domNode.classList.remove(`highlight-` + this._lastHighlightFindOptions), this._lastHighlightFindOptions = 1 - this._lastHighlightFindOptions, this.domNode.classList.add(`highlight-` + this._lastHighlightFindOptions);
  }
  validate() {
    this.inputBox.validate();
  }
  showMessage(e206) {
    this.inputBox.showMessage(e206);
  }
  clearMessage() {
    this.inputBox.hideMessage();
  }
}, HR = B, UR = class extends D {
  constructor(e206, t10, n10) {
    super(), this.parent = e206, this.onDidChange = (e207) => this.findInput.onDidChange(e207), this.container = z(this.parent, HR(`.quick-input-box`)), this.findInput = this._register(new VR(this.container, void 0, { label: ``, inputBoxStyles: t10, toggleStyles: n10 }));
    let r10 = this.findInput.inputBox.inputElement;
    r10.role = `textbox`, r10.ariaHasPopup = `menu`, r10.ariaAutoComplete = `list`;
  }
  get onKeyDown() {
    return this.findInput.onKeyDown;
  }
  get value() {
    return this.findInput.getValue();
  }
  set value(e206) {
    this.findInput.setValue(e206);
  }
  select(e206 = null) {
    this.findInput.inputBox.select(e206);
  }
  getSelection() {
    return this.findInput.inputBox.getSelection();
  }
  isSelectionAtEnd() {
    return this.findInput.inputBox.isSelectionAtEnd();
  }
  get placeholder() {
    return this.findInput.inputBox.inputElement.getAttribute(`placeholder`) || ``;
  }
  set placeholder(e206) {
    this.findInput.inputBox.setPlaceHolder(e206);
  }
  get password() {
    return this.findInput.inputBox.inputElement.type === `password`;
  }
  set password(e206) {
    this.findInput.inputBox.inputElement.type = e206 ? `password` : `text`;
  }
  set enabled(e206) {
    this.findInput.inputBox.inputElement.toggleAttribute(`readonly`, !e206);
  }
  set toggles(e206) {
    this.findInput.setAdditionalToggles(e206);
  }
  get ariaLabel() {
    return this.findInput.inputBox.inputElement.getAttribute(`aria-label`) || ``;
  }
  set ariaLabel(e206) {
    this.findInput.inputBox.inputElement.setAttribute(`aria-label`, e206);
  }
  hasFocus() {
    return this.findInput.inputBox.hasFocus();
  }
  setAttribute(e206, t10) {
    this.findInput.inputBox.inputElement.setAttribute(e206, t10);
  }
  removeAttribute(e206) {
    this.findInput.inputBox.inputElement.removeAttribute(e206);
  }
  showDecoration(e206) {
    e206 === lw.Ignore ? this.findInput.clearMessage() : this.findInput.showMessage({ type: e206 === lw.Info ? 1 : e206 === lw.Warning ? 2 : 3, content: `` });
  }
  stylesForType(e206) {
    return this.findInput.inputBox.stylesForType(e206 === lw.Info ? 1 : e206 === lw.Warning ? 2 : 3);
  }
  setFocus() {
    this.findInput.focus();
  }
  layout() {
    this.findInput.inputBox.layout();
  }
}, WR = class e146 extends D {
  constructor(e206, t10) {
    super(), this.options = t10, this.text = ``, this.title = ``, this.highlights = [], this.didEverRender = false, this.domNode = z(e206, B(`span.monaco-highlighted-label`));
  }
  get element() {
    return this.domNode;
  }
  set(t10, n10 = [], r10 = ``, i10, a10) {
    t10 || (t10 = ``), i10 && (t10 = e146.escapeNewLines(t10, n10)), !(this.didEverRender && this.text === t10 && this.title === r10 && ot(this.highlights, n10)) && (this.text = t10, this.title = r10, this.highlights = n10, this.render(a10));
  }
  render(e206) {
    let t10 = [], n10 = 0;
    for (let r10 of this.highlights) {
      if (r10.end === r10.start) continue;
      if (n10 < r10.start) {
        let i11 = this.text.substring(n10, r10.start);
        e206 ? t10.push(...CP(i11)) : t10.push(i11), n10 = r10.start;
      }
      let i10 = this.text.substring(n10, r10.end), a10 = B(`span.highlight`, void 0, ...e206 ? CP(i10) : [i10]);
      r10.extraClasses && a10.classList.add(...r10.extraClasses), t10.push(a10), n10 = r10.end;
    }
    if (n10 < this.text.length) {
      let r10 = this.text.substring(n10);
      e206 ? t10.push(...CP(r10)) : t10.push(r10);
    }
    if (Jl(this.domNode, ...t10), !this.customHover && this.title !== ``) {
      let e207 = this.options?.hoverDelegate ?? CI(`mouse`);
      this.customHover = this._register(EI().setupManagedHover(e207, this.domNode, this.title));
    } else this.customHover && this.customHover.update(this.title);
    this.didEverRender = true;
  }
  static escapeNewLines(e206, t10) {
    let n10 = 0, r10 = 0;
    return e206.replace(/\r\n|\r|\n/g, (e207, i10) => {
      r10 = e207 === `\r
` ? -1 : 0, i10 += n10;
      for (let e208 of t10) e208.end <= i10 || (e208.start >= i10 && (e208.start += r10), e208.end >= i10 && (e208.end += r10));
      return n10 += r10, `\u23CE`;
    });
  }
}, GR = class {
  constructor(e206) {
    this._element = e206;
  }
  get element() {
    return this._element;
  }
  set textContent(e206) {
    this.disposed || e206 === this._textContent || (this._textContent = e206, this._element.textContent = e206);
  }
  set classNames(e206) {
    this.disposed || ot(e206, this._classNames) || (this._classNames = e206, this._element.classList.value = ``, this._element.classList.add(...e206));
  }
  set empty(e206) {
    this.disposed || e206 === this._empty || (this._empty = e206, this._element.style.marginLeft = e206 ? `0` : ``);
  }
  dispose() {
    this.disposed = true;
  }
}, KR = class extends D {
  constructor(e206, t10) {
    super(), this.customHovers = /* @__PURE__ */ new Map(), this.creationOptions = t10, this.domNode = this._register(new GR(z(e206, B(`.monaco-icon-label`)))), this.labelContainer = z(this.domNode.element, B(`.monaco-icon-label-container`)), this.nameContainer = z(this.labelContainer, B(`span.monaco-icon-name-container`)), t10?.supportHighlights || t10?.supportIcons ? this.nameNode = this._register(new YR(this.nameContainer, !!t10.supportIcons)) : this.nameNode = new qR(this.nameContainer), this.hoverDelegate = t10?.hoverDelegate ?? CI(`mouse`);
  }
  get element() {
    return this.domNode.element;
  }
  setLabel(e206, t10, n10) {
    let r10 = [`monaco-icon-label`], i10 = [`monaco-icon-label-container`], a10 = ``;
    n10 && (n10.extraClasses && r10.push(...n10.extraClasses), n10.bold && r10.push(`bold`), n10.italic && r10.push(`italic`), n10.strikethrough && r10.push(`strikethrough`), n10.disabledCommand && i10.push(`disabled`), n10.title && (typeof n10.title == `string` ? a10 += n10.title : a10 += e206));
    let o10 = this.domNode.element.querySelector(`.monaco-icon-label-iconpath`);
    if (n10?.iconPath) {
      let e207;
      if (!o10 || !Fl(o10) ? (e207 = B(`.monaco-icon-label-iconpath`), this.domNode.element.prepend(e207)) : e207 = o10, ju.isThemeIcon(n10.iconPath)) {
        let t11 = ju.asClassName(n10.iconPath);
        e207.className = `monaco-icon-label-iconpath ${t11}`, e207.style.backgroundImage = ``;
      } else e207.style.backgroundImage = _I2(n10?.iconPath);
      e207.style.backgroundRepeat = `no-repeat`, e207.style.backgroundPosition = `center`, e207.style.backgroundSize = `contain`;
    } else o10 && o10.remove();
    if (this.domNode.classNames = r10, this.domNode.element.setAttribute(`aria-label`, a10), this.labelContainer.classList.value = ``, this.labelContainer.classList.add(...i10), this.setupHover(n10?.descriptionTitle ? this.labelContainer : this.element, n10?.title), this.nameNode.setLabel(e206, n10), t10 || this.descriptionNode) {
      let e207 = this.getOrCreateDescriptionNode();
      if (e207 instanceof WR) {
        let r11 = n10?.supportIcons ?? this.creationOptions?.supportIcons;
        e207.set(t10 || ``, n10 ? n10.descriptionMatches : void 0, void 0, n10?.labelEscapeNewLines, r11), this.setupHover(e207.element, n10?.descriptionTitle);
      } else e207.textContent = t10 && n10?.labelEscapeNewLines ? WR.escapeNewLines(t10, []) : t10 || ``, this.setupHover(e207.element, n10?.descriptionTitle || ``), e207.empty = !t10;
    }
    if (n10?.suffix || this.suffixNode) {
      let e207 = this.getOrCreateSuffixNode();
      e207.textContent = n10?.suffix ?? ``;
    }
  }
  setupHover(e206, t10) {
    let n10 = this.customHovers.get(e206);
    if (n10 && (n10.dispose(), this.customHovers.delete(e206)), !t10) {
      e206.removeAttribute(`title`);
      return;
    }
    let r10 = e206;
    if (this.creationOptions?.hoverTargetOverride) {
      if (!Cl(e206, this.creationOptions.hoverTargetOverride)) throw Error(`hoverTargetOverrride must be an ancestor of the htmlElement`);
      r10 = this.creationOptions.hoverTargetOverride;
    }
    let i10 = EI().setupManagedHover(this.hoverDelegate, r10, t10);
    i10 && this.customHovers.set(e206, i10);
  }
  dispose() {
    super.dispose();
    for (let e206 of this.customHovers.values()) e206.dispose();
    this.customHovers.clear();
  }
  getOrCreateSuffixNode() {
    if (!this.suffixNode) {
      let e206 = this._register(new GR(Kl(this.nameContainer, B(`span.monaco-icon-suffix-container`))));
      this.suffixNode = this._register(new GR(z(e206.element, B(`span.label-suffix`))));
    }
    return this.suffixNode;
  }
  getOrCreateDescriptionNode() {
    if (!this.descriptionNode) {
      let e206 = this._register(new GR(z(this.labelContainer, B(`span.monaco-icon-description-container`))));
      this.creationOptions?.supportDescriptionHighlights ? this.descriptionNode = this._register(new WR(z(e206.element, B(`span.label-description`)))) : this.descriptionNode = this._register(new GR(z(e206.element, B(`span.label-description`))));
    }
    return this.descriptionNode;
  }
}, qR = class {
  constructor(e206) {
    this.container = e206, this.label = void 0, this.singleLabel = void 0;
  }
  setLabel(e206, t10) {
    if (!(this.label === e206 && ot(this.options, t10))) if (this.label = e206, this.options = t10, typeof e206 == `string`) this.singleLabel || (this.singleLabel = (this.container.textContent = ``, this.container.classList.remove(`multiple`), z(this.container, B(`a.label-name`, { id: t10?.domId })))), this.singleLabel.textContent = e206;
    else {
      this.container.textContent = ``, this.container.classList.add(`multiple`), this.singleLabel = void 0;
      for (let n10 = 0; n10 < e206.length; n10++) {
        let r10 = e206[n10], i10 = t10?.domId && `${t10?.domId}_${n10}`;
        z(this.container, B(`a.label-name`, { id: i10, "data-icon-label-count": e206.length, "data-icon-label-index": n10, role: `treeitem` }, r10)), n10 < e206.length - 1 && z(this.container, B(`span.label-separator`, void 0, t10?.separator || `/`));
      }
    }
  }
};
function JR(e206, t10, n10) {
  if (!n10) return;
  let r10 = 0;
  return e206.map((e207) => {
    let i10 = { start: r10, end: r10 + e207.length }, a10 = n10.map((e208) => WP.intersect(i10, e208)).filter((e208) => !WP.isEmpty(e208)).map(({ start: e208, end: t11 }) => ({ start: e208 - r10, end: t11 - r10 }));
    return r10 = i10.end + t10.length, a10;
  });
}
var YR = class extends D {
  constructor(e206, t10) {
    super(), this.container = e206, this.supportIcons = t10, this.label = void 0, this.singleLabel = void 0;
  }
  setLabel(e206, t10) {
    if (this.label === e206 && ot(this.options, t10)) return;
    this.label = e206, this.options = t10;
    let n10 = t10?.supportIcons ?? this.supportIcons;
    if (typeof e206 == `string`) this.singleLabel || (this.singleLabel = (this.container.textContent = ``, this.container.classList.remove(`multiple`), this._register(new WR(z(this.container, B(`a.label-name`, { id: t10?.domId })))))), this.singleLabel.set(e206, t10?.matches, void 0, t10?.labelEscapeNewLines, n10);
    else {
      this.container.textContent = ``, this.container.classList.add(`multiple`), this.singleLabel = void 0;
      let r10 = t10?.separator || `/`, i10 = JR(e206, r10, t10?.matches);
      for (let a10 = 0; a10 < e206.length; a10++) {
        let o10 = e206[a10], s10 = i10 ? i10[a10] : void 0, c10 = B(`a.label-name`, { id: t10?.domId && `${t10?.domId}_${a10}`, "data-icon-label-count": e206.length, "data-icon-label-index": a10, role: `treeitem` });
        this._register(new WR(z(this.container, c10))).set(o10, s10, void 0, t10?.labelEscapeNewLines, n10), a10 < e206.length - 1 && z(c10, B(`span.label-separator`, void 0, r10));
      }
    }
  }
}, XR = B, ZR = { keybindingLabelBackground: void 0, keybindingLabelForeground: void 0, keybindingLabelBorder: void 0, keybindingLabelBottomBorder: void 0, keybindingLabelShadow: void 0 }, QR = class e147 extends D {
  constructor(e206, t10, n10) {
    super(), this.os = t10, this.keyElements = /* @__PURE__ */ new Set(), this.options = n10 || /* @__PURE__ */ Object.create(null);
    let r10 = this.options.keybindingLabelForeground;
    this.domNode = z(e206, XR(`.monaco-keybinding`)), r10 && (this.domNode.style.color = r10), this.hover = this._register(EI().setupManagedHover(CI(`mouse`), this.domNode, ``)), this.didEverRender = false, e206.appendChild(this.domNode);
  }
  set(t10, n10) {
    this.didEverRender && this.keybinding === t10 && e147.areSame(this.matches, n10) || (this.keybinding = t10, this.matches = n10, this.render());
  }
  render() {
    if (this.clear(), this.keybinding) {
      let e206 = this.keybinding.getChords();
      e206[0] && this.renderChord(this.domNode, e206[0], this.matches ? this.matches.firstPart : null);
      for (let t11 = 1; t11 < e206.length; t11++) z(this.domNode, XR(`span.monaco-keybinding-key-chord-separator`, void 0, ` `)), this.renderChord(this.domNode, e206[t11], this.matches ? this.matches.chordPart : null);
      let t10 = this.options.disableTitle ?? false ? void 0 : this.keybinding.getAriaLabel() || void 0;
      this.hover.update(t10), this.domNode.setAttribute(`aria-label`, t10 || ``);
    } else this.options && this.options.renderUnboundKeybindings && this.renderUnbound(this.domNode);
    this.didEverRender = true;
  }
  clear() {
    Xc(this.domNode), this.keyElements.clear();
  }
  renderChord(e206, t10, n10) {
    let r10 = RF.modifierLabels[this.os];
    t10.ctrlKey && this.renderKey(e206, r10.ctrlKey, !!n10?.ctrlKey, r10.separator), t10.shiftKey && this.renderKey(e206, r10.shiftKey, !!n10?.shiftKey, r10.separator), t10.altKey && this.renderKey(e206, r10.altKey, !!n10?.altKey, r10.separator), t10.metaKey && this.renderKey(e206, r10.metaKey, !!n10?.metaKey, r10.separator);
    let i10 = t10.keyLabel;
    i10 && this.renderKey(e206, i10, !!n10?.keyCode, ``);
  }
  renderKey(e206, t10, n10, r10) {
    z(e206, this.createKeyElement(t10, n10 ? `.highlight` : ``)), r10 && z(e206, XR(`span.monaco-keybinding-key-separator`, void 0, r10));
  }
  renderUnbound(e206) {
    z(e206, this.createKeyElement(C(15, `Unbound`)));
  }
  createKeyElement(e206, t10 = ``) {
    let n10 = XR(`span.monaco-keybinding-key` + t10, void 0, e206);
    return this.keyElements.add(n10), this.options.keybindingLabelBackground && (n10.style.backgroundColor = this.options.keybindingLabelBackground), this.options.keybindingLabelBorder && (n10.style.borderColor = this.options.keybindingLabelBorder), this.options.keybindingLabelBottomBorder && (n10.style.borderBottomColor = this.options.keybindingLabelBottomBorder), this.options.keybindingLabelShadow && (n10.style.boxShadow = `inset 0 -1px 0 ${this.options.keybindingLabelShadow}`), n10;
  }
  static areSame(e206, t10) {
    return e206 === t10 || !e206 && !t10 ? true : !!e206 && !!t10 && ot(e206.firstPart, t10.firstPart) && ot(e206.chordPart, t10.chordPart);
  }
}, $R;
(function(e206) {
  e206[e206.Expanded = 0] = `Expanded`, e206[e206.Collapsed = 1] = `Collapsed`, e206[e206.PreserveOrExpanded = 2] = `PreserveOrExpanded`, e206[e206.PreserveOrCollapsed = 3] = `PreserveOrCollapsed`;
})($R || ($R = {}));
var ez;
(function(e206) {
  e206[e206.Unknown = 0] = `Unknown`, e206[e206.Twistie = 1] = `Twistie`, e206[e206.Element = 2] = `Element`, e206[e206.Filter = 3] = `Filter`;
})(ez || (ez = {}));
var tz = class extends Error {
  constructor(e206, t10) {
    super(`TreeError [${e206}] ${t10}`);
  }
}, nz = class {
  constructor(e206) {
    this.fn = e206, this._map = /* @__PURE__ */ new WeakMap();
  }
  map(e206) {
    let t10 = this._map.get(e206);
    return t10 || (t10 = this.fn(e206), this._map.set(e206, t10)), t10;
  }
};
function rz(e206) {
  return !!e206 && e206.visibility !== void 0;
}
function iz(e206) {
  switch (e206) {
    case true:
      return 1;
    case false:
      return 0;
    default:
      return e206;
  }
}
function az(e206) {
  return `collapsible` in e206;
}
var oz = class {
  constructor(e206, t10, n10 = {}) {
    this.user = e206, this.rootRef = [], this.eventBufferer = new dn(), this._onDidSpliceModel = new k(), this.onDidSpliceModel = this._onDidSpliceModel.event, this._onDidSpliceRenderedNodes = new k(), this.onDidSpliceRenderedNodes = this._onDidSpliceRenderedNodes.event, this._onDidChangeCollapseState = new k(), this.onDidChangeCollapseState = this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event), this._onDidChangeRenderNodeCount = new k(), this.onDidChangeRenderNodeCount = this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event), this.refilterDelayer = new ns(Qo), this.collapseByDefault = n10.collapseByDefault === void 0 ? false : n10.collapseByDefault, this.allowNonCollapsibleParents = n10.allowNonCollapsibleParents ?? false, this.filter = n10.filter, this.autoExpandSingleChildren = n10.autoExpandSingleChildren === void 0 ? false : n10.autoExpandSingleChildren, this.root = { parent: void 0, element: t10, children: [], depth: 0, visibleChildrenCount: 0, visibleChildIndex: -1, collapsible: false, collapsed: false, renderNodeCount: 0, visibility: 1, visible: true, filterData: void 0 };
  }
  splice(e206, t10, n10 = Ut.empty(), r10 = {}) {
    if (e206.length === 0) throw new tz(this.user, `Invalid tree location`);
    r10.diffIdentityProvider ? this.spliceSmart(r10.diffIdentityProvider, e206, t10, n10, r10) : this.spliceSimple(e206, t10, n10, r10);
  }
  spliceSmart(e206, t10, n10, r10 = Ut.empty(), i10, a10 = i10.diffDepth ?? 0) {
    let { parentNode: o10 } = this.getParentNodeWithListIndex(t10);
    if (!o10.lastDiffIds) return this.spliceSimple(t10, n10, r10, i10);
    let s10 = [...r10], c10 = t10[t10.length - 1], l10 = new Pp({ getElements: () => o10.lastDiffIds }, { getElements: () => [...o10.children.slice(0, c10), ...s10, ...o10.children.slice(c10 + n10)].map((t11) => e206.getId(t11.element).toString()) }).ComputeDiff(false);
    if (l10.quitEarly) return o10.lastDiffIds = void 0, this.spliceSimple(t10, n10, s10, i10);
    let u10 = t10.slice(0, -1), d10 = (t11, n11, r11) => {
      if (a10 > 0) for (let o11 = 0; o11 < r11; o11++) t11--, n11--, this.spliceSmart(e206, [...u10, t11, 0], 2 ** 53 - 1, s10[n11].children, i10, a10 - 1);
    }, f10 = Math.min(o10.children.length, c10 + n10), p10 = s10.length;
    for (let e207 of l10.changes.sort((e208, t11) => t11.originalStart - e208.originalStart)) d10(f10, p10, f10 - (e207.originalStart + e207.originalLength)), f10 = e207.originalStart, p10 = e207.modifiedStart - c10, this.spliceSimple([...u10, f10], e207.originalLength, Ut.slice(s10, p10, p10 + e207.modifiedLength), i10);
    d10(f10, p10, f10);
  }
  spliceSimple(e206, t10, n10 = Ut.empty(), { onDidCreateNode: r10, onDidDeleteNode: i10, diffIdentityProvider: a10 }) {
    let { parentNode: o10, listIndex: s10, revealed: c10, visible: l10 } = this.getParentNodeWithListIndex(e206), u10 = [], d10 = Ut.map(n10, (e207) => this.createTreeNode(e207, o10, +!!o10.visible, c10, u10, r10)), f10 = e206[e206.length - 1], p10 = 0;
    for (let e207 = f10; e207 >= 0 && e207 < o10.children.length; e207--) {
      let t11 = o10.children[e207];
      if (t11.visible) {
        p10 = t11.visibleChildIndex;
        break;
      }
    }
    let m10 = [], h10 = 0, g10 = 0;
    for (let e207 of d10) m10.push(e207), g10 += e207.renderNodeCount, e207.visible && (e207.visibleChildIndex = p10 + h10++);
    let _10 = ae(o10.children, f10, t10, m10);
    a10 ? o10.lastDiffIds ? ae(o10.lastDiffIds, f10, t10, m10.map((e207) => a10.getId(e207.element).toString())) : o10.lastDiffIds = o10.children.map((e207) => a10.getId(e207.element).toString()) : o10.lastDiffIds = void 0;
    let v10 = 0;
    for (let e207 of _10) e207.visible && v10++;
    if (v10 !== 0) for (let e207 = f10 + m10.length; e207 < o10.children.length; e207++) {
      let t11 = o10.children[e207];
      t11.visible && (t11.visibleChildIndex -= v10);
    }
    if (o10.visibleChildrenCount += h10 - v10, _10.length > 0 && i10) {
      let e207 = (t11) => {
        i10(t11), t11.children.forEach(e207);
      };
      _10.forEach(e207);
    }
    if (c10 && l10) {
      let e207 = _10.reduce((e208, t11) => e208 + (t11.visible ? t11.renderNodeCount : 0), 0);
      this._updateAncestorsRenderNodeCount(o10, g10 - e207), this._onDidSpliceRenderedNodes.fire({ start: s10, deleteCount: e207, elements: u10 });
    }
    this._onDidSpliceModel.fire({ insertedNodes: m10, deletedNodes: _10 });
    let y10 = o10;
    for (; y10; ) {
      if (y10.visibility === 2) {
        this.refilterDelayer.trigger(() => this.refilter());
        break;
      }
      y10 = y10.parent;
    }
  }
  rerender(e206) {
    if (e206.length === 0) throw new tz(this.user, `Invalid tree location`);
    let { node: t10, listIndex: n10, revealed: r10 } = this.getTreeNodeWithListIndex(e206);
    t10.visible && r10 && this._onDidSpliceRenderedNodes.fire({ start: n10, deleteCount: 1, elements: [t10] });
  }
  has(e206) {
    return this.hasTreeNode(e206);
  }
  getListIndex(e206) {
    let { listIndex: t10, visible: n10, revealed: r10 } = this.getTreeNodeWithListIndex(e206);
    return n10 && r10 ? t10 : -1;
  }
  getListRenderCount(e206) {
    return this.getTreeNode(e206).renderNodeCount;
  }
  isCollapsible(e206) {
    return this.getTreeNode(e206).collapsible;
  }
  setCollapsible(e206, t10) {
    let n10 = this.getTreeNode(e206);
    t10 === void 0 && (t10 = !n10.collapsible);
    let r10 = { collapsible: t10 };
    return this.eventBufferer.bufferEvents(() => this._setCollapseState(e206, r10));
  }
  isCollapsed(e206) {
    return this.getTreeNode(e206).collapsed;
  }
  setCollapsed(e206, t10, n10) {
    let r10 = this.getTreeNode(e206);
    t10 === void 0 && (t10 = !r10.collapsed);
    let i10 = { collapsed: t10, recursive: n10 || false };
    return this.eventBufferer.bufferEvents(() => this._setCollapseState(e206, i10));
  }
  _setCollapseState(e206, t10) {
    let { node: n10, listIndex: r10, revealed: i10 } = this.getTreeNodeWithListIndex(e206), a10 = this._setListNodeCollapseState(n10, r10, i10, t10);
    if (n10 !== this.root && this.autoExpandSingleChildren && a10 && !az(t10) && n10.collapsible && !n10.collapsed && !t10.recursive) {
      let r11 = -1;
      for (let e207 = 0; e207 < n10.children.length; e207++) if (n10.children[e207].visible) if (r11 > -1) {
        r11 = -1;
        break;
      } else r11 = e207;
      r11 > -1 && this._setCollapseState([...e206, r11], t10);
    }
    return a10;
  }
  _setListNodeCollapseState(e206, t10, n10, r10) {
    let i10 = this._setNodeCollapseState(e206, r10, false);
    if (!n10 || !e206.visible || !i10) return i10;
    let a10 = e206.renderNodeCount, o10 = this.updateNodeAfterCollapseChange(e206), s10 = a10 - (t10 === -1 ? 0 : 1);
    return this._onDidSpliceRenderedNodes.fire({ start: t10 + 1, deleteCount: s10, elements: o10.slice(1) }), i10;
  }
  _setNodeCollapseState(e206, t10, n10) {
    let r10;
    if (e206 === this.root ? r10 = false : (az(t10) ? (r10 = e206.collapsible !== t10.collapsible, e206.collapsible = t10.collapsible) : e206.collapsible ? (r10 = e206.collapsed !== t10.collapsed, e206.collapsed = t10.collapsed) : r10 = false, r10 && this._onDidChangeCollapseState.fire({ node: e206, deep: n10 })), !az(t10) && t10.recursive) for (let n11 of e206.children) r10 = this._setNodeCollapseState(n11, t10, true) || r10;
    return r10;
  }
  expandTo(e206) {
    this.eventBufferer.bufferEvents(() => {
      let t10 = this.getTreeNode(e206);
      for (; t10.parent; ) t10 = t10.parent, e206 = e206.slice(0, e206.length - 1), t10.collapsed && this._setCollapseState(e206, { collapsed: false, recursive: false });
    });
  }
  refilter() {
    let e206 = this.root.renderNodeCount, t10 = this.updateNodeAfterFilterChange(this.root);
    this._onDidSpliceRenderedNodes.fire({ start: 0, deleteCount: e206, elements: t10 }), this.refilterDelayer.cancel();
  }
  createTreeNode(e206, t10, n10, r10, i10, a10) {
    let o10 = { parent: t10, element: e206.element, children: [], depth: t10.depth + 1, visibleChildrenCount: 0, visibleChildIndex: -1, collapsible: typeof e206.collapsible == `boolean` ? e206.collapsible : e206.collapsed !== void 0, collapsed: e206.collapsed === void 0 ? this.collapseByDefault : e206.collapsed, renderNodeCount: 1, visibility: 1, visible: true, filterData: void 0 }, s10 = this._filterNode(o10, n10);
    o10.visibility = s10, r10 && i10.push(o10);
    let c10 = e206.children || Ut.empty(), l10 = r10 && s10 !== 0 && !o10.collapsed, u10 = 0, d10 = 1;
    for (let e207 of c10) {
      let t11 = this.createTreeNode(e207, o10, s10, l10, i10, a10);
      o10.children.push(t11), d10 += t11.renderNodeCount, t11.visible && (t11.visibleChildIndex = u10++);
    }
    return this.allowNonCollapsibleParents || (o10.collapsible = o10.collapsible || o10.children.length > 0), o10.visibleChildrenCount = u10, o10.visible = s10 === 2 ? u10 > 0 : s10 === 1, o10.visible ? o10.collapsed || (o10.renderNodeCount = d10) : (o10.renderNodeCount = 0, r10 && i10.pop()), a10?.(o10), o10;
  }
  updateNodeAfterCollapseChange(e206) {
    let t10 = e206.renderNodeCount, n10 = [];
    return this._updateNodeAfterCollapseChange(e206, n10), this._updateAncestorsRenderNodeCount(e206.parent, n10.length - t10), n10;
  }
  _updateNodeAfterCollapseChange(e206, t10) {
    if (e206.visible === false) return 0;
    if (t10.push(e206), e206.renderNodeCount = 1, !e206.collapsed) for (let n10 of e206.children) e206.renderNodeCount += this._updateNodeAfterCollapseChange(n10, t10);
    return this._onDidChangeRenderNodeCount.fire(e206), e206.renderNodeCount;
  }
  updateNodeAfterFilterChange(e206) {
    let t10 = e206.renderNodeCount, n10 = [];
    return this._updateNodeAfterFilterChange(e206, +!!e206.visible, n10), this._updateAncestorsRenderNodeCount(e206.parent, n10.length - t10), n10;
  }
  _updateNodeAfterFilterChange(e206, t10, n10, r10 = true) {
    let i10;
    if (e206 !== this.root) {
      if (i10 = this._filterNode(e206, t10), i10 === 0) return e206.visible = false, e206.renderNodeCount = 0, false;
      r10 && n10.push(e206);
    }
    let a10 = n10.length;
    e206.renderNodeCount = e206 === this.root ? 0 : 1;
    let o10 = false;
    if (!e206.collapsed || i10 !== 0) {
      let t11 = 0;
      for (let a11 of e206.children) o10 = this._updateNodeAfterFilterChange(a11, i10, n10, r10 && !e206.collapsed) || o10, a11.visible && (a11.visibleChildIndex = t11++);
      e206.visibleChildrenCount = t11;
    } else e206.visibleChildrenCount = 0;
    return e206 !== this.root && (e206.visible = i10 === 2 ? o10 : i10 === 1, e206.visibility = i10), e206.visible ? e206.collapsed || (e206.renderNodeCount += n10.length - a10) : (e206.renderNodeCount = 0, r10 && n10.pop()), this._onDidChangeRenderNodeCount.fire(e206), e206.visible;
  }
  _updateAncestorsRenderNodeCount(e206, t10) {
    if (t10 !== 0) for (; e206; ) e206.renderNodeCount += t10, this._onDidChangeRenderNodeCount.fire(e206), e206 = e206.parent;
  }
  _filterNode(e206, t10) {
    let n10 = this.filter ? this.filter.filter(e206.element, t10) : 1;
    return typeof n10 == `boolean` ? (e206.filterData = void 0, +!!n10) : rz(n10) ? (e206.filterData = n10.data, iz(n10.visibility)) : (e206.filterData = void 0, iz(n10));
  }
  hasTreeNode(e206, t10 = this.root) {
    if (!e206 || e206.length === 0) return true;
    let [n10, ...r10] = e206;
    return n10 < 0 || n10 > t10.children.length ? false : this.hasTreeNode(r10, t10.children[n10]);
  }
  getTreeNode(e206, t10 = this.root) {
    if (!e206 || e206.length === 0) return t10;
    let [n10, ...r10] = e206;
    if (n10 < 0 || n10 > t10.children.length) throw new tz(this.user, `Invalid tree location`);
    return this.getTreeNode(r10, t10.children[n10]);
  }
  getTreeNodeWithListIndex(e206) {
    if (e206.length === 0) return { node: this.root, listIndex: -1, revealed: true, visible: false };
    let { parentNode: t10, listIndex: n10, revealed: r10, visible: i10 } = this.getParentNodeWithListIndex(e206), a10 = e206[e206.length - 1];
    if (a10 < 0 || a10 > t10.children.length) throw new tz(this.user, `Invalid tree location`);
    let o10 = t10.children[a10];
    return { node: o10, listIndex: n10, revealed: r10, visible: i10 && o10.visible };
  }
  getParentNodeWithListIndex(e206, t10 = this.root, n10 = 0, r10 = true, i10 = true) {
    let [a10, ...o10] = e206;
    if (a10 < 0 || a10 > t10.children.length) throw new tz(this.user, `Invalid tree location`);
    for (let e207 = 0; e207 < a10; e207++) n10 += t10.children[e207].renderNodeCount;
    return r10 && (r10 = !t10.collapsed), i10 && (i10 = t10.visible), o10.length === 0 ? { parentNode: t10, listIndex: n10, revealed: r10, visible: i10 } : this.getParentNodeWithListIndex(o10, t10.children[a10], n10 + 1, r10, i10);
  }
  getNode(e206 = []) {
    return this.getTreeNode(e206);
  }
  getNodeLocation(e206) {
    let t10 = [], n10 = e206;
    for (; n10.parent; ) t10.push(n10.parent.children.indexOf(n10)), n10 = n10.parent;
    return t10.reverse();
  }
  getParentNodeLocation(e206) {
    if (e206.length !== 0) return e206.length === 1 ? [] : a(e206)[0];
  }
  getFirstElementChild(e206) {
    let t10 = this.getTreeNode(e206);
    if (t10.children.length !== 0) return t10.children[0].element;
  }
}, sz = class extends NI {
  constructor(e206) {
    super(e206.elements.map((e207) => e207.element)), this.data = e206;
  }
};
function cz(e206) {
  return e206 instanceof NI ? new sz(e206) : e206;
}
var lz = class {
  constructor(e206, t10) {
    this.modelProvider = e206, this.dnd = t10, this.autoExpandDisposable = D.None, this.disposables = new E();
  }
  getDragURI(e206) {
    return this.dnd.getDragURI(e206.element);
  }
  getDragLabel(e206, t10) {
    if (this.dnd.getDragLabel) return this.dnd.getDragLabel(e206.map((e207) => e207.element), t10);
  }
  onDragStart(e206, t10) {
    this.dnd.onDragStart?.(cz(e206), t10);
  }
  onDragOver(e206, t10, n10, r10, i10, a10 = true) {
    let o10 = this.dnd.onDragOver(cz(e206), t10 && t10.element, n10, r10, i10), s10 = this.autoExpandNode !== t10;
    if (s10 && (this.autoExpandDisposable.dispose(), this.autoExpandNode = t10), t10 === void 0) return o10;
    if (s10 && typeof o10 != `boolean` && o10.autoExpand && (this.autoExpandDisposable = as(() => {
      let e207 = this.modelProvider(), n11 = e207.getNodeLocation(t10);
      e207.isCollapsed(n11) && e207.setCollapsed(n11, false), this.autoExpandNode = void 0;
    }, 500, this.disposables)), typeof o10 == `boolean` || !o10.accept || o10.bubble === void 0 || o10.feedback) return a10 ? o10 : { accept: typeof o10 == `boolean` ? o10 : o10.accept, effect: typeof o10 == `boolean` ? void 0 : o10.effect, feedback: [n10] };
    if (o10.bubble === 1) {
      let n11 = this.modelProvider(), a11 = n11.getNodeLocation(t10), o11 = n11.getParentNodeLocation(a11), s11 = n11.getNode(o11), c11 = o11 && n11.getListIndex(o11);
      return this.onDragOver(e206, s11, c11, r10, i10, false);
    }
    let c10 = this.modelProvider(), l10 = c10.getNodeLocation(t10), u10 = c10.getListIndex(l10), d10 = c10.getListRenderCount(l10);
    return { ...o10, feedback: b(u10, u10 + d10) };
  }
  drop(e206, t10, n10, r10, i10) {
    this.autoExpandDisposable.dispose(), this.autoExpandNode = void 0, this.dnd.drop(cz(e206), t10 && t10.element, n10, r10, i10);
  }
  onDragEnd(e206) {
    this.dnd.onDragEnd?.(e206);
  }
  dispose() {
    this.disposables.dispose(), this.dnd.dispose();
  }
};
function uz(e206, t10, n10) {
  return n10 && { ...n10, identityProvider: n10.identityProvider && { getId(e207) {
    return n10.identityProvider.getId(e207.element);
  } }, dnd: n10.dnd && t10.add(new lz(e206, n10.dnd)), multipleSelectionController: n10.multipleSelectionController && { isSelectionSingleChangeEvent(e207) {
    return n10.multipleSelectionController.isSelectionSingleChangeEvent({ ...e207, element: e207.element });
  }, isSelectionRangeChangeEvent(e207) {
    return n10.multipleSelectionController.isSelectionRangeChangeEvent({ ...e207, element: e207.element });
  } }, accessibilityProvider: n10.accessibilityProvider && { ...n10.accessibilityProvider, getSetSize(t11) {
    let n11 = e206(), r10 = n11.getNodeLocation(t11), i10 = n11.getParentNodeLocation(r10);
    return n11.getNode(i10).visibleChildrenCount;
  }, getPosInSet(e207) {
    return e207.visibleChildIndex + 1;
  }, isChecked: n10.accessibilityProvider && n10.accessibilityProvider.isChecked ? (e207) => n10.accessibilityProvider.isChecked(e207.element) : void 0, getRole: n10.accessibilityProvider && n10.accessibilityProvider.getRole ? (e207) => n10.accessibilityProvider.getRole(e207.element) : () => `treeitem`, getAriaLabel(e207) {
    return n10.accessibilityProvider.getAriaLabel(e207.element);
  }, getWidgetAriaLabel() {
    return n10.accessibilityProvider.getWidgetAriaLabel();
  }, getWidgetRole: n10.accessibilityProvider && n10.accessibilityProvider.getWidgetRole ? () => n10.accessibilityProvider.getWidgetRole() : () => `tree`, getAriaLevel: n10.accessibilityProvider && n10.accessibilityProvider.getAriaLevel ? (e207) => n10.accessibilityProvider.getAriaLevel(e207.element) : (e207) => e207.depth, getActiveDescendantId: n10.accessibilityProvider.getActiveDescendantId && ((e207) => n10.accessibilityProvider.getActiveDescendantId(e207.element)) }, keyboardNavigationLabelProvider: n10.keyboardNavigationLabelProvider && { ...n10.keyboardNavigationLabelProvider, getKeyboardNavigationLabel(e207) {
    return n10.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e207.element);
  } } };
}
var dz = class {
  constructor(e206) {
    this.delegate = e206;
  }
  getHeight(e206) {
    return this.delegate.getHeight(e206.element);
  }
  getTemplateId(e206) {
    return this.delegate.getTemplateId(e206.element);
  }
  hasDynamicHeight(e206) {
    return !!this.delegate.hasDynamicHeight && this.delegate.hasDynamicHeight(e206.element);
  }
  setDynamicHeight(e206, t10) {
    this.delegate.setDynamicHeight?.(e206.element, t10);
  }
}, fz;
(function(e206) {
  e206.None = `none`, e206.OnHover = `onHover`, e206.Always = `always`;
})(fz || (fz = {}));
var pz = class {
  get elements() {
    return this._elements;
  }
  constructor(e206, t10 = []) {
    this._elements = t10, this.disposables = new E(), this.onDidChange = O.forEach(e206, (e207) => this._elements = e207, this.disposables);
  }
  dispose() {
    this.disposables.dispose();
  }
}, mz = (_ab = class {
  constructor(t10, n10, r10, i10, a10, o10 = {}) {
    this.renderer = t10, this.model = n10, this.activeNodes = i10, this.renderedIndentGuides = a10, this.renderedElements = /* @__PURE__ */ new Map(), this.renderedNodes = /* @__PURE__ */ new Map(), this.indent = _ab.DefaultIndent, this.hideTwistiesOfChildlessElements = false, this.shouldRenderIndentGuides = false, this.activeIndentNodes = /* @__PURE__ */ new Set(), this.indentGuidesDisposable = D.None, this.disposables = new E(), this.templateId = t10.templateId, this.updateOptions(o10), O.map(r10, (e206) => e206.node)(this.onDidChangeNodeTwistieState, this, this.disposables), t10.onDidChangeTwistieState?.(this.onDidChangeTwistieState, this, this.disposables);
  }
  updateOptions(t10 = {}) {
    if (t10.indent !== void 0) {
      let n10 = rA(t10.indent, 0, 40);
      if (n10 !== this.indent) {
        this.indent = n10;
        for (let [t11, n11] of this.renderedNodes) n11.indentSize = _ab.DefaultIndent + (t11.depth - 1) * this.indent, this.renderTreeElement(t11, n11);
      }
    }
    if (t10.renderIndentGuides !== void 0) {
      let e206 = t10.renderIndentGuides !== fz.None;
      if (e206 !== this.shouldRenderIndentGuides) {
        this.shouldRenderIndentGuides = e206;
        for (let [e207, t11] of this.renderedNodes) this._renderIndentGuides(e207, t11);
        if (this.indentGuidesDisposable.dispose(), e206) {
          let e207 = new E();
          this.activeNodes.onDidChange(this._onDidChangeActiveNodes, this, e207), this.indentGuidesDisposable = e207, this._onDidChangeActiveNodes(this.activeNodes.elements);
        }
      }
    }
    t10.hideTwistiesOfChildlessElements !== void 0 && (this.hideTwistiesOfChildlessElements = t10.hideTwistiesOfChildlessElements);
  }
  renderTemplate(e206) {
    let t10 = z(e206, B(`.monaco-tl-row`)), n10 = z(t10, B(`.monaco-tl-indent`)), r10 = z(t10, B(`.monaco-tl-twistie`)), i10 = z(t10, B(`.monaco-tl-contents`)), a10 = this.renderer.renderTemplate(i10);
    return { container: e206, indent: n10, twistie: r10, indentGuidesDisposable: D.None, indentSize: 0, templateData: a10 };
  }
  renderElement(t10, n10, r10, i10) {
    r10.indentSize = _ab.DefaultIndent + (t10.depth - 1) * this.indent, this.renderedNodes.set(t10, r10), this.renderedElements.set(t10.element, t10), this.renderTreeElement(t10, r10), this.renderer.renderElement(t10, n10, r10.templateData, { ...i10, indent: r10.indentSize });
  }
  disposeElement(e206, t10, n10, r10) {
    n10.indentGuidesDisposable.dispose(), this.renderer.disposeElement?.(e206, t10, n10.templateData, { ...r10, indent: n10.indentSize }), typeof r10?.height == `number` && (this.renderedNodes.delete(e206), this.renderedElements.delete(e206.element));
  }
  disposeTemplate(e206) {
    this.renderer.disposeTemplate(e206.templateData);
  }
  onDidChangeTwistieState(e206) {
    let t10 = this.renderedElements.get(e206);
    t10 && this.onDidChangeNodeTwistieState(t10);
  }
  onDidChangeNodeTwistieState(e206) {
    let t10 = this.renderedNodes.get(e206);
    t10 && (this._onDidChangeActiveNodes(this.activeNodes.elements), this.renderTreeElement(e206, t10));
  }
  renderTreeElement(e206, t10) {
    t10.twistie.style.paddingLeft = `${t10.indentSize}px`, t10.indent.style.width = `${t10.indentSize + this.indent - 16}px`, e206.collapsible ? t10.container.setAttribute(`aria-expanded`, String(!e206.collapsed)) : t10.container.removeAttribute(`aria-expanded`), t10.twistie.classList.remove(...ju.asClassNameArray(F.treeItemExpanded));
    let n10 = false;
    this.renderer.renderTwistie && (n10 = this.renderer.renderTwistie(e206.element, t10.twistie)), e206.collapsible && (!this.hideTwistiesOfChildlessElements || e206.visibleChildrenCount > 0) ? (n10 || t10.twistie.classList.add(...ju.asClassNameArray(F.treeItemExpanded)), t10.twistie.classList.add(`collapsible`), t10.twistie.classList.toggle(`collapsed`, e206.collapsed)) : t10.twistie.classList.remove(`collapsible`, `collapsed`), this._renderIndentGuides(e206, t10);
  }
  _renderIndentGuides(e206, t10) {
    if (Xc(t10.indent), t10.indentGuidesDisposable.dispose(), !this.shouldRenderIndentGuides) return;
    let n10 = new E();
    for (; ; ) {
      let r10 = this.model.getNodeLocation(e206), i10 = this.model.getParentNodeLocation(r10);
      if (!i10) break;
      let a10 = this.model.getNode(i10), o10 = B(`.indent-guide`, { style: `width: ${this.indent}px` });
      this.activeIndentNodes.has(a10) && o10.classList.add(`active`), t10.indent.childElementCount === 0 ? t10.indent.appendChild(o10) : t10.indent.insertBefore(o10, t10.indent.firstElementChild), this.renderedIndentGuides.add(a10, o10), n10.add(T(() => this.renderedIndentGuides.delete(a10, o10))), e206 = a10;
    }
    t10.indentGuidesDisposable = n10;
  }
  _onDidChangeActiveNodes(e206) {
    if (!this.shouldRenderIndentGuides) return;
    let t10 = /* @__PURE__ */ new Set();
    e206.forEach((e207) => {
      let n10 = this.model.getNodeLocation(e207);
      try {
        let r10 = this.model.getParentNodeLocation(n10);
        e207.collapsible && e207.children.length > 0 && !e207.collapsed ? t10.add(e207) : r10 && t10.add(this.model.getNode(r10));
      } catch {
      }
    }), this.activeIndentNodes.forEach((e207) => {
      t10.has(e207) || this.renderedIndentGuides.forEach(e207, (e208) => e208.classList.remove(`active`));
    }), t10.forEach((e207) => {
      this.activeIndentNodes.has(e207) || this.renderedIndentGuides.forEach(e207, (e208) => e208.classList.add(`active`));
    }), this.activeIndentNodes = t10;
  }
  dispose() {
    this.renderedNodes.clear(), this.renderedElements.clear(), this.indentGuidesDisposable.dispose(), Kt(this.disposables);
  }
}, _ab.DefaultIndent = 8, _ab);
function hz(e206, t10) {
  let n10 = t10.toLowerCase().indexOf(e206), r10;
  if (n10 > -1) {
    r10 = [2 ** 53 - 1, 0];
    for (let t11 = e206.length; t11 > 0; t11--) r10.push(n10 + t11 - 1);
  }
  return r10;
}
var gz = class {
  get totalCount() {
    return this._totalCount;
  }
  get matchCount() {
    return this._matchCount;
  }
  set findMatchType(e206) {
    this._findMatchType = e206;
  }
  get findMatchType() {
    return this._findMatchType;
  }
  set findMode(e206) {
    this._findMode = e206;
  }
  get findMode() {
    return this._findMode;
  }
  constructor(e206, t10, n10) {
    this._keyboardNavigationLabelProvider = e206, this._filter = t10, this._defaultFindVisibility = n10, this._totalCount = 0, this._matchCount = 0, this._findMatchType = yz.Fuzzy, this._findMode = vz.Highlight, this._pattern = ``, this._lowercasePattern = ``, this.disposables = new E();
  }
  filter(e206, t10) {
    let n10 = 1;
    if (this._filter) {
      let r11 = this._filter.filter(e206, t10);
      if (n10 = typeof r11 == `boolean` ? +!!r11 : rz(r11) ? iz(r11.visibility) : r11, n10 === 0) return false;
    }
    if (this._totalCount++, !this._pattern) return this._matchCount++, { data: CM.Default, visibility: n10 };
    let r10 = this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e206), i10 = Array.isArray(r10) ? r10 : [r10];
    for (let e207 of i10) {
      let t11 = e207 && e207.toString();
      if (t11 === void 0) return { data: CM.Default, visibility: n10 };
      let r11;
      if (r11 = this._findMatchType === yz.Contiguous ? hz(this._lowercasePattern, t11.toLowerCase()) : TM(this._pattern, this._lowercasePattern, 0, t11, t11.toLowerCase(), 0, { firstMatchCanBeWeak: true, boostFullMatch: true }), r11) return this._matchCount++, i10.length === 1 ? { data: r11, visibility: n10 } : { data: { label: t11, score: r11 }, visibility: n10 };
    }
    return this._findMode === vz.Filter ? typeof this._defaultFindVisibility == `number` ? this._defaultFindVisibility : this._defaultFindVisibility ? this._defaultFindVisibility(e206) : 2 : { data: CM.Default, visibility: n10 };
  }
  reset() {
    this._totalCount = 0, this._matchCount = 0;
  }
  dispose() {
    Kt(this.disposables);
  }
}, _z2 = class {
  constructor(e206) {
    this.stateMap = new Map(e206.map((e207) => [e207.id, { ...e207 }]));
  }
  get(e206) {
    let t10 = this.stateMap.get(e206);
    if (t10 === void 0) throw Error(`No state found for toggle id ${e206}`);
    return t10.isChecked;
  }
  set(e206, t10) {
    let n10 = this.stateMap.get(e206);
    if (n10 === void 0) throw Error(`No state found for toggle id ${e206}`);
    return n10.isChecked === t10 ? false : (n10.isChecked = t10, true);
  }
}, vz;
(function(e206) {
  e206[e206.Highlight = 0] = `Highlight`, e206[e206.Filter = 1] = `Filter`;
})(vz || (vz = {}));
var yz;
(function(e206) {
  e206[e206.Fuzzy = 0] = `Fuzzy`, e206[e206.Contiguous = 1] = `Contiguous`;
})(yz || (yz = {}));
var bz;
(function(e206) {
  e206.Mode = `mode`, e206.MatchType = `matchType`;
})(bz || (bz = {}));
var xz = class {
  get pattern() {
    return this._pattern;
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e206) {
    this._placeholder = e206, this.widget?.setPlaceHolder(e206);
  }
  constructor(e206, t10, n10, r10 = {}) {
    this.tree = e206, this.filter = t10, this.contextViewProvider = n10, this.options = r10, this._pattern = ``, this._onDidChangePattern = new k(), this._onDidChangeOpenState = new k(), this.onDidChangeOpenState = this._onDidChangeOpenState.event, this.enabledDisposables = new E(), this.disposables = new E(), this.toggles = new _z2(r10.toggles ?? []), this._placeholder = r10.placeholder ?? C(20, `Type to search`);
  }
  isOpened() {
    return !!this.widget;
  }
  updateToggleState(e206, t10) {
    this.toggles.set(e206, t10), this.widget?.setToggleState(e206, t10);
  }
  renderMessage(e206, t10) {
    e206 ? this.tree.options.showNotFoundMessage ?? true ? this.widget?.showMessage({ type: 2, content: t10 ?? C(21, `No results found.`) }) : this.widget?.showMessage({ type: 2 }) : this.widget?.clearMessage();
  }
  alertResults(e206) {
    Wg(e206 ? C(23, `{0} results`, e206) : C(22, `No results`));
  }
  dispose() {
    this._history = void 0, this._onDidChangePattern.dispose(), this.enabledDisposables.dispose(), this.disposables.dispose();
  }
}, Sz = class extends xz {
  get mode() {
    return this.toggles.get(bz.Mode) ? vz.Filter : vz.Highlight;
  }
  set mode(e206) {
    if (e206 === this.mode) return;
    let t10 = e206 === vz.Filter;
    this.updateToggleState(bz.Mode, t10), this.placeholder = t10 ? C(24, `Type to filter`) : C(25, `Type to search`), this.filter.findMode = e206, this.tree.refilter(), this.render(), this._onDidChangeMode.fire(e206);
  }
  get matchType() {
    return this.toggles.get(bz.MatchType) ? yz.Fuzzy : yz.Contiguous;
  }
  set matchType(e206) {
    e206 !== this.matchType && (this.updateToggleState(bz.MatchType, e206 === yz.Fuzzy), this.filter.findMatchType = e206, this.tree.refilter(), this.render(), this._onDidChangeMatchType.fire(e206));
  }
  constructor(e206, t10, n10, r10 = {}) {
    let i10 = r10.defaultFindMode ?? vz.Highlight, a10 = r10.defaultFindMatchType ?? yz.Fuzzy, o10 = [{ id: bz.Mode, icon: F.listFilter, title: C(26, `Filter`), isChecked: i10 === vz.Filter }, { id: bz.MatchType, icon: F.searchFuzzy, title: C(27, `Fuzzy Match`), isChecked: a10 === yz.Fuzzy }];
    t10.findMatchType = a10, t10.findMode = i10, super(e206, t10, n10, { ...r10, toggles: o10 }), this.filter = t10, this._onDidChangeMode = new k(), this.onDidChangeMode = this._onDidChangeMode.event, this._onDidChangeMatchType = new k(), this.onDidChangeMatchType = this._onDidChangeMatchType.event, this.disposables.add(this.tree.onDidChangeModel(() => {
      this.isOpened() && (this.pattern.length !== 0 && this.tree.refilter(), this.render());
    })), this.disposables.add(this.tree.onWillRefilter(() => this.filter.reset()));
  }
  updateOptions(e206 = {}) {
    e206.defaultFindMode !== void 0 && (this.mode = e206.defaultFindMode), e206.defaultFindMatchType !== void 0 && (this.matchType = e206.defaultFindMatchType);
  }
  shouldAllowFocus(e206) {
    return !this.isOpened() || !this.pattern || this.filter.totalCount > 0 && this.filter.matchCount <= 1 ? true : !CM.isDefault(e206.filterData);
  }
  render() {
    let e206 = this.filter.matchCount === 0 && this.filter.totalCount > 0 && this.pattern.length > 0;
    this.renderMessage(e206), this.pattern.length && this.alertResults(this.filter.matchCount);
  }
};
function Cz(e206, t10) {
  return e206.position === t10.position && wz(e206, t10);
}
function wz(e206, t10) {
  return e206.node.element === t10.node.element && e206.startIndex === t10.startIndex && e206.height === t10.height && e206.endIndex === t10.endIndex;
}
var Tz = class {
  constructor(e206 = []) {
    this.stickyNodes = e206;
  }
  get count() {
    return this.stickyNodes.length;
  }
  equal(e206) {
    return o(this.stickyNodes, e206.stickyNodes, Cz);
  }
  contains(e206) {
    return this.stickyNodes.some((t10) => t10.node.element === e206.element);
  }
  lastNodePartiallyVisible() {
    if (this.count === 0) return false;
    let e206 = this.stickyNodes[this.count - 1];
    if (this.count === 1) return e206.position !== 0;
    let t10 = this.stickyNodes[this.count - 2];
    return t10.position + t10.height !== e206.position;
  }
  animationStateChanged(e206) {
    if (!o(this.stickyNodes, e206.stickyNodes, wz) || this.count === 0) return false;
    let t10 = this.stickyNodes[this.count - 1], n10 = e206.stickyNodes[e206.count - 1];
    return t10.position !== n10.position;
  }
}, Ez = class {
  constrainStickyScrollNodes(e206, t10, n10) {
    for (let r10 = 0; r10 < e206.length; r10++) {
      let i10 = e206[r10];
      if (i10.position + i10.height > n10 || r10 >= t10) return e206.slice(0, r10);
    }
    return e206;
  }
}, Dz = class extends D {
  constructor(e206, t10, n10, r10, i10, a10 = {}) {
    super(), this.tree = e206, this.model = t10, this.view = n10, this.treeDelegate = i10, this.maxWidgetViewRatio = 0.4, this.stickyScrollMaxItemCount = this.validateStickySettings(a10).stickyScrollMaxItemCount, this.stickyScrollDelegate = a10.stickyScrollDelegate ?? new Ez(), this.paddingTop = a10.paddingTop ?? 0, this._widget = this._register(new Oz(n10.getScrollableElement(), n10, e206, r10, i10, a10.accessibilityProvider)), this.onDidChangeHasFocus = this._widget.onDidChangeHasFocus, this.onContextMenu = this._widget.onContextMenu, this._register(n10.onDidScroll(() => this.update())), this._register(n10.onDidChangeContentHeight(() => this.update())), this._register(e206.onDidChangeCollapseState(() => this.update())), this._register(t10.onDidSpliceRenderedNodes((e207) => {
      let t11 = this._widget.state;
      if (t11) {
        if (e207.deleteCount > 0 && t11.stickyNodes.some((e208) => !this.model.has(this.model.getNodeLocation(e208.node)))) {
          this.update();
          return;
        }
        t11.stickyNodes.some((n11) => {
          let r11 = this.model.getListIndex(this.model.getNodeLocation(n11.node));
          return r11 >= e207.start && r11 < e207.start + e207.deleteCount && t11.contains(n11.node);
        }) && this._widget.rerender();
      }
    })), this.update();
  }
  get height() {
    return this._widget.height;
  }
  getNodeAtHeight(e206) {
    let t10;
    if (t10 = e206 === 0 ? this.view.firstVisibleIndex : this.view.indexAt(e206 + this.view.scrollTop), !(t10 < 0 || t10 >= this.view.length)) return this.view.element(t10);
  }
  update() {
    let e206 = this.getNodeAtHeight(this.paddingTop);
    if (!e206 || this.tree.scrollTop <= this.paddingTop) {
      this._widget.setState(void 0);
      return;
    }
    let t10 = this.findStickyState(e206);
    this._widget.setState(t10);
  }
  findStickyState(e206) {
    let t10 = [], n10 = e206, r10 = 0, i10 = this.getNextStickyNode(n10, void 0, r10);
    for (; i10 && (t10.push(i10), r10 += i10.height, !(t10.length <= this.stickyScrollMaxItemCount && (n10 = this.getNextVisibleNode(i10), !n10))); ) i10 = this.getNextStickyNode(n10, i10.node, r10);
    let a10 = this.constrainStickyNodes(t10);
    return a10.length ? new Tz(a10) : void 0;
  }
  getNextVisibleNode(e206) {
    return this.getNodeAtHeight(e206.position + e206.height);
  }
  getNextStickyNode(e206, t10, n10) {
    let r10 = this.getAncestorUnderPrevious(e206, t10);
    if (r10 && !(r10 === e206 && (!this.nodeIsUncollapsedParent(e206) || this.nodeTopAlignsWithStickyNodesBottom(e206, n10)))) return this.createStickyScrollNode(r10, n10);
  }
  nodeTopAlignsWithStickyNodesBottom(e206, t10) {
    let n10 = this.getNodeIndex(e206), r10 = this.view.getElementTop(n10), i10 = t10;
    return this.view.scrollTop === r10 - i10;
  }
  createStickyScrollNode(e206, t10) {
    let n10 = this.treeDelegate.getHeight(e206), { startIndex: r10, endIndex: i10 } = this.getNodeRange(e206);
    return { node: e206, position: this.calculateStickyNodePosition(i10, t10, n10), height: n10, startIndex: r10, endIndex: i10 };
  }
  getAncestorUnderPrevious(e206, t10 = void 0) {
    let n10 = e206, r10 = this.getParentNode(n10);
    for (; r10; ) {
      if (r10 === t10) return n10;
      n10 = r10, r10 = this.getParentNode(n10);
    }
    if (t10 === void 0) return n10;
  }
  calculateStickyNodePosition(e206, t10, n10) {
    let r10 = this.view.getRelativeTop(e206);
    if (r10 === null && this.view.firstVisibleIndex === e206 && e206 + 1 < this.view.length) {
      let t11 = this.treeDelegate.getHeight(this.view.element(e206)), n11 = this.view.getRelativeTop(e206 + 1);
      r10 = n11 ? n11 - t11 / this.view.renderHeight : null;
    }
    if (r10 === null) return t10;
    let i10 = this.view.element(e206), a10 = this.treeDelegate.getHeight(i10), o10 = r10 * this.view.renderHeight + a10;
    return t10 + n10 > o10 && t10 <= o10 ? o10 - n10 : t10;
  }
  constrainStickyNodes(e206) {
    if (e206.length === 0) return [];
    let t10 = this.view.renderHeight * this.maxWidgetViewRatio, n10 = e206[e206.length - 1];
    if (e206.length <= this.stickyScrollMaxItemCount && n10.position + n10.height <= t10) return e206;
    let r10 = this.stickyScrollDelegate.constrainStickyScrollNodes(e206, this.stickyScrollMaxItemCount, t10);
    if (!r10.length) return [];
    let i10 = r10[r10.length - 1];
    if (r10.length > this.stickyScrollMaxItemCount || i10.position + i10.height > t10) throw Error(`stickyScrollDelegate violates constraints`);
    return r10;
  }
  getParentNode(e206) {
    let t10 = this.model.getNodeLocation(e206), n10 = this.model.getParentNodeLocation(t10);
    return n10 ? this.model.getNode(n10) : void 0;
  }
  nodeIsUncollapsedParent(e206) {
    let t10 = this.model.getNodeLocation(e206);
    return this.model.getListRenderCount(t10) > 1;
  }
  getNodeIndex(e206) {
    let t10 = this.model.getNodeLocation(e206);
    return this.model.getListIndex(t10);
  }
  getNodeRange(e206) {
    let t10 = this.model.getNodeLocation(e206), n10 = this.model.getListIndex(t10);
    if (n10 < 0) throw Error(`Node not found in tree`);
    return { startIndex: n10, endIndex: n10 + this.model.getListRenderCount(t10) - 1 };
  }
  nodePositionTopBelowWidget(e206) {
    let t10 = [], n10 = this.getParentNode(e206);
    for (; n10; ) t10.push(n10), n10 = this.getParentNode(n10);
    let r10 = 0;
    for (let e207 = 0; e207 < t10.length && e207 < this.stickyScrollMaxItemCount; e207++) r10 += this.treeDelegate.getHeight(t10[e207]);
    return r10;
  }
  domFocus() {
    this._widget.domFocus();
  }
  focusedLast() {
    return this._widget.focusedLast();
  }
  updateOptions(e206 = {}) {
    if (e206.paddingTop !== void 0 && (this.paddingTop = e206.paddingTop), e206.stickyScrollMaxItemCount !== void 0) {
      let t10 = this.validateStickySettings(e206);
      this.stickyScrollMaxItemCount !== t10.stickyScrollMaxItemCount && (this.stickyScrollMaxItemCount = t10.stickyScrollMaxItemCount, this.update());
    }
  }
  validateStickySettings(e206) {
    let t10 = 7;
    return typeof e206.stickyScrollMaxItemCount == `number` && (t10 = Math.max(e206.stickyScrollMaxItemCount, 1)), { stickyScrollMaxItemCount: t10 };
  }
}, Oz = class {
  get state() {
    return this._previousState;
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    this.view = t10, this.tree = n10, this.treeRenderers = r10, this.treeDelegate = i10, this.accessibilityProvider = a10, this._previousElements = [], this._previousStateDisposables = new E(), this._rootDomNode = B(`.monaco-tree-sticky-container.empty`), e206.appendChild(this._rootDomNode);
    let o10 = B(`.monaco-tree-sticky-container-shadow`);
    this._rootDomNode.appendChild(o10), this.stickyScrollFocus = new kz(this._rootDomNode, t10), this.onDidChangeHasFocus = this.stickyScrollFocus.onDidChangeHasFocus, this.onContextMenu = this.stickyScrollFocus.onContextMenu;
  }
  get height() {
    if (!this._previousState) return 0;
    let e206 = this._previousState.stickyNodes[this._previousState.count - 1];
    return e206.position + e206.height;
  }
  setState(e206) {
    let t10 = !!this._previousState && this._previousState.count > 0, n10 = !!e206 && e206.count > 0;
    if (!t10 && !n10 || t10 && n10 && this._previousState.equal(e206)) return;
    if (t10 !== n10 && this.setVisible(n10), !n10) {
      this._previousState = void 0, this._previousElements = [], this._previousStateDisposables.clear();
      return;
    }
    let r10 = e206.stickyNodes[e206.count - 1];
    this._previousState && e206.animationStateChanged(this._previousState) ? this._previousElements[this._previousState.count - 1].style.top = `${r10.position}px` : this.renderState(e206), this._previousState = e206, this._rootDomNode.style.height = `${r10.position + r10.height}px`;
  }
  renderState(e206) {
    this._previousStateDisposables.clear();
    let t10 = Array(e206.count);
    for (let n10 = e206.count - 1; n10 >= 0; n10--) {
      let r10 = e206.stickyNodes[n10], { element: i10, disposable: a10 } = this.createElement(r10, n10, e206.count);
      t10[n10] = i10, this._rootDomNode.appendChild(i10), this._previousStateDisposables.add(a10);
    }
    this.stickyScrollFocus.updateElements(t10, e206), this._previousElements = t10;
  }
  rerender() {
    this._previousState && this.renderState(this._previousState);
  }
  createElement(e206, t10, n10) {
    let r10 = e206.startIndex, i10 = document.createElement(`div`);
    i10.style.top = `${e206.position}px`, this.tree.options.setRowHeight !== false && (i10.style.height = `${e206.height}px`), this.tree.options.setRowLineHeight !== false && (i10.style.lineHeight = `${e206.height}px`), i10.classList.add(`monaco-tree-sticky-row`), i10.classList.add(`monaco-list-row`), i10.setAttribute(`data-index`, `${r10}`), i10.setAttribute(`data-parity`, r10 % 2 == 0 ? `even` : `odd`), i10.setAttribute(`id`, this.view.getElementID(r10));
    let a10 = this.setAccessibilityAttributes(i10, e206.node.element, t10, n10), o10 = this.treeDelegate.getTemplateId(e206.node), s10 = this.treeRenderers.find((e207) => e207.templateId === o10);
    if (!s10) throw Error(`No renderer found for template id ${o10}`);
    let c10 = e206.node;
    c10 === this.tree.getNode(this.tree.getNodeLocation(e206.node)) && (c10 = new Proxy(e206.node, {}));
    let l10 = s10.renderTemplate(i10);
    return s10.renderElement(c10, e206.startIndex, l10, { height: e206.height }), { element: i10, disposable: T(() => {
      a10.dispose(), s10.disposeElement(c10, e206.startIndex, l10, { height: e206.height }), s10.disposeTemplate(l10), i10.remove();
    }) };
  }
  setAccessibilityAttributes(e206, t10, n10, r10) {
    if (!this.accessibilityProvider) return D.None;
    this.accessibilityProvider.getSetSize && e206.setAttribute(`aria-setsize`, String(this.accessibilityProvider.getSetSize(t10, n10, r10))), this.accessibilityProvider.getPosInSet && e206.setAttribute(`aria-posinset`, String(this.accessibilityProvider.getPosInSet(t10, n10))), this.accessibilityProvider.getRole && e206.setAttribute(`role`, this.accessibilityProvider.getRole(t10) ?? `treeitem`);
    let i10 = this.accessibilityProvider.getAriaLabel(t10), a10 = i10 && typeof i10 != `string` ? i10 : FI(i10), o10 = hc((t11) => {
      let n11 = t11.readObservable(a10);
      n11 ? e206.setAttribute(`aria-label`, n11) : e206.removeAttribute(`aria-label`);
    });
    typeof i10 == `string` || i10 && e206.setAttribute(`aria-label`, i10.get());
    let s10 = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(t10);
    return typeof s10 == `number` && e206.setAttribute(`aria-level`, `${s10}`), e206.setAttribute(`aria-selected`, `false`), o10;
  }
  setVisible(e206) {
    this._rootDomNode.classList.toggle(`empty`, !e206), e206 || this.stickyScrollFocus.updateElements([], void 0);
  }
  domFocus() {
    this.stickyScrollFocus.domFocus();
  }
  focusedLast() {
    return this.stickyScrollFocus.focusedLast();
  }
  dispose() {
    this.stickyScrollFocus.dispose(), this._previousStateDisposables.dispose(), this._rootDomNode.remove();
  }
}, kz = class extends D {
  get domHasFocus() {
    return this._domHasFocus;
  }
  set domHasFocus(e206) {
    e206 !== this._domHasFocus && (this._onDidChangeHasFocus.fire(e206), this._domHasFocus = e206);
  }
  constructor(e206, t10) {
    super(), this.container = e206, this.view = t10, this.focusedIndex = -1, this.elements = [], this._onDidChangeHasFocus = new k(), this.onDidChangeHasFocus = this._onDidChangeHasFocus.event, this._onContextMenu = new k(), this.onContextMenu = this._onContextMenu.event, this._domHasFocus = false, this._register(L(this.container, `focus`, () => this.onFocus())), this._register(L(this.container, `blur`, () => this.onBlur())), this._register(this.view.onDidFocus(() => this.toggleStickyScrollFocused(false))), this._register(this.view.onKeyDown((e207) => this.onKeyDown(e207))), this._register(this.view.onMouseDown((e207) => this.onMouseDown(e207))), this._register(this.view.onContextMenu((e207) => this.handleContextMenu(e207)));
  }
  handleContextMenu(e206) {
    let t10 = e206.browserEvent.target;
    if (!HI(t10) && !VI(t10)) {
      this.focusedLast() && this.view.domFocus();
      return;
    }
    if (!zl(e206.browserEvent)) {
      if (!this.state) throw Error(`Context menu should not be triggered when state is undefined`);
      let t11 = this.state.stickyNodes.findIndex((t12) => t12.node.element === e206.element?.element);
      if (t11 === -1) throw Error(`Context menu should not be triggered when element is not in sticky scroll widget`);
      this.container.focus(), this.setFocus(t11);
      return;
    }
    if (!this.state || this.focusedIndex < 0) throw Error(`Context menu key should not be triggered when focus is not in sticky scroll widget`);
    let n10 = this.state.stickyNodes[this.focusedIndex].node.element, r10 = this.elements[this.focusedIndex];
    this._onContextMenu.fire({ element: n10, anchor: r10, browserEvent: e206.browserEvent, isStickyScroll: true });
  }
  onKeyDown(e206) {
    if (this.domHasFocus && this.state) {
      if (e206.key === `ArrowUp`) this.setFocusedElement(Math.max(0, this.focusedIndex - 1)), e206.preventDefault(), e206.stopPropagation();
      else if (e206.key === `ArrowDown` || e206.key === `ArrowRight`) {
        if (this.focusedIndex >= this.state.count - 1) {
          let e207 = this.state.stickyNodes[this.state.count - 1].startIndex + 1;
          this.view.domFocus(), this.view.setFocus([e207]), this.scrollNodeUnderWidget(e207, this.state);
        } else this.setFocusedElement(this.focusedIndex + 1);
        e206.preventDefault(), e206.stopPropagation();
      }
    }
  }
  onMouseDown(e206) {
    let t10 = e206.browserEvent.target;
    !HI(t10) && !VI(t10) || (e206.browserEvent.preventDefault(), e206.browserEvent.stopPropagation());
  }
  updateElements(e206, t10) {
    if (t10 && t10.count === 0) throw Error(`Sticky scroll state must be undefined when there are no sticky nodes`);
    if (t10 && t10.count !== e206.length) throw Error(`Sticky scroll focus received illigel state`);
    let n10 = this.focusedIndex;
    if (this.removeFocus(), this.elements = e206, this.state = t10, t10) {
      let e207 = rA(n10, 0, t10.count - 1);
      this.setFocus(e207);
    } else this.domHasFocus && this.view.domFocus();
    this.container.tabIndex = t10 ? 0 : -1;
  }
  setFocusedElement(e206) {
    let t10 = this.state;
    if (!t10) throw Error(`Cannot set focus when state is undefined`);
    if (this.setFocus(e206), !(e206 < t10.count - 1) && t10.lastNodePartiallyVisible()) {
      let n10 = t10.stickyNodes[e206];
      this.scrollNodeUnderWidget(n10.endIndex + 1, t10);
    }
  }
  scrollNodeUnderWidget(e206, t10) {
    let n10 = t10.stickyNodes[t10.count - 1], r10 = t10.count > 1 ? t10.stickyNodes[t10.count - 2] : void 0, i10 = this.view.getElementTop(e206), a10 = r10 ? r10.position + r10.height + n10.height : n10.height;
    this.view.scrollTop = i10 - a10;
  }
  domFocus() {
    if (!this.state) throw Error(`Cannot focus when state is undefined`);
    this.container.focus();
  }
  focusedLast() {
    return this.state ? this.view.getHTMLElement().classList.contains(`sticky-scroll-focused`) : false;
  }
  removeFocus() {
    this.focusedIndex !== -1 && (this.toggleElementFocus(this.elements[this.focusedIndex], false), this.focusedIndex = -1);
  }
  setFocus(e206) {
    if (0 > e206) throw Error(`addFocus() can not remove focus`);
    if (!this.state && e206 >= 0) throw Error(`Cannot set focus index when state is undefined`);
    if (this.state && e206 >= this.state.count) throw Error(`Cannot set focus index to an index that does not exist`);
    let t10 = this.focusedIndex;
    t10 >= 0 && this.toggleElementFocus(this.elements[t10], false), e206 >= 0 && this.toggleElementFocus(this.elements[e206], true), this.focusedIndex = e206;
  }
  toggleElementFocus(e206, t10) {
    this.toggleElementActiveFocus(e206, t10 && this.domHasFocus), this.toggleElementPassiveFocus(e206, t10);
  }
  toggleCurrentElementActiveFocus(e206) {
    this.focusedIndex !== -1 && this.toggleElementActiveFocus(this.elements[this.focusedIndex], e206);
  }
  toggleElementActiveFocus(e206, t10) {
    e206.classList.toggle(`focused`, t10);
  }
  toggleElementPassiveFocus(e206, t10) {
    e206.classList.toggle(`passive-focused`, t10);
  }
  toggleStickyScrollFocused(e206) {
    this.view.getHTMLElement().classList.toggle(`sticky-scroll-focused`, e206);
  }
  onFocus() {
    if (!this.state || this.elements.length === 0) throw Error(`Cannot focus when state is undefined or elements are empty`);
    this.domHasFocus = true, this.toggleStickyScrollFocused(true), this.toggleCurrentElementActiveFocus(true), this.focusedIndex === -1 && this.setFocus(0);
  }
  onBlur() {
    this.domHasFocus = false, this.toggleCurrentElementActiveFocus(false);
  }
  dispose() {
    this.toggleStickyScrollFocused(false), this._onDidChangeHasFocus.fire(false), super.dispose();
  }
};
function Az(e206) {
  let t10 = ez.Unknown;
  return Tl(e206.browserEvent.target, `monaco-tl-twistie`, `monaco-tl-row`) ? t10 = ez.Twistie : Tl(e206.browserEvent.target, `monaco-tl-contents`, `monaco-tl-row`) ? t10 = ez.Element : Tl(e206.browserEvent.target, `monaco-tree-type-filter`, `monaco-list`) && (t10 = ez.Filter), { browserEvent: e206.browserEvent, element: e206.element ? e206.element.element : null, target: t10 };
}
function jz(e206) {
  let t10 = HI(e206.browserEvent.target);
  return { element: e206.element ? e206.element.element : null, browserEvent: e206.browserEvent, anchor: e206.anchor, isStickyScroll: t10 };
}
function Mz(e206, t10) {
  t10(e206), e206.children.forEach((e207) => Mz(e207, t10));
}
var Nz = class {
  get nodeSet() {
    return this._nodeSet || (this._nodeSet = this.createNodeSet()), this._nodeSet;
  }
  constructor(e206, t10) {
    this.getFirstViewElementWithTrait = e206, this.identityProvider = t10, this.nodes = [], this._onDidChange = new k(), this.onDidChange = this._onDidChange.event;
  }
  set(e206, t10) {
    !t10?.__forceEvent && o(this.nodes, e206) || this._set(e206, false, t10);
  }
  _set(e206, t10, n10) {
    if (this.nodes = [...e206], this.elements = void 0, this._nodeSet = void 0, !t10) {
      let e207 = this;
      this._onDidChange.fire({ get elements() {
        return e207.get();
      }, browserEvent: n10 });
    }
  }
  get() {
    return this.elements || (this.elements = this.nodes.map((e206) => e206.element)), [...this.elements];
  }
  getNodes() {
    return this.nodes;
  }
  has(e206) {
    return this.nodeSet.has(e206);
  }
  onDidModelSplice({ insertedNodes: e206, deletedNodes: t10 }) {
    if (!this.identityProvider) {
      let e207 = this.createNodeSet(), n11 = (t11) => e207.delete(t11);
      t10.forEach((e208) => Mz(e208, n11)), this.set([...e207.values()]);
      return;
    }
    let n10 = /* @__PURE__ */ new Set(), r10 = (e207) => n10.add(this.identityProvider.getId(e207.element).toString());
    t10.forEach((e207) => Mz(e207, r10));
    let i10 = /* @__PURE__ */ new Map(), a10 = (e207) => i10.set(this.identityProvider.getId(e207.element).toString(), e207);
    e206.forEach((e207) => Mz(e207, a10));
    let o10 = [];
    for (let e207 of this.nodes) {
      let t11 = this.identityProvider.getId(e207.element).toString();
      if (!n10.has(t11)) o10.push(e207);
      else {
        let e208 = i10.get(t11);
        e208 && e208.visible && o10.push(e208);
      }
    }
    if (this.nodes.length > 0 && o10.length === 0) {
      let e207 = this.getFirstViewElementWithTrait();
      e207 && o10.push(e207);
    }
    this._set(o10, true);
  }
  createNodeSet() {
    let e206 = /* @__PURE__ */ new Set();
    for (let t10 of this.nodes) e206.add(t10);
    return e206;
  }
}, Pz = class extends XI {
  constructor(e206, t10, n10) {
    super(e206), this.tree = t10, this.stickyScrollProvider = n10;
  }
  onViewPointer(e206) {
    if (UI(e206.browserEvent.target) || iu(e206.browserEvent.target) || BI(e206.browserEvent.target) || e206.browserEvent.isHandledByList) return;
    let t10 = e206.element;
    if (!t10 || this.isSelectionRangeChangeEvent(e206) || this.isSelectionSingleChangeEvent(e206)) return super.onViewPointer(e206);
    let n10 = e206.browserEvent.target, r10 = n10.classList.contains(`monaco-tl-twistie`) || n10.classList.contains(`monaco-icon-label`) && n10.classList.contains(`folder-icon`) && e206.browserEvent.offsetX < 16, i10 = VI(e206.browserEvent.target), a10 = false;
    if (a10 = i10 ? true : typeof this.tree.expandOnlyOnTwistieClick == `function` ? this.tree.expandOnlyOnTwistieClick(t10.element) : !!this.tree.expandOnlyOnTwistieClick, i10) this.handleStickyScrollMouseEvent(e206, t10);
    else if (a10 && !r10 && e206.browserEvent.detail !== 2 || !this.tree.expandOnDoubleClick && e206.browserEvent.detail === 2) return super.onViewPointer(e206);
    if (t10.collapsible && (!i10 || r10)) {
      let n11 = this.tree.getNodeLocation(t10), i11 = e206.browserEvent.altKey;
      if (this.tree.setFocus([n11]), this.tree.toggleCollapsed(n11, i11), r10) {
        e206.browserEvent.isHandledByList = true;
        return;
      }
    }
    i10 || super.onViewPointer(e206);
  }
  handleStickyScrollMouseEvent(e206, t10) {
    if (Pge(e206.browserEvent.target) || Fge(e206.browserEvent.target)) return;
    let n10 = this.stickyScrollProvider();
    if (!n10) throw Error(`Sticky scroll controller not found`);
    let r10 = this.list.indexOf(t10), i10 = this.list.getElementTop(r10), a10 = n10.nodePositionTopBelowWidget(t10);
    this.tree.scrollTop = i10 - a10, this.list.domFocus(), this.list.setFocus([r10]), this.list.setSelection([r10]);
  }
  onDoubleClick(e206) {
    e206.browserEvent.target.classList.contains(`monaco-tl-twistie`) || !this.tree.expandOnDoubleClick || e206.browserEvent.isHandledByList || super.onDoubleClick(e206);
  }
  onMouseDown(e206) {
    let t10 = e206.browserEvent.target;
    if (!HI(t10) && !VI(t10)) {
      super.onMouseDown(e206);
      return;
    }
  }
  onContextMenu(e206) {
    let t10 = e206.browserEvent.target;
    if (!HI(t10) && !VI(t10)) {
      super.onContextMenu(e206);
      return;
    }
  }
}, Fz = class extends $I {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(e206, t10, n10, r10, s10), this.focusTrait = i10, this.selectionTrait = a10, this.anchorTrait = o10;
  }
  createMouseController(e206) {
    return new Pz(this, e206.tree, e206.stickyScrollProvider);
  }
  splice(e206, t10, n10 = []) {
    if (super.splice(e206, t10, n10), n10.length === 0) return;
    let r10 = [], i10 = [], a10;
    n10.forEach((t11, n11) => {
      this.focusTrait.has(t11) && r10.push(e206 + n11), this.selectionTrait.has(t11) && i10.push(e206 + n11), this.anchorTrait.has(t11) && (a10 = e206 + n11);
    }), r10.length > 0 && super.setFocus(y([...super.getFocus(), ...r10])), i10.length > 0 && super.setSelection(y([...super.getSelection(), ...i10])), typeof a10 == `number` && super.setAnchor(a10);
  }
  setFocus(e206, t10, n10 = false) {
    super.setFocus(e206, t10), n10 || this.focusTrait.set(e206.map((e207) => this.element(e207)), t10);
  }
  setSelection(e206, t10, n10 = false) {
    super.setSelection(e206, t10), n10 || this.selectionTrait.set(e206.map((e207) => this.element(e207)), t10);
  }
  setAnchor(e206, t10 = false) {
    super.setAnchor(e206), t10 || (e206 === void 0 ? this.anchorTrait.set([]) : this.anchorTrait.set([this.element(e206)]));
  }
}, Iz = class {
  get onDidScroll() {
    return this.view.onDidScroll;
  }
  get onDidChangeFocus() {
    return this.eventBufferer.wrapEvent(this.focus.onDidChange);
  }
  get onDidChangeSelection() {
    return this.eventBufferer.wrapEvent(this.selection.onDidChange);
  }
  get onMouseDblClick() {
    return O.filter(O.map(this.view.onMouseDblClick, Az), (e206) => e206.target !== ez.Filter);
  }
  get onMouseOver() {
    return O.map(this.view.onMouseOver, Az);
  }
  get onMouseOut() {
    return O.map(this.view.onMouseOut, Az);
  }
  get onContextMenu() {
    return O.any(O.filter(O.map(this.view.onContextMenu, jz), (e206) => !e206.isStickyScroll), this.stickyScrollController?.onContextMenu ?? O.None);
  }
  get onPointer() {
    return O.map(this.view.onPointer, Az);
  }
  get onKeyDown() {
    return this.view.onKeyDown;
  }
  get onDidFocus() {
    return this.view.onDidFocus;
  }
  get onDidChangeModel() {
    return O.any(this.onDidChangeModelRelay.event, this.onDidSwapModel.event);
  }
  get onDidChangeCollapseState() {
    return this.onDidChangeCollapseStateRelay.event;
  }
  get expandOnDoubleClick() {
    return this._options.expandOnDoubleClick === void 0 ? true : this._options.expandOnDoubleClick;
  }
  get expandOnlyOnTwistieClick() {
    return this._options.expandOnlyOnTwistieClick === void 0 ? true : this._options.expandOnlyOnTwistieClick;
  }
  get onDidDispose() {
    return this.view.onDidDispose;
  }
  constructor(e206, t10, n10, r10, i10 = {}) {
    this._user = e206, this._options = i10, this.eventBufferer = new dn(), this.onDidChangeFindOpenState = O.None, this.onDidChangeStickyScrollFocused = O.None, this.disposables = new E(), this.onDidSwapModel = this.disposables.add(new k()), this.onDidChangeModelRelay = this.disposables.add(new fn()), this.onDidSpliceModelRelay = this.disposables.add(new fn()), this.onDidChangeCollapseStateRelay = this.disposables.add(new fn()), this.onDidChangeRenderNodeCountRelay = this.disposables.add(new fn()), this.onDidChangeActiveNodesRelay = this.disposables.add(new fn()), this._onWillRefilter = new k(), this.onWillRefilter = this._onWillRefilter.event, this._onDidUpdateOptions = new k(), this.modelDisposables = new E(), i10.keyboardNavigationLabelProvider && (i10.findWidgetEnabled ?? true) && (this.findFilter = new gz(i10.keyboardNavigationLabelProvider, i10.filter, i10.defaultFindVisibility), i10 = { ...i10, filter: this.findFilter }, this.disposables.add(this.findFilter)), this.model = this.createModel(e206, i10), this.treeDelegate = new dz(n10);
    let a10 = this.disposables.add(new pz(this.onDidChangeActiveNodesRelay.event)), o10 = new Ed();
    this.renderers = r10.map((e207) => new mz(e207, this.model, this.onDidChangeCollapseStateRelay.event, a10, o10, i10));
    for (let e207 of this.renderers) this.disposables.add(e207);
    if (this.focus = new Nz(() => this.view.getFocusedElements()[0], i10.identityProvider), this.selection = new Nz(() => this.view.getSelectedElements()[0], i10.identityProvider), this.anchor = new Nz(() => this.view.getAnchorElement(), i10.identityProvider), this.view = new Fz(e206, t10, this.treeDelegate, this.renderers, this.focus, this.selection, this.anchor, { ...uz(() => this.model, this.disposables, i10), tree: this, stickyScrollProvider: () => this.stickyScrollController }), this.setupModel(this.model), i10.keyboardSupport !== false) {
      let e207 = O.chain(this.view.onKeyDown, (e208) => e208.filter((e209) => !iu(e209.target)).map((e209) => new Jo(e209)));
      O.chain(e207, (e208) => e208.filter((e209) => e209.keyCode === 15))(this.onLeftArrow, this, this.disposables), O.chain(e207, (e208) => e208.filter((e209) => e209.keyCode === 17))(this.onRightArrow, this, this.disposables), O.chain(e207, (e208) => e208.filter((e209) => e209.keyCode === 10))(this.onSpace, this, this.disposables);
    }
    if ((i10.findWidgetEnabled ?? true) && i10.keyboardNavigationLabelProvider && i10.contextViewProvider) {
      let e207 = { styles: i10.findWidgetStyles, defaultFindMode: i10.defaultFindMode, defaultFindMatchType: i10.defaultFindMatchType, showNotFoundMessage: i10.showNotFoundMessage };
      this.findController = this.disposables.add(new Sz(this, this.findFilter, i10.contextViewProvider, e207)), this.focusNavigationFilter = (e208) => this.findController.shouldAllowFocus(e208), this.onDidChangeFindOpenState = this.findController.onDidChangeOpenState, this.onDidChangeFindMode = this.findController.onDidChangeMode, this.onDidChangeFindMatchType = this.findController.onDidChangeMatchType;
    } else this.onDidChangeFindMode = O.None, this.onDidChangeFindMatchType = O.None;
    i10.enableStickyScroll && (this.stickyScrollController = new Dz(this, this.model, this.view, this.renderers, this.treeDelegate, i10), this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus), this.styleElement = g_(this.view.getHTMLElement()), this.getHTMLElement().classList.toggle(`always`, this._options.renderIndentGuides === fz.Always);
  }
  updateOptions(e206 = {}) {
    this._options = { ...this._options, ...e206 };
    for (let t10 of this.renderers) t10.updateOptions(e206);
    this.view.updateOptions(this._options), this.findController?.updateOptions(e206), this.updateStickyScroll(e206), this._onDidUpdateOptions.fire(this._options), this.getHTMLElement().classList.toggle(`always`, this._options.renderIndentGuides === fz.Always);
  }
  get options() {
    return this._options;
  }
  updateStickyScroll(e206) {
    !this.stickyScrollController && this._options.enableStickyScroll ? (this.stickyScrollController = new Dz(this, this.model, this.view, this.renderers, this.treeDelegate, this._options), this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus) : this.stickyScrollController && !this._options.enableStickyScroll && (this.onDidChangeStickyScrollFocused = O.None, this.stickyScrollController.dispose(), this.stickyScrollController = void 0), this.stickyScrollController?.updateOptions(e206);
  }
  getHTMLElement() {
    return this.view.getHTMLElement();
  }
  get onDidChangeContentHeight() {
    return this.view.onDidChangeContentHeight;
  }
  get scrollTop() {
    return this.view.scrollTop;
  }
  set scrollTop(e206) {
    this.view.scrollTop = e206;
  }
  get scrollHeight() {
    return this.view.scrollHeight;
  }
  get renderHeight() {
    return this.view.renderHeight;
  }
  get ariaLabel() {
    return this.view.ariaLabel;
  }
  set ariaLabel(e206) {
    this.view.ariaLabel = e206;
  }
  domFocus() {
    this.stickyScrollController?.focusedLast() ? this.stickyScrollController.domFocus() : this.view.domFocus();
  }
  layout(e206, t10) {
    this.view.layout(e206, t10);
  }
  style(e206) {
    let t10 = `.${this.view.domId}`, n10 = [];
    e206.treeIndentGuidesStroke && (n10.push(`.monaco-list${t10}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t10}.always .monaco-tl-indent > .indent-guide  { opacity: 1; border-color: ${e206.treeInactiveIndentGuidesStroke}; }`), n10.push(`.monaco-list${t10} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e206.treeIndentGuidesStroke}; }`));
    let r10 = e206.treeStickyScrollBackground ?? e206.listBackground;
    r10 && (n10.push(`.monaco-list${t10} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${r10}; }`), n10.push(`.monaco-list${t10} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${r10}; }`)), e206.treeStickyScrollBorder && n10.push(`.monaco-list${t10} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e206.treeStickyScrollBorder}; }`), e206.treeStickyScrollShadow && n10.push(`.monaco-list${t10} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e206.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`), e206.listFocusForeground && (n10.push(`.monaco-list${t10}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e206.listFocusForeground}; }`), n10.push(`.monaco-list${t10}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));
    let i10 = mI(e206.listFocusAndSelectionOutline, mI(e206.listSelectionOutline, e206.listFocusOutline ?? ``));
    i10 && (n10.push(`.monaco-list${t10}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${i10}; outline-offset: -1px;}`), n10.push(`.monaco-list${t10}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)), e206.listFocusOutline && (n10.push(`.monaco-list${t10}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e206.listFocusOutline}; outline-offset: -1px; }`), n10.push(`.monaco-list${t10}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`), n10.push(`.context-menu-visible .monaco-list${t10}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e206.listFocusOutline}; outline-offset: -1px; }`), n10.push(`.context-menu-visible .monaco-list${t10}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`), n10.push(`.context-menu-visible .monaco-list${t10}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)), this.styleElement.textContent = n10.join(`
`), this.view.style(e206);
  }
  getParentElement(e206) {
    let t10 = this.model.getParentNodeLocation(e206);
    return this.model.getNode(t10).element;
  }
  getFirstElementChild(e206) {
    return this.model.getFirstElementChild(e206);
  }
  getNode(e206) {
    return this.model.getNode(e206);
  }
  getNodeLocation(e206) {
    return this.model.getNodeLocation(e206);
  }
  collapse(e206, t10 = false) {
    return this.model.setCollapsed(e206, true, t10);
  }
  expand(e206, t10 = false) {
    return this.model.setCollapsed(e206, false, t10);
  }
  toggleCollapsed(e206, t10 = false) {
    return this.model.setCollapsed(e206, void 0, t10);
  }
  isCollapsible(e206) {
    return this.model.isCollapsible(e206);
  }
  setCollapsible(e206, t10) {
    return this.model.setCollapsible(e206, t10);
  }
  isCollapsed(e206) {
    return this.model.isCollapsed(e206);
  }
  refilter() {
    this._onWillRefilter.fire(void 0), this.model.refilter();
  }
  setSelection(e206, t10) {
    this.eventBufferer.bufferEvents(() => {
      let n10 = e206.map((e207) => this.model.getNode(e207));
      this.selection.set(n10, t10);
      let r10 = e206.map((e207) => this.model.getListIndex(e207)).filter((e207) => e207 > -1);
      this.view.setSelection(r10, t10, true);
    });
  }
  getSelection() {
    return this.selection.get();
  }
  setFocus(e206, t10) {
    this.eventBufferer.bufferEvents(() => {
      let n10 = e206.map((e207) => this.model.getNode(e207));
      this.focus.set(n10, t10);
      let r10 = e206.map((e207) => this.model.getListIndex(e207)).filter((e207) => e207 > -1);
      this.view.setFocus(r10, t10, true);
    });
  }
  focusNext(e206 = 1, t10 = false, n10, r10 = zl(n10) && n10.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusNext(e206, t10, n10, r10);
  }
  focusPrevious(e206 = 1, t10 = false, n10, r10 = zl(n10) && n10.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusPrevious(e206, t10, n10, r10);
  }
  focusNextPage(e206, t10 = zl(e206) && e206.altKey ? void 0 : this.focusNavigationFilter) {
    return this.view.focusNextPage(e206, t10);
  }
  focusPreviousPage(e206, t10 = zl(e206) && e206.altKey ? void 0 : this.focusNavigationFilter) {
    return this.view.focusPreviousPage(e206, t10, () => this.stickyScrollController?.height ?? 0);
  }
  focusLast(e206, t10 = zl(e206) && e206.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusLast(e206, t10);
  }
  focusFirst(e206, t10 = zl(e206) && e206.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusFirst(e206, t10);
  }
  getFocus() {
    return this.focus.get();
  }
  reveal(e206, t10) {
    this.model.expandTo(e206);
    let n10 = this.model.getListIndex(e206);
    if (n10 !== -1) if (!this.stickyScrollController) this.view.reveal(n10, t10);
    else {
      let r10 = this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e206));
      this.view.reveal(n10, t10, r10);
    }
  }
  onLeftArrow(e206) {
    e206.preventDefault(), e206.stopPropagation();
    let t10 = this.view.getFocusedElements();
    if (t10.length === 0) return;
    let n10 = t10[0], r10 = this.model.getNodeLocation(n10);
    if (!this.model.setCollapsed(r10, true)) {
      let e207 = this.model.getParentNodeLocation(r10);
      if (!e207) return;
      let t11 = this.model.getListIndex(e207);
      this.view.reveal(t11), this.view.setFocus([t11]);
    }
  }
  onRightArrow(e206) {
    e206.preventDefault(), e206.stopPropagation();
    let t10 = this.view.getFocusedElements();
    if (t10.length === 0) return;
    let n10 = t10[0], r10 = this.model.getNodeLocation(n10);
    if (!this.model.setCollapsed(r10, false)) {
      if (!n10.children.some((e208) => e208.visible)) return;
      let [e207] = this.view.getFocus(), t11 = e207 + 1;
      this.view.reveal(t11), this.view.setFocus([t11]);
    }
  }
  onSpace(e206) {
    e206.preventDefault(), e206.stopPropagation();
    let t10 = this.view.getFocusedElements();
    if (t10.length === 0) return;
    let n10 = t10[0], r10 = this.model.getNodeLocation(n10), i10 = e206.browserEvent.altKey;
    this.model.setCollapsed(r10, void 0, i10);
  }
  setupModel(e206) {
    this.modelDisposables.clear(), this.modelDisposables.add(e206.onDidSpliceRenderedNodes(({ start: e207, deleteCount: t11, elements: n11 }) => this.view.splice(e207, t11, n11)));
    let t10 = O.forEach(e206.onDidSpliceModel, (e207) => {
      this.eventBufferer.bufferEvents(() => {
        this.focus.onDidModelSplice(e207), this.selection.onDidModelSplice(e207);
      });
    }, this.modelDisposables);
    t10(() => null, null, this.modelDisposables);
    let n10 = this.modelDisposables.add(new k()), r10 = this.modelDisposables.add(new ns(0));
    this.modelDisposables.add(O.any(t10, this.focus.onDidChange, this.selection.onDidChange)(() => {
      r10.trigger(() => {
        let e207 = /* @__PURE__ */ new Set();
        for (let t11 of this.focus.getNodes()) e207.add(t11);
        for (let t11 of this.selection.getNodes()) e207.add(t11);
        n10.fire([...e207.values()]);
      });
    })), this.onDidChangeActiveNodesRelay.input = n10.event, this.onDidChangeModelRelay.input = O.signal(e206.onDidSpliceModel), this.onDidChangeCollapseStateRelay.input = e206.onDidChangeCollapseState, this.onDidChangeRenderNodeCountRelay.input = e206.onDidChangeRenderNodeCount, this.onDidSpliceModelRelay.input = e206.onDidSpliceModel;
  }
  dispose() {
    Kt(this.disposables), this.stickyScrollController?.dispose(), this.view.dispose(), this.modelDisposables.dispose();
  }
}, Lz = new Fa(() => {
  let e206 = Jp.Collator(void 0, { numeric: true, sensitivity: `base` }).value;
  return { collator: e206, collatorIsNumeric: e206.resolvedOptions().numeric };
});
new Fa(() => ({ collator: Jp.Collator(void 0, { numeric: true }).value })), new Fa(() => ({ collator: Jp.Collator(void 0, { numeric: true, sensitivity: `accent` }).value }));
function Rz(e206, t10, n10 = false) {
  let r10 = e206 || ``, i10 = t10 || ``, a10 = Lz.value.collator.compare(r10, i10);
  return Lz.value.collatorIsNumeric && a10 === 0 && r10 !== i10 ? r10 < i10 ? -1 : 1 : a10;
}
function zz(e206, t10, n10) {
  let r10 = e206.toLowerCase(), i10 = t10.toLowerCase(), a10 = Bz(e206, t10, n10);
  if (a10) return a10;
  let o10 = r10.endsWith(n10);
  if (o10 !== i10.endsWith(n10)) return o10 ? -1 : 1;
  let s10 = Rz(r10, i10);
  return s10 === 0 ? r10.localeCompare(i10) : s10;
}
function Bz(e206, t10, n10) {
  let r10 = e206.toLowerCase(), i10 = t10.toLowerCase(), a10 = r10.startsWith(n10), o10 = i10.startsWith(n10);
  if (a10 !== o10) return a10 ? -1 : 1;
  if (a10 && o10) {
    if (r10.length < i10.length) return -1;
    if (r10.length > i10.length) return 1;
  }
  return 0;
}
var Vz = class {
  get templateId() {
    return this.renderer.templateId;
  }
  constructor(e206, t10) {
    this.renderer = e206, this.modelProvider = t10;
  }
  renderTemplate(e206) {
    return { data: this.renderer.renderTemplate(e206), disposable: D.None };
  }
  renderElement(e206, t10, n10, r10) {
    if (n10.disposable?.dispose(), !n10.data) return;
    let i10 = this.modelProvider();
    if (i10.isResolved(e206)) return this.renderer.renderElement(i10.get(e206), e206, n10.data, r10);
    let a10 = new pr(), o10 = i10.resolve(e206, a10.token);
    n10.disposable = { dispose: () => a10.cancel() }, this.renderer.renderPlaceholder(e206, n10.data), o10.then((t11) => this.renderer.renderElement(t11, e206, n10.data, r10));
  }
  disposeTemplate(e206) {
    e206.disposable && (e206.disposable = (e206.disposable.dispose(), void 0)), e206.data && (e206.data = (this.renderer.disposeTemplate(e206.data), void 0));
  }
}, Hz = class {
  constructor(e206, t10) {
    this.modelProvider = e206, this.accessibilityProvider = t10;
  }
  getWidgetAriaLabel() {
    return this.accessibilityProvider.getWidgetAriaLabel();
  }
  getAriaLabel(e206) {
    let t10 = this.modelProvider();
    return t10.isResolved(e206) ? this.accessibilityProvider.getAriaLabel(t10.get(e206)) : null;
  }
};
function Uz(e206, t10) {
  return { ...t10, accessibilityProvider: t10.accessibilityProvider && new Hz(e206, t10.accessibilityProvider) };
}
var Wz = class {
  constructor(e206, t10, n10, r10, i10 = {}) {
    this.modelDisposables = new E();
    let a10 = () => this.model;
    this.list = new $I(e206, t10, n10, r10.map((e207) => new Vz(e207, a10)), Uz(a10, i10));
  }
  updateOptions(e206) {
    this.list.updateOptions(e206);
  }
  getHTMLElement() {
    return this.list.getHTMLElement();
  }
  get onDidFocus() {
    return this.list.onDidFocus;
  }
  get widget() {
    return this.list;
  }
  get onDidDispose() {
    return this.list.onDidDispose;
  }
  get onMouseDblClick() {
    return O.map(this.list.onMouseDblClick, ({ element: e206, index: t10, browserEvent: n10 }) => ({ element: e206 === void 0 ? void 0 : this._model.get(e206), index: t10, browserEvent: n10 }));
  }
  get onPointer() {
    return O.map(this.list.onPointer, ({ element: e206, index: t10, browserEvent: n10 }) => ({ element: e206 === void 0 ? void 0 : this._model.get(e206), index: t10, browserEvent: n10 }));
  }
  get onDidChangeSelection() {
    return O.map(this.list.onDidChangeSelection, ({ elements: e206, indexes: t10, browserEvent: n10 }) => ({ elements: e206.map((e207) => this._model.get(e207)), indexes: t10, browserEvent: n10 }));
  }
  get model() {
    return this._model;
  }
  set model(e206) {
    this.modelDisposables.clear(), this._model = e206, this.list.splice(0, this.list.length, b(e206.length)), this.modelDisposables.add(e206.onDidIncrementLength((e207) => this.list.splice(this.list.length, 0, b(this.list.length, e207))));
  }
  getFocus() {
    return this.list.getFocus();
  }
  getSelection() {
    return this.list.getSelection();
  }
  getSelectedElements() {
    return this.getSelection().map((e206) => this.model.get(e206));
  }
  style(e206) {
    this.list.style(e206);
  }
  dispose() {
    this.list.dispose(), this.modelDisposables.dispose();
  }
}, Gz = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Kz = false, qz;
(function(e206) {
  e206.North = `north`, e206.South = `south`, e206.East = `east`, e206.West = `west`;
})(qz || (qz = {}));
var Jz = 4, Yz = new k(), Xz = 300, Zz = new k(), Qz = class {
  constructor(e206) {
    this.el = e206, this.disposables = new E();
  }
  get onPointerMove() {
    return this.disposables.add(new yx(Vc(this.el), `mousemove`)).event;
  }
  get onPointerUp() {
    return this.disposables.add(new yx(Vc(this.el), `mouseup`)).event;
  }
  dispose() {
    this.disposables.dispose();
  }
};
Gz([ex], Qz.prototype, `onPointerMove`, null), Gz([ex], Qz.prototype, `onPointerUp`, null);
var $z = class {
  get onPointerMove() {
    return this.disposables.add(new yx(this.el, tx.Change)).event;
  }
  get onPointerUp() {
    return this.disposables.add(new yx(this.el, tx.End)).event;
  }
  constructor(e206) {
    this.el = e206, this.disposables = new E();
  }
  dispose() {
    this.disposables.dispose();
  }
};
Gz([ex], $z.prototype, `onPointerMove`, null), Gz([ex], $z.prototype, `onPointerUp`, null);
var eB = class {
  get onPointerMove() {
    return this.factory.onPointerMove;
  }
  get onPointerUp() {
    return this.factory.onPointerUp;
  }
  constructor(e206) {
    this.factory = e206;
  }
  dispose() {
  }
};
Gz([ex], eB.prototype, `onPointerMove`, null), Gz([ex], eB.prototype, `onPointerUp`, null);
var tB = `pointer-events-disabled`, nB = class e148 extends D {
  get state() {
    return this._state;
  }
  get orthogonalStartSash() {
    return this._orthogonalStartSash;
  }
  get orthogonalEndSash() {
    return this._orthogonalEndSash;
  }
  set state(e206) {
    this._state !== e206 && (this.el.classList.toggle(`disabled`, e206 === 0), this.el.classList.toggle(`minimum`, e206 === 1), this.el.classList.toggle(`maximum`, e206 === 2), this._state = e206, this.onDidEnablementChange.fire(e206));
  }
  get onDidStart() {
    return this._onDidStart.event;
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get onDidReset() {
    return this._onDidReset.event;
  }
  get onDidEnd() {
    return this._onDidEnd.event;
  }
  set orthogonalStartSash(t10) {
    if (this._orthogonalStartSash !== t10) {
      if (this.orthogonalStartDragHandleDisposables.clear(), this.orthogonalStartSashDisposables.clear(), t10) {
        let n10 = (n11) => {
          this.orthogonalStartDragHandleDisposables.clear(), n11 !== 0 && (this._orthogonalStartDragHandle = z(this.el, B(`.orthogonal-drag-handle.start`)), this.orthogonalStartDragHandleDisposables.add(T(() => this._orthogonalStartDragHandle.remove())), this.orthogonalStartDragHandleDisposables.add(L(this._orthogonalStartDragHandle, `mouseenter`, () => e148.onMouseEnter(t10))), this.orthogonalStartDragHandleDisposables.add(L(this._orthogonalStartDragHandle, `mouseleave`, () => e148.onMouseLeave(t10))));
        };
        this.orthogonalStartSashDisposables.add(t10.onDidEnablementChange.event(n10, this)), n10(t10.state);
      }
      this._orthogonalStartSash = t10;
    }
  }
  set orthogonalEndSash(t10) {
    if (this._orthogonalEndSash !== t10) {
      if (this.orthogonalEndDragHandleDisposables.clear(), this.orthogonalEndSashDisposables.clear(), t10) {
        let n10 = (n11) => {
          this.orthogonalEndDragHandleDisposables.clear(), n11 !== 0 && (this._orthogonalEndDragHandle = z(this.el, B(`.orthogonal-drag-handle.end`)), this.orthogonalEndDragHandleDisposables.add(T(() => this._orthogonalEndDragHandle.remove())), this.orthogonalEndDragHandleDisposables.add(L(this._orthogonalEndDragHandle, `mouseenter`, () => e148.onMouseEnter(t10))), this.orthogonalEndDragHandleDisposables.add(L(this._orthogonalEndDragHandle, `mouseleave`, () => e148.onMouseLeave(t10))));
        };
        this.orthogonalEndSashDisposables.add(t10.onDidEnablementChange.event(n10, this)), n10(t10.state);
      }
      this._orthogonalEndSash = t10;
    }
  }
  constructor(t10, n10, r10) {
    super(), this.hoverDelay = Xz, this.hoverDelayer = this._register(new ns(this.hoverDelay)), this._state = 3, this.onDidEnablementChange = this._register(new k()), this._onDidStart = this._register(new k()), this._onDidChange = this._register(new k()), this._onDidReset = this._register(new k()), this._onDidEnd = this._register(new k()), this.orthogonalStartSashDisposables = this._register(new E()), this.orthogonalStartDragHandleDisposables = this._register(new E()), this.orthogonalEndSashDisposables = this._register(new E()), this.orthogonalEndDragHandleDisposables = this._register(new E()), this.linkedSash = void 0, this.el = z(t10, B(`.monaco-sash`)), r10.orthogonalEdge && this.el.classList.add(`orthogonal-edge-${r10.orthogonalEdge}`), Tt && this.el.classList.add(`mac`), this._register(L(this.el, `mousedown`, (e206) => this.onPointerStart(e206, new Qz(t10)))), this._register(L(this.el, `dblclick`, (e206) => this.onPointerDoublePress(e206))), this._register(L(this.el, `mouseenter`, () => e148.onMouseEnter(this))), this._register(L(this.el, `mouseleave`, () => e148.onMouseLeave(this))), this._register(nx.addTarget(this.el)), this._register(L(this.el, tx.Start, (e206) => this.onPointerStart(e206, new $z(this.el))));
    let i10;
    this._register(L(this.el, tx.Tap, (e206) => {
      if (i10) {
        clearTimeout(i10), i10 = void 0, this.onPointerDoublePress(e206);
        return;
      }
      clearTimeout(i10), i10 = setTimeout(() => i10 = void 0, 250);
    })), typeof r10.size == `number` ? (this.size = r10.size, r10.orientation === 0 ? this.el.style.width = `${this.size}px` : this.el.style.height = `${this.size}px`) : (this.size = Jz, this._register(Yz.event((e206) => {
      this.size = e206, this.layout();
    }))), this._register(Zz.event((e206) => this.hoverDelay = e206)), this.layoutProvider = n10, this.orthogonalStartSash = r10.orthogonalStartSash, this.orthogonalEndSash = r10.orthogonalEndSash, this.orientation = r10.orientation || 0, this.orientation === 1 ? (this.el.classList.add(`horizontal`), this.el.classList.remove(`vertical`)) : (this.el.classList.remove(`horizontal`), this.el.classList.add(`vertical`)), this.el.classList.toggle(`debug`, Kz), this.layout();
  }
  onPointerStart(e206, t10) {
    Vl.stop(e206);
    let n10 = false;
    if (!e206.__orthogonalSashEvent) {
      let r11 = this.getOrthogonalSash(e206);
      r11 && (n10 = true, e206.__orthogonalSashEvent = true, r11.onPointerStart(e206, new eB(t10)));
    }
    if (this.linkedSash && !e206.__linkedSashEvent && (e206.__linkedSashEvent = true, this.linkedSash.onPointerStart(e206, new eB(t10))), !this.state) return;
    let r10 = this.el.ownerDocument.getElementsByTagName(`iframe`);
    for (let e207 of r10) e207.classList.add(tB);
    let i10 = e206.pageX, a10 = e206.pageY, o10 = e206.altKey, s10 = { startX: i10, currentX: i10, startY: a10, currentY: a10, altKey: o10 };
    this.el.classList.add(`active`), this._onDidStart.fire(s10);
    let c10 = g_(this.el), l10 = () => {
      let e207 = ``;
      e207 = n10 ? `all-scroll` : this.orientation === 1 ? this.state === 1 ? `s-resize` : this.state === 2 ? `n-resize` : Tt ? `row-resize` : `ns-resize` : this.state === 1 ? `e-resize` : this.state === 2 ? `w-resize` : Tt ? `col-resize` : `ew-resize`, c10.textContent = `* { cursor: ${e207} !important; }`;
    }, u10 = new E();
    l10(), n10 || this.onDidEnablementChange.event(l10, null, u10), t10.onPointerMove((e207) => {
      Vl.stop(e207, false);
      let t11 = { startX: i10, currentX: e207.pageX, startY: a10, currentY: e207.pageY, altKey: o10 };
      this._onDidChange.fire(t11);
    }, null, u10), t10.onPointerUp((e207) => {
      Vl.stop(e207, false), c10.remove(), this.el.classList.remove(`active`), this._onDidEnd.fire(), u10.dispose();
      for (let e208 of r10) e208.classList.remove(tB);
    }, null, u10), u10.add(t10);
  }
  onPointerDoublePress(e206) {
    let t10 = this.getOrthogonalSash(e206);
    t10 && t10._onDidReset.fire(), this.linkedSash && this.linkedSash._onDidReset.fire(), this._onDidReset.fire();
  }
  static onMouseEnter(t10, n10 = false) {
    t10.el.classList.contains(`active`) ? (t10.hoverDelayer.cancel(), t10.el.classList.add(`hover`)) : t10.hoverDelayer.trigger(() => t10.el.classList.add(`hover`), t10.hoverDelay).then(void 0, () => {
    }), !n10 && t10.linkedSash && e148.onMouseEnter(t10.linkedSash, true);
  }
  static onMouseLeave(t10, n10 = false) {
    t10.hoverDelayer.cancel(), t10.el.classList.remove(`hover`), !n10 && t10.linkedSash && e148.onMouseLeave(t10.linkedSash, true);
  }
  clearSashHoverState() {
    e148.onMouseLeave(this);
  }
  layout() {
    if (this.orientation === 0) {
      let e206 = this.layoutProvider;
      this.el.style.left = e206.getVerticalSashLeft(this) - this.size / 2 + `px`, e206.getVerticalSashTop && (this.el.style.top = e206.getVerticalSashTop(this) + `px`), e206.getVerticalSashHeight && (this.el.style.height = e206.getVerticalSashHeight(this) + `px`);
    } else {
      let e206 = this.layoutProvider;
      this.el.style.top = e206.getHorizontalSashTop(this) - this.size / 2 + `px`, e206.getHorizontalSashLeft && (this.el.style.left = e206.getHorizontalSashLeft(this) + `px`), e206.getHorizontalSashWidth && (this.el.style.width = e206.getHorizontalSashWidth(this) + `px`);
    }
  }
  getOrthogonalSash(e206) {
    let t10 = e206.initialTarget ?? e206.target;
    if (!(!t10 || !Fl(t10)) && t10.classList.contains(`orthogonal-drag-handle`)) return t10.classList.contains(`start`) ? this.orthogonalStartSash : this.orthogonalEndSash;
  }
  dispose() {
    super.dispose(), this.el.remove();
  }
}, rB = { separatorBorder: Y.transparent }, iB = class {
  set size(e206) {
    this._size = e206;
  }
  get size() {
    return this._size;
  }
  get visible() {
    return this._cachedVisibleSize === void 0;
  }
  setVisible(e206, t10) {
    if (e206 !== this.visible) {
      e206 ? (this.size = rA(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize), this._cachedVisibleSize = void 0) : (this._cachedVisibleSize = typeof t10 == `number` ? t10 : this.size, this.size = 0), this.container.classList.toggle(`visible`, e206);
      try {
        this.view.setVisible?.(e206);
      } catch (e207) {
        console.error(`Splitview: Failed to set visible view`), console.error(e207);
      }
    }
  }
  get minimumSize() {
    return this.visible ? this.view.minimumSize : 0;
  }
  get viewMinimumSize() {
    return this.view.minimumSize;
  }
  get maximumSize() {
    return this.visible ? this.view.maximumSize : 0;
  }
  get viewMaximumSize() {
    return this.view.maximumSize;
  }
  get priority() {
    return this.view.priority;
  }
  get proportionalLayout() {
    return this.view.proportionalLayout ?? true;
  }
  get snap() {
    return !!this.view.snap;
  }
  set enabled(e206) {
    this.container.style.pointerEvents = e206 ? `` : `none`;
  }
  constructor(e206, t10, n10, r10) {
    this.container = e206, this.view = t10, this.disposable = r10, this._cachedVisibleSize = void 0, typeof n10 == `number` ? (this._size = n10, this._cachedVisibleSize = void 0, e206.classList.add(`visible`)) : (this._size = 0, this._cachedVisibleSize = n10.cachedVisibleSize);
  }
  layout(e206, t10) {
    this.layoutContainer(e206);
    try {
      this.view.layout(this.size, e206, t10);
    } catch (e207) {
      console.error(`Splitview: Failed to layout view`), console.error(e207);
    }
  }
  dispose() {
    this.disposable.dispose();
  }
}, aB = class extends iB {
  layoutContainer(e206) {
    this.container.style.top = `${e206}px`, this.container.style.height = `${this.size}px`;
  }
}, oB = class extends iB {
  layoutContainer(e206) {
    this.container.style.left = `${e206}px`, this.container.style.width = `${this.size}px`;
  }
}, sB;
(function(e206) {
  e206[e206.Idle = 0] = `Idle`, e206[e206.Busy = 1] = `Busy`;
})(sB || (sB = {}));
var cB;
(function(e206) {
  e206.Distribute = { type: `distribute` };
  function t10(e207) {
    return { type: `split`, index: e207 };
  }
  e206.Split = t10;
  function n10(e207) {
    return { type: `auto`, index: e207 };
  }
  e206.Auto = n10;
  function r10(e207) {
    return { type: `invisible`, cachedVisibleSize: e207 };
  }
  e206.Invisible = r10;
})(cB || (cB = {}));
var lB = class extends D {
  get orthogonalStartSash() {
    return this._orthogonalStartSash;
  }
  get orthogonalEndSash() {
    return this._orthogonalEndSash;
  }
  get startSnappingEnabled() {
    return this._startSnappingEnabled;
  }
  get endSnappingEnabled() {
    return this._endSnappingEnabled;
  }
  set orthogonalStartSash(e206) {
    for (let t10 of this.sashItems) t10.sash.orthogonalStartSash = e206;
    this._orthogonalStartSash = e206;
  }
  set orthogonalEndSash(e206) {
    for (let t10 of this.sashItems) t10.sash.orthogonalEndSash = e206;
    this._orthogonalEndSash = e206;
  }
  set startSnappingEnabled(e206) {
    this._startSnappingEnabled !== e206 && (this._startSnappingEnabled = e206, this.updateSashEnablement());
  }
  set endSnappingEnabled(e206) {
    this._endSnappingEnabled !== e206 && (this._endSnappingEnabled = e206, this.updateSashEnablement());
  }
  constructor(e206, t10 = {}) {
    super(), this.size = 0, this._contentSize = 0, this.proportions = void 0, this.viewItems = [], this.sashItems = [], this.state = sB.Idle, this._onDidSashChange = this._register(new k()), this._onDidSashReset = this._register(new k()), this._startSnappingEnabled = true, this._endSnappingEnabled = true, this.onDidSashChange = this._onDidSashChange.event, this.onDidSashReset = this._onDidSashReset.event, this.orientation = t10.orientation ?? 0, this.inverseAltBehavior = t10.inverseAltBehavior ?? false, this.proportionalLayout = t10.proportionalLayout ?? true, this.getSashOrthogonalSize = t10.getSashOrthogonalSize, this.el = document.createElement(`div`), this.el.classList.add(`monaco-split-view2`), this.el.classList.add(this.orientation === 0 ? `vertical` : `horizontal`), e206.appendChild(this.el), this.sashContainer = z(this.el, B(`.sash-container`)), this.viewContainer = B(`.split-view-container`), this.scrollable = this._register(new ox({ forceIntegerValues: true, smoothScrollDuration: 125, scheduleAtNextAnimationFrame: (e207) => cl(Vc(this.el), e207) })), this.scrollableElement = this._register(new mx(this.viewContainer, { vertical: this.orientation === 0 ? t10.scrollbarVisibility ?? 1 : 2, horizontal: this.orientation === 1 ? t10.scrollbarVisibility ?? 1 : 2 }, this.scrollable));
    let n10 = this._register(new yx(this.viewContainer, `scroll`)).event;
    this._register(n10((e207) => {
      let t11 = this.scrollableElement.getScrollPosition(), n11 = Math.abs(this.viewContainer.scrollLeft - t11.scrollLeft) <= 1 ? void 0 : this.viewContainer.scrollLeft, r10 = Math.abs(this.viewContainer.scrollTop - t11.scrollTop) <= 1 ? void 0 : this.viewContainer.scrollTop;
      (n11 !== void 0 || r10 !== void 0) && this.scrollableElement.setScrollPosition({ scrollLeft: n11, scrollTop: r10 });
    })), this.onDidScroll = this.scrollableElement.onScroll, this._register(this.onDidScroll((e207) => {
      e207.scrollTopChanged && (this.viewContainer.scrollTop = e207.scrollTop), e207.scrollLeftChanged && (this.viewContainer.scrollLeft = e207.scrollLeft);
    })), z(this.el, this.scrollableElement.getDomNode()), this.style(t10.styles || rB), t10.descriptor && (this.size = t10.descriptor.size, t10.descriptor.views.forEach((e207, t11) => {
      let n11 = Ge(e207.visible) || e207.visible ? e207.size : { type: `invisible`, cachedVisibleSize: e207.size }, r10 = e207.view;
      this.doAddView(r10, n11, t11, true);
    }), this._contentSize = this.viewItems.reduce((e207, t11) => e207 + t11.size, 0), this.saveProportions());
  }
  style(e206) {
    e206.separatorBorder.isTransparent() ? (this.el.classList.remove(`separator-border`), this.el.style.removeProperty(`--separator-border`)) : (this.el.classList.add(`separator-border`), this.el.style.setProperty(`--separator-border`, e206.separatorBorder.toString()));
  }
  addView(e206, t10, n10 = this.viewItems.length, r10) {
    this.doAddView(e206, t10, n10, r10);
  }
  layout(e206, t10) {
    let n10 = Math.max(this.size, this._contentSize);
    if (this.size = e206, this.layoutContext = t10, this.proportions) {
      let t11 = 0;
      for (let n11 = 0; n11 < this.viewItems.length; n11++) {
        let r10 = this.viewItems[n11], i10 = this.proportions[n11];
        typeof i10 == `number` ? t11 += i10 : e206 -= r10.size;
      }
      for (let n11 = 0; n11 < this.viewItems.length; n11++) {
        let r10 = this.viewItems[n11], i10 = this.proportions[n11];
        typeof i10 == `number` && t11 > 0 && (r10.size = rA(Math.round(i10 * e206 / t11), r10.minimumSize, r10.maximumSize));
      }
    } else {
      let t11 = b(this.viewItems.length), r10 = t11.filter((e207) => this.viewItems[e207].priority === 1), i10 = t11.filter((e207) => this.viewItems[e207].priority === 2);
      this.resize(this.viewItems.length - 1, e206 - n10, void 0, r10, i10);
    }
    this.distributeEmptySpace(), this.layoutViews();
  }
  saveProportions() {
    this.proportionalLayout && this._contentSize > 0 && (this.proportions = this.viewItems.map((e206) => e206.proportionalLayout && e206.visible ? e206.size / this._contentSize : void 0));
  }
  onSashStart({ sash: e206, start: t10, alt: n10 }) {
    for (let e207 of this.viewItems) e207.enabled = false;
    let r10 = this.sashItems.findIndex((t11) => t11.sash === e206), i10 = qt(L(this.el.ownerDocument.body, `keydown`, (e207) => a10(this.sashDragState.current, e207.altKey)), L(this.el.ownerDocument.body, `keyup`, () => a10(this.sashDragState.current, false))), a10 = (e207, t11) => {
      let n11 = this.viewItems.map((e208) => e208.size), a11 = -1 / 0, o10 = 1 / 0;
      if (this.inverseAltBehavior && (t11 = !t11), t11) if (r10 === this.sashItems.length - 1) {
        let e208 = this.viewItems[r10];
        a11 = (e208.minimumSize - e208.size) / 2, o10 = (e208.maximumSize - e208.size) / 2;
      } else {
        let e208 = this.viewItems[r10 + 1];
        a11 = (e208.size - e208.maximumSize) / 2, o10 = (e208.size - e208.minimumSize) / 2;
      }
      let s10, c10;
      if (!t11) {
        let e208 = b(r10, -1), t12 = b(r10 + 1, this.viewItems.length), i11 = e208.reduce((e209, t13) => e209 + (this.viewItems[t13].minimumSize - n11[t13]), 0), a12 = e208.reduce((e209, t13) => e209 + (this.viewItems[t13].viewMaximumSize - n11[t13]), 0), o11 = t12.length === 0 ? 1 / 0 : t12.reduce((e209, t13) => e209 + (n11[t13] - this.viewItems[t13].minimumSize), 0), l10 = t12.length === 0 ? -1 / 0 : t12.reduce((e209, t13) => e209 + (n11[t13] - this.viewItems[t13].viewMaximumSize), 0), u10 = Math.max(i11, l10), d10 = Math.min(o11, a12), f10 = this.findFirstSnapIndex(e208), p10 = this.findFirstSnapIndex(t12);
        if (typeof f10 == `number`) {
          let e209 = this.viewItems[f10], t13 = Math.floor(e209.viewMinimumSize / 2);
          s10 = { index: f10, limitDelta: e209.visible ? u10 - t13 : u10 + t13, size: e209.size };
        }
        if (typeof p10 == `number`) {
          let e209 = this.viewItems[p10], t13 = Math.floor(e209.viewMinimumSize / 2);
          c10 = { index: p10, limitDelta: e209.visible ? d10 + t13 : d10 - t13, size: e209.size };
        }
      }
      this.sashDragState = { start: e207, current: e207, index: r10, sizes: n11, minDelta: a11, maxDelta: o10, alt: t11, snapBefore: s10, snapAfter: c10, disposable: i10 };
    };
    a10(t10, n10);
  }
  onSashChange({ current: e206 }) {
    let { index: t10, start: n10, sizes: r10, alt: i10, minDelta: a10, maxDelta: o10, snapBefore: s10, snapAfter: c10 } = this.sashDragState;
    this.sashDragState.current = e206;
    let l10 = e206 - n10, u10 = this.resize(t10, l10, r10, void 0, void 0, a10, o10, s10, c10);
    if (i10) {
      let e207 = t10 === this.sashItems.length - 1, n11 = this.viewItems.map((e208) => e208.size), r11 = e207 ? t10 : t10 + 1, i11 = this.viewItems[r11], a11 = i11.size - i11.maximumSize, o11 = i11.size - i11.minimumSize, s11 = e207 ? t10 - 1 : t10 + 1;
      this.resize(s11, -u10, n11, void 0, void 0, a11, o11);
    }
    this.distributeEmptySpace(), this.layoutViews();
  }
  onSashEnd(e206) {
    this._onDidSashChange.fire(e206), this.sashDragState.disposable.dispose(), this.saveProportions();
    for (let e207 of this.viewItems) e207.enabled = true;
  }
  onViewChange(e206, t10) {
    let n10 = this.viewItems.indexOf(e206);
    n10 < 0 || n10 >= this.viewItems.length || (t10 = typeof t10 == `number` ? t10 : e206.size, t10 = rA(t10, e206.minimumSize, e206.maximumSize), this.inverseAltBehavior && n10 > 0 ? (this.resize(n10 - 1, Math.floor((e206.size - t10) / 2)), this.distributeEmptySpace(), this.layoutViews()) : (e206.size = t10, this.relayout([n10], void 0)));
  }
  resizeView(e206, t10) {
    if (!(e206 < 0 || e206 >= this.viewItems.length)) {
      if (this.state !== sB.Idle) throw Error(`Cant modify splitview`);
      this.state = sB.Busy;
      try {
        let n10 = b(this.viewItems.length).filter((t11) => t11 !== e206), r10 = [...n10.filter((e207) => this.viewItems[e207].priority === 1), e206], i10 = n10.filter((e207) => this.viewItems[e207].priority === 2), a10 = this.viewItems[e206];
        t10 = Math.round(t10), t10 = rA(t10, a10.minimumSize, Math.min(a10.maximumSize, this.size)), a10.size = t10, this.relayout(r10, i10);
      } finally {
        this.state = sB.Idle;
      }
    }
  }
  distributeViewSizes() {
    let e206 = [], t10 = 0;
    for (let n11 of this.viewItems) n11.maximumSize - n11.minimumSize > 0 && (e206.push(n11), t10 += n11.size);
    let n10 = Math.floor(t10 / e206.length);
    for (let t11 of e206) t11.size = rA(n10, t11.minimumSize, t11.maximumSize);
    let r10 = b(this.viewItems.length), i10 = r10.filter((e207) => this.viewItems[e207].priority === 1), a10 = r10.filter((e207) => this.viewItems[e207].priority === 2);
    this.relayout(i10, a10);
  }
  getViewSize(e206) {
    return e206 < 0 || e206 >= this.viewItems.length ? -1 : this.viewItems[e206].size;
  }
  doAddView(e206, t10, n10 = this.viewItems.length, r10) {
    if (this.state !== sB.Idle) throw Error(`Cant modify splitview`);
    this.state = sB.Busy;
    try {
      let i10 = B(`.split-view-view`);
      n10 === this.viewItems.length ? this.viewContainer.appendChild(i10) : this.viewContainer.insertBefore(i10, this.viewContainer.children.item(n10));
      let a10 = qt(e206.onDidChange((e207) => this.onViewChange(s10, e207)), T(() => i10.remove())), o10;
      typeof t10 == `number` ? o10 = t10 : (t10.type === `auto` && (t10 = this.areViewsDistributed() ? { type: `distribute` } : { type: `split`, index: t10.index }), o10 = t10.type === `split` ? this.getViewSize(t10.index) / 2 : t10.type === `invisible` ? { cachedVisibleSize: t10.cachedVisibleSize } : e206.minimumSize);
      let s10 = this.orientation === 0 ? new aB(i10, e206, o10, a10) : new oB(i10, e206, o10, a10);
      if (this.viewItems.splice(n10, 0, s10), this.viewItems.length > 1) {
        let e207 = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash }, t11 = this.orientation === 0 ? new nB(this.sashContainer, { getHorizontalSashTop: (e208) => this.getSashPosition(e208), getHorizontalSashWidth: this.getSashOrthogonalSize }, { ...e207, orientation: 1 }) : new nB(this.sashContainer, { getVerticalSashLeft: (e208) => this.getSashPosition(e208), getVerticalSashHeight: this.getSashOrthogonalSize }, { ...e207, orientation: 0 }), r11 = this.orientation === 0 ? (e208) => ({ sash: t11, start: e208.startY, current: e208.currentY, alt: e208.altKey }) : (e208) => ({ sash: t11, start: e208.startX, current: e208.currentX, alt: e208.altKey }), i11 = { sash: t11, disposable: qt(O.map(t11.onDidStart, r11)(this.onSashStart, this), O.map(t11.onDidChange, r11)(this.onSashChange, this), O.map(t11.onDidEnd, () => this.sashItems.findIndex((e208) => e208.sash === t11))(this.onSashEnd, this), t11.onDidReset(() => {
          let e208 = this.sashItems.findIndex((e209) => e209.sash === t11), n11 = b(e208, -1), r12 = b(e208 + 1, this.viewItems.length), i12 = this.findFirstSnapIndex(n11), a11 = this.findFirstSnapIndex(r12);
          typeof i12 == `number` && !this.viewItems[i12].visible || typeof a11 == `number` && !this.viewItems[a11].visible || this._onDidSashReset.fire(e208);
        }), t11) };
        this.sashItems.splice(n10 - 1, 0, i11);
      }
      i10.appendChild(e206.element);
      let c10;
      typeof t10 != `number` && t10.type === `split` && (c10 = [t10.index]), r10 || this.relayout([n10], c10), !r10 && typeof t10 != `number` && t10.type === `distribute` && this.distributeViewSizes();
    } finally {
      this.state = sB.Idle;
    }
  }
  relayout(e206, t10) {
    let n10 = this.viewItems.reduce((e207, t11) => e207 + t11.size, 0);
    this.resize(this.viewItems.length - 1, this.size - n10, void 0, e206, t10), this.distributeEmptySpace(), this.layoutViews(), this.saveProportions();
  }
  resize(e206, t10, n10 = this.viewItems.map((e207) => e207.size), r10, i10, a10 = -1 / 0, o10 = 1 / 0, s10, c10) {
    if (e206 < 0 || e206 >= this.viewItems.length) return 0;
    let l10 = b(e206, -1), u10 = b(e206 + 1, this.viewItems.length);
    if (i10) for (let e207 of i10) S(l10, e207), S(u10, e207);
    if (r10) for (let e207 of r10) ee(l10, e207), ee(u10, e207);
    let d10 = l10.map((e207) => this.viewItems[e207]), f10 = l10.map((e207) => n10[e207]), p10 = u10.map((e207) => this.viewItems[e207]), m10 = u10.map((e207) => n10[e207]), h10 = l10.reduce((e207, t11) => e207 + (this.viewItems[t11].minimumSize - n10[t11]), 0), g10 = l10.reduce((e207, t11) => e207 + (this.viewItems[t11].maximumSize - n10[t11]), 0), _10 = u10.length === 0 ? 1 / 0 : u10.reduce((e207, t11) => e207 + (n10[t11] - this.viewItems[t11].minimumSize), 0), v10 = u10.length === 0 ? -1 / 0 : u10.reduce((e207, t11) => e207 + (n10[t11] - this.viewItems[t11].maximumSize), 0), y10 = Math.max(h10, v10, a10), x10 = Math.min(_10, g10, o10), te2 = false;
    if (s10) {
      let e207 = this.viewItems[s10.index], n11 = t10 >= s10.limitDelta;
      te2 = n11 !== e207.visible, e207.setVisible(n11, s10.size);
    }
    if (!te2 && c10) {
      let e207 = this.viewItems[c10.index], n11 = t10 < c10.limitDelta;
      te2 = n11 !== e207.visible, e207.setVisible(n11, c10.size);
    }
    if (te2) return this.resize(e206, t10, n10, r10, i10, a10, o10);
    t10 = rA(t10, y10, x10);
    for (let e207 = 0, n11 = t10; e207 < d10.length; e207++) {
      let t11 = d10[e207], r11 = rA(f10[e207] + n11, t11.minimumSize, t11.maximumSize), i11 = r11 - f10[e207];
      n11 -= i11, t11.size = r11;
    }
    for (let e207 = 0, n11 = t10; e207 < p10.length; e207++) {
      let t11 = p10[e207], r11 = rA(m10[e207] - n11, t11.minimumSize, t11.maximumSize), i11 = r11 - m10[e207];
      n11 += i11, t11.size = r11;
    }
    return t10;
  }
  distributeEmptySpace(e206) {
    let t10 = this.viewItems.reduce((e207, t11) => e207 + t11.size, 0), n10 = this.size - t10, r10 = b(this.viewItems.length - 1, -1), i10 = r10.filter((e207) => this.viewItems[e207].priority === 1), a10 = r10.filter((e207) => this.viewItems[e207].priority === 2);
    for (let e207 of a10) S(r10, e207);
    for (let e207 of i10) ee(r10, e207);
    typeof e206 == `number` && ee(r10, e206);
    for (let e207 = 0; n10 !== 0 && e207 < r10.length; e207++) {
      let t11 = this.viewItems[r10[e207]], i11 = rA(t11.size + n10, t11.minimumSize, t11.maximumSize), a11 = i11 - t11.size;
      n10 -= a11, t11.size = i11;
    }
  }
  layoutViews() {
    this._contentSize = this.viewItems.reduce((e207, t10) => e207 + t10.size, 0);
    let e206 = 0;
    for (let t10 of this.viewItems) t10.layout(e206, this.layoutContext), e206 += t10.size;
    this.sashItems.forEach((e207) => e207.sash.layout()), this.updateSashEnablement(), this.updateScrollableElement();
  }
  updateScrollableElement() {
    this.orientation === 0 ? this.scrollableElement.setScrollDimensions({ height: this.size, scrollHeight: this._contentSize }) : this.scrollableElement.setScrollDimensions({ width: this.size, scrollWidth: this._contentSize });
  }
  updateSashEnablement() {
    let e206 = false, t10 = this.viewItems.map((t11) => e206 = t11.size - t11.minimumSize > 0 || e206);
    e206 = false;
    let n10 = this.viewItems.map((t11) => e206 = t11.maximumSize - t11.size > 0 || e206), r10 = [...this.viewItems].reverse();
    e206 = false;
    let i10 = r10.map((t11) => e206 = t11.size - t11.minimumSize > 0 || e206).reverse();
    e206 = false;
    let a10 = r10.map((t11) => e206 = t11.maximumSize - t11.size > 0 || e206).reverse(), o10 = 0;
    for (let e207 = 0; e207 < this.sashItems.length; e207++) {
      let { sash: r11 } = this.sashItems[e207], s10 = this.viewItems[e207];
      o10 += s10.size;
      let c10 = !(t10[e207] && a10[e207 + 1]), l10 = !(n10[e207] && i10[e207 + 1]);
      if (c10 && l10) {
        let n11 = b(e207, -1), a11 = b(e207 + 1, this.viewItems.length), s11 = this.findFirstSnapIndex(n11), c11 = this.findFirstSnapIndex(a11), l11 = typeof s11 == `number` && !this.viewItems[s11].visible, u10 = typeof c11 == `number` && !this.viewItems[c11].visible;
        l11 && i10[e207] && (o10 > 0 || this.startSnappingEnabled) ? r11.state = 1 : u10 && t10[e207] && (o10 < this._contentSize || this.endSnappingEnabled) ? r11.state = 2 : r11.state = 0;
      } else c10 && !l10 ? r11.state = 1 : !c10 && l10 ? r11.state = 2 : r11.state = 3;
    }
  }
  getSashPosition(e206) {
    let t10 = 0;
    for (let n10 = 0; n10 < this.sashItems.length; n10++) if (t10 += this.viewItems[n10].size, this.sashItems[n10].sash === e206) return t10;
    return 0;
  }
  findFirstSnapIndex(e206) {
    for (let t10 of e206) {
      let e207 = this.viewItems[t10];
      if (e207.visible && e207.snap) return t10;
    }
    for (let t10 of e206) {
      let e207 = this.viewItems[t10];
      if (e207.visible && e207.maximumSize - e207.minimumSize > 0) return;
      if (!e207.visible && e207.snap) return t10;
    }
  }
  areViewsDistributed() {
    let e206, t10;
    for (let n10 of this.viewItems) if (e206 = e206 === void 0 ? n10.size : Math.min(e206, n10.size), t10 = t10 === void 0 ? n10.size : Math.max(t10, n10.size), t10 - e206 > 2) return false;
    return true;
  }
  dispose() {
    this.sashDragState?.disposable.dispose(), Kt(this.viewItems), this.viewItems = [], this.sashItems.forEach((e206) => e206.disposable.dispose()), this.sashItems = [], super.dispose();
  }
}, uB = (_bb = class {
  constructor(t10, n10, r10) {
    this.columns = t10, this.getColumnSize = r10, this.templateId = _bb.TemplateId, this.renderedTemplates = /* @__PURE__ */ new Set();
    let i10 = new Map(n10.map((e206) => [e206.templateId, e206]));
    this.renderers = [];
    for (let e206 of t10) {
      let t11 = i10.get(e206.templateId);
      if (!t11) throw Error(`Table cell renderer for template id ${e206.templateId} not found.`);
      this.renderers.push(t11);
    }
  }
  renderTemplate(e206) {
    let t10 = z(e206, B(`.monaco-table-tr`)), n10 = [], r10 = [];
    for (let e207 = 0; e207 < this.columns.length; e207++) {
      let i11 = this.renderers[e207], a10 = z(t10, B(`.monaco-table-td`, { "data-col-index": e207 }));
      a10.style.width = `${this.getColumnSize(e207)}px`, n10.push(a10), r10.push(i11.renderTemplate(a10));
    }
    let i10 = { container: e206, cellContainers: n10, cellTemplateData: r10 };
    return this.renderedTemplates.add(i10), i10;
  }
  renderElement(e206, t10, n10, r10) {
    for (let i10 = 0; i10 < this.columns.length; i10++) {
      let a10 = this.columns[i10].project(e206);
      this.renderers[i10].renderElement(a10, t10, n10.cellTemplateData[i10], r10);
    }
  }
  disposeElement(e206, t10, n10, r10) {
    for (let i10 = 0; i10 < this.columns.length; i10++) {
      let a10 = this.renderers[i10];
      if (a10.disposeElement) {
        let o10 = this.columns[i10].project(e206);
        a10.disposeElement(o10, t10, n10.cellTemplateData[i10], r10);
      }
    }
  }
  disposeTemplate(e206) {
    for (let t10 = 0; t10 < this.columns.length; t10++) this.renderers[t10].disposeTemplate(e206.cellTemplateData[t10]);
    Xc(e206.container), this.renderedTemplates.delete(e206);
  }
  layoutColumn(e206, t10) {
    for (let { cellContainers: n10 } of this.renderedTemplates) n10[e206].style.width = `${t10}px`;
  }
}, _bb.TemplateId = `row`, _bb);
function dB(e206) {
  return { getHeight(t10) {
    return e206.getHeight(t10);
  }, getTemplateId() {
    return uB.TemplateId;
  } };
}
var fB = class extends D {
  get minimumSize() {
    return this.column.minimumWidth ?? 120;
  }
  get maximumSize() {
    return this.column.maximumWidth ?? 1 / 0;
  }
  get onDidChange() {
    return this.column.onDidChangeWidthConstraints ?? O.None;
  }
  constructor(e206, t10) {
    super(), this.column = e206, this.index = t10, this._onDidLayout = new k(), this.onDidLayout = this._onDidLayout.event, this.element = B(`.monaco-table-th`, { "data-col-index": t10 }, e206.label), e206.tooltip && this._register(EI().setupManagedHover(CI(`mouse`), this.element, e206.tooltip));
  }
  layout(e206) {
    this._onDidLayout.fire([this.index, e206]);
  }
}, pB = (_cb = class {
  get onDidChangeFocus() {
    return this.list.onDidChangeFocus;
  }
  get onDidChangeSelection() {
    return this.list.onDidChangeSelection;
  }
  get onDidScroll() {
    return this.list.onDidScroll;
  }
  get onMouseDblClick() {
    return this.list.onMouseDblClick;
  }
  get onPointer() {
    return this.list.onPointer;
  }
  get onDidFocus() {
    return this.list.onDidFocus;
  }
  get scrollTop() {
    return this.list.scrollTop;
  }
  set scrollTop(e206) {
    this.list.scrollTop = e206;
  }
  get scrollHeight() {
    return this.list.scrollHeight;
  }
  get renderHeight() {
    return this.list.renderHeight;
  }
  get onDidDispose() {
    return this.list.onDidDispose;
  }
  constructor(t10, n10, r10, i10, a10, o10) {
    this.virtualDelegate = r10, this.columns = i10, this.domId = `table_id_${++_cb.InstanceCount}`, this.disposables = new E(), this.cachedWidth = 0, this.cachedHeight = 0, this.domNode = z(n10, B(`.monaco-table.${this.domId}`));
    let s10 = i10.map((e206, t11) => this.disposables.add(new fB(e206, t11))), c10 = { size: s10.reduce((e206, t11) => e206 + t11.column.weight, 0), views: s10.map((e206) => ({ size: e206.column.weight, view: e206 })) };
    this.splitview = this.disposables.add(new lB(this.domNode, { orientation: 1, scrollbarVisibility: 2, getSashOrthogonalSize: () => this.cachedHeight, descriptor: c10 })), this.splitview.el.style.height = `${r10.headerRowHeight}px`, this.splitview.el.style.lineHeight = `${r10.headerRowHeight}px`;
    let l10 = new uB(i10, a10, (e206) => this.splitview.getViewSize(e206));
    this.list = this.disposables.add(new $I(t10, this.domNode, dB(r10), [l10], o10)), O.any(...s10.map((e206) => e206.onDidLayout))(([e206, t11]) => l10.layoutColumn(e206, t11), null, this.disposables), this.splitview.onDidSashReset((e206) => {
      let t11 = i10.reduce((e207, t12) => e207 + t12.weight, 0), n11 = i10[e206].weight / t11 * this.cachedWidth;
      this.splitview.resizeView(e206, n11);
    }, null, this.disposables), this.styleElement = g_(this.domNode), this.style(Vge);
  }
  updateOptions(e206) {
    this.list.updateOptions(e206);
  }
  splice(e206, t10, n10 = []) {
    this.list.splice(e206, t10, n10);
  }
  getHTMLElement() {
    return this.domNode;
  }
  style(e206) {
    let t10 = [];
    t10.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
			top: ${this.virtualDelegate.headerRowHeight + 1}px;
			height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
		}`), this.styleElement.textContent = t10.join(`
`), this.list.style(e206);
  }
  getSelectedElements() {
    return this.list.getSelectedElements();
  }
  getSelection() {
    return this.list.getSelection();
  }
  getFocus() {
    return this.list.getFocus();
  }
  dispose() {
    this.disposables.dispose();
  }
}, _cb.InstanceCount = 0, _cb), mB = class {
  constructor(e206, t10 = {}) {
    this.user = e206, this.rootRef = null, this.nodes = /* @__PURE__ */ new Map(), this.nodesByIdentity = /* @__PURE__ */ new Map(), this.model = new oz(e206, null, t10), this.onDidSpliceModel = this.model.onDidSpliceModel, this.onDidSpliceRenderedNodes = this.model.onDidSpliceRenderedNodes, this.onDidChangeCollapseState = this.model.onDidChangeCollapseState, this.onDidChangeRenderNodeCount = this.model.onDidChangeRenderNodeCount, t10.sorter && (this.sorter = { compare(e207, n10) {
      return t10.sorter.compare(e207.element, n10.element);
    } }), this.identityProvider = t10.identityProvider;
  }
  setChildren(e206, t10 = Ut.empty(), n10 = {}) {
    let r10 = this.getElementLocation(e206);
    this._setChildren(r10, this.preserveCollapseState(t10), n10);
  }
  _setChildren(e206, t10 = Ut.empty(), n10) {
    let r10 = /* @__PURE__ */ new Set(), i10 = /* @__PURE__ */ new Set(), a10 = (e207) => {
      if (e207.element === null) return;
      let t11 = e207;
      if (r10.add(t11.element), this.nodes.set(t11.element, t11), this.identityProvider) {
        let e208 = this.identityProvider.getId(t11.element).toString();
        i10.add(e208), this.nodesByIdentity.set(e208, t11);
      }
      n10.onDidCreateNode?.(t11);
    }, o10 = (e207) => {
      if (e207.element === null) return;
      let t11 = e207;
      if (r10.has(t11.element) || this.nodes.delete(t11.element), this.identityProvider) {
        let e208 = this.identityProvider.getId(t11.element).toString();
        i10.has(e208) || this.nodesByIdentity.delete(e208);
      }
      n10.onDidDeleteNode?.(t11);
    };
    this.model.splice([...e206, 0], Number.MAX_VALUE, t10, { ...n10, onDidCreateNode: a10, onDidDeleteNode: o10 });
  }
  preserveCollapseState(e206 = Ut.empty()) {
    return this.sorter && (e206 = [...e206].sort(this.sorter.compare.bind(this.sorter))), Ut.map(e206, (e207) => {
      let t10 = this.nodes.get(e207.element);
      if (!t10 && this.identityProvider) {
        let n11 = this.identityProvider.getId(e207.element).toString();
        t10 = this.nodesByIdentity.get(n11);
      }
      if (!t10) {
        let t11;
        return t11 = e207.collapsed === void 0 ? void 0 : e207.collapsed === $R.Collapsed || e207.collapsed === $R.PreserveOrCollapsed ? true : e207.collapsed === $R.Expanded || e207.collapsed === $R.PreserveOrExpanded ? false : !!e207.collapsed, { ...e207, children: this.preserveCollapseState(e207.children), collapsed: t11 };
      }
      let n10 = typeof e207.collapsible == `boolean` ? e207.collapsible : t10.collapsible, r10;
      return r10 = e207.collapsed === void 0 || e207.collapsed === $R.PreserveOrCollapsed || e207.collapsed === $R.PreserveOrExpanded ? t10.collapsed : e207.collapsed === $R.Collapsed ? true : e207.collapsed === $R.Expanded ? false : !!e207.collapsed, { ...e207, collapsible: n10, collapsed: r10, children: this.preserveCollapseState(e207.children) };
    });
  }
  rerender(e206) {
    let t10 = this.getElementLocation(e206);
    this.model.rerender(t10);
  }
  resort(e206 = null, t10 = true) {
    if (!this.sorter) return;
    let n10 = this.getElementLocation(e206), r10 = this.model.getNode(n10);
    this._setChildren(n10, this.resortChildren(r10, t10), {});
  }
  resortChildren(e206, t10, n10 = true) {
    let r10 = [...e206.children];
    return (t10 || n10) && (r10 = r10.sort(this.sorter.compare.bind(this.sorter))), Ut.map(r10, (e207) => ({ element: e207.element, collapsible: e207.collapsible, collapsed: e207.collapsed, children: this.resortChildren(e207, t10, false) }));
  }
  getFirstElementChild(e206 = null) {
    let t10 = this.getElementLocation(e206);
    return this.model.getFirstElementChild(t10);
  }
  has(e206) {
    return this.nodes.has(e206);
  }
  getListIndex(e206) {
    let t10 = this.getElementLocation(e206);
    return this.model.getListIndex(t10);
  }
  getListRenderCount(e206) {
    let t10 = this.getElementLocation(e206);
    return this.model.getListRenderCount(t10);
  }
  isCollapsible(e206) {
    let t10 = this.getElementLocation(e206);
    return this.model.isCollapsible(t10);
  }
  setCollapsible(e206, t10) {
    let n10 = this.getElementLocation(e206);
    return this.model.setCollapsible(n10, t10);
  }
  isCollapsed(e206) {
    let t10 = this.getElementLocation(e206);
    return this.model.isCollapsed(t10);
  }
  setCollapsed(e206, t10, n10) {
    let r10 = this.getElementLocation(e206);
    return this.model.setCollapsed(r10, t10, n10);
  }
  expandTo(e206) {
    let t10 = this.getElementLocation(e206);
    this.model.expandTo(t10);
  }
  refilter() {
    this.model.refilter();
  }
  getNode(e206 = null) {
    if (e206 === null) return this.model.getNode(this.model.rootRef);
    let t10 = this.nodes.get(e206);
    if (!t10) throw new tz(this.user, `Tree element not found: ${e206}`);
    return t10;
  }
  getNodeLocation(e206) {
    return e206.element;
  }
  getParentNodeLocation(e206) {
    if (e206 === null) throw new tz(this.user, `Invalid getParentNodeLocation call`);
    let t10 = this.nodes.get(e206);
    if (!t10) throw new tz(this.user, `Tree element not found: ${e206}`);
    let n10 = this.model.getNodeLocation(t10), r10 = this.model.getParentNodeLocation(n10);
    return this.model.getNode(r10).element;
  }
  getElementLocation(e206) {
    if (e206 === null) return [];
    let t10 = this.nodes.get(e206);
    if (!t10) throw new tz(this.user, `Tree element not found: ${e206}`);
    return this.model.getNodeLocation(t10);
  }
};
function hB(e206) {
  return { element: { elements: [e206.element], incompressible: e206.incompressible || false }, children: Ut.map(Ut.from(e206.children), hB), collapsible: e206.collapsible, collapsed: e206.collapsed };
}
function gB(e206) {
  let t10 = [e206.element], n10 = e206.incompressible || false, r10, i10;
  for (; [i10, r10] = Ut.consume(Ut.from(e206.children), 2), !(i10.length !== 1 || i10[0].incompressible); ) e206 = i10[0], t10.push(e206.element);
  return { element: { elements: t10, incompressible: n10 }, children: Ut.map(Ut.concat(i10, r10), gB), collapsible: e206.collapsible, collapsed: e206.collapsed };
}
function _B2(e206, t10 = 0) {
  let n10;
  return n10 = t10 < e206.element.elements.length - 1 ? [_B2(e206, t10 + 1)] : Ut.map(Ut.from(e206.children), (e207) => _B2(e207, 0)), t10 === 0 && e206.element.incompressible ? { element: e206.element.elements[t10], children: n10, incompressible: true, collapsible: e206.collapsible, collapsed: e206.collapsed } : { element: e206.element.elements[t10], children: n10, collapsible: e206.collapsible, collapsed: e206.collapsed };
}
function vB(e206) {
  return _B2(e206, 0);
}
function yB(e206, t10, n10) {
  return e206.element === t10 ? { ...e206, children: n10 } : { ...e206, children: Ut.map(Ut.from(e206.children), (e207) => yB(e207, t10, n10)) };
}
var bB = (e206) => ({ getId(t10) {
  return t10.elements.map((t11) => e206.getId(t11).toString()).join(`\0`);
} }), xB = class {
  get onDidSpliceRenderedNodes() {
    return this.model.onDidSpliceRenderedNodes;
  }
  get onDidSpliceModel() {
    return this.model.onDidSpliceModel;
  }
  get onDidChangeCollapseState() {
    return this.model.onDidChangeCollapseState;
  }
  get onDidChangeRenderNodeCount() {
    return this.model.onDidChangeRenderNodeCount;
  }
  constructor(e206, t10 = {}) {
    this.user = e206, this.rootRef = null, this.nodes = /* @__PURE__ */ new Map(), this.model = new mB(e206, t10), this.enabled = t10.compressionEnabled === void 0 ? true : t10.compressionEnabled, this.identityProvider = t10.identityProvider;
  }
  setChildren(e206, t10 = Ut.empty(), n10) {
    let r10 = n10.diffIdentityProvider && bB(n10.diffIdentityProvider);
    if (e206 === null) {
      let e207 = Ut.map(t10, this.enabled ? gB : hB);
      this._setChildren(null, e207, { diffIdentityProvider: r10, diffDepth: 1 / 0 });
      return;
    }
    let i10 = this.nodes.get(e206);
    if (!i10) throw new tz(this.user, `Unknown compressed tree node`);
    let a10 = this.model.getNode(i10), s10 = this.model.getParentNodeLocation(i10), c10 = this.model.getNode(s10), l10 = yB(vB(a10), e206, t10), u10 = (this.enabled ? gB : hB)(l10), d10 = n10.diffIdentityProvider ? ((e207, t11) => n10.diffIdentityProvider.getId(e207) === n10.diffIdentityProvider.getId(t11)) : void 0;
    if (o(u10.element.elements, a10.element.elements, d10)) {
      this._setChildren(i10, u10.children || Ut.empty(), { diffIdentityProvider: r10, diffDepth: 1 });
      return;
    }
    let f10 = c10.children.map((e207) => e207 === a10 ? u10 : e207);
    this._setChildren(c10.element, f10, { diffIdentityProvider: r10, diffDepth: a10.depth - c10.depth });
  }
  isCompressionEnabled() {
    return this.enabled;
  }
  setCompressionEnabled(e206) {
    if (e206 === this.enabled) return;
    this.enabled = e206;
    let t10 = this.model.getNode().children, n10 = Ut.map(t10, vB), r10 = Ut.map(n10, e206 ? gB : hB);
    this._setChildren(null, r10, { diffIdentityProvider: this.identityProvider, diffDepth: 1 / 0 });
  }
  _setChildren(e206, t10, n10) {
    let r10 = /* @__PURE__ */ new Set(), i10 = (e207) => {
      for (let t11 of e207.element.elements) r10.add(t11), this.nodes.set(t11, e207.element);
    }, a10 = (e207) => {
      for (let t11 of e207.element.elements) r10.has(t11) || this.nodes.delete(t11);
    };
    this.model.setChildren(e206, t10, { ...n10, onDidCreateNode: i10, onDidDeleteNode: a10 });
  }
  has(e206) {
    return this.nodes.has(e206);
  }
  getListIndex(e206) {
    let t10 = this.getCompressedNode(e206);
    return this.model.getListIndex(t10);
  }
  getListRenderCount(e206) {
    let t10 = this.getCompressedNode(e206);
    return this.model.getListRenderCount(t10);
  }
  getNode(e206) {
    if (e206 === void 0) return this.model.getNode();
    let t10 = this.getCompressedNode(e206);
    return this.model.getNode(t10);
  }
  getNodeLocation(e206) {
    let t10 = this.model.getNodeLocation(e206);
    return t10 === null ? null : t10.elements[t10.elements.length - 1];
  }
  getParentNodeLocation(e206) {
    let t10 = this.getCompressedNode(e206), n10 = this.model.getParentNodeLocation(t10);
    return n10 === null ? null : n10.elements[n10.elements.length - 1];
  }
  getFirstElementChild(e206) {
    let t10 = this.getCompressedNode(e206);
    return this.model.getFirstElementChild(t10);
  }
  isCollapsible(e206) {
    let t10 = this.getCompressedNode(e206);
    return this.model.isCollapsible(t10);
  }
  setCollapsible(e206, t10) {
    let n10 = this.getCompressedNode(e206);
    return this.model.setCollapsible(n10, t10);
  }
  isCollapsed(e206) {
    let t10 = this.getCompressedNode(e206);
    return this.model.isCollapsed(t10);
  }
  setCollapsed(e206, t10, n10) {
    let r10 = this.getCompressedNode(e206);
    return this.model.setCollapsed(r10, t10, n10);
  }
  expandTo(e206) {
    let t10 = this.getCompressedNode(e206);
    this.model.expandTo(t10);
  }
  rerender(e206) {
    let t10 = this.getCompressedNode(e206);
    this.model.rerender(t10);
  }
  refilter() {
    this.model.refilter();
  }
  resort(e206 = null, t10 = true) {
    let n10 = this.getCompressedNode(e206);
    this.model.resort(n10, t10);
  }
  getCompressedNode(e206) {
    if (e206 === null) return null;
    let t10 = this.nodes.get(e206);
    if (!t10) throw new tz(this.user, `Tree element not found: ${e206}`);
    return t10;
  }
}, SB = (e206) => e206[e206.length - 1], CB = class e149 {
  get element() {
    return this.node.element === null ? null : this.unwrapper(this.node.element);
  }
  get children() {
    return this.node.children.map((t10) => new e149(this.unwrapper, t10));
  }
  get depth() {
    return this.node.depth;
  }
  get visibleChildrenCount() {
    return this.node.visibleChildrenCount;
  }
  get visibleChildIndex() {
    return this.node.visibleChildIndex;
  }
  get collapsible() {
    return this.node.collapsible;
  }
  get collapsed() {
    return this.node.collapsed;
  }
  get visible() {
    return this.node.visible;
  }
  get filterData() {
    return this.node.filterData;
  }
  constructor(e206, t10) {
    this.unwrapper = e206, this.node = t10;
  }
};
function wB(e206, t10) {
  return { ...t10, identityProvider: t10.identityProvider && { getId(n10) {
    return t10.identityProvider.getId(e206(n10));
  } }, sorter: t10.sorter && { compare(e207, n10) {
    return t10.sorter.compare(e207.elements[0], n10.elements[0]);
  } }, filter: t10.filter && { filter(e207, n10) {
    let r10 = e207.elements;
    for (let e208 = 0; e208 < r10.length - 1; e208++) {
      let i10 = t10.filter.filter(r10[e208], n10);
      n10 = iz(rz(i10) ? i10.visibility : i10);
    }
    return t10.filter.filter(r10[r10.length - 1], n10);
  } } };
}
var TB = class {
  get onDidSpliceModel() {
    return O.map(this.model.onDidSpliceModel, ({ insertedNodes: e206, deletedNodes: t10 }) => ({ insertedNodes: e206.map((e207) => this.nodeMapper.map(e207)), deletedNodes: t10.map((e207) => this.nodeMapper.map(e207)) }));
  }
  get onDidSpliceRenderedNodes() {
    return O.map(this.model.onDidSpliceRenderedNodes, ({ start: e206, deleteCount: t10, elements: n10 }) => ({ start: e206, deleteCount: t10, elements: n10.map((e207) => this.nodeMapper.map(e207)) }));
  }
  get onDidChangeCollapseState() {
    return O.map(this.model.onDidChangeCollapseState, ({ node: e206, deep: t10 }) => ({ node: this.nodeMapper.map(e206), deep: t10 }));
  }
  get onDidChangeRenderNodeCount() {
    return O.map(this.model.onDidChangeRenderNodeCount, (e206) => this.nodeMapper.map(e206));
  }
  constructor(e206, t10 = {}) {
    this.rootRef = null, this.elementMapper = t10.elementMapper || SB;
    let n10 = (e207) => this.elementMapper(e207.elements);
    this.nodeMapper = new nz((e207) => new CB(n10, e207)), this.model = new xB(e206, wB(n10, t10));
  }
  setChildren(e206, t10 = Ut.empty(), n10 = {}) {
    this.model.setChildren(e206, t10, n10);
  }
  isCompressionEnabled() {
    return this.model.isCompressionEnabled();
  }
  setCompressionEnabled(e206) {
    this.model.setCompressionEnabled(e206);
  }
  has(e206) {
    return this.model.has(e206);
  }
  getListIndex(e206) {
    return this.model.getListIndex(e206);
  }
  getListRenderCount(e206) {
    return this.model.getListRenderCount(e206);
  }
  getNode(e206) {
    return this.nodeMapper.map(this.model.getNode(e206));
  }
  getNodeLocation(e206) {
    return e206.element;
  }
  getParentNodeLocation(e206) {
    return this.model.getParentNodeLocation(e206);
  }
  getFirstElementChild(e206) {
    let t10 = this.model.getFirstElementChild(e206);
    return t10 == null ? t10 : this.elementMapper(t10.elements);
  }
  isCollapsible(e206) {
    return this.model.isCollapsible(e206);
  }
  setCollapsible(e206, t10) {
    return this.model.setCollapsible(e206, t10);
  }
  isCollapsed(e206) {
    return this.model.isCollapsed(e206);
  }
  setCollapsed(e206, t10, n10) {
    return this.model.setCollapsed(e206, t10, n10);
  }
  expandTo(e206) {
    return this.model.expandTo(e206);
  }
  rerender(e206) {
    return this.model.rerender(e206);
  }
  refilter() {
    return this.model.refilter();
  }
  resort(e206 = null, t10 = true) {
    return this.model.resort(e206, t10);
  }
  getCompressedTreeNode(e206 = null) {
    return this.model.getNode(e206);
  }
}, EB = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, DB = class extends Iz {
  get onDidChangeCollapseState() {
    return this.model.onDidChangeCollapseState;
  }
  constructor(e206, t10, n10, r10, i10 = {}) {
    super(e206, t10, n10, r10, i10), this.user = e206;
  }
  setChildren(e206, t10 = Ut.empty(), n10) {
    this.model.setChildren(e206, t10, n10);
  }
  rerender(e206) {
    if (e206 === void 0) {
      this.view.rerender();
      return;
    }
    this.model.rerender(e206);
  }
  resort(e206, t10 = true) {
    this.model.resort(e206, t10);
  }
  hasElement(e206) {
    return this.model.has(e206);
  }
  createModel(e206, t10) {
    return new mB(e206, t10);
  }
}, OB = class {
  get compressedTreeNodeProvider() {
    return this._compressedTreeNodeProvider();
  }
  constructor(e206, t10, n10) {
    this._compressedTreeNodeProvider = e206, this.stickyScrollDelegate = t10, this.renderer = n10, this.templateId = n10.templateId, n10.onDidChangeTwistieState && (this.onDidChangeTwistieState = n10.onDidChangeTwistieState);
  }
  renderTemplate(e206) {
    return { compressedTreeNode: void 0, data: this.renderer.renderTemplate(e206) };
  }
  renderElement(e206, t10, n10, r10) {
    let i10 = this.stickyScrollDelegate.getCompressedNode(e206);
    i10 || (i10 = this.compressedTreeNodeProvider.getCompressedTreeNode(e206.element)), i10.element.elements.length === 1 ? (n10.compressedTreeNode = void 0, this.renderer.renderElement(e206, t10, n10.data, r10)) : (n10.compressedTreeNode = i10, this.renderer.renderCompressedElements(i10, t10, n10.data, r10));
  }
  disposeElement(e206, t10, n10, r10) {
    n10.compressedTreeNode ? this.renderer.disposeCompressedElements?.(n10.compressedTreeNode, t10, n10.data, r10) : this.renderer.disposeElement?.(e206, t10, n10.data, r10);
  }
  disposeTemplate(e206) {
    this.renderer.disposeTemplate(e206.data);
  }
  renderTwistie(e206, t10) {
    return this.renderer.renderTwistie?.(e206, t10) ?? false;
  }
};
EB([ex], OB.prototype, `compressedTreeNodeProvider`, null);
var kB = class {
  constructor(e206) {
    this.modelProvider = e206, this.compressedStickyNodes = /* @__PURE__ */ new Map();
  }
  getCompressedNode(e206) {
    return this.compressedStickyNodes.get(e206);
  }
  constrainStickyScrollNodes(e206, t10, n10) {
    if (this.compressedStickyNodes.clear(), e206.length === 0) return [];
    for (let r10 = 0; r10 < e206.length; r10++) {
      let i10 = e206[r10], a10 = i10.position + i10.height;
      if (r10 + 1 < e206.length && a10 + e206[r10 + 1].height > n10 || r10 >= t10 - 1 && t10 < e206.length) {
        let t11 = e206.slice(0, r10), n11 = e206.slice(r10), i11 = this.compressStickyNodes(n11);
        return [...t11, i11];
      }
    }
    return e206;
  }
  compressStickyNodes(e206) {
    if (e206.length === 0) throw Error(`Can't compress empty sticky nodes`);
    let t10 = this.modelProvider();
    if (!t10.isCompressionEnabled()) return e206[0];
    let n10 = [];
    for (let r11 = 0; r11 < e206.length; r11++) {
      let i11 = e206[r11], a11 = t10.getCompressedTreeNode(i11.node.element);
      if (a11.element) {
        if (r11 !== 0 && a11.element.incompressible) break;
        n10.push(...a11.element.elements);
      }
    }
    if (n10.length < 2) return e206[0];
    let r10 = e206[e206.length - 1], i10 = { elements: n10, incompressible: false }, a10 = { ...r10.node, children: [], element: i10 }, o10 = new Proxy(e206[0].node, {}), s10 = { node: o10, startIndex: e206[0].startIndex, endIndex: r10.endIndex, position: e206[0].position, height: e206[0].height };
    return this.compressedStickyNodes.set(o10, a10), s10;
  }
};
function AB(e206, t10) {
  return t10 && { ...t10, keyboardNavigationLabelProvider: t10.keyboardNavigationLabelProvider && { getKeyboardNavigationLabel(n10) {
    let r10;
    try {
      r10 = e206().getCompressedTreeNode(n10);
    } catch {
      return t10.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n10);
    }
    return r10.element.elements.length === 1 ? t10.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n10) : t10.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(r10.element.elements);
  } } };
}
var jB = class extends DB {
  constructor(e206, t10, n10, r10, i10 = {}) {
    let a10 = () => this, o10 = new kB(() => this.model), s10 = r10.map((e207) => new OB(a10, o10, e207));
    super(e206, t10, n10, s10, { ...AB(a10, i10), stickyScrollDelegate: o10 });
  }
  setChildren(e206, t10 = Ut.empty(), n10) {
    this.model.setChildren(e206, t10, n10);
  }
  createModel(e206, t10) {
    return new TB(e206, t10);
  }
  updateOptions(e206 = {}) {
    super.updateOptions(e206), e206.compressionEnabled !== void 0 && this.model.setCompressionEnabled(e206.compressionEnabled);
  }
  getCompressedTreeNode(e206 = null) {
    return this.model.getCompressedTreeNode(e206);
  }
};
function MB(e206) {
  return { ...e206, children: [], refreshPromise: void 0, stale: true, slow: false, forceExpanded: false };
}
function NB(e206, t10) {
  return t10.parent ? t10.parent === e206 ? true : NB(e206, t10.parent) : false;
}
function PB(e206, t10) {
  return e206 === t10 || NB(e206, t10) || NB(t10, e206);
}
var FB = class e150 {
  get element() {
    return this.node.element.element;
  }
  get children() {
    return this.node.children.map((t10) => new e150(t10));
  }
  get depth() {
    return this.node.depth;
  }
  get visibleChildrenCount() {
    return this.node.visibleChildrenCount;
  }
  get visibleChildIndex() {
    return this.node.visibleChildIndex;
  }
  get collapsible() {
    return this.node.collapsible;
  }
  get collapsed() {
    return this.node.collapsed;
  }
  get visible() {
    return this.node.visible;
  }
  get filterData() {
    return this.node.filterData;
  }
  constructor(e206) {
    this.node = e206;
  }
}, IB = class {
  constructor(e206, t10, n10) {
    this.renderer = e206, this.nodeMapper = t10, this.onDidChangeTwistieState = n10, this.renderedNodes = /* @__PURE__ */ new Map(), this.templateId = e206.templateId;
  }
  renderTemplate(e206) {
    return { templateData: this.renderer.renderTemplate(e206) };
  }
  renderElement(e206, t10, n10, r10) {
    this.renderer.renderElement(this.nodeMapper.map(e206), t10, n10.templateData, r10);
  }
  renderTwistie(e206, t10) {
    return e206.slow ? (t10.classList.add(...ju.asClassNameArray(F.treeItemLoading)), true) : (t10.classList.remove(...ju.asClassNameArray(F.treeItemLoading)), false);
  }
  disposeElement(e206, t10, n10, r10) {
    this.renderer.disposeElement?.(this.nodeMapper.map(e206), t10, n10.templateData, r10);
  }
  disposeTemplate(e206) {
    this.renderer.disposeTemplate(e206.templateData);
  }
  dispose() {
    this.renderedNodes.clear();
  }
};
function LB(e206) {
  return { browserEvent: e206.browserEvent, elements: e206.elements.map((e207) => e207.element) };
}
function RB(e206) {
  return { browserEvent: e206.browserEvent, element: e206.element && e206.element.element, target: e206.target };
}
var zB = class extends NI {
  constructor(e206) {
    super(e206.elements.map((e207) => e207.element)), this.data = e206;
  }
};
function BB(e206) {
  return e206 instanceof NI ? new zB(e206) : e206;
}
var VB = class {
  constructor(e206) {
    this.dnd = e206;
  }
  getDragURI(e206) {
    return this.dnd.getDragURI(e206.element);
  }
  getDragLabel(e206, t10) {
    if (this.dnd.getDragLabel) return this.dnd.getDragLabel(e206.map((e207) => e207.element), t10);
  }
  onDragStart(e206, t10) {
    this.dnd.onDragStart?.(BB(e206), t10);
  }
  onDragOver(e206, t10, n10, r10, i10, a10 = true) {
    return this.dnd.onDragOver(BB(e206), t10 && t10.element, n10, r10, i10);
  }
  drop(e206, t10, n10, r10, i10) {
    this.dnd.drop(BB(e206), t10 && t10.element, n10, r10, i10);
  }
  onDragEnd(e206) {
    this.dnd.onDragEnd?.(e206);
  }
  dispose() {
    this.dnd.dispose();
  }
}, HB = class extends gz {
  constructor(e206, t10, n10) {
    super(t10, n10), this.findProvider = e206, this.isFindSessionActive = false;
  }
  filter(e206, t10) {
    let n10 = super.filter(e206, t10);
    return !this.isFindSessionActive || this.findMode === vz.Highlight || !this.findProvider.isVisible ? n10 : iz(rz(n10) ? n10.visibility : n10) === 0 ? 0 : this.findProvider.isVisible(e206) ? n10 : 0;
  }
}, UB = class extends Sz {
  constructor(e206, t10, n10, r10, i10) {
    super(e206, n10, r10, i10), this.findProvider = t10, this.filter = n10, this.activeSession = false, this.asyncWorkInProgress = false, this.disposables.add(T(async () => {
      this.activeSession && await this.findProvider.endSession?.();
    }));
  }
  render() {
    if (this.asyncWorkInProgress || !this.activeFindMetadata) return;
    let e206 = this.activeFindMetadata.matchCount === 0 && this.pattern.length > 0;
    this.renderMessage(e206), this.pattern.length && this.alertResults(this.activeFindMetadata.matchCount);
  }
  shouldAllowFocus(e206) {
    return this.shouldFocusWhenNavigating(e206);
  }
  shouldFocusWhenNavigating(e206) {
    if (!this.activeSession || !this.activeFindMetadata) return true;
    let t10 = e206.element?.element;
    return t10 && this.activeFindMetadata.isMatch(t10) ? true : !CM.isDefault(e206.filterData);
  }
};
function WB(e206) {
  return e206 && { ...e206, collapseByDefault: true, identityProvider: e206.identityProvider && { getId(t10) {
    return e206.identityProvider.getId(t10.element);
  } }, dnd: e206.dnd && new VB(e206.dnd), multipleSelectionController: e206.multipleSelectionController && { isSelectionSingleChangeEvent(t10) {
    return e206.multipleSelectionController.isSelectionSingleChangeEvent({ ...t10, element: t10.element });
  }, isSelectionRangeChangeEvent(t10) {
    return e206.multipleSelectionController.isSelectionRangeChangeEvent({ ...t10, element: t10.element });
  } }, accessibilityProvider: e206.accessibilityProvider && { ...e206.accessibilityProvider, getPosInSet: void 0, getSetSize: void 0, getRole: e206.accessibilityProvider.getRole ? (t10) => e206.accessibilityProvider.getRole(t10.element) : () => `treeitem`, isChecked: e206.accessibilityProvider.isChecked ? (t10) => !!e206.accessibilityProvider?.isChecked(t10.element) : void 0, getAriaLabel(t10) {
    return e206.accessibilityProvider.getAriaLabel(t10.element);
  }, getWidgetAriaLabel() {
    return e206.accessibilityProvider.getWidgetAriaLabel();
  }, getWidgetRole: e206.accessibilityProvider.getWidgetRole ? () => e206.accessibilityProvider.getWidgetRole() : () => `tree`, getAriaLevel: e206.accessibilityProvider.getAriaLevel && ((t10) => e206.accessibilityProvider.getAriaLevel(t10.element)), getActiveDescendantId: e206.accessibilityProvider.getActiveDescendantId && ((t10) => e206.accessibilityProvider.getActiveDescendantId(t10.element)) }, filter: e206.filter && { filter(t10, n10) {
    return e206.filter.filter(t10.element, n10);
  } }, keyboardNavigationLabelProvider: e206.keyboardNavigationLabelProvider && { ...e206.keyboardNavigationLabelProvider, getKeyboardNavigationLabel(t10) {
    return e206.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t10.element);
  } }, sorter: void 0, expandOnlyOnTwistieClick: e206.expandOnlyOnTwistieClick === void 0 ? void 0 : typeof e206.expandOnlyOnTwistieClick == `function` ? ((t10) => e206.expandOnlyOnTwistieClick(t10.element)) : e206.expandOnlyOnTwistieClick, defaultFindVisibility: (t10) => t10.hasChildren && t10.stale ? 1 : typeof e206.defaultFindVisibility == `number` ? e206.defaultFindVisibility : e206.defaultFindVisibility === void 0 ? 2 : e206.defaultFindVisibility(t10.element), stickyScrollDelegate: e206.stickyScrollDelegate };
}
function GB(e206, t10) {
  t10(e206), e206.children.forEach((e207) => GB(e207, t10));
}
var KB = class {
  get onDidScroll() {
    return this.tree.onDidScroll;
  }
  get onDidChangeFocus() {
    return O.map(this.tree.onDidChangeFocus, LB);
  }
  get onDidChangeSelection() {
    return O.map(this.tree.onDidChangeSelection, LB);
  }
  get onMouseDblClick() {
    return O.map(this.tree.onMouseDblClick, RB);
  }
  get onPointer() {
    return O.map(this.tree.onPointer, RB);
  }
  get onDidFocus() {
    return this.tree.onDidFocus;
  }
  get onDidChangeModel() {
    return this.tree.onDidChangeModel;
  }
  get onDidChangeCollapseState() {
    return this.tree.onDidChangeCollapseState;
  }
  get onDidChangeStickyScrollFocused() {
    return this.tree.onDidChangeStickyScrollFocused;
  }
  get onDidDispose() {
    return this.tree.onDidDispose;
  }
  constructor(e206, t10, n10, r10, i10, a10 = {}) {
    this.user = e206, this.dataSource = i10, this.nodes = /* @__PURE__ */ new Map(), this.subTreeRefreshPromises = /* @__PURE__ */ new Map(), this.refreshPromises = /* @__PURE__ */ new Map(), this._onDidRender = new k(), this._onDidChangeNodeSlowState = new k(), this.nodeMapper = new nz((e207) => new FB(e207)), this.disposables = new E(), this.identityProvider = a10.identityProvider, this.autoExpandSingleChildren = a10.autoExpandSingleChildren === void 0 ? false : a10.autoExpandSingleChildren, this.sorter = a10.sorter, this.getDefaultCollapseState = (e207) => a10.collapseByDefault ? a10.collapseByDefault(e207) ? $R.PreserveOrCollapsed : $R.PreserveOrExpanded : void 0;
    let o10 = false, s10;
    if (a10.findProvider && (a10.findWidgetEnabled ?? true) && a10.keyboardNavigationLabelProvider && a10.contextViewProvider && (o10 = true, s10 = new HB(a10.findProvider, a10.keyboardNavigationLabelProvider, a10.filter)), this.tree = this.createTree(e206, t10, n10, r10, { ...a10, findWidgetEnabled: !o10, filter: s10 ?? a10.filter }), this.root = MB({ element: void 0, parent: null, hasChildren: true, defaultCollapseState: void 0 }), this.identityProvider && (this.root = { ...this.root, id: null }), this.nodes.set(null, this.root), this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables), o10) {
      let e207 = { styles: a10.findWidgetStyles, showNotFoundMessage: a10.showNotFoundMessage, defaultFindMatchType: a10.defaultFindMatchType, defaultFindMode: a10.defaultFindMode };
      this.findController = this.disposables.add(new UB(this.tree, a10.findProvider, s10, this.tree.options.contextViewProvider, e207)), this.focusNavigationFilter = (e208) => this.findController.shouldFocusWhenNavigating(e208), this.onDidChangeFindOpenState = this.findController.onDidChangeOpenState, this.onDidChangeFindMode = this.findController.onDidChangeMode, this.onDidChangeFindMatchType = this.findController.onDidChangeMatchType;
    } else this.onDidChangeFindOpenState = this.tree.onDidChangeFindOpenState, this.onDidChangeFindMode = this.tree.onDidChangeFindMode, this.onDidChangeFindMatchType = this.tree.onDidChangeFindMatchType;
  }
  createTree(e206, t10, n10, r10, i10) {
    return new DB(e206, t10, new dz(n10), r10.map((e207) => new IB(e207, this.nodeMapper, this._onDidChangeNodeSlowState.event)), WB(i10) || {});
  }
  updateOptions(e206 = {}) {
    this.findController && (e206.defaultFindMode !== void 0 && (this.findController.mode = e206.defaultFindMode), e206.defaultFindMatchType !== void 0 && (this.findController.matchType = e206.defaultFindMatchType)), this.tree.updateOptions(e206);
  }
  getHTMLElement() {
    return this.tree.getHTMLElement();
  }
  get scrollTop() {
    return this.tree.scrollTop;
  }
  set scrollTop(e206) {
    this.tree.scrollTop = e206;
  }
  get scrollHeight() {
    return this.tree.scrollHeight;
  }
  get renderHeight() {
    return this.tree.renderHeight;
  }
  domFocus() {
    this.tree.domFocus();
  }
  layout(e206, t10) {
    this.tree.layout(e206, t10);
  }
  style(e206) {
    this.tree.style(e206);
  }
  getInput() {
    return this.root.element;
  }
  async setInput(e206, t10) {
    this.cancelAllRefreshPromises(), this.root.element = e206;
    let n10 = t10 && { viewState: t10, focus: [], selection: [] };
    await this._updateChildren(e206, true, false, n10), n10 && (this.tree.setFocus(n10.focus), this.tree.setSelection(n10.selection)), t10 && typeof t10.scrollTop == `number` && (this.scrollTop = t10.scrollTop);
  }
  cancelAllRefreshPromises(e206 = false) {
    this.refreshPromises.forEach((e207) => e207.cancel()), this.refreshPromises.clear(), e206 && (this.subTreeRefreshPromises.forEach((e207) => e207.cancel()), this.subTreeRefreshPromises.clear());
  }
  async _updateChildren(e206 = this.root.element, t10 = true, n10 = false, r10, i10) {
    if (this.root.element === void 0) throw new tz(this.user, `Tree input not set`);
    this.root.refreshPromise && (await this.root.refreshPromise, await O.toPromise(this._onDidRender.event));
    let a10 = this.getDataNode(e206);
    if (await this.refreshAndRenderNode(a10, t10, r10, i10), n10) try {
      this.tree.rerender(a10);
    } catch {
    }
  }
  rerender(e206) {
    if (e206 === void 0 || e206 === this.root.element) {
      this.tree.rerender();
      return;
    }
    let t10 = this.getDataNode(e206);
    this.tree.rerender(t10);
  }
  getNode(e206 = this.root.element) {
    let t10 = this.getDataNode(e206), n10 = this.tree.getNode(t10 === this.root ? null : t10);
    return this.nodeMapper.map(n10);
  }
  collapse(e206, t10 = false) {
    let n10 = this.getDataNode(e206);
    return this.tree.collapse(n10 === this.root ? null : n10, t10);
  }
  async expand(e206, t10 = false) {
    if (this.root.element === void 0) throw new tz(this.user, `Tree input not set`);
    this.root.refreshPromise && (await this.root.refreshPromise, await O.toPromise(this._onDidRender.event));
    let n10 = this.getDataNode(e206);
    if (this.tree.hasElement(n10) && !this.tree.isCollapsible(n10) || (n10.refreshPromise && (await n10.refreshPromise, await O.toPromise(this._onDidRender.event)), n10 !== this.root && !n10.refreshPromise && !this.tree.isCollapsed(n10))) return false;
    let r10 = this.tree.expand(n10 === this.root ? null : n10, t10);
    return n10.refreshPromise && (await n10.refreshPromise, await O.toPromise(this._onDidRender.event)), r10;
  }
  setSelection(e206, t10) {
    let n10 = e206.map((e207) => this.getDataNode(e207));
    this.tree.setSelection(n10, t10);
  }
  getSelection() {
    return this.tree.getSelection().map((e206) => e206.element);
  }
  setFocus(e206, t10) {
    let n10 = e206.map((e207) => this.getDataNode(e207));
    this.tree.setFocus(n10, t10);
  }
  getFocus() {
    return this.tree.getFocus().map((e206) => e206.element);
  }
  reveal(e206, t10) {
    this.tree.reveal(this.getDataNode(e206), t10);
  }
  getParentElement(e206) {
    let t10 = this.tree.getParentElement(this.getDataNode(e206));
    return t10 && t10.element;
  }
  getFirstElementChild(e206 = this.root.element) {
    let t10 = this.getDataNode(e206), n10 = this.tree.getFirstElementChild(t10 === this.root ? null : t10);
    return n10 && n10.element;
  }
  getDataNode(e206) {
    let t10 = this.nodes.get(e206 === this.root.element ? null : e206);
    if (!t10) {
      let t11 = this.identityProvider?.getId(e206).toString();
      throw new tz(this.user, `Data tree node not found${t11 ? `: ${t11}` : ``}`);
    }
    return t10;
  }
  async refreshAndRenderNode(e206, t10, n10, r10) {
    this.disposables.isDisposed || (await this.refreshNode(e206, t10, n10), !this.disposables.isDisposed && this.render(e206, n10, r10));
  }
  async refreshNode(e206, t10, n10) {
    let r10;
    if (this.subTreeRefreshPromises.forEach((i10, a10) => {
      !r10 && PB(a10, e206) && (r10 = i10.then(() => this.refreshNode(e206, t10, n10)));
    }), r10) return r10;
    if (e206 !== this.root && this.tree.getNode(e206).collapsed) {
      e206.hasChildren = !!this.dataSource.hasChildren(e206.element), e206.stale = true, this.setChildren(e206, [], t10, n10);
      return;
    }
    return this.doRefreshSubTree(e206, t10, n10);
  }
  async doRefreshSubTree(e206, t10, n10) {
    let r10 = es(async () => {
      let r11 = await this.doRefreshNode(e206, t10, n10);
      e206.stale = false, await gs.settled(r11.map((e207) => this.doRefreshSubTree(e207, t10, n10)));
    });
    return e206.refreshPromise = r10, this.subTreeRefreshPromises.set(e206, r10), r10.finally(() => {
      e206.refreshPromise = void 0, this.subTreeRefreshPromises.delete(e206);
    }), r10;
  }
  async doRefreshNode(e206, t10, n10) {
    e206.hasChildren = !!this.dataSource.hasChildren(e206.element);
    let r10;
    if (!e206.hasChildren) r10 = Promise.resolve(Ut.empty());
    else {
      let t11 = this.doGetChildren(e206);
      if (Ue(t11)) r10 = Promise.resolve(t11);
      else {
        let n11 = is(800);
        n11.then(() => {
          e206.slow = true, this._onDidChangeNodeSlowState.fire(e206);
        }, (e207) => null), r10 = t11.finally(() => n11.cancel());
      }
    }
    try {
      let i10 = await r10;
      return this.setChildren(e206, i10, t10, n10);
    } catch (t11) {
      if (e206 !== this.root && this.tree.hasElement(e206) && this.tree.collapse(e206), we(t11)) return [];
      throw t11;
    } finally {
      e206.slow && (e206.slow = false, this._onDidChangeNodeSlowState.fire(e206));
    }
  }
  doGetChildren(e206) {
    let t10 = this.refreshPromises.get(e206);
    if (t10) return t10;
    let n10 = this.dataSource.getChildren(e206.element);
    return Ue(n10) ? this.processChildren(n10) : (t10 = es(async () => this.processChildren(await n10)), this.refreshPromises.set(e206, t10), t10.finally(() => {
      this.refreshPromises.delete(e206);
    }));
  }
  _onDidChangeCollapseState({ node: e206, deep: t10 }) {
    e206.element !== null && !e206.collapsed && e206.element.stale && (t10 ? this.collapse(e206.element.element) : this.refreshAndRenderNode(e206.element, false).catch(be));
  }
  setChildren(e206, t10, n10, r10) {
    let i10 = [...t10];
    if (e206.children.length === 0 && i10.length === 0) return [];
    let a10 = /* @__PURE__ */ new Map(), o10 = /* @__PURE__ */ new Map();
    for (let t11 of e206.children) a10.set(t11.element, t11), this.identityProvider && o10.set(t11.id, { node: t11, collapsed: this.tree.hasElement(t11) && this.tree.isCollapsed(t11) });
    let s10 = [], c10 = i10.map((t11) => {
      let i11 = !!this.dataSource.hasChildren(t11);
      if (!this.identityProvider) {
        let n11 = MB({ element: t11, parent: e206, hasChildren: i11, defaultCollapseState: this.getDefaultCollapseState(t11) });
        return i11 && n11.defaultCollapseState === $R.PreserveOrExpanded && s10.push(n11), n11;
      }
      let c11 = this.identityProvider.getId(t11).toString(), l10 = o10.get(c11);
      if (l10) {
        let e207 = l10.node;
        return a10.delete(e207.element), this.nodes.delete(e207.element), this.nodes.set(t11, e207), e207.element = t11, e207.hasChildren = i11, n10 ? l10.collapsed ? (e207.children.forEach((e208) => GB(e208, (e209) => this.nodes.delete(e209.element))), e207.children.splice(0, e207.children.length), e207.stale = true) : s10.push(e207) : i11 && !l10.collapsed && s10.push(e207), e207;
      }
      let u10 = MB({ element: t11, parent: e206, id: c11, hasChildren: i11, defaultCollapseState: this.getDefaultCollapseState(t11) });
      return r10 && r10.viewState.focus && r10.viewState.focus.indexOf(c11) > -1 && r10.focus.push(u10), r10 && r10.viewState.selection && r10.viewState.selection.indexOf(c11) > -1 && r10.selection.push(u10), (r10 && r10.viewState.expanded && r10.viewState.expanded.indexOf(c11) > -1 || i11 && u10.defaultCollapseState === $R.PreserveOrExpanded) && s10.push(u10), u10;
    });
    for (let e207 of a10.values()) GB(e207, (e208) => this.nodes.delete(e208.element));
    for (let e207 of c10) this.nodes.set(e207.element, e207);
    return ae(e206.children, 0, e206.children.length, c10), e206 !== this.root && this.autoExpandSingleChildren && c10.length === 1 && s10.length === 0 && (c10[0].forceExpanded = true, s10.push(c10[0])), s10;
  }
  render(e206, t10, n10) {
    let r10 = e206.children.map((e207) => this.asTreeElement(e207, t10)), i10 = n10 && { ...n10, diffIdentityProvider: n10.diffIdentityProvider && { getId(e207) {
      return n10.diffIdentityProvider.getId(e207.element);
    } } };
    this.tree.setChildren(e206 === this.root ? null : e206, r10, i10), e206 !== this.root && this.tree.setCollapsible(e206, e206.hasChildren), this._onDidRender.fire();
  }
  asTreeElement(e206, t10) {
    if (e206.stale) return { element: e206, collapsible: e206.hasChildren, collapsed: true };
    let n10;
    return t10 && t10.viewState.expanded && e206.id && t10.viewState.expanded.indexOf(e206.id) > -1 ? n10 = false : e206.forceExpanded ? (n10 = false, e206.forceExpanded = false) : n10 = e206.defaultCollapseState, { element: e206, children: e206.hasChildren ? Ut.map(e206.children, (e207) => this.asTreeElement(e207, t10)) : [], collapsible: e206.hasChildren, collapsed: n10 };
  }
  processChildren(e206) {
    return this.sorter && (e206 = [...e206].sort(this.sorter.compare.bind(this.sorter))), e206;
  }
  dispose() {
    this.disposables.dispose(), this.tree.dispose();
  }
}, qB = class e151 {
  get element() {
    return { elements: this.node.element.elements.map((e206) => e206.element), incompressible: this.node.element.incompressible };
  }
  get children() {
    return this.node.children.map((t10) => new e151(t10));
  }
  get depth() {
    return this.node.depth;
  }
  get visibleChildrenCount() {
    return this.node.visibleChildrenCount;
  }
  get visibleChildIndex() {
    return this.node.visibleChildIndex;
  }
  get collapsible() {
    return this.node.collapsible;
  }
  get collapsed() {
    return this.node.collapsed;
  }
  get visible() {
    return this.node.visible;
  }
  get filterData() {
    return this.node.filterData;
  }
  constructor(e206) {
    this.node = e206;
  }
}, JB = class {
  constructor(e206, t10, n10, r10) {
    this.renderer = e206, this.nodeMapper = t10, this.compressibleNodeMapperProvider = n10, this.onDidChangeTwistieState = r10, this.renderedNodes = /* @__PURE__ */ new Map(), this.disposables = [], this.templateId = e206.templateId;
  }
  renderTemplate(e206) {
    return { templateData: this.renderer.renderTemplate(e206) };
  }
  renderElement(e206, t10, n10, r10) {
    this.renderer.renderElement(this.nodeMapper.map(e206), t10, n10.templateData, r10);
  }
  renderCompressedElements(e206, t10, n10, r10) {
    this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e206), t10, n10.templateData, r10);
  }
  renderTwistie(e206, t10) {
    return e206.slow ? (t10.classList.add(...ju.asClassNameArray(F.treeItemLoading)), true) : (t10.classList.remove(...ju.asClassNameArray(F.treeItemLoading)), false);
  }
  disposeElement(e206, t10, n10, r10) {
    this.renderer.disposeElement?.(this.nodeMapper.map(e206), t10, n10.templateData, r10);
  }
  disposeCompressedElements(e206, t10, n10, r10) {
    this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e206), t10, n10.templateData, r10);
  }
  disposeTemplate(e206) {
    this.renderer.disposeTemplate(e206.templateData);
  }
  dispose() {
    this.renderedNodes.clear(), this.disposables = Kt(this.disposables);
  }
};
function YB(e206) {
  let t10 = e206 && WB(e206);
  return t10 && { ...t10, keyboardNavigationLabelProvider: t10.keyboardNavigationLabelProvider && { ...t10.keyboardNavigationLabelProvider, getCompressedNodeKeyboardNavigationLabel(t11) {
    return e206.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t11.map((e207) => e207.element));
  } }, stickyScrollDelegate: t10.stickyScrollDelegate };
}
var XB = class extends KB {
  constructor(e206, t10, n10, r10, i10, a10, o10 = {}) {
    super(e206, t10, n10, i10, a10, o10), this.compressionDelegate = r10, this.compressibleNodeMapper = new nz((e207) => new qB(e207)), this.filter = o10.filter;
  }
  createTree(e206, t10, n10, r10, i10) {
    return new jB(e206, t10, new dz(n10), r10.map((e207) => new JB(e207, this.nodeMapper, () => this.compressibleNodeMapper, this._onDidChangeNodeSlowState.event)), YB(i10) || {});
  }
  asTreeElement(e206, t10) {
    return { incompressible: this.compressionDelegate.isIncompressible(e206.element), ...super.asTreeElement(e206, t10) };
  }
  render(e206, t10, n10) {
    if (!this.identityProvider) return super.render(e206, t10);
    let r10 = (e207) => this.identityProvider.getId(e207).toString(), i10 = (e207) => {
      let t11 = /* @__PURE__ */ new Set();
      for (let n11 of e207) {
        let e208 = this.tree.getCompressedTreeNode(n11 === this.root ? null : n11);
        if (e208.element) for (let n12 of e208.element.elements) t11.add(r10(n12.element));
      }
      return t11;
    }, a10 = i10(this.tree.getSelection()), o10 = i10(this.tree.getFocus());
    super.render(e206, t10, n10);
    let s10 = this.getSelection(), c10 = false, l10 = this.getFocus(), u10 = false, d10 = (e207) => {
      let t11 = e207.element;
      if (t11) for (let e208 = 0; e208 < t11.elements.length; e208++) {
        let n11 = r10(t11.elements[e208].element), i11 = t11.elements[t11.elements.length - 1].element;
        a10.has(n11) && s10.indexOf(i11) === -1 && (s10.push(i11), c10 = true), o10.has(n11) && l10.indexOf(i11) === -1 && (l10.push(i11), u10 = true);
      }
      e207.children.forEach(d10);
    };
    d10(this.tree.getCompressedTreeNode(e206 === this.root ? null : e206)), c10 && this.setSelection(s10), u10 && this.setFocus(l10);
  }
  processChildren(e206) {
    return this.filter && (e206 = Ut.filter(e206, (e207) => {
      let t10 = ZB(this.filter.filter(e207, 1));
      if (t10 === 2) throw Error(`Recursive tree visibility not supported in async data compressed trees`);
      return t10 === 1;
    })), super.processChildren(e206);
  }
};
function ZB(e206) {
  return typeof e206 == `boolean` ? +!!e206 : rz(e206) ? iz(e206.visibility) : iz(e206);
}
var QB = class extends Iz {
  constructor(e206, t10, n10, r10, i10, a10 = {}) {
    super(e206, t10, n10, r10, a10), this.user = e206, this.dataSource = i10, this.identityProvider = a10.identityProvider;
  }
  createModel(e206, t10) {
    return new mB(e206, t10);
  }
};
new U(`isMac`, Tt, C(1684, `Whether the operating system is macOS`)), new U(`isLinux`, Et, C(1685, `Whether the operating system is Linux`));
var $B = new U(`isWindows`, wt, C(1686, `Whether the operating system is Windows`)), eV = new U(`isWeb`, Ot, C(1687, `Whether the platform is a web browser`));
new U(`isMacNative`, Tt && !Ot, C(1688, `Whether the operating system is macOS on a non-browser platform`)), new U(`isIOS`, kt, C(1689, `Whether the operating system is iOS`)), new U(`isMobile`, At, C(1690, `Whether the platform is a mobile web browser`)), new U(`isDevelopment`, false, true), new U(`productQualityType`, ``, C(1691, `Quality type of VS Code`));
var tV = `inputFocus`, nV = new U(tV, false, C(1692, `Whether keyboard focus is inside an input box`)), rV = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, iV = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, aV = xu(`listService`), oV = class {
  get lastFocusedList() {
    return this._lastFocusedWidget;
  }
  constructor() {
    this.disposables = new E(), this.lists = [], this._lastFocusedWidget = void 0;
  }
  setLastFocusedList(e206) {
    e206 !== this._lastFocusedWidget && (this._lastFocusedWidget?.getHTMLElement().classList.remove(`last-focused`), this._lastFocusedWidget = e206, this._lastFocusedWidget?.getHTMLElement().classList.add(`last-focused`));
  }
  register(e206, t10) {
    if (this.lists.some((t11) => t11.widget === e206)) throw Error(`Cannot register the same widget multiple times`);
    let n10 = { widget: e206, extraContextKeys: t10 };
    return this.lists.push(n10), Al(e206.getHTMLElement()) && this.setLastFocusedList(e206), qt(e206.onDidFocus(() => this.setLastFocusedList(e206)), T(() => this.lists.splice(this.lists.indexOf(n10), 1)), e206.onDidDispose(() => {
      this.lists = this.lists.filter((e207) => e207 !== n10), this._lastFocusedWidget === e206 && this.setLastFocusedList(void 0);
    }));
  }
  dispose() {
    this.disposables.dispose();
  }
}, sV = new U(`listScrollAtBoundary`, `none`);
H.or(sV.isEqualTo(`top`), sV.isEqualTo(`both`)), H.or(sV.isEqualTo(`bottom`), sV.isEqualTo(`both`));
var cV = new U(`listFocus`, true), lV = new U(`treestickyScrollFocused`, false), uV = new U(`listSupportsMultiselect`, true), dV = H.and(cV, H.not(tV), lV.negate()), fV = new U(`listHasSelectionOrFocus`, false), pV = new U(`listDoubleSelection`, false), mV = new U(`listMultiSelection`, false), hV = new U(`listSelectionNavigation`, false), gV = new U(`listSupportsFind`, true), _V2 = new U(`treeElementCanCollapse`, false), vV = new U(`treeElementHasParent`, false), yV = new U(`treeElementCanExpand`, false), bV = new U(`treeElementHasChild`, false), xV = new U(`treeFindOpen`, false), SV = `listTypeNavigationMode`, CV = `listAutomaticKeyboardNavigation`;
function wV(e206, t10) {
  let n10 = e206.createScoped(t10.getHTMLElement());
  return cV.bindTo(n10), n10;
}
function TV(e206, t10) {
  let n10 = sV.bindTo(e206), r10 = () => {
    let e207 = t10.scrollTop === 0, r11 = t10.scrollHeight - t10.renderHeight - t10.scrollTop < 1;
    e207 && r11 ? n10.set(`both`) : e207 ? n10.set(`top`) : r11 ? n10.set(`bottom`) : n10.set(`none`);
  };
  return r10(), t10.onDidScroll(r10);
}
var EV = `workbench.list.multiSelectModifier`, DV = `workbench.list.openMode`, OV = `workbench.list.horizontalScrolling`, kV = `workbench.list.defaultFindMode`, AV = `workbench.list.typeNavigationMode`, jV = `workbench.list.keyboardNavigation`, MV = `workbench.list.scrollByPage`, NV = `workbench.list.defaultFindMatchType`, PV = `workbench.tree.indent`, FV = `workbench.tree.renderIndentGuides`, IV = `workbench.list.smoothScrolling`, LV = `workbench.list.mouseWheelScrollSensitivity`, RV = `workbench.list.fastScrollSensitivity`, zV = `workbench.tree.expandMode`, BV = `workbench.tree.enableStickyScroll`, VV = `workbench.tree.stickyScrollMaxItemCount`;
function HV(e206) {
  return e206.getValue(EV) === `alt`;
}
var UV = class extends D {
  constructor(e206) {
    super(), this.configurationService = e206, this.useAltAsMultipleSelectionModifier = HV(e206), this.registerListeners();
  }
  registerListeners() {
    this._register(this.configurationService.onDidChangeConfiguration((e206) => {
      e206.affectsConfiguration(EV) && (this.useAltAsMultipleSelectionModifier = HV(this.configurationService));
    }));
  }
  isSelectionSingleChangeEvent(e206) {
    return this.useAltAsMultipleSelectionModifier ? e206.browserEvent.altKey : qI(e206);
  }
  isSelectionRangeChangeEvent(e206) {
    return JI(e206);
  }
};
function WV(e206, t10) {
  let n10 = e206.get(Uf), r10 = e206.get(Dw), i10 = new E();
  return [{ ...t10, keyboardNavigationDelegate: { mightProducePrintableCharacter(e207) {
    return r10.mightProducePrintableCharacter(e207);
  } }, smoothScrolling: !!n10.getValue(IV), mouseWheelScrollSensitivity: n10.getValue(LV), fastScrollSensitivity: n10.getValue(RV), multipleSelectionController: t10.multipleSelectionController ?? i10.add(new UV(n10)), keyboardNavigationEventFilter: QV(r10), scrollByPage: !!n10.getValue(MV) }, i10];
}
var GV = class extends $I {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let l10 = i10.horizontalScrolling === void 0 ? !!s10.getValue(OV) : i10.horizontalScrolling, [u10, d10] = c10.invokeFunction(WV, i10);
    super(e206, t10, n10, r10, { keyboardSupport: false, ...u10, horizontalScrolling: l10 }), this.disposables.add(d10), this.contextKeyService = wV(a10, this), this.disposables.add(TV(this.contextKeyService, this)), this.listSupportsMultiSelect = uV.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(i10.multipleSelectionSupport !== false), hV.bindTo(this.contextKeyService).set(!!i10.selectionNavigation), this.listHasSelectionOrFocus = fV.bindTo(this.contextKeyService), this.listDoubleSelection = pV.bindTo(this.contextKeyService), this.listMultiSelection = mV.bindTo(this.contextKeyService), this.horizontalScrolling = i10.horizontalScrolling, this._useAltAsMultipleSelectionModifier = HV(s10), this.disposables.add(this.contextKeyService), this.disposables.add(o10.register(this)), this.updateStyles(i10.overrideStyles), this.disposables.add(this.onDidChangeSelection(() => {
      let e207 = this.getSelection(), t11 = this.getFocus();
      this.contextKeyService.bufferChangeEvents(() => {
        this.listHasSelectionOrFocus.set(e207.length > 0 || t11.length > 0), this.listMultiSelection.set(e207.length > 1), this.listDoubleSelection.set(e207.length === 2);
      });
    })), this.disposables.add(this.onDidChangeFocus(() => {
      let e207 = this.getSelection(), t11 = this.getFocus();
      this.listHasSelectionOrFocus.set(e207.length > 0 || t11.length > 0);
    })), this.disposables.add(s10.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(EV) && (this._useAltAsMultipleSelectionModifier = HV(s10));
      let t11 = {};
      if (e207.affectsConfiguration(OV) && this.horizontalScrolling === void 0) {
        let e208 = !!s10.getValue(OV);
        t11 = { ...t11, horizontalScrolling: e208 };
      }
      if (e207.affectsConfiguration(MV)) {
        let e208 = !!s10.getValue(MV);
        t11 = { ...t11, scrollByPage: e208 };
      }
      if (e207.affectsConfiguration(IV)) {
        let e208 = !!s10.getValue(IV);
        t11 = { ...t11, smoothScrolling: e208 };
      }
      if (e207.affectsConfiguration(LV)) {
        let e208 = s10.getValue(LV);
        t11 = { ...t11, mouseWheelScrollSensitivity: e208 };
      }
      if (e207.affectsConfiguration(RV)) {
        let e208 = s10.getValue(RV);
        t11 = { ...t11, fastScrollSensitivity: e208 };
      }
      Object.keys(t11).length > 0 && this.updateOptions(t11);
    })), this.navigator = new YV(this, { configurationService: s10, ...i10 }), this.disposables.add(this.navigator);
  }
  updateOptions(e206) {
    super.updateOptions(e206), e206.overrideStyles !== void 0 && this.updateStyles(e206.overrideStyles), e206.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e206.multipleSelectionSupport);
  }
  updateStyles(e206) {
    this.style(e206 ? dL(e206) : uL);
  }
};
GV = rV([iV(5, nd), iV(6, aV), iV(7, Uf), iV(8, V)], GV);
var KV = class extends Wz {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let l10 = i10.horizontalScrolling === void 0 ? !!s10.getValue(OV) : i10.horizontalScrolling, [u10, d10] = c10.invokeFunction(WV, i10);
    super(e206, t10, n10, r10, { keyboardSupport: false, ...u10, horizontalScrolling: l10 }), this.disposables = new E(), this.disposables.add(d10), this.contextKeyService = wV(a10, this), this.disposables.add(TV(this.contextKeyService, this.widget)), this.horizontalScrolling = i10.horizontalScrolling, this.listSupportsMultiSelect = uV.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(i10.multipleSelectionSupport !== false), hV.bindTo(this.contextKeyService).set(!!i10.selectionNavigation), this._useAltAsMultipleSelectionModifier = HV(s10), this.disposables.add(this.contextKeyService), this.disposables.add(o10.register(this)), this.updateStyles(i10.overrideStyles), this.disposables.add(s10.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(EV) && (this._useAltAsMultipleSelectionModifier = HV(s10));
      let t11 = {};
      if (e207.affectsConfiguration(OV) && this.horizontalScrolling === void 0) {
        let e208 = !!s10.getValue(OV);
        t11 = { ...t11, horizontalScrolling: e208 };
      }
      if (e207.affectsConfiguration(MV)) {
        let e208 = !!s10.getValue(MV);
        t11 = { ...t11, scrollByPage: e208 };
      }
      if (e207.affectsConfiguration(IV)) {
        let e208 = !!s10.getValue(IV);
        t11 = { ...t11, smoothScrolling: e208 };
      }
      if (e207.affectsConfiguration(LV)) {
        let e208 = s10.getValue(LV);
        t11 = { ...t11, mouseWheelScrollSensitivity: e208 };
      }
      if (e207.affectsConfiguration(RV)) {
        let e208 = s10.getValue(RV);
        t11 = { ...t11, fastScrollSensitivity: e208 };
      }
      Object.keys(t11).length > 0 && this.updateOptions(t11);
    })), this.navigator = new YV(this, { configurationService: s10, ...i10 }), this.disposables.add(this.navigator);
  }
  updateOptions(e206) {
    super.updateOptions(e206), e206.overrideStyles !== void 0 && this.updateStyles(e206.overrideStyles), e206.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e206.multipleSelectionSupport);
  }
  updateStyles(e206) {
    this.style(e206 ? dL(e206) : uL);
  }
  dispose() {
    this.disposables.dispose(), super.dispose();
  }
};
KV = rV([iV(5, nd), iV(6, aV), iV(7, Uf), iV(8, V)], KV);
var qV = class extends pB {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    let u10 = a10.horizontalScrolling === void 0 ? !!c10.getValue(OV) : a10.horizontalScrolling, [d10, f10] = l10.invokeFunction(WV, a10);
    super(e206, t10, n10, r10, i10, { keyboardSupport: false, ...d10, horizontalScrolling: u10 }), this.disposables.add(f10), this.contextKeyService = wV(o10, this), this.disposables.add(TV(this.contextKeyService, this)), this.listSupportsMultiSelect = uV.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(a10.multipleSelectionSupport !== false), hV.bindTo(this.contextKeyService).set(!!a10.selectionNavigation), this.listHasSelectionOrFocus = fV.bindTo(this.contextKeyService), this.listDoubleSelection = pV.bindTo(this.contextKeyService), this.listMultiSelection = mV.bindTo(this.contextKeyService), this.horizontalScrolling = a10.horizontalScrolling, this._useAltAsMultipleSelectionModifier = HV(c10), this.disposables.add(this.contextKeyService), this.disposables.add(s10.register(this)), this.updateStyles(a10.overrideStyles), this.disposables.add(this.onDidChangeSelection(() => {
      let e207 = this.getSelection(), t11 = this.getFocus();
      this.contextKeyService.bufferChangeEvents(() => {
        this.listHasSelectionOrFocus.set(e207.length > 0 || t11.length > 0), this.listMultiSelection.set(e207.length > 1), this.listDoubleSelection.set(e207.length === 2);
      });
    })), this.disposables.add(this.onDidChangeFocus(() => {
      let e207 = this.getSelection(), t11 = this.getFocus();
      this.listHasSelectionOrFocus.set(e207.length > 0 || t11.length > 0);
    })), this.disposables.add(c10.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(EV) && (this._useAltAsMultipleSelectionModifier = HV(c10));
      let t11 = {};
      if (e207.affectsConfiguration(OV) && this.horizontalScrolling === void 0) {
        let e208 = !!c10.getValue(OV);
        t11 = { ...t11, horizontalScrolling: e208 };
      }
      if (e207.affectsConfiguration(MV)) {
        let e208 = !!c10.getValue(MV);
        t11 = { ...t11, scrollByPage: e208 };
      }
      if (e207.affectsConfiguration(IV)) {
        let e208 = !!c10.getValue(IV);
        t11 = { ...t11, smoothScrolling: e208 };
      }
      if (e207.affectsConfiguration(LV)) {
        let e208 = c10.getValue(LV);
        t11 = { ...t11, mouseWheelScrollSensitivity: e208 };
      }
      if (e207.affectsConfiguration(RV)) {
        let e208 = c10.getValue(RV);
        t11 = { ...t11, fastScrollSensitivity: e208 };
      }
      Object.keys(t11).length > 0 && this.updateOptions(t11);
    })), this.navigator = new XV(this, { configurationService: c10, ...a10 }), this.disposables.add(this.navigator);
  }
  updateOptions(e206) {
    super.updateOptions(e206), e206.overrideStyles !== void 0 && this.updateStyles(e206.overrideStyles), e206.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e206.multipleSelectionSupport);
  }
  updateStyles(e206) {
    this.style(e206 ? dL(e206) : uL);
  }
  dispose() {
    this.disposables.dispose(), super.dispose();
  }
};
qV = rV([iV(6, nd), iV(7, aV), iV(8, Uf), iV(9, V)], qV);
var JV = class extends D {
  constructor(e206, t10) {
    super(), this.widget = e206, this._onDidOpen = this._register(new k()), this.onDidOpen = this._onDidOpen.event, this._register(O.filter(this.widget.onDidChangeSelection, (e207) => zl(e207.browserEvent))((e207) => this.onSelectionFromKeyboard(e207))), this._register(this.widget.onPointer((e207) => this.onPointer(e207.element, e207.browserEvent))), this._register(this.widget.onMouseDblClick((e207) => this.onMouseDblClick(e207.element, e207.browserEvent))), typeof t10?.openOnSingleClick != `boolean` && t10?.configurationService ? (this.openOnSingleClick = t10?.configurationService.getValue(DV) !== `doubleClick`, this._register(t10?.configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(DV) && (this.openOnSingleClick = t10?.configurationService.getValue(DV) !== `doubleClick`);
    }))) : this.openOnSingleClick = t10?.openOnSingleClick ?? true;
  }
  onSelectionFromKeyboard(e206) {
    if (e206.elements.length !== 1) return;
    let t10 = e206.browserEvent, n10 = typeof t10.preserveFocus == `boolean` ? t10.preserveFocus : true, r10 = typeof t10.pinned == `boolean` ? t10.pinned : !n10;
    this._open(this.getSelectedElement(), n10, r10, false, e206.browserEvent);
  }
  onPointer(e206, t10) {
    if (!this.openOnSingleClick || t10.detail === 2) return;
    let n10 = t10.button === 1, r10 = t10.ctrlKey || t10.metaKey || t10.altKey;
    this._open(e206, true, n10, r10, t10);
  }
  onMouseDblClick(e206, t10) {
    if (!t10) return;
    let n10 = t10.target;
    if (n10.classList.contains(`monaco-tl-twistie`) || n10.classList.contains(`monaco-icon-label`) && n10.classList.contains(`folder-icon`) && t10.offsetX < 16) return;
    let r10 = t10.ctrlKey || t10.metaKey || t10.altKey;
    this._open(e206, false, true, r10, t10);
  }
  _open(e206, t10, n10, r10, i10) {
    e206 && this._onDidOpen.fire({ editorOptions: { preserveFocus: t10, pinned: n10, revealIfVisible: true }, sideBySide: r10, element: e206, browserEvent: i10 });
  }
}, YV = class extends JV {
  constructor(e206, t10) {
    super(e206, t10), this.widget = e206;
  }
  getSelectedElement() {
    return this.widget.getSelectedElements()[0];
  }
}, XV = class extends JV {
  constructor(e206, t10) {
    super(e206, t10);
  }
  getSelectedElement() {
    return this.widget.getSelectedElements()[0];
  }
}, ZV = class extends JV {
  constructor(e206, t10) {
    super(e206, t10);
  }
  getSelectedElement() {
    return this.widget.getSelection()[0] ?? void 0;
  }
};
function QV(e206) {
  let t10 = false;
  return (n10) => {
    if (n10.toKeyCodeChord().isModifierKey()) return false;
    if (t10) return t10 = false, false;
    let r10 = e206.softDispatch(n10, n10.target);
    return r10.kind === 1 ? (t10 = true, false) : (t10 = false, r10.kind === 0);
  };
}
var $V = class extends DB {
  get onDidOpen() {
    return this.internals.onDidOpen;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let { options: l10, getTypeNavigationMode: u10, disposable: d10 } = a10.invokeFunction(oH, i10);
    super(e206, t10, n10, r10, l10), this.disposables.add(d10), this.internals = new sH(this, i10, u10, i10.overrideStyles, o10, s10, c10), this.disposables.add(this.internals);
  }
  updateOptions(e206) {
    super.updateOptions(e206), this.internals.updateOptions(e206);
  }
};
$V = rV([iV(5, V), iV(6, nd), iV(7, aV), iV(8, Uf)], $V);
var eH = class extends jB {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let { options: l10, getTypeNavigationMode: u10, disposable: d10 } = a10.invokeFunction(oH, i10);
    super(e206, t10, n10, r10, l10), this.disposables.add(d10), this.internals = new sH(this, i10, u10, i10.overrideStyles, o10, s10, c10), this.disposables.add(this.internals);
  }
  updateOptions(e206 = {}) {
    super.updateOptions(e206), e206.overrideStyles && this.internals.updateStyleOverrides(e206.overrideStyles), this.internals.updateOptions(e206);
  }
};
eH = rV([iV(5, V), iV(6, nd), iV(7, aV), iV(8, Uf)], eH);
var tH = class extends QB {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    let { options: u10, getTypeNavigationMode: d10, disposable: f10 } = o10.invokeFunction(oH, a10);
    super(e206, t10, n10, r10, i10, u10), this.disposables.add(f10), this.internals = new sH(this, a10, d10, a10.overrideStyles, s10, c10, l10), this.disposables.add(this.internals);
  }
  updateOptions(e206 = {}) {
    super.updateOptions(e206), e206.overrideStyles !== void 0 && this.internals.updateStyleOverrides(e206.overrideStyles), this.internals.updateOptions(e206);
  }
};
tH = rV([iV(6, V), iV(7, nd), iV(8, aV), iV(9, Uf)], tH);
var nH = class extends KB {
  get onDidOpen() {
    return this.internals.onDidOpen;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    let { options: u10, getTypeNavigationMode: d10, disposable: f10 } = o10.invokeFunction(oH, a10);
    super(e206, t10, n10, r10, i10, u10), this.disposables.add(f10), this.internals = new sH(this, a10, d10, a10.overrideStyles, s10, c10, l10), this.disposables.add(this.internals);
  }
  updateOptions(e206 = {}) {
    super.updateOptions(e206), e206.overrideStyles && this.internals.updateStyleOverrides(e206.overrideStyles), this.internals.updateOptions(e206);
  }
};
nH = rV([iV(6, V), iV(7, nd), iV(8, aV), iV(9, Uf)], nH);
var rH = class extends XB {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    let { options: d10, getTypeNavigationMode: f10, disposable: p10 } = s10.invokeFunction(oH, o10);
    super(e206, t10, n10, r10, i10, a10, d10), this.disposables.add(p10), this.internals = new sH(this, o10, f10, o10.overrideStyles, c10, l10, u10), this.disposables.add(this.internals);
  }
  updateOptions(e206) {
    super.updateOptions(e206), this.internals.updateOptions(e206);
  }
};
rH = rV([iV(7, V), iV(8, nd), iV(9, aV), iV(10, Uf)], rH);
function iH(e206) {
  let t10 = e206.getValue(kV);
  if (t10 === `highlight`) return vz.Highlight;
  if (t10 === `filter`) return vz.Filter;
  let n10 = e206.getValue(jV);
  if (n10 === `simple` || n10 === `highlight`) return vz.Highlight;
  if (n10 === `filter`) return vz.Filter;
}
function aH(e206) {
  let t10 = e206.getValue(NV);
  if (t10 === `fuzzy`) return yz.Fuzzy;
  if (t10 === `contiguous`) return yz.Contiguous;
}
function oH(e206, t10) {
  let n10 = e206.get(Uf), r10 = e206.get(pj), i10 = e206.get(nd), a10 = e206.get(V), o10 = () => {
    let e207 = i10.getContextKeyValue(SV);
    if (e207 === `automatic`) return GI.Automatic;
    if (e207 === `trigger` || i10.getContextKeyValue(CV) === false) return GI.Trigger;
    let t11 = n10.getValue(AV);
    if (t11 === `automatic`) return GI.Automatic;
    if (t11 === `trigger`) return GI.Trigger;
  }, s10 = t10.horizontalScrolling === void 0 ? !!n10.getValue(OV) : t10.horizontalScrolling, [c10, l10] = a10.invokeFunction(WV, t10), u10 = t10.paddingBottom, d10 = t10.renderIndentGuides === void 0 ? n10.getValue(FV) : t10.renderIndentGuides;
  return { getTypeNavigationMode: o10, disposable: l10, options: { keyboardSupport: false, ...c10, indent: typeof n10.getValue(PV) == `number` ? n10.getValue(PV) : void 0, renderIndentGuides: d10, smoothScrolling: !!n10.getValue(IV), defaultFindMode: t10.defaultFindMode ?? iH(n10), defaultFindMatchType: t10.defaultFindMatchType ?? aH(n10), horizontalScrolling: s10, scrollByPage: !!n10.getValue(MV), paddingBottom: u10, hideTwistiesOfChildlessElements: t10.hideTwistiesOfChildlessElements, expandOnlyOnTwistieClick: t10.expandOnlyOnTwistieClick ?? n10.getValue(zV) === `doubleClick`, contextViewProvider: r10, findWidgetStyles: o_e, enableStickyScroll: !!n10.getValue(BV), stickyScrollMaxItemCount: Number(n10.getValue(VV)) } };
}
var sH = class {
  get onDidOpen() {
    return this.navigator.onDidOpen;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.tree = e206, this.disposables = [], this.contextKeyService = wV(i10, e206), this.disposables.push(TV(this.contextKeyService, e206)), this.listSupportsMultiSelect = uV.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(t10.multipleSelectionSupport !== false), hV.bindTo(this.contextKeyService).set(!!t10.selectionNavigation), this.listSupportFindWidget = gV.bindTo(this.contextKeyService), this.listSupportFindWidget.set(t10.findWidgetEnabled ?? true), this.hasSelectionOrFocus = fV.bindTo(this.contextKeyService), this.hasDoubleSelection = pV.bindTo(this.contextKeyService), this.hasMultiSelection = mV.bindTo(this.contextKeyService), this.treeElementCanCollapse = _V2.bindTo(this.contextKeyService), this.treeElementHasParent = vV.bindTo(this.contextKeyService), this.treeElementCanExpand = yV.bindTo(this.contextKeyService), this.treeElementHasChild = bV.bindTo(this.contextKeyService), this.treeFindOpen = xV.bindTo(this.contextKeyService), this.treeStickyScrollFocused = lV.bindTo(this.contextKeyService), this._useAltAsMultipleSelectionModifier = HV(o10), this.updateStyleOverrides(r10);
    let s10 = () => {
      let t11 = e206.getFocus()[0];
      if (!t11) return;
      let n11 = e206.getNode(t11);
      this.treeElementCanCollapse.set(n11.collapsible && !n11.collapsed), this.treeElementHasParent.set(!!e206.getParentElement(t11)), this.treeElementCanExpand.set(n11.collapsible && n11.collapsed), this.treeElementHasChild.set(!!e206.getFirstElementChild(t11));
    }, c10 = /* @__PURE__ */ new Set();
    c10.add(SV), c10.add(CV), this.disposables.push(this.contextKeyService, a10.register(e206), e206.onDidChangeSelection(() => {
      let t11 = e206.getSelection(), n11 = e206.getFocus();
      this.contextKeyService.bufferChangeEvents(() => {
        this.hasSelectionOrFocus.set(t11.length > 0 || n11.length > 0), this.hasMultiSelection.set(t11.length > 1), this.hasDoubleSelection.set(t11.length === 2);
      });
    }), e206.onDidChangeFocus(() => {
      let t11 = e206.getSelection(), n11 = e206.getFocus();
      this.hasSelectionOrFocus.set(t11.length > 0 || n11.length > 0), s10();
    }), e206.onDidChangeCollapseState(s10), e206.onDidChangeModel(s10), e206.onDidChangeFindOpenState((e207) => this.treeFindOpen.set(e207)), e206.onDidChangeStickyScrollFocused((e207) => this.treeStickyScrollFocused.set(e207)), o10.onDidChangeConfiguration((r11) => {
      let i11 = {};
      if (r11.affectsConfiguration(EV) && (this._useAltAsMultipleSelectionModifier = HV(o10)), r11.affectsConfiguration(PV)) {
        let e207 = o10.getValue(PV);
        i11 = { ...i11, indent: e207 };
      }
      if (r11.affectsConfiguration(FV) && t10.renderIndentGuides === void 0) {
        let e207 = o10.getValue(FV);
        i11 = { ...i11, renderIndentGuides: e207 };
      }
      if (r11.affectsConfiguration(IV)) {
        let e207 = !!o10.getValue(IV);
        i11 = { ...i11, smoothScrolling: e207 };
      }
      if (r11.affectsConfiguration(kV) || r11.affectsConfiguration(jV)) {
        let e207 = iH(o10);
        i11 = { ...i11, defaultFindMode: e207 };
      }
      if (r11.affectsConfiguration(AV) || r11.affectsConfiguration(jV)) {
        let e207 = n10();
        i11 = { ...i11, typeNavigationMode: e207 };
      }
      if (r11.affectsConfiguration(NV)) {
        let e207 = aH(o10);
        i11 = { ...i11, defaultFindMatchType: e207 };
      }
      if (r11.affectsConfiguration(OV) && t10.horizontalScrolling === void 0) {
        let e207 = !!o10.getValue(OV);
        i11 = { ...i11, horizontalScrolling: e207 };
      }
      if (r11.affectsConfiguration(MV)) {
        let e207 = !!o10.getValue(MV);
        i11 = { ...i11, scrollByPage: e207 };
      }
      if (r11.affectsConfiguration(zV) && t10.expandOnlyOnTwistieClick === void 0 && (i11 = { ...i11, expandOnlyOnTwistieClick: o10.getValue(zV) === `doubleClick` }), r11.affectsConfiguration(BV)) {
        let e207 = o10.getValue(BV);
        i11 = { ...i11, enableStickyScroll: e207 };
      }
      if (r11.affectsConfiguration(VV)) {
        let e207 = Math.max(1, o10.getValue(VV));
        i11 = { ...i11, stickyScrollMaxItemCount: e207 };
      }
      if (r11.affectsConfiguration(LV)) {
        let e207 = o10.getValue(LV);
        i11 = { ...i11, mouseWheelScrollSensitivity: e207 };
      }
      if (r11.affectsConfiguration(RV)) {
        let e207 = o10.getValue(RV);
        i11 = { ...i11, fastScrollSensitivity: e207 };
      }
      Object.keys(i11).length > 0 && e206.updateOptions(i11);
    }), this.contextKeyService.onDidChangeContext((t11) => {
      t11.affectsSome(c10) && e206.updateOptions({ typeNavigationMode: n10() });
    })), this.navigator = new ZV(e206, { configurationService: o10, ...t10 }), this.disposables.push(this.navigator);
  }
  updateOptions(e206) {
    e206.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e206.multipleSelectionSupport);
  }
  updateStyleOverrides(e206) {
    this.tree.style(e206 ? dL(e206) : uL);
  }
  dispose() {
    this.disposables = Kt(this.disposables);
  }
};
sH = rV([iV(4, nd), iV(5, aV), iV(6, Uf)], sH), cd.as(op.Configuration).registerConfiguration({ id: `workbench`, order: 7, title: C(1705, `Workbench`), type: `object`, properties: { [EV]: { type: `string`, enum: [`ctrlCmd`, `alt`], markdownEnumDescriptions: [C(1706, "Maps to `Control` on Windows and Linux and to `Command` on macOS."), C(1707, "Maps to `Alt` on Windows and Linux and to `Option` on macOS.")], default: `ctrlCmd`, description: C(1708, `The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.`) }, [DV]: { type: `string`, enum: [`singleClick`, `doubleClick`], default: `singleClick`, description: C(1709, `Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.`) }, [OV]: { type: `boolean`, default: false, description: C(1710, `Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.`) }, [MV]: { type: `boolean`, default: false, description: C(1711, `Controls whether clicks in the scrollbar scroll page by page.`) }, [PV]: { type: `number`, default: 8, minimum: 4, maximum: 40, description: C(1712, `Controls tree indentation in pixels.`) }, [FV]: { type: `string`, enum: [`none`, `onHover`, `always`], default: `onHover`, description: C(1713, `Controls whether the tree should render indent guides.`) }, [IV]: { type: `boolean`, default: false, description: C(1714, `Controls whether lists and trees have smooth scrolling.`) }, [LV]: { type: `number`, default: 1, markdownDescription: C(1715, "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.") }, [RV]: { type: `number`, default: 5, markdownDescription: C(1716, "Scrolling speed multiplier when pressing `Alt`.") }, [kV]: { type: `string`, enum: [`highlight`, `filter`], enumDescriptions: [C(1717, `Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements.`), C(1718, `Filter elements when searching.`)], default: `highlight`, description: C(1719, `Controls the default find mode for lists and trees in the workbench.`) }, [jV]: { type: `string`, enum: [`simple`, `highlight`, `filter`], enumDescriptions: [C(1720, `Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes.`), C(1721, `Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements.`), C(1722, `Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.`)], default: `highlight`, description: C(1723, `Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.`), deprecated: true, deprecationMessage: C(1724, `Please use 'workbench.list.defaultFindMode' and	'workbench.list.typeNavigationMode' instead.`) }, [NV]: { type: `string`, enum: [`fuzzy`, `contiguous`], enumDescriptions: [C(1725, `Use fuzzy matching when searching.`), C(1726, `Use contiguous matching when searching.`)], default: `fuzzy`, description: C(1727, `Controls the type of matching used when searching lists and trees in the workbench.`) }, [zV]: { type: `string`, enum: [`singleClick`, `doubleClick`], default: `singleClick`, description: C(1728, `Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.`) }, [BV]: { type: `boolean`, default: true, description: C(1729, `Controls whether sticky scrolling is enabled in trees.`) }, [VV]: { type: `number`, minimum: 1, default: 7, markdownDescription: C(1730, `Controls the number of sticky elements displayed in the tree when {0} is enabled.`, "`#workbench.tree.enableStickyScroll#`") }, [AV]: { type: `string`, enum: [`automatic`, `trigger`], default: `automatic`, markdownDescription: C(1731, "Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.") } } });
var cH = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, lH = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, uH, dH = B, fH = class {
  constructor(e206, t10, n10) {
    this.index = e206, this.hasCheckbox = t10, this._hidden = false, this._init = new Fa(() => {
      let e207 = n10.label ?? ``;
      return { saneLabel: e207, saneSortLabel: MM(e207).text.trim(), saneAriaLabel: n10.ariaLabel || [e207, this.saneDescription, this.saneDetail].map((e208) => AM(e208)).filter((e208) => !!e208).join(`, `) };
    }), this._saneDescription = n10.description, this._saneTooltip = n10.tooltip;
  }
  get saneLabel() {
    return this._init.value.saneLabel;
  }
  get saneSortLabel() {
    return this._init.value.saneSortLabel;
  }
  get saneAriaLabel() {
    return this._init.value.saneAriaLabel;
  }
  get element() {
    return this._element;
  }
  set element(e206) {
    this._element = e206;
  }
  get hidden() {
    return this._hidden;
  }
  set hidden(e206) {
    this._hidden = e206;
  }
  get saneDescription() {
    return this._saneDescription;
  }
  set saneDescription(e206) {
    this._saneDescription = e206;
  }
  get saneDetail() {
    return this._saneDetail;
  }
  set saneDetail(e206) {
    this._saneDetail = e206;
  }
  get saneTooltip() {
    return this._saneTooltip;
  }
  set saneTooltip(e206) {
    this._saneTooltip = e206;
  }
  get labelHighlights() {
    return this._labelHighlights;
  }
  set labelHighlights(e206) {
    this._labelHighlights = e206;
  }
  get descriptionHighlights() {
    return this._descriptionHighlights;
  }
  set descriptionHighlights(e206) {
    this._descriptionHighlights = e206;
  }
  get detailHighlights() {
    return this._detailHighlights;
  }
  set detailHighlights(e206) {
    this._detailHighlights = e206;
  }
}, pH = class extends fH {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(e206, n10, a10), this.childIndex = t10, this.fireButtonTriggered = r10, this._onChecked = i10, this.item = a10, this._separator = o10, this._checked = false, this.onChecked = n10 ? O.map(O.filter(this._onChecked.event, (e207) => e207.element === this), (e207) => e207.checked) : O.None, this._saneDetail = a10.detail, this._labelHighlights = a10.highlights?.label, this._descriptionHighlights = a10.highlights?.description, this._detailHighlights = a10.highlights?.detail;
  }
  get separator() {
    return this._separator;
  }
  set separator(e206) {
    this._separator = e206;
  }
  get checked() {
    return this._checked;
  }
  set checked(e206) {
    e206 !== this._checked && (this._checked = e206, this._onChecked.fire({ element: this, checked: e206 }));
  }
  get checkboxDisabled() {
    return !!this.item.disabled;
  }
}, mH;
(function(e206) {
  e206[e206.NONE = 0] = `NONE`, e206[e206.MOUSE_HOVER = 1] = `MOUSE_HOVER`, e206[e206.ACTIVE_ITEM = 2] = `ACTIVE_ITEM`;
})(mH || (mH = {}));
var hH = class extends fH {
  constructor(e206, t10, n10) {
    super(e206, false, n10), this.fireSeparatorButtonTriggered = t10, this.separator = n10, this.children = [], this.focusInsideSeparator = mH.NONE;
  }
}, gH = class {
  getHeight(e206) {
    return e206 instanceof hH ? 30 : e206.saneDetail ? 44 : 22;
  }
  getTemplateId(e206) {
    return e206 instanceof pH ? yH.ID : bH.ID;
  }
}, _H2 = class {
  getWidgetAriaLabel() {
    return C(1770, `Quick Input`);
  }
  getAriaLabel(e206) {
    return e206.separator?.label ? `${e206.saneAriaLabel}, ${e206.separator.label}` : e206.saneAriaLabel;
  }
  getWidgetRole() {
    return `listbox`;
  }
  getRole(e206) {
    return e206.hasCheckbox ? `checkbox` : `option`;
  }
  isChecked(e206) {
    if (!(!e206.hasCheckbox || !(e206 instanceof pH))) return { get value() {
      return e206.checked;
    }, onDidChange: (t10) => e206.onChecked(() => t10()) };
  }
}, vH = class {
  constructor(e206) {
    this.hoverDelegate = e206;
  }
  renderTemplate(e206) {
    let t10 = /* @__PURE__ */ Object.create(null);
    t10.toDisposeElement = new E(), t10.toDisposeTemplate = new E(), t10.entry = z(e206, dH(`.quick-input-list-entry`));
    let n10 = z(t10.entry, dH(`label.quick-input-list-label`));
    t10.outerLabel = n10, t10.checkbox = t10.toDisposeTemplate.add(new Jt()), t10.toDisposeTemplate.add(el(n10, R.CLICK, (e207) => {
      if (t10.checkbox.value && !e207.defaultPrevented && t10.checkbox.value.enabled) {
        let e208 = !t10.checkbox.value.checked;
        t10.checkbox.value.checked = e208, t10.element.checked = e208;
      }
    }));
    let r10 = z(n10, dH(`.quick-input-list-rows`)), i10 = z(r10, dH(`.quick-input-list-row`)), a10 = z(r10, dH(`.quick-input-list-row`));
    return t10.label = new KR(i10, { supportHighlights: true, supportDescriptionHighlights: true, supportIcons: true, hoverDelegate: this.hoverDelegate }), t10.toDisposeTemplate.add(t10.label), t10.icon = ql(t10.label.element, dH(`.quick-input-list-icon`)), t10.keybinding = new QR(z(i10, dH(`.quick-input-list-entry-keybinding`)), Pt), t10.toDisposeTemplate.add(t10.keybinding), t10.detail = new KR(z(a10, dH(`.quick-input-list-label-meta`)), { supportHighlights: true, supportIcons: true, hoverDelegate: this.hoverDelegate }), t10.toDisposeTemplate.add(t10.detail), t10.separator = z(t10.entry, dH(`.quick-input-list-separator`)), t10.actionBar = new CL(t10.entry, this.hoverDelegate ? { hoverDelegate: this.hoverDelegate } : void 0), t10.actionBar.domNode.classList.add(`quick-input-list-entry-action-bar`), t10.toDisposeTemplate.add(t10.actionBar), t10;
  }
  disposeTemplate(e206) {
    e206.toDisposeElement.dispose(), e206.toDisposeTemplate.dispose();
  }
  disposeElement(e206, t10, n10) {
    n10.toDisposeElement.clear(), n10.actionBar.clear();
  }
}, yH = (_db = class extends vH {
  constructor(e206, t10) {
    super(e206), this.themeService = t10, this._itemsWithSeparatorsFrequency = /* @__PURE__ */ new Map();
  }
  get templateId() {
    return uH.ID;
  }
  ensureCheckbox(e206, t10) {
    if (!e206.hasCheckbox) {
      t10.checkbox.value?.domNode.remove(), t10.checkbox.clear();
      return;
    }
    let n10 = t10.checkbox.value;
    n10 ? n10.setTitle(e206.saneLabel) : (n10 = new aR(e206.saneLabel, e206.checked, { ...sL, size: 15 }), t10.checkbox.value = n10, t10.outerLabel.prepend(n10.domNode)), e206.checkboxDisabled ? n10.disable() : n10.enable(), n10.checked = e206.checked, t10.toDisposeElement.add(e206.onChecked((e207) => n10.checked = e207)), t10.toDisposeElement.add(n10.onChange(() => e206.checked = n10.checked));
  }
  renderElement(e206, t10, n10) {
    let r10 = e206.element;
    n10.element = r10, r10.element = n10.entry ?? void 0;
    let i10 = r10.item;
    r10.element.classList.toggle(`not-pickable`, r10.item.pickable === false), this.ensureCheckbox(r10, n10);
    let { labelHighlights: a10, descriptionHighlights: o10, detailHighlights: s10 } = r10;
    if (i10.iconPath) {
      let e207 = Ib(this.themeService.getColorTheme().type) ? i10.iconPath.dark : i10.iconPath.light ?? i10.iconPath.dark, t11 = $r.revive(e207);
      n10.icon.className = `quick-input-list-icon`, n10.icon.style.backgroundImage = _I2(t11);
    } else n10.icon.style.backgroundImage = ``, n10.icon.className = i10.iconClass ? `quick-input-list-icon ${i10.iconClass}` : ``;
    let c10;
    !r10.saneTooltip && r10.saneDescription && (c10 = { markdown: { value: Ra(r10.saneDescription), supportThemeIcons: true }, markdownNotSupportedFallback: r10.saneDescription });
    let l10 = { matches: a10 || [], descriptionTitle: c10, descriptionMatches: o10 || [], labelEscapeNewLines: true };
    if (l10.extraClasses = i10.iconClasses, l10.italic = i10.italic, l10.strikethrough = i10.strikethrough, n10.entry.classList.remove(`quick-input-list-separator-as-item`), n10.label.setLabel(r10.saneLabel, r10.saneDescription, l10), n10.keybinding.set(i10.keybinding), r10.saneDetail) {
      let e207;
      r10.saneTooltip || (e207 = { markdown: { value: Ra(r10.saneDetail), supportThemeIcons: true }, markdownNotSupportedFallback: r10.saneDetail }), n10.detail.element.style.display = ``, n10.detail.setLabel(r10.saneDetail, void 0, { matches: s10, title: e207, labelEscapeNewLines: true });
    } else n10.detail.element.style.display = `none`;
    r10.separator?.label ? (n10.separator.textContent = r10.separator.label, n10.separator.style.display = ``, this.addItemWithSeparator(r10)) : n10.separator.style.display = `none`, n10.entry.classList.toggle(`quick-input-list-separator-border`, !!r10.separator && r10.childIndex !== 0);
    let u10 = i10.buttons;
    u10 && u10.length ? (n10.actionBar.push(u10.map((e207, t11) => lR(e207, `id-${t11}`, () => r10.fireButtonTriggered({ button: e207, item: r10.item }))), { icon: true, label: false }), n10.entry.classList.add(`has-actions`)) : n10.entry.classList.remove(`has-actions`);
  }
  disposeElement(e206, t10, n10) {
    this.removeItemWithSeparator(e206.element), super.disposeElement(e206, t10, n10);
  }
  isItemWithSeparatorVisible(e206) {
    return this._itemsWithSeparatorsFrequency.has(e206);
  }
  addItemWithSeparator(e206) {
    this._itemsWithSeparatorsFrequency.set(e206, (this._itemsWithSeparatorsFrequency.get(e206) || 0) + 1);
  }
  removeItemWithSeparator(e206) {
    let t10 = this._itemsWithSeparatorsFrequency.get(e206) || 0;
    t10 > 1 ? this._itemsWithSeparatorsFrequency.set(e206, t10 - 1) : this._itemsWithSeparatorsFrequency.delete(e206);
  }
}, uH = _db, _db.ID = `quickpickitem`, _db);
yH = uH = cH([lH(1, US)], yH);
var bH = (_eb = class extends vH {
  constructor() {
    super(...arguments), this._visibleSeparatorsFrequency = /* @__PURE__ */ new Map();
  }
  get templateId() {
    return _eb.ID;
  }
  get visibleSeparators() {
    return [...this._visibleSeparatorsFrequency.keys()];
  }
  isSeparatorVisible(e206) {
    return this._visibleSeparatorsFrequency.has(e206);
  }
  renderElement(e206, t10, n10) {
    let r10 = e206.element;
    n10.element = r10, r10.element = n10.entry ?? void 0, r10.element.classList.toggle(`focus-inside`, !!r10.focusInsideSeparator);
    let i10 = r10.separator, { labelHighlights: a10, descriptionHighlights: o10 } = r10;
    n10.icon.style.backgroundImage = ``, n10.icon.className = ``;
    let s10;
    !r10.saneTooltip && r10.saneDescription && (s10 = { markdown: { value: Ra(r10.saneDescription), supportThemeIcons: true }, markdownNotSupportedFallback: r10.saneDescription });
    let c10 = { matches: a10 || [], descriptionTitle: s10, descriptionMatches: o10 || [], labelEscapeNewLines: true };
    n10.entry.classList.add(`quick-input-list-separator-as-item`), n10.label.setLabel(r10.saneLabel, r10.saneDescription, c10), n10.separator.style.display = `none`, n10.entry.classList.add(`quick-input-list-separator-border`);
    let l10 = i10.buttons;
    l10 && l10.length ? (n10.actionBar.push(l10.map((e207, t11) => lR(e207, `id-${t11}`, () => r10.fireSeparatorButtonTriggered({ button: e207, separator: r10.separator }))), { icon: true, label: false }), n10.entry.classList.add(`has-actions`)) : n10.entry.classList.remove(`has-actions`), this.addSeparator(r10);
  }
  disposeElement(e206, t10, n10) {
    this.removeSeparator(e206.element), this.isSeparatorVisible(e206.element) || e206.element.element?.classList.remove(`focus-inside`), super.disposeElement(e206, t10, n10);
  }
  addSeparator(e206) {
    this._visibleSeparatorsFrequency.set(e206, (this._visibleSeparatorsFrequency.get(e206) || 0) + 1);
  }
  removeSeparator(e206) {
    let t10 = this._visibleSeparatorsFrequency.get(e206) || 0;
    t10 > 1 ? this._visibleSeparatorsFrequency.set(e206, t10 - 1) : this._visibleSeparatorsFrequency.delete(e206);
  }
}, _eb.ID = `quickpickseparator`, _eb), xH = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this.parent = e206, this.hoverDelegate = t10, this.linkOpenerDelegate = n10, this.accessibilityService = a10, this._onKeyDown = new k(), this._onLeave = new k(), this.onLeave = this._onLeave.event, this._visibleCountObservable = Ic(`VisibleCount`, 0), this.onChangedVisibleCount = O.fromObservable(this._visibleCountObservable, this._store), this._allVisibleCheckedObservable = Ic(`AllVisibleChecked`, false), this.onChangedAllVisibleChecked = O.fromObservable(this._allVisibleCheckedObservable, this._store), this._checkedCountObservable = Ic(`CheckedCount`, 0), this.onChangedCheckedCount = O.fromObservable(this._checkedCountObservable, this._store), this._checkedElementsObservable = yD({ equalsFn: o }, []), this.onChangedCheckedElements = O.fromObservable(this._checkedElementsObservable, this._store), this._onButtonTriggered = new k(), this.onButtonTriggered = this._onButtonTriggered.event, this._onSeparatorButtonTriggered = new k(), this.onSeparatorButtonTriggered = this._onSeparatorButtonTriggered.event, this._elementChecked = new k(), this._elementCheckedEventBufferer = new dn(), this._hasCheckboxes = false, this._inputElements = [], this._elementTree = [], this._itemElements = [], this._elementDisposable = this._register(new E()), this._matchOnDescription = false, this._matchOnDetail = false, this._matchOnLabel = true, this._matchOnLabelMode = `fuzzy`, this._sortByLabel = true, this._shouldLoop = true, this._container = z(this.parent, dH(`.quick-input-list`)), this._separatorRenderer = new bH(t10), this._itemRenderer = i10.createInstance(yH, t10), this._tree = this._register(i10.createInstance($V, `QuickInput`, this._container, new gH(), [this._itemRenderer, this._separatorRenderer], { filter: { filter(e207) {
      return e207.hidden ? 0 : e207 instanceof hH ? 2 : 1;
    } }, sorter: { compare: (e207, t11) => !this.sortByLabel || !this._lastQueryString ? 0 : wH(e207, t11, this._lastQueryString.toLowerCase()) }, accessibilityProvider: new _H2(), setRowLineHeight: false, multipleSelectionSupport: false, hideTwistiesOfChildlessElements: true, renderIndentGuides: fz.None, findWidgetEnabled: false, indent: 0, horizontalScrolling: false, allowNonCollapsibleParents: true, alwaysConsumeMouseWheel: true })), this._tree.getHTMLElement().id = r10, this._registerListeners();
  }
  get onDidChangeFocus() {
    return O.map(this._tree.onDidChangeFocus, (e206) => e206.elements.filter((e207) => e207 instanceof pH).map((e207) => e207.item), this._store);
  }
  get onDidChangeSelection() {
    return O.map(this._tree.onDidChangeSelection, (e206) => ({ items: e206.elements.filter((e207) => e207 instanceof pH).map((e207) => e207.item), event: e206.browserEvent }), this._store);
  }
  get displayed() {
    return this._container.style.display !== `none`;
  }
  set displayed(e206) {
    this._container.style.display = e206 ? `` : `none`;
  }
  get scrollTop() {
    return this._tree.scrollTop;
  }
  set scrollTop(e206) {
    this._tree.scrollTop = e206;
  }
  get ariaLabel() {
    return this._tree.ariaLabel;
  }
  set ariaLabel(e206) {
    this._tree.ariaLabel = e206 ?? ``;
  }
  set enabled(e206) {
    this._tree.getHTMLElement().style.pointerEvents = e206 ? `` : `none`;
  }
  get matchOnDescription() {
    return this._matchOnDescription;
  }
  set matchOnDescription(e206) {
    this._matchOnDescription = e206;
  }
  get matchOnDetail() {
    return this._matchOnDetail;
  }
  set matchOnDetail(e206) {
    this._matchOnDetail = e206;
  }
  get matchOnLabel() {
    return this._matchOnLabel;
  }
  set matchOnLabel(e206) {
    this._matchOnLabel = e206;
  }
  get matchOnLabelMode() {
    return this._matchOnLabelMode;
  }
  set matchOnLabelMode(e206) {
    this._matchOnLabelMode = e206;
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e206) {
    this._sortByLabel = e206;
  }
  get shouldLoop() {
    return this._shouldLoop;
  }
  set shouldLoop(e206) {
    this._shouldLoop = e206;
  }
  _registerListeners() {
    this._registerOnKeyDown(), this._registerOnContainerClick(), this._registerOnMouseMiddleClick(), this._registerOnTreeModelChanged(), this._registerOnElementChecked(), this._registerOnContextMenu(), this._registerHoverListeners(), this._registerSelectionChangeListener(), this._registerSeparatorActionShowingListeners();
  }
  _registerOnKeyDown() {
    this._register(this._tree.onKeyDown((e206) => {
      let t10 = new Jo(e206);
      switch (t10.keyCode) {
        case 10:
          this.toggleCheckbox();
          break;
      }
      this._onKeyDown.fire(t10);
    }));
  }
  _registerOnContainerClick() {
    this._register(L(this._container, R.CLICK, (e206) => {
      (e206.x || e206.y) && this._onLeave.fire();
    }));
  }
  _registerOnMouseMiddleClick() {
    this._register(L(this._container, R.AUXCLICK, (e206) => {
      e206.button === 1 && this._onLeave.fire();
    }));
  }
  _registerOnTreeModelChanged() {
    this._register(this._tree.onDidChangeModel(() => {
      let e206 = this._itemElements.filter((e207) => !e207.hidden).length;
      this._visibleCountObservable.set(e206, void 0), this._hasCheckboxes && this._updateCheckedObservables();
    }));
  }
  _registerOnElementChecked() {
    this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event, (e206, t10) => t10)((e206) => this._updateCheckedObservables()));
  }
  _registerOnContextMenu() {
    this._register(this._tree.onContextMenu((e206) => {
      e206.element && (e206.browserEvent.preventDefault(), this._tree.setSelection([e206.element]));
    }));
  }
  _registerHoverListeners() {
    let e206 = this._register(new rs(typeof this.hoverDelegate.delay == `function` ? this.hoverDelegate.delay() : this.hoverDelegate.delay));
    this._register(this._tree.onMouseOver(async (t10) => {
      if (Il(t10.browserEvent.target)) {
        e206.cancel();
        return;
      }
      if (!(!Il(t10.browserEvent.relatedTarget) && Cl(t10.browserEvent.relatedTarget, t10.element?.element))) try {
        await e206.trigger(async () => {
          t10.element instanceof pH && this.showHover(t10.element);
        });
      } catch (e207) {
        if (!we(e207)) throw e207;
      }
    })), this._register(this._tree.onMouseOut((t10) => {
      Cl(t10.browserEvent.relatedTarget, t10.element?.element) || e206.cancel();
    }));
  }
  _registerSeparatorActionShowingListeners() {
    this._register(this._tree.onDidChangeFocus((e206) => {
      let t10 = e206.elements[0] ? this._tree.getParentElement(e206.elements[0]) : null;
      for (let e207 of this._separatorRenderer.visibleSeparators) {
        let n10 = e207 === t10;
        !!(e207.focusInsideSeparator & mH.ACTIVE_ITEM) !== n10 && (n10 ? e207.focusInsideSeparator |= mH.ACTIVE_ITEM : e207.focusInsideSeparator &= ~mH.ACTIVE_ITEM, this._tree.rerender(e207));
      }
    })), this._register(this._tree.onMouseOver((e206) => {
      let t10 = e206.element ? this._tree.getParentElement(e206.element) : null;
      for (let e207 of this._separatorRenderer.visibleSeparators) e207 === t10 && (e207.focusInsideSeparator & mH.MOUSE_HOVER || (e207.focusInsideSeparator |= mH.MOUSE_HOVER, this._tree.rerender(e207)));
    })), this._register(this._tree.onMouseOut((e206) => {
      let t10 = e206.element ? this._tree.getParentElement(e206.element) : null;
      for (let e207 of this._separatorRenderer.visibleSeparators) e207 === t10 && e207.focusInsideSeparator & mH.MOUSE_HOVER && (e207.focusInsideSeparator &= ~mH.MOUSE_HOVER, this._tree.rerender(e207));
    }));
  }
  _registerSelectionChangeListener() {
    this._register(this._tree.onDidChangeSelection((e206) => {
      let t10 = e206.elements.filter((e207) => e207 instanceof pH);
      t10.length !== e206.elements.length && (e206.elements.length === 1 && e206.elements[0] instanceof hH && (this._tree.setFocus([e206.elements[0].children[0]]), this._tree.reveal(e206.elements[0], 0)), this._tree.setSelection(t10));
    }));
  }
  setAllVisibleChecked(e206) {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      this._itemElements.forEach((t10) => {
        !t10.hidden && !t10.checkboxDisabled && t10.item.pickable !== false && (t10.checked = e206);
      });
    });
  }
  setElements(e206) {
    this._elementDisposable.clear(), this._lastQueryString = void 0, this._inputElements = e206, this._hasCheckboxes = this.parent.classList.contains(`show-checkboxes`);
    let t10;
    this._itemElements = [], this._elementTree = e206.reduce((n10, r10, i10) => {
      let a10;
      if (r10.type === `separator`) {
        if (!r10.buttons) return n10;
        t10 = new hH(i10, (e207) => this._onSeparatorButtonTriggered.fire(e207), r10), a10 = t10;
      } else {
        let o10 = i10 > 0 ? e206[i10 - 1] : void 0, s10;
        o10 && o10.type === `separator` && !o10.buttons && (s10 = o10);
        let c10 = new pH(i10, t10?.children ? t10.children.length : i10, this._hasCheckboxes && r10.pickable !== false, (e207) => this._onButtonTriggered.fire(e207), this._elementChecked, r10, s10);
        if (this._itemElements.push(c10), t10) return t10.children.push(c10), n10;
        a10 = c10;
      }
      return n10.push(a10), n10;
    }, []), this._setElementsToTree(this._elementTree), this.accessibilityService.isScreenReaderOptimized() && setTimeout(() => {
      let e207 = this._tree.getHTMLElement().querySelector(`.monaco-list-row.focused`), t11 = e207?.parentNode;
      if (e207 && t11) {
        let n10 = e207.nextSibling;
        e207.remove(), t11.insertBefore(e207, n10);
      }
    }, 0);
  }
  setFocusedElements(e206) {
    let t10 = e206.map((e207) => this._itemElements.find((t11) => t11.item === e207)).filter((e207) => !!e207).filter((e207) => !e207.hidden);
    if (this._tree.setFocus(t10), e206.length > 0) {
      let e207 = this._tree.getFocus()[0];
      e207 && this._tree.reveal(e207);
    }
  }
  getActiveDescendant() {
    return this._tree.getHTMLElement().getAttribute(`aria-activedescendant`);
  }
  setSelectedElements(e206) {
    let t10 = e206.map((e207) => this._itemElements.find((t11) => t11.item === e207)).filter((e207) => !!e207);
    this._tree.setSelection(t10);
  }
  getCheckedElements() {
    return this._itemElements.filter((e206) => e206.checked).map((e206) => e206.item);
  }
  setCheckedElements(e206) {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      let t10 = /* @__PURE__ */ new Set();
      for (let n10 of e206) t10.add(n10);
      for (let e207 of this._itemElements) e207.checked = t10.has(e207.item);
    });
  }
  focus(e206) {
    if (this._itemElements.length) switch (e206 === rF.Second && this._itemElements.length < 2 && (e206 = rF.First), e206) {
      case rF.First:
        this._tree.scrollTop = 0, this._tree.focusFirst(void 0, (e207) => e207.element instanceof pH);
        break;
      case rF.Second: {
        this._tree.scrollTop = 0;
        let e207 = false;
        this._tree.focusFirst(void 0, (t10) => t10.element instanceof pH ? e207 ? true : (e207 = !e207, false) : false);
        break;
      }
      case rF.Last:
        this._tree.scrollTop = this._tree.scrollHeight, this._tree.focusLast(void 0, (e207) => e207.element instanceof pH);
        break;
      case rF.Next: {
        let e207 = this._tree.getFocus();
        this._tree.focusNext(void 0, this._shouldLoop, void 0, (e208) => e208.element instanceof pH ? (this._tree.reveal(e208.element), true) : false);
        let t10 = this._tree.getFocus();
        e207.length && e207[0] === t10[0] && this._onLeave.fire();
        break;
      }
      case rF.Previous: {
        let e207 = this._tree.getFocus();
        this._tree.focusPrevious(void 0, this._shouldLoop, void 0, (e208) => {
          if (!(e208.element instanceof pH)) return false;
          let t11 = this._tree.getParentElement(e208.element);
          return t11 === null || t11.children[0] !== e208.element ? this._tree.reveal(e208.element) : this._tree.reveal(t11), true;
        });
        let t10 = this._tree.getFocus();
        e207.length && e207[0] === t10[0] && this._onLeave.fire();
        break;
      }
      case rF.NextPage:
        this._tree.focusNextPage(void 0, (e207) => e207.element instanceof pH ? (this._tree.reveal(e207.element), true) : false);
        break;
      case rF.PreviousPage:
        this._tree.focusPreviousPage(void 0, (e207) => {
          if (!(e207.element instanceof pH)) return false;
          let t10 = this._tree.getParentElement(e207.element);
          return t10 === null || t10.children[0] !== e207.element ? this._tree.reveal(e207.element) : this._tree.reveal(t10), true;
        });
        break;
      case rF.NextSeparator: {
        let e207 = false, t10 = this._tree.getFocus()[0];
        this._tree.focusNext(void 0, true, void 0, (t11) => {
          if (e207) return true;
          if (t11.element instanceof hH) e207 = true, this._separatorRenderer.isSeparatorVisible(t11.element) ? this._tree.reveal(t11.element.children[0]) : this._tree.reveal(t11.element, 0);
          else if (t11.element instanceof pH) {
            if (t11.element.separator) return this._itemRenderer.isItemWithSeparatorVisible(t11.element) ? this._tree.reveal(t11.element) : this._tree.reveal(t11.element, 0), true;
            if (t11.element === this._elementTree[0]) return this._tree.reveal(t11.element, 0), true;
          }
          return false;
        }), t10 === this._tree.getFocus()[0] && (this._tree.scrollTop = this._tree.scrollHeight, this._tree.focusLast(void 0, (e208) => e208.element instanceof pH));
        break;
      }
      case rF.PreviousSeparator: {
        let e207, t10 = !!this._tree.getFocus()[0]?.separator;
        this._tree.focusPrevious(void 0, true, void 0, (n10) => {
          if (n10.element instanceof hH) t10 ? e207 || (e207 = (this._separatorRenderer.isSeparatorVisible(n10.element) ? this._tree.reveal(n10.element) : this._tree.reveal(n10.element, 0), n10.element.children[0])) : t10 = true;
          else if (n10.element instanceof pH && !e207) {
            if (n10.element.separator) this._itemRenderer.isItemWithSeparatorVisible(n10.element) ? this._tree.reveal(n10.element) : this._tree.reveal(n10.element, 0), e207 = n10.element;
            else if (n10.element === this._elementTree[0]) return this._tree.reveal(n10.element, 0), true;
          }
          return false;
        }), e207 && this._tree.setFocus([e207]);
        break;
      }
    }
  }
  clearFocus() {
    this._tree.setFocus([]);
  }
  domFocus() {
    this._tree.domFocus();
  }
  layout(e206) {
    this._tree.getHTMLElement().style.maxHeight = e206 ? `${Math.floor(e206 / 44) * 44 + 6}px` : ``, this._tree.layout();
  }
  filter(e206) {
    if (this._lastQueryString = e206, !(this._sortByLabel || this._matchOnLabel || this._matchOnDescription || this._matchOnDetail)) return this._tree.layout(), false;
    let t10 = e206;
    if (e206 = e206.trim(), !e206 || !(this.matchOnLabel || this.matchOnDescription || this.matchOnDetail)) this._itemElements.forEach((e207) => {
      e207.labelHighlights = void 0, e207.descriptionHighlights = void 0, e207.detailHighlights = void 0, e207.hidden = false;
      let t11 = e207.index && this._inputElements[e207.index - 1];
      e207.item && (e207.separator = t11 && t11.type === `separator` && !t11.buttons ? t11 : void 0);
    });
    else {
      let n10;
      this._itemElements.forEach((r10) => {
        let i10;
        i10 = this.matchOnLabelMode === `fuzzy` ? this.matchOnLabel ? NM(e206, MM(r10.saneLabel)) ?? void 0 : void 0 : this.matchOnLabel ? SH(t10, MM(r10.saneLabel)) ?? void 0 : void 0;
        let a10 = this.matchOnDescription ? NM(e206, MM(r10.saneDescription || ``)) ?? void 0 : void 0, o10 = this.matchOnDetail ? NM(e206, MM(r10.saneDetail || ``)) ?? void 0 : void 0;
        if (i10 || a10 || o10 ? (r10.labelHighlights = i10, r10.descriptionHighlights = a10, r10.detailHighlights = o10, r10.hidden = false) : (r10.labelHighlights = void 0, r10.descriptionHighlights = void 0, r10.detailHighlights = void 0, r10.hidden = r10.item ? !r10.item.alwaysShow : true), r10.item ? r10.separator = void 0 : r10.separator && (r10.hidden = true), !this.sortByLabel) {
          let e207 = r10.index && this._inputElements[r10.index - 1] || void 0;
          e207?.type === `separator` && !e207.buttons && (n10 = e207), n10 && !r10.hidden && (r10.separator = n10, n10 = void 0);
        }
      });
    }
    return this._setElementsToTree(this._sortByLabel && e206 ? this._itemElements : this._elementTree), this._tree.layout(), true;
  }
  toggleCheckbox() {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      let e206 = this._tree.getFocus().filter((e207) => e207 instanceof pH), t10 = this._allVisibleChecked(e206);
      for (let n10 of e206) n10.checkboxDisabled || (n10.checked = !t10);
    });
  }
  style(e206) {
    this._tree.style(e206);
  }
  toggleHover() {
    let e206 = this._tree.getFocus()[0];
    if (!e206?.saneTooltip || !(e206 instanceof pH)) return;
    if (this._lastHover && !this._lastHover.isDisposed) {
      this._lastHover.dispose();
      return;
    }
    this.showHover(e206);
    let t10 = new E();
    t10.add(this._tree.onDidChangeFocus((e207) => {
      e207.elements[0] instanceof pH && this.showHover(e207.elements[0]);
    })), this._lastHover && t10.add(this._lastHover), this._elementDisposable.add(t10);
  }
  _setElementsToTree(e206) {
    let t10 = [];
    for (let n10 of e206) n10 instanceof hH ? t10.push({ element: n10, collapsible: false, collapsed: false, children: n10.children.map((e207) => ({ element: e207, collapsible: false, collapsed: false })) }) : t10.push({ element: n10, collapsible: false, collapsed: false });
    this._tree.setChildren(null, t10);
  }
  _allVisibleChecked(e206, t10 = true) {
    for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
      let r11 = e206[n10];
      if (!r11.hidden && r11.item.pickable !== false) if (r11.checked) t10 = true;
      else return false;
    }
    return t10;
  }
  _updateCheckedObservables() {
    bc((e206) => {
      this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements, false), e206);
      let t10 = this._itemElements.filter((e207) => e207.checked).length;
      this._checkedCountObservable.set(t10, e206), this._checkedElementsObservable.set(this.getCheckedElements(), e206);
    });
  }
  showHover(e206) {
    this._lastHover && !this._lastHover.isDisposed && (this.hoverDelegate.onDidHideHover?.(), this._lastHover?.dispose()), !(!e206.element || !e206.saneTooltip) && (this._lastHover = this.hoverDelegate.showHover({ content: e206.saneTooltip, target: e206.element, linkHandler: (e207) => {
      this.linkOpenerDelegate(e207);
    }, appearance: { showPointer: true }, container: this._container, position: { hoverPosition: 1 } }, false));
  }
};
cH([ex], xH.prototype, `onDidChangeFocus`, null), cH([ex], xH.prototype, `onDidChangeSelection`, null), xH = cH([lH(4, V), lH(5, e_)], xH);
function SH(e206, t10) {
  let { text: n10, iconOffsets: r10 } = t10;
  if (!r10 || r10.length === 0) return CH(e206, n10);
  let i10 = Ba(n10, ` `), a10 = n10.length - i10.length, o10 = CH(e206, i10);
  if (o10) for (let e207 of o10) {
    let t11 = r10[e207.start + a10] + a10;
    e207.start += t11, e207.end += t11;
  }
  return o10;
}
function CH(e206, t10) {
  let n10 = t10.toLowerCase().indexOf(e206.toLowerCase());
  return n10 === -1 ? null : [{ start: n10, end: n10 + e206.length }];
}
function wH(e206, t10, n10) {
  let r10 = e206.labelHighlights || [], i10 = t10.labelHighlights || [];
  return r10.length && !i10.length ? -1 : !r10.length && i10.length ? 1 : r10.length === 0 && i10.length === 0 ? 0 : zz(e206.saneSortLabel, t10.saneSortLabel, n10);
}
function TH(e206, t10 = {}) {
  ld.registerCommandAndKeybindingRule({ weight: 200, when: fR, metadata: { description: C(1758, `Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.`) }, ...e206, secondary: OH(e206.primary, e206.secondary ?? [], t10) });
}
function EH(e206, t10 = {}) {
  ld.registerCommandAndKeybindingRule({ weight: 200, when: H.and(H.or(H.equals(pR, `quickPick`), H.equals(pR, `quickTree`)), fR), metadata: { description: C(1759, `Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.`) }, ...e206, secondary: OH(e206.primary, e206.secondary ?? [], t10) });
}
var DH = Tt ? 256 : 2048;
function OH(e206, t10, n10 = {}) {
  return n10.withAltMod && t10.push(512 + e206), n10.withCtrlMod && (t10.push(DH + e206), n10.withAltMod && t10.push(512 + DH + e206)), n10.withCmdMod && Tt && (t10.push(2048 + e206), n10.withCtrlMod && t10.push(2304 + e206), n10.withAltMod && (t10.push(2560 + e206), n10.withCtrlMod && t10.push(2816 + e206))), t10;
}
function kH(e206, t10) {
  return (n10) => {
    let r10 = n10.get(aF).currentQuickInput;
    if (r10) return t10 && r10.quickNavigate ? r10.focus(t10) : r10.focus(e206);
  };
}
EH({ id: `quickInput.pageNext`, primary: 12, handler: kH(rF.NextPage) }, { withAltMod: true, withCtrlMod: true, withCmdMod: true }), EH({ id: `quickInput.pagePrevious`, primary: 11, handler: kH(rF.PreviousPage) }, { withAltMod: true, withCtrlMod: true, withCmdMod: true }), EH({ id: `quickInput.first`, primary: DH + 14, handler: kH(rF.First) }, { withAltMod: true, withCmdMod: true }), EH({ id: `quickInput.last`, primary: DH + 13, handler: kH(rF.Last) }, { withAltMod: true, withCmdMod: true }), EH({ id: `quickInput.next`, primary: 18, handler: kH(rF.Next) }, { withCtrlMod: true }), EH({ id: `quickInput.previous`, primary: 16, handler: kH(rF.Previous) }, { withCtrlMod: true });
var AH = C(1760, `If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator.`), jH = C(1761, `If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.`);
Tt ? (EH({ id: `quickInput.nextSeparatorWithQuickAccessFallback`, primary: 2066, handler: kH(rF.NextSeparator, rF.Next), metadata: { description: AH } }), EH({ id: `quickInput.nextSeparator`, primary: 2578, secondary: [2322], handler: kH(rF.NextSeparator) }, { withCtrlMod: true }), EH({ id: `quickInput.previousSeparatorWithQuickAccessFallback`, primary: 2064, handler: kH(rF.PreviousSeparator, rF.Previous), metadata: { description: jH } }), EH({ id: `quickInput.previousSeparator`, primary: 2576, secondary: [2320], handler: kH(rF.PreviousSeparator) }, { withCtrlMod: true })) : (EH({ id: `quickInput.nextSeparatorWithQuickAccessFallback`, primary: 530, handler: kH(rF.NextSeparator, rF.Next), metadata: { description: AH } }), EH({ id: `quickInput.nextSeparator`, primary: 2578, handler: kH(rF.NextSeparator) }), EH({ id: `quickInput.previousSeparatorWithQuickAccessFallback`, primary: 528, handler: kH(rF.PreviousSeparator, rF.Previous), metadata: { description: jH } }), EH({ id: `quickInput.previousSeparator`, primary: 2576, handler: kH(rF.PreviousSeparator) })), ld.registerCommandAndKeybindingRule({ id: `quickInput.accept`, primary: 3, weight: 200, when: H.and(H.notEquals(pR, `quickWidget`), fR, H.not(`isComposing`)), metadata: { description: C(1762, `Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.`) }, handler: (e206) => {
  e206.get(aF).currentQuickInput?.accept();
}, secondary: OH(3, [], { withAltMod: true, withCtrlMod: true, withCmdMod: true }) }), EH({ id: `quickInput.acceptInBackground`, when: H.and(fR, H.equals(pR, `quickPick`), H.or(nV.negate(), B_e)), primary: 17, weight: 250, handler: (e206) => {
  e206.get(aF).currentQuickInput?.accept(true);
} }, { withAltMod: true, withCtrlMod: true, withCmdMod: true }), TH({ id: `quickInput.hide`, primary: 9, handler: (e206) => {
  e206.get(aF).currentQuickInput?.hide();
} }, { withAltMod: true, withCtrlMod: true, withCmdMod: true }), EH({ id: `quickInput.toggleHover`, primary: DH | 10, handler: (e206) => {
  e206.get(aF).toggleHover();
} });
var MH = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, NH = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, PH, FH = B, IH = (_fb = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._hoverDelegate = e206, this._buttonTriggeredEmitter = t10, this.onCheckedEvent = n10, this._themeService = r10, this.templateId = PH.ID;
  }
  renderTemplate(e206) {
    let t10 = new E(), n10 = z(e206, FH(`.quick-input-tree-entry`)), r10 = t10.add(new oR(``, false, { ...sL, size: 15 }));
    n10.appendChild(r10.domNode);
    let i10 = z(z(z(n10, FH(`label.quick-input-tree-label`)), FH(`.quick-input-tree-rows`)), FH(`.quick-input-tree-row`)), a10 = ql(i10, FH(`.quick-input-tree-icon`)), o10 = t10.add(new KR(i10, { supportHighlights: true, supportDescriptionHighlights: true, supportIcons: true, hoverDelegate: this._hoverDelegate })), s10 = t10.add(new CL(n10, this._hoverDelegate ? { hoverDelegate: this._hoverDelegate } : void 0));
    return s10.domNode.classList.add(`quick-input-tree-entry-action-bar`), { toDisposeTemplate: t10, entry: n10, checkbox: r10, icon: a10, label: o10, actionBar: s10, toDisposeElement: new E() };
  }
  renderElement(e206, t10, n10, r10) {
    let i10 = n10.toDisposeElement, a10 = e206.element;
    if (a10.pickable === false ? n10.checkbox.domNode.style.display = `none` : (n10.checkbox.domNode.style.display = ``, n10.checkbox.checked = a10.checked ?? false, i10.add(O.filter(this.onCheckedEvent, (e207) => e207.item === a10)((e207) => n10.checkbox.checked = e207.checked)), a10.disabled && n10.checkbox.disable()), a10.iconPath) {
      let e207 = Ib(this._themeService.getColorTheme().type) ? a10.iconPath.dark : a10.iconPath.light ?? a10.iconPath.dark, t11 = $r.revive(e207);
      n10.icon.className = `quick-input-tree-icon`, n10.icon.style.backgroundImage = _I2(t11);
    } else n10.icon.style.backgroundImage = ``, n10.icon.className = a10.iconClass ? `quick-input-tree-icon ${a10.iconClass}` : ``;
    let { labelHighlights: o10, descriptionHighlights: s10 } = e206.filterData || {}, c10;
    a10.description && (c10 = { markdown: { value: Ra(a10.description), supportThemeIcons: true }, markdownNotSupportedFallback: a10.description }), n10.label.setLabel(a10.label, a10.description, { matches: o10, descriptionMatches: s10, extraClasses: a10.iconClasses, italic: a10.italic, strikethrough: a10.strikethrough, labelEscapeNewLines: true, descriptionTitle: c10 });
    let l10 = a10.buttons;
    l10 && l10.length ? (n10.actionBar.push(l10.map((e207, t11) => lR(e207, `tree-${t11}`, () => this._buttonTriggeredEmitter.fire({ item: a10, button: e207 }))), { icon: true, label: false }), n10.entry.classList.add(`has-actions`)) : n10.entry.classList.remove(`has-actions`);
  }
  disposeElement(e206, t10, n10, r10) {
    n10.toDisposeElement.clear(), n10.actionBar.clear();
  }
  disposeTemplate(e206) {
    e206.toDisposeElement.dispose(), e206.toDisposeTemplate.dispose();
  }
}, PH = _fb, _fb.ID = `quickInputTreeElement`, _fb);
IH = PH = MH([NH(3, US)], IH);
var LH = class {
  getHeight(e206) {
    return 22;
  }
  getTemplateId(e206) {
    return IH.ID;
  }
};
function RH(e206) {
  let t10 = false, n10 = false, r10 = false;
  for (let i10 of e206) {
    switch (i10.element?.checked) {
      case `mixed`:
        r10 = true;
        break;
      case true:
        t10 = true;
        break;
      default:
        n10 = true;
        break;
    }
    if (t10 && n10 && r10) break;
  }
  return n10 ? r10 || t10 ? `mixed` : false : r10 ? `mixed` : t10;
}
var zH = class {
  constructor(e206) {
    this.onCheckedEvent = e206;
  }
  getWidgetAriaLabel() {
    return C(1772, `Quick Tree`);
  }
  getAriaLabel(e206) {
    return e206.ariaLabel || [e206.label, e206.description].map((e207) => AM(e207)).filter((e207) => !!e207).join(`, `);
  }
  getWidgetRole() {
    return `tree`;
  }
  getRole(e206) {
    return `checkbox`;
  }
  isChecked(e206) {
    return { get value() {
      return e206.checked === `mixed` ? `mixed` : !!e206.checked;
    }, onDidChange: (t10) => O.filter(this.onCheckedEvent, (t11) => t11.item === e206)((e207) => t10()) };
  }
}, BH = class {
  constructor() {
    this.filterValue = ``, this.matchOnLabel = true, this.matchOnDescription = false;
  }
  filter(e206, t10) {
    if (!this.filterValue || !(this.matchOnLabel || this.matchOnDescription)) return e206.children ? { visibility: 2, data: {} } : { visibility: 1, data: {} };
    let n10 = this.matchOnLabel ? NM(this.filterValue, MM(e206.label)) ?? void 0 : void 0, r10 = this.matchOnDescription ? NM(this.filterValue, MM(e206.description || ``)) ?? void 0 : void 0;
    return { visibility: t10 === 1 || n10 || r10 ? 1 : e206.children ? 2 : 0, data: { labelHighlights: n10, descriptionHighlights: r10 } };
  }
}, VH = class extends D {
  constructor() {
    super(...arguments), this._sortByLabel = true;
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e206) {
    this._sortByLabel = e206;
  }
  compare(e206, t10) {
    if (!this._sortByLabel) return 0;
    if (e206.label < t10.label) return -1;
    if (e206.label > t10.label) return 1;
    if (e206.description && t10.description) {
      if (e206.description < t10.description) return -1;
      if (e206.description > t10.description) return 1;
    } else if (e206.description) return -1;
    else if (t10.description) return 1;
    return 0;
  }
}, HH = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, UH = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, WH = B, GH = class extends D {
  constructor(e206, t10, n10) {
    super(), this.instantiationService = n10, this._onDidTriggerButton = this._register(new k()), this._onDidChangeCheckboxState = this._register(new k()), this.onDidChangeCheckboxState = this._onDidChangeCheckboxState.event, this._onDidCheckedLeafItemsChange = this._register(new k()), this._onLeave = new k(), this.onLeave = this._onLeave.event, this._onDidAccept = this._register(new k()), this.onDidAccept = this._onDidAccept.event, this._container = z(e206, WH(`.quick-input-tree`)), this._renderer = this._register(this.instantiationService.createInstance(IH, t10, this._onDidTriggerButton, this.onDidChangeCheckboxState)), this._filter = this.instantiationService.createInstance(BH), this._sorter = this._register(new VH()), this._tree = this._register(this.instantiationService.createInstance($V, `QuickInputTree`, this._container, new LH(), [this._renderer], { accessibilityProvider: new zH(this.onDidChangeCheckboxState), horizontalScrolling: false, multipleSelectionSupport: false, findWidgetEnabled: false, alwaysConsumeMouseWheel: true, hideTwistiesOfChildlessElements: true, renderIndentGuides: fz.None, expandOnDoubleClick: true, expandOnlyOnTwistieClick: true, disableExpandOnSpacebar: true, sorter: this._sorter, filter: this._filter })), this.registerOnOpenListener();
  }
  get tree() {
    return this._tree;
  }
  get displayed() {
    return this._container.style.display !== `none`;
  }
  set displayed(e206) {
    this._container.style.display = e206 ? `` : `none`;
  }
  get sortByLabel() {
    return this._sorter.sortByLabel;
  }
  set sortByLabel(e206) {
    this._sorter.sortByLabel = e206, this._tree.resort(null, true);
  }
  getActiveDescendant() {
    return this._tree.getHTMLElement().getAttribute(`aria-activedescendant`);
  }
  updateFilterOptions(e206) {
    e206.matchOnLabel !== void 0 && (this._filter.matchOnLabel = e206.matchOnLabel), e206.matchOnDescription !== void 0 && (this._filter.matchOnDescription = e206.matchOnDescription), this._tree.refilter();
  }
  layout(e206) {
    this._tree.getHTMLElement().style.maxHeight = e206 ? `${Math.floor(e206 / 44) * 44 + 6}px` : ``, this._tree.layout();
  }
  registerOnOpenListener() {
    this._register(this._tree.onDidOpen((e206) => {
      let t10 = e206.element;
      if (!t10 || t10.disabled) return;
      if (t10.pickable === false) {
        this._tree.setFocus([t10]), this._onDidAccept.fire();
        return;
      }
      let n10 = t10.checked !== true;
      if ((t10.checked ?? false) === n10) return;
      t10.checked = n10, this._tree.rerender(t10);
      let r10 = /* @__PURE__ */ new Set(), i10 = [...this._tree.getNode(t10).children];
      for (; i10.length; ) {
        let e207 = i10.shift();
        e207?.element && !r10.has(e207.element) && (r10.add(e207.element), (e207.element.checked ?? false) !== t10.checked && (e207.element.checked = t10.checked, this._tree.rerender(e207.element)), i10.push(...e207.children));
      }
      let a10 = this._tree.getParentElement(t10);
      for (; a10; ) {
        let e207 = RH([...this._tree.getNode(a10).children]);
        (a10.checked ?? false) !== e207 && (a10.checked = e207, this._tree.rerender(a10)), a10 = this._tree.getParentElement(a10);
      }
      this._onDidChangeCheckboxState.fire({ item: t10, checked: t10.checked ?? false }), this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems());
    }));
  }
  getCheckedLeafItems() {
    let e206 = /* @__PURE__ */ new Set(), t10 = [...this._tree.getNode().children], n10 = [];
    for (; t10.length; ) {
      let r10 = t10.shift();
      !r10?.element || e206.has(r10.element) || r10.element.checked && (e206.add(r10.element), t10.push(...r10.children), r10.element.children || n10.push(r10.element));
    }
    return n10;
  }
};
GH = HH([UH(2, V)], GH);
var KH = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, qH = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, JH, YH = B, XH = `workbench.quickInput.viewState`, ZH = (_gb = class extends D {
  get currentQuickInput() {
    return this.controller ?? void 0;
  }
  get container() {
    return this._container;
  }
  constructor(e206, t10, n10, r10, i10) {
    super(), this.options = e206, this.layoutService = t10, this.instantiationService = n10, this.storageService = i10, this.enabled = true, this.onDidAcceptEmitter = this._register(new k()), this.onDidCustomEmitter = this._register(new k()), this.onDidTriggerButtonEmitter = this._register(new k()), this.keyMods = { ctrlCmd: false, alt: false }, this.controller = null, this.onShowEmitter = this._register(new k()), this.onShow = this.onShowEmitter.event, this.onHideEmitter = this._register(new k()), this.onHide = this.onHideEmitter.event, this.inQuickInputContext = I_e.bindTo(r10), this.quickInputTypeContext = R_e.bindTo(r10), this.endOfQuickInputBoxContext = z_e.bindTo(r10), this.idPrefix = e206.idPrefix, this._container = e206.container, this.styles = e206.styles, this._register(O.runAndSubscribe(qc, ({ window: e207, disposables: t11 }) => this.registerKeyModsListeners(e207, t11), { window: Aa, disposables: this._store })), this._register(Jc((e207) => {
      this.ui && Vc(this.ui.container) === e207 && (this.reparentUI(this.layoutService.mainContainer), this.layout(this.layoutService.mainContainerDimension, this.layoutService.mainContainerOffset.quickPickTop));
    })), this.viewState = this.loadViewState();
  }
  registerKeyModsListeners(e206, t10) {
    let n10 = (e207) => {
      this.keyMods.ctrlCmd = e207.ctrlKey || e207.metaKey, this.keyMods.alt = e207.altKey;
    };
    for (let r10 of [R.KEY_DOWN, R.KEY_UP, R.MOUSE_DOWN]) t10.add(L(e206, r10, n10, true));
  }
  getUI(e206) {
    if (this.ui) return e206 && Vc(this._container) !== Vc(this.layoutService.activeContainer) && (this.reparentUI(this.layoutService.activeContainer), this.layout(this.layoutService.activeContainerDimension, this.layoutService.activeContainerOffset.quickPickTop)), this.ui;
    let t10 = z(this._container, YH(`.quick-input-widget.show-file-icons`));
    t10.tabIndex = -1, t10.style.display = `none`;
    let n10 = g_(t10), r10 = z(t10, YH(`.quick-input-titlebar`)), i10 = this._register(new CL(r10, { hoverDelegate: this.options.hoverDelegate }));
    i10.domNode.classList.add(`quick-input-left-action-bar`);
    let a10 = z(r10, YH(`.quick-input-title`)), o10 = this._register(new CL(r10, { hoverDelegate: this.options.hoverDelegate }));
    o10.domNode.classList.add(`quick-input-right-action-bar`);
    let s10 = z(t10, YH(`.quick-input-header`)), c10 = this._register(new oR(C(1763, `Toggle all checkboxes`), false, { ...sL, size: 15 }));
    z(s10, c10.domNode), this._register(c10.onChange(() => {
      let e207 = c10.checked;
      ie2.setAllVisibleChecked(e207 === true);
    })), this._register(L(c10.domNode, R.CLICK, (e207) => {
      (e207.x || e207.y) && f10.setFocus();
    }));
    let l10 = z(s10, YH(`.quick-input-description`)), u10 = z(s10, YH(`.quick-input-and-message`)), d10 = z(u10, YH(`.quick-input-filter`)), f10 = this._register(new UR(d10, this.styles.inputBox, this.styles.toggle));
    f10.setAttribute(`aria-describedby`, `${this.idPrefix}message`);
    let p10 = z(d10, YH(`.quick-input-visible-count`));
    p10.setAttribute(`aria-live`, `polite`), p10.setAttribute(`aria-atomic`, `true`);
    let m10 = this._register(new bR(p10, { countFormat: C(1764, `{0} Results`) }, this.styles.countBadge)), h10 = z(d10, YH(`.quick-input-count`));
    h10.setAttribute(`aria-live`, `polite`);
    let g10 = this._register(new bR(h10, { countFormat: C(1765, `{0} Selected`) }, this.styles.countBadge)), _10 = this._register(new CL(s10, { hoverDelegate: this.options.hoverDelegate }));
    _10.domNode.classList.add(`quick-input-inline-action-bar`);
    let v10 = z(s10, YH(`.quick-input-action`)), y10 = this._register(new yR(v10, this.styles.button));
    y10.label = C(1766, `OK`), this._register(y10.onDidClick((e207) => {
      this.onDidAcceptEmitter.fire();
    }));
    let b10 = z(s10, YH(`.quick-input-action`)), x10 = this._register(new yR(b10, { ...this.styles.button, supportIcons: true }));
    x10.label = C(1767, `Custom`), this._register(x10.onDidClick((e207) => {
      this.onDidCustomEmitter.fire();
    }));
    let S10 = z(u10, YH(`#${this.idPrefix}message.quick-input-message`)), ee2 = this._register(new U_e(t10, this.styles.progressBar));
    ee2.getContainer().classList.add(`quick-input-progress`);
    let te2 = z(t10, YH(`.quick-input-html-widget`));
    te2.tabIndex = -1;
    let ne2 = z(t10, YH(`.quick-input-description`)), re2 = this.idPrefix + `list`, ie2 = this._register(this.instantiationService.createInstance(xH, t10, this.options.hoverDelegate, this.options.linkOpenerDelegate, re2));
    f10.setAttribute(`aria-controls`, re2), this._register(ie2.onDidChangeFocus(() => {
      f10.hasFocus() && f10.setAttribute(`aria-activedescendant`, ie2.getActiveDescendant() ?? ``);
    })), this._register(ie2.onChangedAllVisibleChecked((e207) => {
      c10.checked = e207;
    })), this._register(ie2.onChangedVisibleCount((e207) => {
      m10.setCount(e207);
    })), this._register(ie2.onChangedCheckedCount((e207) => {
      Nt(() => g10.setCount(e207));
    })), this._register(ie2.onLeave(() => {
      setTimeout(() => {
        this.controller && (f10.setFocus(), this.controller instanceof _R2 && this.controller.canSelectMany && ie2.clearFocus());
      }, 0);
    }));
    let ae2 = this._register(this.instantiationService.createInstance(GH, t10, this.options.hoverDelegate));
    this._register(ae2.tree.onDidChangeFocus(() => {
      f10.hasFocus() && f10.setAttribute(`aria-activedescendant`, ae2.getActiveDescendant() ?? ``);
    })), this._register(ae2.onLeave(() => {
      setTimeout(() => {
        this.controller && (f10.setFocus(), ae2.tree.setFocus([]));
      }, 0);
    })), this._register(ae2.onDidAccept(() => {
      this.onDidAcceptEmitter.fire();
    })), this._register(ae2.tree.onDidChangeContentHeight(() => this.updateLayout()));
    let oe2 = Gl(t10);
    return this._register(oe2), this._register(L(t10, R.FOCUS, (e207) => {
      let t11 = this.getUI();
      if (Cl(e207.relatedTarget, t11.inputContainer)) {
        let e208 = t11.inputBox.isSelectionAtEnd();
        this.endOfQuickInputBoxContext.get() !== e208 && this.endOfQuickInputBoxContext.set(e208);
      }
      Cl(e207.relatedTarget, t11.container) || (this.inQuickInputContext.set(true), this.previousFocusElement = Fl(e207.relatedTarget) ? e207.relatedTarget : void 0);
    }, true)), this._register(oe2.onDidBlur(() => {
      !this.getUI().ignoreFocusOut && !this.options.ignoreFocusOut() && this.hide(tF.Blur), this.inQuickInputContext.set(false), this.endOfQuickInputBoxContext.set(false), this.previousFocusElement = void 0;
    })), this._register(f10.onKeyDown((e207) => {
      let t11 = this.getUI().inputBox.isSelectionAtEnd();
      this.endOfQuickInputBoxContext.get() !== t11 && this.endOfQuickInputBoxContext.set(t11), f10.removeAttribute(`aria-activedescendant`);
    })), this._register(L(t10, R.FOCUS, (e207) => {
      f10.setFocus();
    })), this.dndController = this._register(this.instantiationService.createInstance(QH, this._container, t10, [{ node: r10, includeChildren: true }, { node: s10, includeChildren: false }], this.viewState)), this._register(hc((e207) => {
      let t11 = this.dndController?.dndViewState.read(e207);
      t11 && (t11.top !== void 0 && t11.left !== void 0 ? this.viewState = { ...this.viewState, top: t11.top, left: t11.left } : this.viewState = void 0, this.updateLayout(), t11.done && this.saveViewState(this.viewState));
    })), this.ui = { container: t10, styleSheet: n10, leftActionBar: i10, titleBar: r10, title: a10, description1: ne2, description2: l10, widget: te2, rightActionBar: o10, inlineActionBar: _10, checkAll: c10, inputContainer: u10, filterContainer: d10, inputBox: f10, visibleCountContainer: p10, visibleCount: m10, countContainer: h10, count: g10, okContainer: v10, ok: y10, message: S10, customButtonContainer: b10, customButton: x10, list: ie2, tree: ae2, progressBar: ee2, onDidAccept: this.onDidAcceptEmitter.event, onDidCustom: this.onDidCustomEmitter.event, onDidTriggerButton: this.onDidTriggerButtonEmitter.event, ignoreFocusOut: false, keyMods: this.keyMods, show: (e207) => this.show(e207), hide: () => this.hide(), setVisibilities: (e207) => this.setVisibilities(e207), setEnabled: (e207) => this.setEnabled(e207), setContextKey: (e207) => this.options.setContextKey(e207), linkOpenerDelegate: (e207) => this.options.linkOpenerDelegate(e207) }, this.updateStyles(), this.ui;
  }
  reparentUI(e206) {
    this.ui && (this._container = e206, z(this._container, this.ui.container), this.dndController?.reparentUI(this._container));
  }
  pick(e206, t10 = {}, n10 = dr.None) {
    return new Promise((r10, i10) => {
      let a10 = (e207) => {
        a10 = r10, t10.onKeyMods?.(o10.keyMods), r10(e207);
      };
      if (n10.isCancellationRequested) {
        a10(void 0);
        return;
      }
      let o10 = this.createQuickPick({ useSeparators: true }), s10, c10 = [o10, o10.onDidAccept(() => {
        if (o10.canSelectMany) a10(o10.selectedItems.slice()), o10.hide();
        else {
          let e207 = o10.activeItems[0];
          e207 && (a10(e207), o10.hide());
        }
      }), o10.onDidChangeActive((e207) => {
        let n11 = e207[0];
        n11 && t10.onDidFocus && t10.onDidFocus(n11);
      }), o10.onDidChangeSelection((e207) => {
        if (!o10.canSelectMany) {
          let t11 = e207[0];
          t11 && (a10(t11), o10.hide());
        }
      }), o10.onDidTriggerItemButton((e207) => t10.onDidTriggerItemButton && t10.onDidTriggerItemButton({ ...e207, removeItem: () => {
        let t11 = o10.items.indexOf(e207.item);
        if (t11 !== -1) {
          let e208 = o10.items.slice(), n11 = e208.splice(t11, 1), r11 = o10.activeItems.filter((e209) => e209 !== n11[0]), i11 = o10.keepScrollPosition;
          o10.keepScrollPosition = true, o10.items = e208, r11 && (o10.activeItems = r11), o10.keepScrollPosition = i11;
        }
      } })), o10.onDidTriggerSeparatorButton((e207) => t10.onDidTriggerSeparatorButton?.(e207)), o10.onDidChangeValue((e207) => {
        s10 && !e207 && (o10.activeItems.length !== 1 || o10.activeItems[0] !== s10) && (o10.activeItems = [s10]);
      }), n10.onCancellationRequested(() => {
        o10.hide();
      }), o10.onDidHide(() => {
        Kt(c10), a10(void 0);
      })];
      o10.title = t10.title, t10.value && (o10.value = t10.value), o10.canSelectMany = !!t10.canPickMany, o10.placeholder = t10.placeHolder, o10.prompt = t10.prompt, o10.ignoreFocusOut = !!t10.ignoreFocusLost, o10.matchOnDescription = !!t10.matchOnDescription, o10.matchOnDetail = !!t10.matchOnDetail, t10.sortByLabel !== void 0 && (o10.sortByLabel = t10.sortByLabel), o10.matchOnLabel = t10.matchOnLabel === void 0 || t10.matchOnLabel, o10.quickNavigate = t10.quickNavigate, o10.hideInput = !!t10.hideInput, o10.contextKey = t10.contextKey, o10.busy = true, Promise.all([e206, t10.activeItem]).then(([e207, t11]) => {
        s10 = t11, o10.busy = false, o10.items = e207, o10.canSelectMany && (o10.selectedItems = e207.filter((e208) => e208.type !== `separator` && e208.picked)), s10 && (o10.activeItems = [s10]);
      }), o10.show(), Promise.resolve(e206).then(void 0, (e207) => {
        i10(e207), o10.hide();
      });
    });
  }
  setValidationOnInput(e206, t10) {
    t10 && Re(t10) ? (e206.severity = lw.Error, e206.validationMessage = t10) : t10 && !Re(t10) ? (e206.severity = t10.severity, e206.validationMessage = t10.content) : (e206.severity = lw.Ignore, e206.validationMessage = void 0);
  }
  input(e206 = {}, t10 = dr.None) {
    return new Promise((n10) => {
      if (t10.isCancellationRequested) {
        n10(void 0);
        return;
      }
      let r10 = this.createInputBox(), i10 = e206.validateInput || (() => Promise.resolve(void 0)), a10 = O.debounce(r10.onDidChangeValue, (e207, t11) => t11, 100), o10 = e206.value || ``, s10 = Promise.resolve(i10(o10)), c10 = [r10, a10((e207) => {
        e207 !== o10 && (s10 = Promise.resolve(i10(e207)), o10 = e207), s10.then((t11) => {
          e207 === o10 && this.setValidationOnInput(r10, t11);
        });
      }), r10.onDidAccept(() => {
        let e207 = r10.value;
        e207 !== o10 && (s10 = Promise.resolve(i10(e207)), o10 = e207), s10.then((t11) => {
          !t11 || !Re(t11) && t11.severity !== lw.Error ? (n10(e207), r10.hide()) : e207 === o10 && this.setValidationOnInput(r10, t11);
        });
      }), t10.onCancellationRequested(() => {
        r10.hide();
      }), r10.onDidHide(() => {
        Kt(c10), n10(void 0);
      })];
      r10.title = e206.title, r10.value = e206.value || ``, r10.valueSelection = e206.valueSelection, r10.prompt = e206.prompt, r10.placeholder = e206.placeHolder, r10.password = !!e206.password, r10.ignoreFocusOut = !!e206.ignoreFocusLost, r10.show();
    });
  }
  createQuickPick(e206 = { useSeparators: false }) {
    return new _R2(this.getUI(true));
  }
  createInputBox() {
    return new V_e(this.getUI(true));
  }
  show(e206) {
    let t10 = this.getUI(true);
    this.onShowEmitter.fire();
    let n10 = this.controller;
    this.controller = e206, n10?.didHide(), this.setEnabled(true), t10.leftActionBar.clear(), t10.title.textContent = ``, t10.description1.textContent = ``, t10.description2.textContent = ``, Jl(t10.widget), t10.rightActionBar.clear(), t10.inlineActionBar.clear(), t10.checkAll.checked = false, t10.inputBox.placeholder = ``, t10.inputBox.password = false, t10.inputBox.showDecoration(lw.Ignore), t10.visibleCount.setCount(0), t10.count.setCount(0), Jl(t10.message), t10.progressBar.stop(), t10.progressBar.getContainer().setAttribute(`aria-hidden`, `true`), t10.list.setElements([]), t10.list.matchOnDescription = false, t10.list.matchOnDetail = false, t10.list.matchOnLabel = true, t10.list.sortByLabel = true, t10.tree.updateFilterOptions({ matchOnDescription: false, matchOnLabel: true }), t10.tree.sortByLabel = true, t10.ignoreFocusOut = false, t10.inputBox.toggles = void 0;
    let r10 = this.options.backKeybindingLabel();
    hR.tooltip = r10 ? C(1768, `Back ({0})`, r10) : C(1769, `Back`), t10.container.style.display = ``, this.updateLayout(), this.dndController?.layoutContainer(), t10.inputBox.setFocus(), this.quickInputTypeContext.set(e206.type);
  }
  isVisible() {
    return !!this.ui && this.ui.container.style.display !== `none`;
  }
  setVisibilities(e206) {
    let t10 = this.getUI();
    t10.title.style.display = e206.title ? `` : `none`, t10.description1.style.display = e206.description && (e206.inputBox || e206.checkAll) ? `` : `none`, t10.description2.style.display = e206.description && !(e206.inputBox || e206.checkAll) ? `` : `none`, t10.checkAll.domNode.style.display = e206.checkAll ? `` : `none`, t10.inputContainer.style.display = e206.inputBox ? `` : `none`, t10.filterContainer.style.display = e206.inputBox ? `` : `none`, t10.visibleCountContainer.style.display = e206.visibleCount ? `` : `none`, t10.countContainer.style.display = e206.count ? `` : `none`, t10.okContainer.style.display = e206.ok ? `` : `none`, t10.customButtonContainer.style.display = e206.customButton ? `` : `none`, t10.message.style.display = e206.message ? `` : `none`, t10.progressBar.getContainer().style.display = e206.progressBar ? `` : `none`, t10.list.displayed = !!e206.list, t10.tree.displayed = !!e206.tree, t10.container.classList.toggle(`show-checkboxes`, !!e206.checkBox), t10.container.classList.toggle(`hidden-input`, !e206.inputBox && !e206.description), this.updateLayout();
  }
  setEnabled(e206) {
    if (e206 !== this.enabled) {
      this.enabled = e206;
      let t10 = this.getUI();
      for (let n10 of t10.leftActionBar.viewItems) n10.action.enabled = e206;
      for (let n10 of t10.rightActionBar.viewItems) n10.action.enabled = e206;
      e206 ? t10.checkAll.enable() : t10.checkAll.disable(), t10.inputBox.enabled = e206, t10.ok.enabled = e206, t10.list.enabled = e206;
    }
  }
  hide(e206) {
    let t10 = this.controller;
    if (!t10) return;
    t10.willHide(e206);
    let n10 = this.ui?.container, r10 = n10 && !jl(n10);
    if (this.controller = null, this.onHideEmitter.fire(), n10 && (n10.style.display = `none`), !r10) {
      let e207 = this.previousFocusElement;
      for (; e207 && !e207.offsetParent; ) e207 = e207.parentElement ?? void 0;
      e207?.offsetParent ? (e207.focus(), this.previousFocusElement = void 0) : this.options.returnFocus();
    }
    t10.didHide(e206);
  }
  toggleHover() {
    this.isVisible() && this.controller instanceof _R2 && this.getUI().list.toggleHover();
  }
  layout(e206, t10) {
    this.dimension = e206, this.titleBarOffset = t10, this.updateLayout();
  }
  updateLayout() {
    if (this.ui && this.isVisible()) {
      let e206 = this.ui.container.style, t10 = Math.min(this.dimension.width * 0.62, JH.MAX_WIDTH);
      e206.width = t10 + `px`, e206.top = `${this.viewState?.top ? Math.round(this.dimension.height * this.viewState.top) : this.titleBarOffset}px`, e206.left = `${Math.round(this.dimension.width * (this.viewState?.left ?? 0.5) - t10 / 2)}px`, this.ui.inputBox.layout(), this.ui.list.layout(this.dimension && this.dimension.height * 0.4), this.ui.tree.layout(this.dimension && this.dimension.height * 0.4);
    }
  }
  applyStyles(e206) {
    this.styles = e206, this.updateStyles();
  }
  updateStyles() {
    if (this.ui) {
      let { quickInputTitleBackground: e206, quickInputBackground: t10, quickInputForeground: n10, widgetBorder: r10, widgetShadow: i10 } = this.styles.widget;
      this.ui.titleBar.style.backgroundColor = e206 ?? ``, this.ui.container.style.backgroundColor = t10 ?? ``, this.ui.container.style.color = n10 ?? ``, this.ui.container.style.border = r10 ? `1px solid ${r10}` : ``, this.ui.container.style.boxShadow = i10 ? `0 0 8px 2px ${i10}` : ``, this.ui.list.style(this.styles.list), this.ui.tree.tree.style(this.styles.list);
      let a10 = [];
      this.styles.pickerGroup.pickerGroupBorder && a10.push(`.quick-input-list .quick-input-list-entry { border-top-color:  ${this.styles.pickerGroup.pickerGroupBorder}; }`), this.styles.pickerGroup.pickerGroupForeground && a10.push(`.quick-input-list .quick-input-list-separator { color:  ${this.styles.pickerGroup.pickerGroupForeground}; }`), this.styles.pickerGroup.pickerGroupForeground && a10.push(`.quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }`), (this.styles.keybindingLabel.keybindingLabelBackground || this.styles.keybindingLabel.keybindingLabelBorder || this.styles.keybindingLabel.keybindingLabelBottomBorder || this.styles.keybindingLabel.keybindingLabelShadow || this.styles.keybindingLabel.keybindingLabelForeground) && (a10.push(`.quick-input-list .monaco-keybinding > .monaco-keybinding-key {`), this.styles.keybindingLabel.keybindingLabelBackground && a10.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`), this.styles.keybindingLabel.keybindingLabelBorder && a10.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`), this.styles.keybindingLabel.keybindingLabelBottomBorder && a10.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`), this.styles.keybindingLabel.keybindingLabelShadow && a10.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`), this.styles.keybindingLabel.keybindingLabelForeground && a10.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`), a10.push(`}`));
      let o10 = a10.join(`
`);
      o10 !== this.ui.styleSheet.textContent && (this.ui.styleSheet.textContent = o10);
    }
  }
  loadViewState() {
    try {
      let e206 = JSON.parse(this.storageService.get(XH, -1, `{}`));
      if (e206.top !== void 0 || e206.left !== void 0) return e206;
    } catch {
    }
  }
  saveViewState(e206) {
    this.layoutService.activeContainer === this.layoutService.mainContainer && (e206 === void 0 ? this.storageService.remove(XH, -1) : this.storageService.store(XH, JSON.stringify(e206), -1, 1));
  }
}, JH = _gb, _gb.MAX_WIDTH = 600, _gb);
ZH = JH = KH([qH(1, Bk), qH(2, V), qH(3, nd), qH(4, dF)], ZH);
var QH = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this._container = e206, this._quickInputContainer = t10, this._quickInputDragAreas = n10, this._layoutService = i10, this.configurationService = o10, this.dndViewState = Ic(this, void 0), this._snapThreshold = 20, this._snapLineHorizontalRatio = 0.25, this._quickInputAlignmentContext = L_e.bindTo(a10);
    let s10 = d_e(this.configurationService) === `custom`;
    this._controlsOnLeft = s10 && jt === 1, this._controlsOnRight = s10 && (jt === 3 || jt === 2), this._registerLayoutListener(), this.registerMouseListeners(), this.dndViewState.set({ ...r10, done: true }, void 0);
  }
  reparentUI(e206) {
    this._container = e206;
  }
  layoutContainer(e206 = this._layoutService.activeContainerDimension) {
    let t10 = this.dndViewState.get(), n10 = this._quickInputContainer.getBoundingClientRect();
    if (t10?.top && t10?.left) {
      let r10 = Math.round(t10.left * 100) / 100, i10 = e206.width, a10 = n10.width, o10 = r10 * i10 - a10 / 2;
      this._layout(t10.top * e206.height, o10);
    }
  }
  _registerLayoutListener() {
    this._register(O.filter(this._layoutService.onDidLayoutContainer, (e206) => e206.container === this._container)((e206) => this.layoutContainer(e206.dimension)));
  }
  registerMouseListeners() {
    let e206 = this._quickInputContainer;
    this._register(il(e206, (t10) => {
      let n10 = new Xo(Vc(e206), t10);
      n10.detail === 2 && this._quickInputDragAreas.some(({ node: e207, includeChildren: t11 }) => t11 ? Cl(n10.target, e207) : n10.target === e207) && this.dndViewState.set({ top: void 0, left: void 0, done: true }, void 0);
    })), this._register(nl(e206, (e207) => {
      let t10 = Vc(this._layoutService.activeContainer), n10 = new Xo(t10, e207);
      if (!this._quickInputDragAreas.some(({ node: e208, includeChildren: t11 }) => t11 ? Cl(n10.target, e208) : n10.target === e208)) return;
      let r10 = this._quickInputContainer.getBoundingClientRect(), i10 = n10.browserEvent.clientX - r10.left, a10 = n10.browserEvent.clientY - r10.top, o10 = false, s10 = rl(t10, (e208) => {
        new Xo(t10, e208).preventDefault(), o10 || (o10 = true), this._layout(e208.clientY - a10, e208.clientX - i10);
      }), c10 = il(t10, (e208) => {
        if (o10) {
          let e209 = this.dndViewState.get();
          this.dndViewState.set({ top: e209?.top, left: e209?.left, done: true }, void 0);
        }
        s10.dispose(), c10.dispose();
      });
    }));
  }
  _layout(e206, t10) {
    let n10 = this._getTopSnapValue(), r10 = this._getCenterYSnapValue(), i10 = this._getCenterXSnapValue();
    e206 = Math.max(0, Math.min(e206, this._container.clientHeight - this._quickInputContainer.clientHeight)), e206 < this._layoutService.activeContainerOffset.top && (this._controlsOnLeft ? t10 = Math.max(t10, 80 / Ao(Nl())) : this._controlsOnRight && (t10 = Math.min(t10, this._container.clientWidth - this._quickInputContainer.clientWidth - 140 / Ao(Nl()))));
    let a10 = Math.abs(e206 - n10) < this._snapThreshold;
    e206 = a10 ? n10 : e206;
    let o10 = Math.abs(e206 - r10) < this._snapThreshold;
    e206 = o10 ? r10 : e206;
    let s10 = e206 / this._container.clientHeight;
    t10 = Math.max(0, Math.min(t10, this._container.clientWidth - this._quickInputContainer.clientWidth));
    let c10 = Math.abs(t10 - i10) < this._snapThreshold;
    t10 = c10 ? i10 : t10;
    let l10 = this._container.clientWidth, u10 = this._quickInputContainer.clientWidth, d10 = (t10 + u10 / 2) / l10;
    if (this.dndViewState.set({ top: s10, left: d10, done: false }, void 0), c10) {
      if (a10) {
        this._quickInputAlignmentContext.set(`top`);
        return;
      } else if (o10) {
        this._quickInputAlignmentContext.set(`center`);
        return;
      }
    }
    this._quickInputAlignmentContext.set(void 0);
  }
  _getTopSnapValue() {
    return this._layoutService.activeContainerOffset.quickPickTop;
  }
  _getCenterYSnapValue() {
    return Math.round(this._container.clientHeight * this._snapLineHorizontalRatio);
  }
  _getCenterXSnapValue() {
    return Math.round(this._container.clientWidth / 2) - Math.round(this._quickInputContainer.clientWidth / 2);
  }
};
QH = KH([qH(4, Bk), qH(5, nd), qH(6, Uf)], QH);
var $H = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, eU = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, tU = class extends Wse {
  get controller() {
    return this._controller || (this._controller = this._register(this.createController())), this._controller;
  }
  get hasController() {
    return !!this._controller;
  }
  get currentQuickInput() {
    return this.controller.currentQuickInput;
  }
  get quickAccess() {
    return this._quickAccess || (this._quickAccess = this._register(this.instantiationService.createInstance(tR))), this._quickAccess;
  }
  constructor(e206, t10, n10, r10, i10) {
    super(n10), this.instantiationService = e206, this.contextKeyService = t10, this.layoutService = r10, this.configurationService = i10, this._onShow = this._register(new k()), this._onHide = this._register(new k()), this.contexts = /* @__PURE__ */ new Map();
  }
  createController(e206 = this.layoutService, t10) {
    let n10 = { idPrefix: `quickInput_`, container: e206.activeContainer, ignoreFocusOut: () => false, backKeybindingLabel: () => void 0, setContextKey: (e207) => this.setContextKey(e207), linkOpenerDelegate: (e207) => {
      this.instantiationService.invokeFunction((t11) => {
        t11.get(IP).open(e207, { allowCommands: true, fromUserGesture: true });
      });
    }, returnFocus: () => e206.focus(), styles: this.computeStyles(), hoverDelegate: this._register(this.instantiationService.createInstance(vR)) }, r10 = this._register(this.instantiationService.createInstance(ZH, { ...n10, ...t10 }));
    return r10.layout(e206.activeContainerDimension, e206.activeContainerOffset.quickPickTop), this._register(e206.onDidLayoutActiveContainer((t11) => {
      Vc(e206.activeContainer) === Vc(r10.container) && r10.layout(t11, e206.activeContainerOffset.quickPickTop);
    })), this._register(e206.onDidChangeActiveContainer(() => {
      r10.isVisible() || r10.layout(e206.activeContainerDimension, e206.activeContainerOffset.quickPickTop);
    })), this._register(r10.onShow(() => {
      this.resetContextKeys(), this._onShow.fire();
    })), this._register(r10.onHide(() => {
      this.resetContextKeys(), this._onHide.fire();
    })), r10;
  }
  setContextKey(e206) {
    let t10;
    e206 && (t10 = this.contexts.get(e206), t10 || (t10 = new U(e206, false).bindTo(this.contextKeyService), this.contexts.set(e206, t10))), !(t10 && t10.get()) && (this.resetContextKeys(), t10?.set(true));
  }
  resetContextKeys() {
    this.contexts.forEach((e206) => {
      e206.get() && e206.reset();
    });
  }
  pick(e206, t10, n10 = dr.None) {
    return this.controller.pick(e206, t10, n10);
  }
  input(e206 = {}, t10 = dr.None) {
    return this.controller.input(e206, t10);
  }
  createQuickPick(e206 = { useSeparators: false }) {
    return this.controller.createQuickPick(e206);
  }
  createInputBox() {
    return this.controller.createInputBox();
  }
  toggleHover() {
    this.hasController && this.controller.toggleHover();
  }
  updateStyles() {
    this.hasController && this.controller.applyStyles(this.computeStyles());
  }
  computeStyles() {
    return { widget: { quickInputBackground: Z(fb), quickInputForeground: Z(poe), quickInputTitleBackground: Z(moe), widgetBorder: Z(Wv), widgetShadow: Z(Uv) }, inputBox: cL, toggle: oL, countBadge: lL, button: i_e, progressBar: a_e, keybindingLabel: aL, list: dL({ listBackground: fb, listFocusBackground: _b2, listFocusForeground: hb, listInactiveFocusForeground: hb, listInactiveSelectionIconForeground: gb, listInactiveFocusBackground: _b2, listFocusOutline: J_, listInactiveFocusOutline: J_, treeStickyScrollBackground: fb }), pickerGroup: { pickerGroupBorder: Z(hoe), pickerGroupForeground: Z(pb) } };
  }
};
tU = $H([eU(0, V), eU(1, nd), eU(2, US), eU(3, Bk), eU(4, Uf)], tU);
var nU = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, rU = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, iU = class extends tU {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(t10, n10, r10, new Wk(e206.getContainerDomNode(), i10), a10), this.host = void 0;
    let o10 = oU.get(e206);
    if (o10) {
      let t11 = o10.widget;
      this.host = { _serviceBrand: void 0, get mainContainer() {
        return t11.getDomNode();
      }, getContainer() {
        return t11.getDomNode();
      }, whenContainerStylesLoaded() {
      }, get containers() {
        return [t11.getDomNode()];
      }, get activeContainer() {
        return t11.getDomNode();
      }, get mainContainerDimension() {
        return e206.getLayoutInfo();
      }, get activeContainerDimension() {
        return e206.getLayoutInfo();
      }, get onDidLayoutMainContainer() {
        return e206.onDidLayoutChange;
      }, get onDidLayoutActiveContainer() {
        return e206.onDidLayoutChange;
      }, get onDidLayoutContainer() {
        return O.map(e206.onDidLayoutChange, (e207) => ({ container: t11.getDomNode(), dimension: e207 }));
      }, get onDidChangeActiveContainer() {
        return O.None;
      }, get onDidAddContainer() {
        return O.None;
      }, get mainContainerOffset() {
        return { top: 0, quickPickTop: 0 };
      }, get activeContainerOffset() {
        return { top: 0, quickPickTop: 0 };
      }, focus: () => e206.focus() };
    } else this.host = void 0;
  }
  createController() {
    return super.createController(this.host);
  }
};
iU = nU([rU(1, V), rU(2, nd), rU(3, US), rU(4, Su), rU(5, Uf)], iU);
var aU = class {
  get activeService() {
    let e206 = this.codeEditorService.getFocusedCodeEditor();
    if (!e206) throw Error(`Quick input service needs a focused editor to work.`);
    let t10 = this.mapEditorToService.get(e206);
    if (!t10) {
      let n10 = t10 = this.instantiationService.createInstance(iU, e206);
      this.mapEditorToService.set(e206, t10), Ht(e206.onDidDispose)(() => {
        n10.dispose(), this.mapEditorToService.delete(e206);
      });
    }
    return t10;
  }
  get currentQuickInput() {
    return this.activeService.currentQuickInput;
  }
  get quickAccess() {
    return this.activeService.quickAccess;
  }
  constructor(e206, t10) {
    this.instantiationService = e206, this.codeEditorService = t10, this.mapEditorToService = /* @__PURE__ */ new Map();
  }
  pick(e206, t10, n10 = dr.None) {
    return this.activeService.pick(e206, t10, n10);
  }
  input(e206, t10) {
    return this.activeService.input(e206, t10);
  }
  createQuickPick(e206 = { useSeparators: false }) {
    return this.activeService.createQuickPick(e206);
  }
  createInputBox() {
    return this.activeService.createInputBox();
  }
  toggleHover() {
    return this.activeService.toggleHover();
  }
};
aU = nU([rU(0, V), rU(1, Su)], aU);
var oU = (_hb = class {
  static get(t10) {
    return t10.getContribution(_hb.ID);
  }
  constructor(e206) {
    this.editor = e206, this.widget = new sU(this.editor);
  }
  dispose() {
    this.widget.dispose();
  }
}, _hb.ID = `editor.controller.quickInput`, _hb), sU = (_ib = class {
  constructor(e206) {
    this.codeEditor = e206, this.domNode = document.createElement(`div`), this.codeEditor.addOverlayWidget(this);
  }
  getId() {
    return _ib.ID;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return { preference: { top: 0, left: 0 } };
  }
  dispose() {
    this.codeEditor.removeOverlayWidget(this);
  }
}, _ib.ID = `editor.contrib.quickInputWidget`, _ib);
af(oU.ID, oU, 4);
var cU = class {
  constructor(e206, t10, n10, r10, i10) {
    this._parsedThemeRuleBrand = void 0, this.token = e206, this.index = t10, this.fontStyle = n10, this.foreground = r10, this.background = i10;
  }
};
function lU(e206) {
  if (!e206 || !Array.isArray(e206)) return [];
  let t10 = [], n10 = 0;
  for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
    let i11 = e206[r10], a10 = -1;
    if (typeof i11.fontStyle == `string`) {
      a10 = 0;
      let e207 = i11.fontStyle.split(` `);
      for (let t11 = 0, n11 = e207.length; t11 < n11; t11++) switch (e207[t11]) {
        case `italic`:
          a10 |= 1;
          break;
        case `bold`:
          a10 |= 2;
          break;
        case `underline`:
          a10 |= 4;
          break;
        case `strikethrough`:
          a10 |= 8;
          break;
      }
    }
    let o10 = null;
    typeof i11.foreground == `string` && (o10 = i11.foreground);
    let s10 = null;
    typeof i11.background == `string` && (s10 = i11.background), t10[n10++] = new cU(i11.token || ``, r10, a10, o10, s10);
  }
  return t10;
}
function uU(e206, t10) {
  e206.sort((e207, t11) => {
    let n11 = gU(e207.token, t11.token);
    return n11 === 0 ? e207.index - t11.index : n11;
  });
  let n10 = 0, r10 = `000000`, i10 = `ffffff`;
  for (; e206.length >= 1 && e206[0].token === ``; ) {
    let t11 = e206.shift();
    t11.fontStyle !== -1 && (n10 = t11.fontStyle), t11.foreground !== null && (r10 = t11.foreground), t11.background !== null && (i10 = t11.background);
  }
  let a10 = new fU();
  for (let e207 of t10) a10.getId(e207);
  let o10 = a10.getId(r10), s10 = a10.getId(i10), c10 = new vU(new _U2(n10, o10, s10));
  for (let t11 = 0, n11 = e206.length; t11 < n11; t11++) {
    let n12 = e206[t11];
    c10.insert(n12.token, n12.fontStyle, a10.getId(n12.foreground), a10.getId(n12.background));
  }
  return new pU(a10, c10);
}
var dU = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/, fU = class {
  constructor() {
    this._lastColorId = 0, this._id2color = [], this._color2id = /* @__PURE__ */ new Map();
  }
  getId(e206) {
    if (e206 === null) return 0;
    let t10 = e206.match(dU);
    if (!t10) throw Error(`Illegal value for token color: ` + e206);
    e206 = t10[1].toUpperCase();
    let n10 = this._color2id.get(e206);
    return n10 || (n10 = ++this._lastColorId, this._color2id.set(e206, n10), this._id2color[n10] = Y.fromHex(`#` + e206), n10);
  }
  getColorMap() {
    return this._id2color.slice(0);
  }
}, pU = class {
  static createFromRawTokenTheme(e206, t10) {
    return this.createFromParsedTokenTheme(lU(e206), t10);
  }
  static createFromParsedTokenTheme(e206, t10) {
    return uU(e206, t10);
  }
  constructor(e206, t10) {
    this._colorMap = e206, this._root = t10, this._cache = /* @__PURE__ */ new Map();
  }
  getColorMap() {
    return this._colorMap.getColorMap();
  }
  _match(e206) {
    return this._root.match(e206);
  }
  match(e206, t10) {
    let n10 = this._cache.get(t10);
    if (n10 === void 0) {
      let e207 = this._match(t10), r10 = hU(t10);
      n10 = (e207.metadata | r10 << 8) >>> 0, this._cache.set(t10, n10);
    }
    return (n10 | e206 << 0) >>> 0;
  }
}, mU = /\b(comment|string|regex|regexp)\b/;
function hU(e206) {
  let t10 = e206.match(mU);
  if (!t10) return 0;
  switch (t10[1]) {
    case `comment`:
      return 1;
    case `string`:
      return 2;
    case `regex`:
      return 3;
    case `regexp`:
      return 3;
  }
  throw Error(`Unexpected match for standard token type!`);
}
function gU(e206, t10) {
  return e206 < t10 ? -1 : +(e206 > t10);
}
var _U2 = class e152 {
  constructor(e206, t10, n10) {
    this._themeTrieElementRuleBrand = void 0, this._fontStyle = e206, this._foreground = t10, this._background = n10, this.metadata = (this._fontStyle << 11 | this._foreground << 15 | this._background << 24) >>> 0;
  }
  clone() {
    return new e152(this._fontStyle, this._foreground, this._background);
  }
  acceptOverwrite(e206, t10, n10) {
    e206 !== -1 && (this._fontStyle = e206), t10 !== 0 && (this._foreground = t10), n10 !== 0 && (this._background = n10), this.metadata = (this._fontStyle << 11 | this._foreground << 15 | this._background << 24) >>> 0;
  }
}, vU = class e153 {
  constructor(e206) {
    this._themeTrieElementBrand = void 0, this._mainRule = e206, this._children = /* @__PURE__ */ new Map();
  }
  match(e206) {
    if (e206 === ``) return this._mainRule;
    let t10 = e206.indexOf(`.`), n10, r10;
    t10 === -1 ? (n10 = e206, r10 = ``) : (n10 = e206.substring(0, t10), r10 = e206.substring(t10 + 1));
    let i10 = this._children.get(n10);
    return i10 === void 0 ? this._mainRule : i10.match(r10);
  }
  insert(t10, n10, r10, i10) {
    if (t10 === ``) {
      this._mainRule.acceptOverwrite(n10, r10, i10);
      return;
    }
    let a10 = t10.indexOf(`.`), o10, s10;
    a10 === -1 ? (o10 = t10, s10 = ``) : (o10 = t10.substring(0, a10), s10 = t10.substring(a10 + 1));
    let c10 = this._children.get(o10);
    c10 === void 0 && (c10 = new e153(this._mainRule.clone()), this._children.set(o10, c10)), c10.insert(s10, n10, r10, i10);
  }
};
function yU(e206) {
  let t10 = [];
  for (let n10 = 1, r10 = e206.length; n10 < r10; n10++) {
    let r11 = e206[n10];
    t10[n10] = `.mtk${n10} { color: ${r11}; }`;
  }
  return t10.push(`.mtki { font-style: italic; }`), t10.push(`.mtkb { font-weight: bold; }`), t10.push(`.mtku { text-decoration: underline; text-underline-position: under; }`), t10.push(`.mtks { text-decoration: line-through; }`), t10.push(`.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }`), t10.join(`
`);
}
var bU = { base: `vs`, inherit: false, rules: [{ token: ``, foreground: `000000`, background: `fffffe` }, { token: `invalid`, foreground: `cd3131` }, { token: `emphasis`, fontStyle: `italic` }, { token: `strong`, fontStyle: `bold` }, { token: `variable`, foreground: `001188` }, { token: `variable.predefined`, foreground: `4864AA` }, { token: `constant`, foreground: `dd0000` }, { token: `comment`, foreground: `008000` }, { token: `number`, foreground: `098658` }, { token: `number.hex`, foreground: `3030c0` }, { token: `regexp`, foreground: `800000` }, { token: `annotation`, foreground: `808080` }, { token: `type`, foreground: `008080` }, { token: `delimiter`, foreground: `000000` }, { token: `delimiter.html`, foreground: `383838` }, { token: `delimiter.xml`, foreground: `0000FF` }, { token: `tag`, foreground: `800000` }, { token: `tag.id.pug`, foreground: `4F76AC` }, { token: `tag.class.pug`, foreground: `4F76AC` }, { token: `meta.scss`, foreground: `800000` }, { token: `metatag`, foreground: `e00000` }, { token: `metatag.content.html`, foreground: `FF0000` }, { token: `metatag.html`, foreground: `808080` }, { token: `metatag.xml`, foreground: `808080` }, { token: `metatag.php`, fontStyle: `bold` }, { token: `key`, foreground: `863B00` }, { token: `string.key.json`, foreground: `A31515` }, { token: `string.value.json`, foreground: `0451A5` }, { token: `attribute.name`, foreground: `FF0000` }, { token: `attribute.value`, foreground: `0451A5` }, { token: `attribute.value.number`, foreground: `098658` }, { token: `attribute.value.unit`, foreground: `098658` }, { token: `attribute.value.html`, foreground: `0000FF` }, { token: `attribute.value.xml`, foreground: `0000FF` }, { token: `string`, foreground: `A31515` }, { token: `string.html`, foreground: `0000FF` }, { token: `string.sql`, foreground: `FF0000` }, { token: `string.yaml`, foreground: `0451A5` }, { token: `keyword`, foreground: `0000FF` }, { token: `keyword.json`, foreground: `0451A5` }, { token: `keyword.flow`, foreground: `AF00DB` }, { token: `keyword.flow.scss`, foreground: `0000FF` }, { token: `operator.scss`, foreground: `666666` }, { token: `operator.sql`, foreground: `778899` }, { token: `operator.swift`, foreground: `666666` }, { token: `predefined.sql`, foreground: `C700C7` }], colors: { [rv]: `#FFFFFE`, [iv]: `#000000`, [yv]: `#E5EBF1`, [nC]: `#D3D3D3`, [rC]: `#939393`, [bv]: `#ADD6FF4D` } }, xU = { base: `vs-dark`, inherit: false, rules: [{ token: ``, foreground: `D4D4D4`, background: `1E1E1E` }, { token: `invalid`, foreground: `f44747` }, { token: `emphasis`, fontStyle: `italic` }, { token: `strong`, fontStyle: `bold` }, { token: `variable`, foreground: `74B0DF` }, { token: `variable.predefined`, foreground: `4864AA` }, { token: `variable.parameter`, foreground: `9CDCFE` }, { token: `constant`, foreground: `569CD6` }, { token: `comment`, foreground: `608B4E` }, { token: `number`, foreground: `B5CEA8` }, { token: `number.hex`, foreground: `5BB498` }, { token: `regexp`, foreground: `B46695` }, { token: `annotation`, foreground: `cc6666` }, { token: `type`, foreground: `3DC9B0` }, { token: `delimiter`, foreground: `DCDCDC` }, { token: `delimiter.html`, foreground: `808080` }, { token: `delimiter.xml`, foreground: `808080` }, { token: `tag`, foreground: `569CD6` }, { token: `tag.id.pug`, foreground: `4F76AC` }, { token: `tag.class.pug`, foreground: `4F76AC` }, { token: `meta.scss`, foreground: `A79873` }, { token: `meta.tag`, foreground: `CE9178` }, { token: `metatag`, foreground: `DD6A6F` }, { token: `metatag.content.html`, foreground: `9CDCFE` }, { token: `metatag.html`, foreground: `569CD6` }, { token: `metatag.xml`, foreground: `569CD6` }, { token: `metatag.php`, fontStyle: `bold` }, { token: `key`, foreground: `9CDCFE` }, { token: `string.key.json`, foreground: `9CDCFE` }, { token: `string.value.json`, foreground: `CE9178` }, { token: `attribute.name`, foreground: `9CDCFE` }, { token: `attribute.value`, foreground: `CE9178` }, { token: `attribute.value.number.css`, foreground: `B5CEA8` }, { token: `attribute.value.unit.css`, foreground: `B5CEA8` }, { token: `attribute.value.hex.css`, foreground: `D4D4D4` }, { token: `string`, foreground: `CE9178` }, { token: `string.sql`, foreground: `FF0000` }, { token: `keyword`, foreground: `569CD6` }, { token: `keyword.flow`, foreground: `C586C0` }, { token: `keyword.json`, foreground: `CE9178` }, { token: `keyword.flow.scss`, foreground: `569CD6` }, { token: `operator.scss`, foreground: `909090` }, { token: `operator.sql`, foreground: `778899` }, { token: `operator.swift`, foreground: `909090` }, { token: `predefined.sql`, foreground: `FF00FF` }], colors: { [rv]: `#1E1E1E`, [iv]: `#D4D4D4`, [yv]: `#3A3D41`, [nC]: `#404040`, [rC]: `#707070`, [bv]: `#ADD6FF26` } }, SU = { base: `hc-black`, inherit: false, rules: [{ token: ``, foreground: `FFFFFF`, background: `000000` }, { token: `invalid`, foreground: `f44747` }, { token: `emphasis`, fontStyle: `italic` }, { token: `strong`, fontStyle: `bold` }, { token: `variable`, foreground: `1AEBFF` }, { token: `variable.parameter`, foreground: `9CDCFE` }, { token: `constant`, foreground: `569CD6` }, { token: `comment`, foreground: `608B4E` }, { token: `number`, foreground: `FFFFFF` }, { token: `regexp`, foreground: `C0C0C0` }, { token: `annotation`, foreground: `569CD6` }, { token: `type`, foreground: `3DC9B0` }, { token: `delimiter`, foreground: `FFFF00` }, { token: `delimiter.html`, foreground: `FFFF00` }, { token: `tag`, foreground: `569CD6` }, { token: `tag.id.pug`, foreground: `4F76AC` }, { token: `tag.class.pug`, foreground: `4F76AC` }, { token: `meta`, foreground: `D4D4D4` }, { token: `meta.tag`, foreground: `CE9178` }, { token: `metatag`, foreground: `569CD6` }, { token: `metatag.content.html`, foreground: `1AEBFF` }, { token: `metatag.html`, foreground: `569CD6` }, { token: `metatag.xml`, foreground: `569CD6` }, { token: `metatag.php`, fontStyle: `bold` }, { token: `key`, foreground: `9CDCFE` }, { token: `string.key`, foreground: `9CDCFE` }, { token: `string.value`, foreground: `CE9178` }, { token: `attribute.name`, foreground: `569CD6` }, { token: `attribute.value`, foreground: `3FF23F` }, { token: `string`, foreground: `CE9178` }, { token: `string.sql`, foreground: `FF0000` }, { token: `keyword`, foreground: `569CD6` }, { token: `keyword.flow`, foreground: `C586C0` }, { token: `operator.sql`, foreground: `778899` }, { token: `operator.swift`, foreground: `909090` }, { token: `predefined.sql`, foreground: `FF00FF` }], colors: { [rv]: `#000000`, [iv]: `#FFFFFF`, [nC]: `#FFFFFF`, [rC]: `#FFFFFF` } }, CU = { base: `hc-light`, inherit: false, rules: [{ token: ``, foreground: `292929`, background: `FFFFFF` }, { token: `invalid`, foreground: `B5200D` }, { token: `emphasis`, fontStyle: `italic` }, { token: `strong`, fontStyle: `bold` }, { token: `variable`, foreground: `264F70` }, { token: `variable.predefined`, foreground: `4864AA` }, { token: `constant`, foreground: `dd0000` }, { token: `comment`, foreground: `008000` }, { token: `number`, foreground: `098658` }, { token: `number.hex`, foreground: `3030c0` }, { token: `regexp`, foreground: `800000` }, { token: `annotation`, foreground: `808080` }, { token: `type`, foreground: `008080` }, { token: `delimiter`, foreground: `000000` }, { token: `delimiter.html`, foreground: `383838` }, { token: `tag`, foreground: `800000` }, { token: `tag.id.pug`, foreground: `4F76AC` }, { token: `tag.class.pug`, foreground: `4F76AC` }, { token: `meta.scss`, foreground: `800000` }, { token: `metatag`, foreground: `e00000` }, { token: `metatag.content.html`, foreground: `B5200D` }, { token: `metatag.html`, foreground: `808080` }, { token: `metatag.xml`, foreground: `808080` }, { token: `metatag.php`, fontStyle: `bold` }, { token: `key`, foreground: `863B00` }, { token: `string.key.json`, foreground: `A31515` }, { token: `string.value.json`, foreground: `0451A5` }, { token: `attribute.name`, foreground: `264F78` }, { token: `attribute.value`, foreground: `0451A5` }, { token: `string`, foreground: `A31515` }, { token: `string.sql`, foreground: `B5200D` }, { token: `keyword`, foreground: `0000FF` }, { token: `keyword.flow`, foreground: `AF00DB` }, { token: `operator.sql`, foreground: `778899` }, { token: `operator.swift`, foreground: `666666` }, { token: `predefined.sql`, foreground: `C700C7` }], colors: { [rv]: `#FFFFFF`, [iv]: `#292929`, [nC]: `#292929`, [rC]: `#292929` } }, wU = { IconContribution: `base.contributions.icons` }, TU;
(function(e206) {
  function t10(e207, t11) {
    let n10 = e207.defaults;
    for (; ju.isThemeIcon(n10); ) {
      let e208 = kU.getIcon(n10.id);
      if (!e208) return;
      n10 = e208.defaults;
    }
    return n10;
  }
  e206.getDefinition = t10;
})(TU || (TU = {}));
var EU;
(function(e206) {
  function t10(e207) {
    return { weight: e207.weight, style: e207.style, src: e207.src.map((e208) => ({ format: e208.format, location: e208.location.toString() })) };
  }
  e206.toJSONObject = t10;
  function n10(e207) {
    let t11 = (e208) => Re(e208) ? e208 : void 0;
    if (e207 && Array.isArray(e207.src) && e207.src.every((e208) => Re(e208.format) && Re(e208.location))) return { weight: t11(e207.weight), style: t11(e207.style), src: e207.src.map((e208) => ({ format: e208.format, location: $r.parse(e208.location) })) };
  }
  e206.fromJSONObject = n10;
})(EU || (EU = {}));
var DU = /^([\w_-]+)$/, OU = C(2024, `The font ID must only contain letters, numbers, underscores and dashes.`), kU = new class extends D {
  constructor() {
    super(), this._onDidChange = this._register(new k()), this.onDidChange = this._onDidChange.event, this.iconSchema = { definitions: { icons: { type: `object`, properties: { fontId: { type: `string`, description: C(2025, `The id of the font to use. If not set, the font that is defined first is used.`), pattern: DU.source, patternErrorMessage: OU }, fontCharacter: { type: `string`, description: C(2026, `The font character associated with the icon definition.`) } }, additionalProperties: false, defaultSnippets: [{ body: { fontCharacter: `\\\\e030` } }] } }, type: `object`, properties: {} }, this.iconReferenceSchema = { type: `string`, pattern: `^${ju.iconNameExpression}$`, enum: [], enumDescriptions: [] }, this.iconsById = {}, this.iconFontsById = {};
  }
  registerIcon(e206, t10, n10, r10) {
    let i10 = this.iconsById[e206];
    if (i10) {
      if (n10 && !i10.description) {
        i10.description = n10, this.iconSchema.properties[e206].markdownDescription = `${n10} $(${e206})`;
        let t11 = this.iconReferenceSchema.enum.indexOf(e206);
        t11 !== -1 && (this.iconReferenceSchema.enumDescriptions[t11] = n10), this._onDidChange.fire();
      }
      return i10;
    }
    let a10 = { id: e206, description: n10, defaults: t10, deprecationMessage: r10 };
    this.iconsById[e206] = a10;
    let o10 = { $ref: `#/definitions/icons` };
    return r10 && (o10.deprecationMessage = r10), n10 && (o10.markdownDescription = `${n10}: $(${e206})`), this.iconSchema.properties[e206] = o10, this.iconReferenceSchema.enum.push(e206), this.iconReferenceSchema.enumDescriptions.push(n10 || ``), this._onDidChange.fire(), { id: e206 };
  }
  getIcons() {
    return Object.keys(this.iconsById).map((e206) => this.iconsById[e206]);
  }
  getIcon(e206) {
    return this.iconsById[e206];
  }
  getIconSchema() {
    return this.iconSchema;
  }
  toString() {
    let e206 = (e207, t11) => e207.id.localeCompare(t11.id), t10 = (e207) => {
      for (; ju.isThemeIcon(e207.defaults); ) e207 = this.iconsById[e207.defaults.id];
      return `codicon codicon-${e207 ? e207.id : ``}`;
    }, n10 = [];
    n10.push(`| preview     | identifier                        | default codicon ID                | description`), n10.push(`| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |`);
    let r10 = Object.keys(this.iconsById).map((e207) => this.iconsById[e207]);
    for (let i10 of r10.filter((e207) => !!e207.description).sort(e206)) n10.push(`|<i class="${t10(i10)}"></i>|${i10.id}|${ju.isThemeIcon(i10.defaults) ? i10.defaults.id : i10.id}|${i10.description || ``}|`);
    n10.push(`| preview     | identifier                        `), n10.push(`| ----------- | --------------------------------- |`);
    for (let i10 of r10.filter((e207) => !ju.isThemeIcon(e207.defaults)).sort(e206)) n10.push(`|<i class="${t10(i10)}"></i>|${i10.id}|`);
    return n10.join(`
`);
  }
}();
cd.add(wU.IconContribution, kU);
function AU(e206, t10, n10, r10) {
  return kU.registerIcon(e206, t10, n10, r10);
}
function jU() {
  return kU;
}
function MU() {
  let e206 = ui();
  for (let t10 in e206) {
    let n10 = `\\` + e206[t10].toString(16);
    kU.registerIcon(t10, { fontCharacter: n10 });
  }
}
MU();
var NU = `vscode://schemas/icons`, PU = cd.as(ep.JSONContribution);
PU.registerSchema(NU, kU.getIconSchema());
var FU = new us(() => PU.notifySchemaChanged(NU), 200);
kU.onDidChange(() => {
  FU.isScheduled() || FU.schedule();
});
var IU = AU(`widget-close`, F.close, C(2027, `Icon for the close action in widgets.`));
AU(`goto-previous-location`, F.arrowUp, C(2028, `Icon for goto previous editor location.`)), AU(`goto-next-location`, F.arrowDown, C(2029, `Icon for goto next editor location.`)), ju.modify(F.sync, `spin`), ju.modify(F.loading, `spin`);
function LU(e206) {
  let t10 = new E(), n10 = t10.add(new k()), r10 = jU();
  return t10.add(r10.onDidChange(() => n10.fire())), e206 && t10.add(e206.onDidProductIconThemeChange(() => n10.fire())), { dispose: () => t10.dispose(), onDidChange: n10.event, getCSS() {
    let t11 = e206 ? e206.getProductIconTheme() : new RU(), n11 = {}, i10 = new bI(), a10 = new bI();
    for (let e207 of r10.getIcons()) {
      let r11 = t11.getIcon(e207);
      if (!r11) continue;
      let o10 = r11.font, s10 = yI`--vscode-icon-${vI(e207.id)}-font-family`, c10 = yI`--vscode-icon-${vI(e207.id)}-content`;
      o10 ? (n11[o10.id] = o10.definition, a10.push(yI`${s10}: ${gI(o10.id)};`, yI`${c10}: ${gI(r11.fontCharacter)};`), i10.push(yI`.codicon-${vI(e207.id)}:before { content: ${gI(r11.fontCharacter)}; font-family: ${gI(o10.id)}; }`)) : (a10.push(yI`${c10}: ${gI(r11.fontCharacter)}; ${s10}: 'codicon';`), i10.push(yI`.codicon-${vI(e207.id)}:before { content: ${gI(r11.fontCharacter)}; }`));
    }
    for (let e207 in n11) {
      let t12 = n11[e207], r11 = t12.weight ? yI`font-weight: ${hI(t12.weight)};` : yI``, a11 = t12.style ? yI`font-style: ${hI(t12.style)};` : yI``, o10 = new bI();
      for (let e208 of t12.src) o10.push(yI`${_I2(e208.location)} format(${gI(e208.format)})`);
      i10.push(yI`@font-face { src: ${o10.join(`, `)}; font-family: ${gI(e207)};${r11}${a11} font-display: block; }`);
    }
    return i10.push(yI`:root { ${a10.join(` `)} }`), i10.join(`
`);
  } };
}
var RU = class {
  getIcon(e206) {
    let t10 = jU(), n10 = e206.defaults;
    for (; ju.isThemeIcon(n10); ) {
      let e207 = t10.getIcon(n10.id);
      if (!e207) return;
      n10 = e207.defaults;
    }
    return n10;
  }
}, zU = `vs-dark`, BU = `hc-black`, VU = `hc-light`, HU = cd.as(k_.ColorContribution), UU = cd.as(KS.ThemingContribution), WU = class {
  constructor(e206, t10) {
    this.semanticHighlighting = false, this.themeData = t10;
    let n10 = t10.base;
    e206.length > 0 ? (GU(e206) ? this.id = e206 : this.id = n10 + ` ` + e206, this.themeName = e206) : (this.id = n10, this.themeName = n10), this.colors = null, this.defaultColors = /* @__PURE__ */ Object.create(null), this._tokenTheme = null;
  }
  get base() {
    return this.themeData.base;
  }
  notifyBaseUpdated() {
    this.themeData.inherit && (this.colors = null, this._tokenTheme = null);
  }
  getColors() {
    if (!this.colors) {
      let e206 = /* @__PURE__ */ new Map();
      for (let t10 in this.themeData.colors) e206.set(t10, Y.fromHex(this.themeData.colors[t10]));
      if (this.themeData.inherit) {
        let t10 = KU(this.themeData.base);
        for (let n10 in t10.colors) e206.has(n10) || e206.set(n10, Y.fromHex(t10.colors[n10]));
      }
      this.colors = e206;
    }
    return this.colors;
  }
  getColor(e206, t10) {
    let n10 = this.getColors().get(e206);
    if (n10) return n10;
    if (t10 !== false) return this.getDefault(e206);
  }
  getDefault(e206) {
    let t10 = this.defaultColors[e206];
    return t10 || (t10 = HU.resolveDefaultColor(e206, this), this.defaultColors[e206] = t10, t10);
  }
  defines(e206) {
    return this.getColors().has(e206);
  }
  get type() {
    switch (this.base) {
      case `vs`:
        return Nb.LIGHT;
      case BU:
        return Nb.HIGH_CONTRAST_DARK;
      case VU:
        return Nb.HIGH_CONTRAST_LIGHT;
      default:
        return Nb.DARK;
    }
  }
  get tokenTheme() {
    if (!this._tokenTheme) {
      let e206 = [], t10 = [];
      if (this.themeData.inherit) {
        let n11 = KU(this.themeData.base);
        e206 = n11.rules, n11.encodedTokensColors && (t10 = n11.encodedTokensColors);
      }
      let n10 = this.themeData.colors[`editor.foreground`], r10 = this.themeData.colors[`editor.background`];
      if (n10 || r10) {
        let t11 = { token: `` };
        n10 && (t11.foreground = n10), r10 && (t11.background = r10), e206.push(t11);
      }
      e206 = e206.concat(this.themeData.rules), this.themeData.encodedTokensColors && (t10 = this.themeData.encodedTokensColors), this._tokenTheme = pU.createFromRawTokenTheme(e206, t10);
    }
    return this._tokenTheme;
  }
  getTokenStyleMetadata(e206, t10, n10) {
    let r10 = this.tokenTheme._match([e206].concat(t10).join(`.`)).metadata, i10 = ng.getForeground(r10), a10 = ng.getFontStyle(r10);
    return { foreground: i10, italic: !!(a10 & 1), bold: !!(a10 & 2), underline: !!(a10 & 4), strikethrough: !!(a10 & 8) };
  }
  get tokenColorMap() {
    return [];
  }
};
function GU(e206) {
  return e206 === `vs` || e206 === `vs-dark` || e206 === `hc-black` || e206 === `hc-light`;
}
function KU(e206) {
  switch (e206) {
    case `vs`:
      return bU;
    case zU:
      return xU;
    case BU:
      return SU;
    case VU:
      return CU;
  }
}
function qU(e206) {
  return new WU(e206, KU(e206));
}
var JU = class extends D {
  constructor() {
    super(), this._onColorThemeChange = this._register(new k()), this.onDidColorThemeChange = this._onColorThemeChange.event, this._onProductIconThemeChange = this._register(new k()), this.onDidProductIconThemeChange = this._onProductIconThemeChange.event, this._environment = /* @__PURE__ */ Object.create(null), this._builtInProductIconTheme = new RU(), this._autoDetectHighContrast = true, this._knownThemes = /* @__PURE__ */ new Map(), this._knownThemes.set(`vs`, qU(`vs`)), this._knownThemes.set(zU, qU(zU)), this._knownThemes.set(BU, qU(BU)), this._knownThemes.set(VU, qU(VU));
    let e206 = this._register(LU(this));
    this._codiconCSS = e206.getCSS(), this._themeCSS = ``, this._allCSS = `${this._codiconCSS}
${this._themeCSS}`, this._globalStyleElement = null, this._styleElements = [], this._colorMapOverride = null, this.setTheme(`vs`), this._onOSSchemeChanged(), this._register(e206.onDidChange(() => {
      this._codiconCSS = e206.getCSS(), this._updateCSS();
    })), ko(Aa, `(forced-colors: active)`, () => {
      this._onOSSchemeChanged();
    });
  }
  registerEditorContainer(e206) {
    return Dl(e206) ? this._registerShadowDomContainer(e206) : this._registerRegularEditorContainer();
  }
  _registerRegularEditorContainer() {
    return this._globalStyleElement || (this._globalStyleElement = g_(void 0, (e206) => {
      e206.className = `monaco-colors`, e206.textContent = this._allCSS;
    }), this._styleElements.push(this._globalStyleElement)), D.None;
  }
  _registerShadowDomContainer(e206) {
    let t10 = g_(e206, (e207) => {
      e207.className = `monaco-colors`, e207.textContent = this._allCSS;
    });
    return this._styleElements.push(t10), { dispose: () => {
      for (let e207 = 0; e207 < this._styleElements.length; e207++) if (this._styleElements[e207] === t10) {
        this._styleElements.splice(e207, 1);
        return;
      }
    } };
  }
  defineTheme(e206, t10) {
    if (!/^[a-z0-9\-]+$/i.test(e206)) throw Error(`Illegal theme name!`);
    if (!GU(t10.base) && !GU(e206)) throw Error(`Illegal theme base!`);
    this._knownThemes.set(e206, new WU(e206, t10)), GU(e206) && this._knownThemes.forEach((t11) => {
      t11.base === e206 && t11.notifyBaseUpdated();
    }), this._theme.themeName === e206 && this.setTheme(e206);
  }
  getColorTheme() {
    return this._theme;
  }
  setColorMapOverride(e206) {
    this._colorMapOverride = e206, this._updateThemeOrColorMap();
  }
  setTheme(e206) {
    let t10;
    t10 = this._knownThemes.has(e206) ? this._knownThemes.get(e206) : this._knownThemes.get(`vs`), this._updateActualTheme(t10);
  }
  _updateActualTheme(e206) {
    !e206 || this._theme === e206 || (this._theme = e206, this._updateThemeOrColorMap());
  }
  _onOSSchemeChanged() {
    if (this._autoDetectHighContrast) {
      let e206 = Aa.matchMedia(`(forced-colors: active)`).matches;
      if (e206 !== Fb(this._theme.type)) {
        let t10;
        t10 = Ib(this._theme.type) ? e206 ? BU : zU : e206 ? VU : `vs`, this._updateActualTheme(this._knownThemes.get(t10));
      }
    }
  }
  setAutoDetectHighContrast(e206) {
    this._autoDetectHighContrast = e206, this._onOSSchemeChanged();
  }
  _updateThemeOrColorMap() {
    let e206 = [], t10 = {}, n10 = { addRule: (n11) => {
      t10[n11] || (e206.push(n11), t10[n11] = true);
    } };
    UU.getThemingParticipants().forEach((e207) => e207(this._theme, n10, this._environment));
    let r10 = [];
    for (let e207 of HU.getColors()) {
      let t11 = this._theme.getColor(e207.id, true);
      t11 && r10.push(`${E_(e207.id)}: ${t11.toString()};`);
    }
    n10.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${r10.join(`
`)} }`);
    let i10 = this._colorMapOverride || this._theme.tokenTheme.getColorMap();
    n10.addRule(yU(i10)), n10.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }`), this._themeCSS = e206.join(`
`), this._updateCSS(), Pi.setColorMap(i10), this._onColorThemeChange.fire(this._theme);
  }
  _updateCSS() {
    this._allCSS = `${this._codiconCSS}
${this._themeCSS}`, this._styleElements.forEach((e206) => e206.textContent = this._allCSS);
  }
  getFileIconTheme() {
    return { hasFileIcons: false, hasFolderIcons: false, hidesExplorerArrows: false };
  }
  getProductIconTheme() {
    return this._builtInProductIconTheme;
  }
}, YU = xu(`themeService`), XU = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, ZU = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, QU = class extends D {
  constructor(e206, t10, n10) {
    super(), this._contextKeyService = e206, this._layoutService = t10, this._configurationService = n10, this._accessibilitySupport = 0, this._onDidChangeScreenReaderOptimized = new k(), this._onDidChangeReducedMotion = new k(), this._onDidChangeLinkUnderline = new k(), this._accessibilityModeEnabledContext = t_.bindTo(this._contextKeyService);
    let r10 = () => this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());
    this._register(this._configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(`editor.accessibilitySupport`) && (r10(), this._onDidChangeScreenReaderOptimized.fire()), e207.affectsConfiguration(`workbench.reduceMotion`) && (this._configMotionReduced = this._configurationService.getValue(`workbench.reduceMotion`), this._onDidChangeReducedMotion.fire());
    })), r10(), this._register(this.onDidChangeScreenReaderOptimized(() => r10()));
    let i10 = Aa.matchMedia(`(prefers-reduced-motion: reduce)`);
    this._systemMotionReduced = i10.matches, this._configMotionReduced = this._configurationService.getValue(`workbench.reduceMotion`), this._linkUnderlinesEnabled = this._configurationService.getValue(`accessibility.underlineLinks`), this.initReducedMotionListeners(i10), this.initLinkUnderlineListeners();
  }
  initReducedMotionListeners(e206) {
    this._register(L(e206, `change`, () => {
      this._systemMotionReduced = e206.matches, this._configMotionReduced === `auto` && this._onDidChangeReducedMotion.fire();
    }));
    let t10 = () => {
      let e207 = this.isMotionReduced();
      this._layoutService.mainContainer.classList.toggle(`monaco-reduce-motion`, e207), this._layoutService.mainContainer.classList.toggle(`monaco-enable-motion`, !e207);
    };
    t10(), this._register(this.onDidChangeReducedMotion(() => t10()));
  }
  initLinkUnderlineListeners() {
    this._register(this._configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(`accessibility.underlineLinks`) && (this._linkUnderlinesEnabled = this._configurationService.getValue(`accessibility.underlineLinks`), this._onDidChangeLinkUnderline.fire());
    }));
    let e206 = () => {
      let e207 = this._linkUnderlinesEnabled;
      this._layoutService.mainContainer.classList.toggle(`underline-links`, e207);
    };
    e206(), this._register(this.onDidChangeLinkUnderlines(() => e206()));
  }
  onDidChangeLinkUnderlines(e206) {
    return this._onDidChangeLinkUnderline.event(e206);
  }
  get onDidChangeScreenReaderOptimized() {
    return this._onDidChangeScreenReaderOptimized.event;
  }
  isScreenReaderOptimized() {
    let e206 = this._configurationService.getValue(`editor.accessibilitySupport`);
    return e206 === `on` || e206 === `auto` && this._accessibilitySupport === 2;
  }
  get onDidChangeReducedMotion() {
    return this._onDidChangeReducedMotion.event;
  }
  isMotionReduced() {
    let e206 = this._configMotionReduced;
    return e206 === `on` || e206 === `auto` && this._systemMotionReduced;
  }
  getAccessibilitySupport() {
    return this._accessibilitySupport;
  }
};
QU = XU([ZU(0, nd), ZU(1, Bk), ZU(2, Uf)], QU);
var $U = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, eW = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, tW, nW, rW = class {
  constructor(e206, t10, n10) {
    this._commandService = e206, this._keybindingService = t10, this._hiddenStates = new iW(n10);
  }
  createMenu(e206, t10, n10) {
    return new sW(e206, this._hiddenStates, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...n10 }, this._commandService, this._keybindingService, t10);
  }
  getMenuActions(e206, t10, n10) {
    let r10 = new sW(e206, this._hiddenStates, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...n10 }, this._commandService, this._keybindingService, t10), i10 = r10.getActions(n10);
    return r10.dispose(), i10;
  }
  resetHiddenStates(e206) {
    this._hiddenStates.reset(e206);
  }
};
rW = $U([eW(0, Mu), eW(1, Dw), eW(2, dF)], rW);
var iW = (_jb = class {
  constructor(e206) {
    this._storageService = e206, this._disposables = new E(), this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._ignoreChangeEvent = false, this._hiddenByDefaultCache = /* @__PURE__ */ new Map();
    try {
      let t10 = e206.get(tW._key, 0, `{}`);
      this._data = JSON.parse(t10);
    } catch {
      this._data = /* @__PURE__ */ Object.create(null);
    }
    this._disposables.add(e206.onDidChangeValue(0, tW._key, this._disposables)(() => {
      if (!this._ignoreChangeEvent) try {
        let t10 = e206.get(tW._key, 0, `{}`);
        this._data = JSON.parse(t10);
      } catch (e207) {
        console.log(`FAILED to read storage after UPDATE`, e207);
      }
      this._onDidChange.fire();
    }));
  }
  dispose() {
    this._onDidChange.dispose(), this._disposables.dispose();
  }
  _isHiddenByDefault(e206, t10) {
    return this._hiddenByDefaultCache.get(`${e206.id}/${t10}`) ?? false;
  }
  setDefaultState(e206, t10, n10) {
    this._hiddenByDefaultCache.set(`${e206.id}/${t10}`, n10);
  }
  isHidden(e206, t10) {
    let n10 = this._isHiddenByDefault(e206, t10), r10 = this._data[e206.id]?.includes(t10) ?? false;
    return n10 ? !r10 : r10;
  }
  updateHidden(e206, t10, n10) {
    this._isHiddenByDefault(e206, t10) && (n10 = !n10);
    let r10 = this._data[e206.id];
    if (n10) r10 ? r10.indexOf(t10) < 0 && r10.push(t10) : this._data[e206.id] = [t10];
    else if (r10) {
      let n11 = r10.indexOf(t10);
      n11 >= 0 && s(r10, n11), r10.length === 0 && delete this._data[e206.id];
    }
    this._persist();
  }
  reset(e206) {
    if (e206 === void 0) this._data = /* @__PURE__ */ Object.create(null), this._persist();
    else {
      for (let { id: t10 } of e206) this._data[t10] && delete this._data[t10];
      this._persist();
    }
  }
  _persist() {
    try {
      this._ignoreChangeEvent = true;
      let e206 = JSON.stringify(this._data);
      this._storageService.store(tW._key, e206, 0, 0);
    } finally {
      this._ignoreChangeEvent = false;
    }
  }
}, tW = _jb, _jb._key = `menu.hiddenCommands`, _jb);
iW = tW = $U([eW(0, dF)], iW);
var aW = class e154 {
  constructor(e206, t10) {
    this._id = e206, this._collectContextKeysForSubmenus = t10, this._menuGroups = [], this._allMenuIds = /* @__PURE__ */ new Set(), this._structureContextKeys = /* @__PURE__ */ new Set(), this._preconditionContextKeys = /* @__PURE__ */ new Set(), this._toggledContextKeys = /* @__PURE__ */ new Set(), this.refresh();
  }
  get allMenuIds() {
    return this._allMenuIds;
  }
  get structureContextKeys() {
    return this._structureContextKeys;
  }
  get preconditionContextKeys() {
    return this._preconditionContextKeys;
  }
  get toggledContextKeys() {
    return this._toggledContextKeys;
  }
  refresh() {
    this._menuGroups.length = 0, this._allMenuIds.clear(), this._structureContextKeys.clear(), this._preconditionContextKeys.clear(), this._toggledContextKeys.clear();
    let e206 = this._sort(hd.getMenuItems(this._id)), t10;
    for (let n10 of e206) {
      let e207 = n10.group || ``;
      (!t10 || t10[0] !== e207) && (t10 = [e207, []], this._menuGroups.push(t10)), t10[1].push(n10), this._collectContextKeysAndSubmenuIds(n10);
    }
    this._allMenuIds.add(this._id);
  }
  _sort(e206) {
    return e206;
  }
  _collectContextKeysAndSubmenuIds(t10) {
    if (e154._fillInKbExprKeys(t10.when, this._structureContextKeys), fd(t10)) {
      if (t10.command.precondition && e154._fillInKbExprKeys(t10.command.precondition, this._preconditionContextKeys), t10.command.toggled) {
        let n10 = t10.command.toggled.condition || t10.command.toggled;
        e154._fillInKbExprKeys(n10, this._toggledContextKeys);
      }
    } else this._collectContextKeysForSubmenus && (hd.getMenuItems(t10.submenu).forEach(this._collectContextKeysAndSubmenuIds, this), this._allMenuIds.add(t10.submenu));
  }
  static _fillInKbExprKeys(e206, t10) {
    if (e206) for (let n10 of e206.keys()) t10.add(n10);
  }
}, oW = nW = class extends aW {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(e206, n10), this._hiddenStates = t10, this._commandService = r10, this._keybindingService = i10, this._contextKeyService = a10, this.refresh();
  }
  createActionGroups(e206) {
    let t10 = [];
    for (let n10 of this._menuGroups) {
      let [r10, i10] = n10, a10;
      for (let t11 of i10) if (this._contextKeyService.contextMatchesRules(t11.when)) {
        let n11 = fd(t11);
        n11 && this._hiddenStates.setDefaultState(this._id, t11.command.id, !!t11.isHiddenByDefault);
        let r11 = cW(this._id, n11 ? t11.command : t11, this._hiddenStates);
        if (n11) {
          let n12 = lW(this._commandService, this._keybindingService, t11.command.id, t11.when);
          (a10 ?? (a10 = [])).push(new _d2(t11.command, t11.alt, e206, r11, n12, this._contextKeyService, this._commandService));
        } else {
          let n12 = new nW(t11.submenu, this._hiddenStates, this._collectContextKeysForSubmenus, this._commandService, this._keybindingService, this._contextKeyService).createActionGroups(e206), i11 = Du.join(...n12.map((e207) => e207[1]));
          i11.length > 0 && (a10 ?? (a10 = [])).push(new gd(t11, r11, i11));
        }
      }
      a10 && a10.length > 0 && t10.push([r10, a10]);
    }
    return t10;
  }
  _sort(e206) {
    return e206.sort(nW._compareMenuItems);
  }
  static _compareMenuItems(e206, t10) {
    let n10 = e206.group, r10 = t10.group;
    if (n10 !== r10) {
      if (!n10) return 1;
      if (!r10 || n10 === `navigation`) return -1;
      if (r10 === `navigation`) return 1;
      let e207 = n10.localeCompare(r10);
      if (e207 !== 0) return e207;
    }
    let i10 = e206.order || 0, a10 = t10.order || 0;
    return i10 < a10 ? -1 : i10 > a10 ? 1 : nW._compareTitles(fd(e206) ? e206.command.title : e206.title, fd(t10) ? t10.command.title : t10.title);
  }
  static _compareTitles(e206, t10) {
    let n10 = typeof e206 == `string` ? e206 : e206.original, r10 = typeof t10 == `string` ? t10 : t10.original;
    return n10.localeCompare(r10);
  }
};
oW = nW = $U([eW(3, Mu), eW(4, Dw), eW(5, nd)], oW);
var sW = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._disposables = new E(), this._menuInfo = new oW(e206, t10, n10.emitEventsForSubmenuChanges, r10, i10, a10);
    let o10 = new us(() => {
      this._menuInfo.refresh(), this._onDidChange.fire({ menu: this, isStructuralChange: true, isEnablementChange: true, isToggleChange: true });
    }, n10.eventDebounceDelay);
    this._disposables.add(o10), this._disposables.add(hd.onDidChangeMenu((e207) => {
      for (let t11 of this._menuInfo.allMenuIds) if (e207.has(t11)) {
        o10.schedule();
        break;
      }
    }));
    let s10 = this._disposables.add(new E());
    this._onDidChange = new un({ onWillAddFirstListener: () => {
      s10.add(a10.onDidChangeContext((e207) => {
        let t11 = e207.affectsSome(this._menuInfo.structureContextKeys), n11 = e207.affectsSome(this._menuInfo.preconditionContextKeys), r11 = e207.affectsSome(this._menuInfo.toggledContextKeys);
        (t11 || n11 || r11) && this._onDidChange.fire({ menu: this, isStructuralChange: t11, isEnablementChange: n11, isToggleChange: r11 });
      })), s10.add(t10.onDidChange((e207) => {
        this._onDidChange.fire({ menu: this, isStructuralChange: true, isEnablementChange: false, isToggleChange: false });
      }));
    }, onDidRemoveLastListener: s10.clear.bind(s10), delay: n10.eventDebounceDelay, merge: (e207) => {
      let t11 = false, n11 = false, r11 = false;
      for (let i11 of e207) if (t11 || (t11 = i11.isStructuralChange), n11 || (n11 = i11.isEnablementChange), r11 || (r11 = i11.isToggleChange), t11 && n11 && r11) break;
      return { menu: this, isStructuralChange: t11, isEnablementChange: n11, isToggleChange: r11 };
    } }), this.onDidChange = this._onDidChange.event;
  }
  getActions(e206) {
    return this._menuInfo.createActionGroups(e206);
  }
  dispose() {
    this._disposables.dispose(), this._onDidChange.dispose();
  }
};
sW = $U([eW(3, Mu), eW(4, Dw), eW(5, nd)], sW);
function cW(e206, t10, n10) {
  let r10 = Jne(t10) ? t10.submenu.id : t10.id, i10 = typeof t10.title == `string` ? t10.title : t10.title.value, a10 = ku({ id: `hide/${e206.id}/${r10}`, label: C(1651, `Hide '{0}'`, i10), run() {
    n10.updateHidden(e206, r10, true);
  } }), o10 = ku({ id: `toggle/${e206.id}/${r10}`, label: i10, get checked() {
    return !n10.isHidden(e206, r10);
  }, run() {
    n10.updateHidden(e206, r10, !!this.checked);
  } });
  return { hide: a10, toggle: o10, get isHidden() {
    return !o10.checked;
  } };
}
function lW(e206, t10, n10, r10 = void 0, i10 = true) {
  return ku({ id: `configureKeybinding/${n10}`, label: C(1652, `Configure Keybinding`), enabled: i10, run() {
    let i11 = !t10.lookupKeybinding(n10) && r10 ? r10.serialize() : void 0;
    e206.executeCommand(`workbench.action.openGlobalKeybindings`, `@command:${n10}` + (i11 ? ` +when:${i11}` : ``));
  } });
}
var uW = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, dW = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, fW, pW = `application/vnd.code.resources`, mW = (_kb = class extends D {
  constructor(e206, t10) {
    super(), this.layoutService = e206, this.logService = t10, this.mapTextToType = /* @__PURE__ */ new Map(), this.findText = ``, this.resources = [], this.resourcesStateHash = void 0, (Fo || Io) && this.installWebKitWriteTextWorkaround(), this._register(O.runAndSubscribe(qc, ({ window: e207, disposables: t11 }) => {
      t11.add(L(e207.document, `copy`, () => this.clearResourcesState()));
    }, { window: Aa, disposables: this._store }));
  }
  triggerPaste() {
    this.logService.trace(`BrowserClipboardService#triggerPaste`);
  }
  installWebKitWriteTextWorkaround() {
    let e206 = () => {
      let e207 = new hs();
      this.webKitPendingClipboardWritePromise && !this.webKitPendingClipboardWritePromise.isSettled && this.webKitPendingClipboardWritePromise.cancel(), this.webKitPendingClipboardWritePromise = e207, Nl().navigator.clipboard.write([new ClipboardItem({ "text/plain": e207.p })]).catch(async (t10) => {
        (!(t10 instanceof Error) || t10.name !== `NotAllowedError` || !e207.isRejected) && this.logService.error(t10);
      });
    };
    this._register(O.runAndSubscribe(this.layoutService.onDidAddContainer, ({ container: t10, disposables: n10 }) => {
      n10.add(L(t10, `click`, e206)), n10.add(L(t10, `keydown`, e206));
    }, { container: this.layoutService.mainContainer, disposables: this._store }));
  }
  async writeText(e206, t10) {
    if (this.logService.trace(`BrowserClipboardService#writeText called with type:`, t10, ` text.length:`, e206.length), this.clearResourcesState(), t10) {
      this.mapTextToType.set(t10, e206), this.logService.trace(`BrowserClipboardService#writeText`);
      return;
    }
    if (this.webKitPendingClipboardWritePromise) return this.webKitPendingClipboardWritePromise.complete(e206);
    try {
      return this.logService.trace(`before navigator.clipboard.writeText`), await Nl().navigator.clipboard.writeText(e206);
    } catch (e207) {
      console.error(e207);
    }
    this.fallbackWriteText(e206);
  }
  fallbackWriteText(e206) {
    this.logService.trace(`BrowserClipboardService#fallbackWriteText`);
    let t10 = Ml(), n10 = t10.activeElement, r10 = t10.body.appendChild(B(`textarea`, { "aria-hidden": true }));
    r10.style.height = `1px`, r10.style.width = `1px`, r10.style.position = `absolute`, r10.value = e206, r10.focus(), r10.select(), t10.execCommand(`copy`), Fl(n10) && n10.focus(), r10.remove();
  }
  async readText(e206) {
    if (this.logService.trace(`BrowserClipboardService#readText called with type:`, e206), e206) {
      let t10 = this.mapTextToType.get(e206) || ``;
      return this.logService.trace(`BrowserClipboardService#readText text.length:`, t10.length), t10;
    }
    try {
      let e207 = await Nl().navigator.clipboard.readText();
      return this.logService.trace(`BrowserClipboardService#readText text.length:`, e207.length), e207;
    } catch (e207) {
      console.error(e207);
    }
    return ``;
  }
  async readFindText() {
    return this.findText;
  }
  async writeFindText(e206) {
    this.findText = e206;
  }
  async readResources() {
    try {
      let e207 = await Nl().navigator.clipboard.read();
      for (let t10 of e207) if (t10.types.includes(`web ${pW}`)) {
        let e208 = await t10.getType(`web ${pW}`);
        return JSON.parse(await e208.text()).map((e209) => $r.from(e209));
      }
    } catch {
    }
    let e206 = await this.computeResourcesStateHash();
    return this.resourcesStateHash !== e206 && this.clearResourcesState(), this.resources;
  }
  async computeResourcesStateHash() {
    if (this.resources.length !== 0) return Is((await this.readText()).substring(0, fW.MAX_RESOURCE_STATE_SOURCE_LENGTH));
  }
  clearInternalState() {
    this.clearResourcesState();
  }
  clearResourcesState() {
    this.resources = [], this.resourcesStateHash = void 0;
  }
}, fW = _kb, _kb.MAX_RESOURCE_STATE_SOURCE_LENGTH = 1e3, _kb);
mW = fW = uW([dW(0, Bk), dW(1, Ud)], mW);
var hW = xu(`clipboardService`), gW = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, _W2 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, vW = `data-keybinding-context`, yW = class {
  constructor(e206, t10) {
    this._id = e206, this._parent = t10, this._value = /* @__PURE__ */ Object.create(null), this._value._contextId = e206;
  }
  get value() {
    return { ...this._value };
  }
  setValue(e206, t10) {
    return this._value[e206] === t10 ? false : (this._value[e206] = t10, true);
  }
  removeValue(e206) {
    return e206 in this._value ? (delete this._value[e206], true) : false;
  }
  getValue(e206) {
    let t10 = this._value[e206];
    return t10 === void 0 && this._parent ? this._parent.getValue(e206) : t10;
  }
}, bW = (_lb = class extends yW {
  constructor() {
    super(-1, null);
  }
  setValue(e206, t10) {
    return false;
  }
  removeValue(e206) {
    return false;
  }
  getValue(e206) {
  }
}, _lb.INSTANCE = new _lb(), _lb), xW = (_mb = class extends yW {
  constructor(e206, t10, n10) {
    super(e206, null), this._configurationService = t10, this._values = KF.forConfigKeys(), this._listener = this._configurationService.onDidChangeConfiguration((e207) => {
      if (e207.source === 7) {
        let e208 = Array.from(this._values, ([e209]) => e209);
        this._values.clear(), n10.fire(new wW(e208));
      } else {
        let t11 = [];
        for (let n11 of e207.affectedKeys) {
          let e208 = `config.${n11}`, r10 = this._values.findSuperstr(e208);
          r10 !== void 0 && (t11.push(...Ut.map(r10, ([e209]) => e209)), this._values.deleteSuperstr(e208)), this._values.has(e208) && (t11.push(e208), this._values.delete(e208));
        }
        n10.fire(new wW(t11));
      }
    });
  }
  dispose() {
    this._listener.dispose();
  }
  getValue(t10) {
    if (t10.indexOf(_mb._keyPrefix) !== 0) return super.getValue(t10);
    if (this._values.has(t10)) return this._values.get(t10);
    let n10 = t10.substr(_mb._keyPrefix.length), r10 = this._configurationService.getValue(n10), i10;
    switch (typeof r10) {
      case `number`:
      case `boolean`:
      case `string`:
        i10 = r10;
        break;
      default:
        i10 = Array.isArray(r10) ? JSON.stringify(r10) : r10;
    }
    return this._values.set(t10, i10), i10;
  }
  setValue(e206, t10) {
    return super.setValue(e206, t10);
  }
  removeValue(e206) {
    return super.removeValue(e206);
  }
}, _mb._keyPrefix = `config.`, _mb), SW = class {
  constructor(e206, t10, n10) {
    this._service = e206, this._key = t10, this._defaultValue = n10, this.reset();
  }
  set(e206) {
    this._service.setContext(this._key, e206);
  }
  reset() {
    this._defaultValue === void 0 ? this._service.removeContext(this._key) : this._service.setContext(this._key, this._defaultValue);
  }
  get() {
    return this._service.getContextKeyValue(this._key);
  }
}, CW = class {
  constructor(e206) {
    this.key = e206;
  }
  affectsSome(e206) {
    return e206.has(this.key);
  }
  allKeysContainedIn(e206) {
    return this.affectsSome(e206);
  }
}, wW = class {
  constructor(e206) {
    this.keys = e206;
  }
  affectsSome(e206) {
    for (let t10 of this.keys) if (e206.has(t10)) return true;
    return false;
  }
  allKeysContainedIn(e206) {
    return this.keys.every((t10) => e206.has(t10));
  }
}, TW = class {
  constructor(e206) {
    this.events = e206;
  }
  affectsSome(e206) {
    for (let t10 of this.events) if (t10.affectsSome(e206)) return true;
    return false;
  }
  allKeysContainedIn(e206) {
    return this.events.every((t10) => t10.allKeysContainedIn(e206));
  }
};
function EW(e206, t10) {
  return e206.allKeysContainedIn(new Set(Object.keys(t10)));
}
var DW = class extends D {
  get onDidChangeContext() {
    return this._onDidChangeContext.event;
  }
  constructor(e206) {
    super(), this._onDidChangeContext = this._register(new ln({ merge: (e207) => new TW(e207) })), this._isDisposed = false, this._myContextId = e206;
  }
  createKey(e206, t10) {
    if (this._isDisposed) throw Error(`AbstractContextKeyService has been disposed`);
    return new SW(this, e206, t10);
  }
  bufferChangeEvents(e206) {
    this._onDidChangeContext.pause();
    try {
      e206();
    } finally {
      this._onDidChangeContext.resume();
    }
  }
  createScoped(e206) {
    if (this._isDisposed) throw Error(`AbstractContextKeyService has been disposed`);
    return new kW(this, e206);
  }
  contextMatchesRules(e206) {
    if (this._isDisposed) throw Error(`AbstractContextKeyService has been disposed`);
    let t10 = this.getContextValuesContainer(this._myContextId);
    return e206 ? e206.evaluate(t10) : true;
  }
  getContextKeyValue(e206) {
    if (!this._isDisposed) return this.getContextValuesContainer(this._myContextId).getValue(e206);
  }
  setContext(e206, t10) {
    if (this._isDisposed) return;
    let n10 = this.getContextValuesContainer(this._myContextId);
    n10 && n10.setValue(e206, t10) && this._onDidChangeContext.fire(new CW(e206));
  }
  removeContext(e206) {
    this._isDisposed || this.getContextValuesContainer(this._myContextId).removeValue(e206) && this._onDidChangeContext.fire(new CW(e206));
  }
  getContext(e206) {
    return this._isDisposed ? bW.INSTANCE : this.getContextValuesContainer(AW(e206));
  }
  dispose() {
    super.dispose(), this._isDisposed = true;
  }
}, OW = class extends DW {
  constructor(e206) {
    super(0), this._contexts = /* @__PURE__ */ new Map(), this._lastContextId = 0, this.inputFocusedContext = nV.bindTo(this);
    let t10 = this._register(new xW(this._myContextId, e206, this._onDidChangeContext));
    this._contexts.set(this._myContextId, t10), this._register(O.runAndSubscribe(qc, ({ window: e207, disposables: t11 }) => {
      let n10 = t11.add(new Jt());
      t11.add(L(e207, R.FOCUS_IN, () => {
        n10.value = new E(), this.updateInputContextKeys(e207.document, n10.value);
      }, true));
    }, { window: Aa, disposables: this._store }));
  }
  updateInputContextKeys(e206, t10) {
    function n10() {
      return !!e206.activeElement && iu(e206.activeElement);
    }
    let r10 = n10();
    if (this.inputFocusedContext.set(r10), r10) {
      let r11 = t10.add(Gl(e206.activeElement));
      O.once(r11.onDidBlur)(() => {
        Nl().document === e206 && this.inputFocusedContext.set(n10()), r11.dispose();
      }, void 0, t10);
    }
  }
  getContextValuesContainer(e206) {
    return this._isDisposed ? bW.INSTANCE : this._contexts.get(e206) || bW.INSTANCE;
  }
  createChildContext(e206 = this._myContextId) {
    if (this._isDisposed) throw Error(`ContextKeyService has been disposed`);
    let t10 = ++this._lastContextId;
    return this._contexts.set(t10, new yW(t10, this.getContextValuesContainer(e206))), t10;
  }
  disposeContext(e206) {
    this._isDisposed || this._contexts.delete(e206);
  }
};
OW = gW([_W2(0, Uf)], OW);
var kW = class extends DW {
  constructor(e206, t10) {
    if (super(e206.createChildContext()), this._parentChangeListener = this._register(new Jt()), this._parent = e206, this._updateParentChangeListener(), this._domNode = t10, this._domNode.hasAttribute(vW)) {
      let e207 = ``;
      this._domNode.classList && (e207 = Array.from(this._domNode.classList.values()).join(`, `)), console.error(`Element already has context attribute${e207 ? `: ` + e207 : ``}`);
    }
    this._domNode.setAttribute(vW, String(this._myContextId));
  }
  _updateParentChangeListener() {
    this._parentChangeListener.value = this._parent.onDidChangeContext((e206) => {
      let t10 = this._parent.getContextValuesContainer(this._myContextId).value;
      EW(e206, t10) || this._onDidChangeContext.fire(e206);
    });
  }
  dispose() {
    this._isDisposed || (this._parent.disposeContext(this._myContextId), this._domNode.removeAttribute(vW), super.dispose());
  }
  getContextValuesContainer(e206) {
    return this._isDisposed ? bW.INSTANCE : this._parent.getContextValuesContainer(e206);
  }
  createChildContext(e206 = this._myContextId) {
    if (this._isDisposed) throw Error(`ScopedContextKeyService has been disposed`);
    return this._parent.createChildContext(e206);
  }
  disposeContext(e206) {
    this._isDisposed || this._parent.disposeContext(e206);
  }
};
function AW(e206) {
  for (; e206; ) {
    if (e206.hasAttribute(vW)) {
      let t10 = e206.getAttribute(vW);
      return t10 ? parseInt(t10, 10) : NaN;
    }
    e206 = e206.parentElement;
  }
  return 0;
}
function jW(e206, t10, n10) {
  e206.get(nd).createKey(String(t10), MW(n10));
}
function MW(e206) {
  return rt(e206, (e207) => {
    if (typeof e207 == `object` && e207.$mid === 1) return $r.revive(e207).toString();
    if (e207 instanceof $r) return e207.toString();
  });
}
Nu.registerCommand(`_setContext`, jW), Nu.registerCommand({ id: `getContextKeyInfo`, handler() {
  return [...U.all()].sort((e206, t10) => e206.key.localeCompare(t10.key));
}, metadata: { description: C(1674, `A command that returns information about context keys`), args: [] } }), Nu.registerCommand(`_generateContextKeyInfo`, function() {
  let e206 = [], t10 = /* @__PURE__ */ new Set();
  for (let n10 of U.all()) t10.has(n10.key) || (t10.add(n10.key), e206.push(n10));
  e206.sort((e207, t11) => e207.key.localeCompare(t11.key)), console.log(JSON.stringify(e206, void 0, 2));
});
var NW = class {
  constructor(e206, t10) {
    this.key = e206, this.data = t10, this.incoming = /* @__PURE__ */ new Map(), this.outgoing = /* @__PURE__ */ new Map();
  }
}, PW = class {
  constructor(e206) {
    this._hashFn = e206, this._nodes = /* @__PURE__ */ new Map();
  }
  roots() {
    let e206 = [];
    for (let t10 of this._nodes.values()) t10.outgoing.size === 0 && e206.push(t10);
    return e206;
  }
  insertEdge(e206, t10) {
    let n10 = this.lookupOrInsertNode(e206), r10 = this.lookupOrInsertNode(t10);
    n10.outgoing.set(r10.key, r10), r10.incoming.set(n10.key, n10);
  }
  removeNode(e206) {
    let t10 = this._hashFn(e206);
    this._nodes.delete(t10);
    for (let e207 of this._nodes.values()) e207.outgoing.delete(t10), e207.incoming.delete(t10);
  }
  lookupOrInsertNode(e206) {
    let t10 = this._hashFn(e206), n10 = this._nodes.get(t10);
    return n10 || (n10 = new NW(t10, e206), this._nodes.set(t10, n10)), n10;
  }
  isEmpty() {
    return this._nodes.size === 0;
  }
  toString() {
    let e206 = [];
    for (let [t10, n10] of this._nodes) e206.push(`${t10}
	(-> incoming)[${[...n10.incoming.keys()].join(`, `)}]
	(outgoing ->)[${[...n10.outgoing.keys()].join(`,`)}]
`);
    return e206.join(`
`);
  }
  findCycleSlow() {
    for (let [e206, t10] of this._nodes) {
      let n10 = /* @__PURE__ */ new Set([e206]), r10 = this._findCycle(t10, n10);
      if (r10) return r10;
    }
  }
  _findCycle(e206, t10) {
    for (let [n10, r10] of e206.outgoing) {
      if (t10.has(n10)) return [...t10, n10].join(` -> `);
      t10.add(n10);
      let e207 = this._findCycle(r10, t10);
      if (e207) return e207;
      t10.delete(n10);
    }
  }
}, FW = false, IW = class extends Error {
  constructor(e206) {
    super(`cyclic dependency between services`), this.message = e206.findCycleSlow() ?? `UNABLE to detect cycle, dumping graph: 
${e206.toString()}`;
  }
}, LW = class e155 {
  constructor(e206 = new kk(), t10 = false, n10, r10 = FW) {
    this._services = e206, this._strict = t10, this._parent = n10, this._enableTracing = r10, this._isDisposed = false, this._servicesToMaybeDispose = /* @__PURE__ */ new Set(), this._children = /* @__PURE__ */ new Set(), this._activeInstantiations = /* @__PURE__ */ new Set(), this._services.set(V, this), this._globalGraph = r10 ? n10?._globalGraph ?? new PW((e207) => e207) : void 0;
  }
  dispose() {
    if (!this._isDisposed) {
      this._isDisposed = true, Kt(this._children), this._children.clear();
      for (let e206 of this._servicesToMaybeDispose) Gt(e206) && e206.dispose();
      this._servicesToMaybeDispose.clear();
    }
  }
  _throwIfDisposed() {
    if (this._isDisposed) throw Error(`InstantiationService has been disposed`);
  }
  createChild(t10, n10) {
    this._throwIfDisposed();
    let r10 = this, i10 = new class extends e155 {
      dispose() {
        r10._children.delete(i10), super.dispose();
      }
    }(t10, this._strict, this, this._enableTracing);
    return this._children.add(i10), n10?.add(i10), i10;
  }
  invokeFunction(e206, ...t10) {
    this._throwIfDisposed();
    let n10 = RW.traceInvocation(this._enableTracing, e206), r10 = false;
    try {
      return e206({ get: (e207) => {
        if (r10) throw Oe(`service accessor is only valid during the invocation of its target method`);
        let t11 = this._getOrCreateServiceInstance(e207, n10);
        if (!t11) throw Error(`[invokeFunction] unknown service '${e207}'`);
        return t11;
      }, getIfExists: (e207) => {
        if (r10) throw Oe(`service accessor is only valid during the invocation of its target method`);
        return this._getOrCreateServiceInstance(e207, n10);
      } }, ...t10);
    } finally {
      r10 = true, n10.stop();
    }
  }
  createInstance(e206, ...t10) {
    this._throwIfDisposed();
    let n10, r10;
    return e206 instanceof Yf ? (n10 = RW.traceCreation(this._enableTracing, e206.ctor), r10 = this._createInstance(e206.ctor, e206.staticArguments.concat(t10), n10)) : (n10 = RW.traceCreation(this._enableTracing, e206), r10 = this._createInstance(e206, t10, n10)), n10.stop(), r10;
  }
  _createInstance(e206, t10 = [], n10) {
    let r10 = bu.getServiceDependencies(e206).sort((e207, t11) => e207.index - t11.index), i10 = [];
    for (let t11 of r10) {
      let r11 = this._getOrCreateServiceInstance(t11.id, n10);
      r11 || this._throwIfStrict(`[createInstance] ${e206.name} depends on UNKNOWN service ${t11.id}.`, false), i10.push(r11);
    }
    let a10 = r10.length > 0 ? r10[0].index : t10.length;
    if (t10.length !== a10) {
      console.trace(`[createInstance] First service dependency of ${e206.name} at position ${a10 + 1} conflicts with ${t10.length} static arguments`);
      let n11 = a10 - t10.length;
      t10 = n11 > 0 ? t10.concat(Array(n11)) : t10.slice(0, a10);
    }
    return Reflect.construct(e206, t10.concat(i10));
  }
  _setCreatedServiceInstance(e206, t10) {
    if (this._services.get(e206) instanceof Yf) this._services.set(e206, t10);
    else if (this._parent) this._parent._setCreatedServiceInstance(e206, t10);
    else throw Error(`illegalState - setting UNKNOWN service instance`);
  }
  _getServiceInstanceOrDescriptor(e206) {
    let t10 = this._services.get(e206);
    return !t10 && this._parent ? this._parent._getServiceInstanceOrDescriptor(e206) : t10;
  }
  _getOrCreateServiceInstance(e206, t10) {
    this._globalGraph && this._globalGraphImplicitDependency && this._globalGraph.insertEdge(this._globalGraphImplicitDependency, String(e206));
    let n10 = this._getServiceInstanceOrDescriptor(e206);
    return n10 instanceof Yf ? this._safeCreateAndCacheServiceInstance(e206, n10, t10.branch(e206, true)) : (t10.branch(e206, false), n10);
  }
  _safeCreateAndCacheServiceInstance(e206, t10, n10) {
    if (this._activeInstantiations.has(e206)) throw Error(`illegal state - RECURSIVELY instantiating service '${e206}'`);
    this._activeInstantiations.add(e206);
    try {
      return this._createAndCacheServiceInstance(e206, t10, n10);
    } finally {
      this._activeInstantiations.delete(e206);
    }
  }
  _createAndCacheServiceInstance(e206, t10, n10) {
    let r10 = new PW((e207) => e207.id.toString()), i10 = 0, a10 = [{ id: e206, desc: t10, _trace: n10 }], o10 = /* @__PURE__ */ new Set();
    for (; a10.length; ) {
      let t11 = a10.pop();
      if (!o10.has(String(t11.id))) {
        if (o10.add(String(t11.id)), r10.lookupOrInsertNode(t11), i10++ > 1e3) throw new IW(r10);
        for (let n11 of bu.getServiceDependencies(t11.desc.ctor)) {
          let i11 = this._getServiceInstanceOrDescriptor(n11.id);
          if (i11 || this._throwIfStrict(`[createInstance] ${e206} depends on ${n11.id} which is NOT registered.`, true), this._globalGraph?.insertEdge(String(t11.id), String(n11.id)), i11 instanceof Yf) {
            let e207 = { id: n11.id, desc: i11, _trace: t11._trace.branch(n11.id, true) };
            r10.insertEdge(t11, e207), a10.push(e207);
          }
        }
      }
    }
    for (; ; ) {
      let e207 = r10.roots();
      if (e207.length === 0) {
        if (!r10.isEmpty()) throw new IW(r10);
        break;
      }
      for (let { data: t11 } of e207) {
        if (this._getServiceInstanceOrDescriptor(t11.id) instanceof Yf) {
          let e208 = this._createServiceInstanceWithOwner(t11.id, t11.desc.ctor, t11.desc.staticArguments, t11.desc.supportsDelayedInstantiation, t11._trace);
          this._setCreatedServiceInstance(t11.id, e208);
        }
        r10.removeNode(t11);
      }
    }
    return this._getServiceInstanceOrDescriptor(e206);
  }
  _createServiceInstanceWithOwner(e206, t10, n10 = [], r10, i10) {
    if (this._services.get(e206) instanceof Yf) return this._createServiceInstance(e206, t10, n10, r10, i10, this._servicesToMaybeDispose);
    if (this._parent) return this._parent._createServiceInstanceWithOwner(e206, t10, n10, r10, i10);
    throw Error(`illegalState - creating UNKNOWN service instance ${t10.name}`);
  }
  _createServiceInstance(t10, n10, r10 = [], i10, a10, o10) {
    if (i10) {
      let i11 = new e155(void 0, this._strict, this, this._enableTracing);
      i11._globalGraphImplicitDependency = String(t10);
      let s10 = /* @__PURE__ */ new Map(), c10 = new ms(() => {
        let e206 = i11._createInstance(n10, r10, a10);
        for (let [t11, n11] of s10) {
          let r11 = e206[t11];
          if (typeof r11 == `function`) for (let t12 of n11) t12.disposable = r11.apply(e206, t12.listener);
        }
        return s10.clear(), o10.add(e206), e206;
      });
      return new Proxy(/* @__PURE__ */ Object.create(null), { get(e206, t11) {
        if (!c10.isInitialized && typeof t11 == `string` && (t11.startsWith(`onDid`) || t11.startsWith(`onWill`))) {
          let e207 = s10.get(t11);
          return e207 || (e207 = new Qt(), s10.set(t11, e207)), (n12, r12, i12) => {
            if (c10.isInitialized) return c10.value[t11](n12, r12, i12);
            {
              let t12 = { listener: [n12, r12, i12], disposable: void 0 }, a11 = e207.push(t12);
              return T(() => {
                a11(), t12.disposable?.dispose();
              });
            }
          };
        }
        if (t11 in e206) return e206[t11];
        let n11 = c10.value, r11 = n11[t11];
        return typeof r11 == `function` ? (r11 = r11.bind(n11), e206[t11] = r11, r11) : r11;
      }, set(e206, t11, n11) {
        return c10.value[t11] = n11, true;
      }, getPrototypeOf(e206) {
        return n10.prototype;
      } });
    } else {
      let e206 = this._createInstance(n10, r10, a10);
      return o10.add(e206), e206;
    }
  }
  _throwIfStrict(e206, t10) {
    if (t10 && console.warn(e206), this._strict) throw Error(e206);
  }
}, RW = (_nb = class {
  static traceInvocation(t10, n10) {
    return t10 ? new _nb(2, n10.name || Error().stack.split(`
`).slice(3, 4).join(`
`)) : _nb._None;
  }
  static traceCreation(t10, n10) {
    return t10 ? new _nb(1, n10.name) : _nb._None;
  }
  constructor(e206, t10) {
    this.type = e206, this.name = t10, this._start = Date.now(), this._dep = [];
  }
  branch(t10, n10) {
    let r10 = new _nb(3, t10.toString());
    return this._dep.push([t10, n10, r10]), r10;
  }
  stop() {
    let t10 = Date.now() - this._start;
    _nb._totals += t10;
    let n10 = false;
    function r10(e206, t11) {
      let i11 = [], a10 = Array(e206 + 1).join(`	`);
      for (let [o10, s10, c10] of t11._dep) if (s10 && c10) {
        n10 = true, i11.push(`${a10}CREATES -> ${o10}`);
        let t12 = r10(e206 + 1, c10);
        t12 && i11.push(t12);
      } else i11.push(`${a10}uses -> ${o10}`);
      return i11.join(`
`);
    }
    let i10 = [`${this.type === 1 ? `CREATE` : `CALL`} ${this.name}`, `${r10(1, this)}`, `DONE, took ${t10.toFixed(2)}ms (grand total ${_nb._totals.toFixed(2)}ms)`];
    (t10 > 2 || n10) && _nb.all.add(i10.join(`
`));
  }
}, _nb.all = /* @__PURE__ */ new Set(), _nb._None = new class extends _nb {
  constructor() {
    super(0, null);
  }
  stop() {
  }
  branch() {
    return this;
  }
}(), _nb._totals = 0, _nb), zW = /* @__PURE__ */ new Set([xs.inMemory, xs.vscodeSourceControl, xs.walkThrough, xs.walkThroughSnippet, xs.vscodeChatCodeBlock, xs.vscodeTerminal]), BW = class {
  constructor() {
    this._byResource = new wd(), this._byOwner = /* @__PURE__ */ new Map();
  }
  set(e206, t10, n10) {
    let r10 = this._byResource.get(e206);
    r10 || (r10 = /* @__PURE__ */ new Map(), this._byResource.set(e206, r10)), r10.set(t10, n10);
    let i10 = this._byOwner.get(t10);
    i10 || (i10 = new wd(), this._byOwner.set(t10, i10)), i10.set(e206, n10);
  }
  get(e206, t10) {
    return this._byResource.get(e206)?.get(t10);
  }
  delete(e206, t10) {
    let n10 = false, r10 = false, i10 = this._byResource.get(e206);
    i10 && (n10 = i10.delete(t10));
    let a10 = this._byOwner.get(t10);
    if (a10 && (r10 = a10.delete(e206)), n10 !== r10) throw Error(`illegal state`);
    return n10 && r10;
  }
  values(e206) {
    return typeof e206 == `string` ? this._byOwner.get(e206)?.values() ?? Ut.empty() : $r.isUri(e206) ? this._byResource.get(e206)?.values() ?? Ut.empty() : Ut.map(Ut.concat(...this._byOwner.values()), (e207) => e207[1]);
  }
}, VW = class {
  constructor(e206) {
    this.errors = 0, this.infos = 0, this.warnings = 0, this.unknowns = 0, this._data = new wd(), this._service = e206, this._subscription = e206.onMarkerChanged(this._update, this);
  }
  dispose() {
    this._subscription.dispose();
  }
  _update(e206) {
    for (let t10 of e206) {
      let e207 = this._data.get(t10);
      e207 && this._substract(e207);
      let n10 = this._resourceStats(t10);
      this._add(n10), this._data.set(t10, n10);
    }
  }
  _resourceStats(e206) {
    let t10 = { errors: 0, warnings: 0, infos: 0, unknowns: 0 };
    if (zW.has(e206.scheme)) return t10;
    for (let { severity: n10 } of this._service.read({ resource: e206 })) n10 === UL.Error ? t10.errors += 1 : n10 === UL.Warning ? t10.warnings += 1 : n10 === UL.Info ? t10.infos += 1 : t10.unknowns += 1;
    return t10;
  }
  _substract(e206) {
    this.errors -= e206.errors, this.warnings -= e206.warnings, this.infos -= e206.infos, this.unknowns -= e206.unknowns;
  }
  _add(e206) {
    this.errors += e206.errors, this.warnings += e206.warnings, this.infos += e206.infos, this.unknowns += e206.unknowns;
  }
}, HW = class e156 {
  constructor() {
    this._onMarkerChanged = new un({ delay: 0, merge: e156._merge }), this.onMarkerChanged = this._onMarkerChanged.event, this._data = new BW(), this._stats = new VW(this), this._filteredResources = new wd();
  }
  dispose() {
    this._stats.dispose(), this._onMarkerChanged.dispose();
  }
  remove(e206, t10) {
    for (let n10 of t10 || []) this.changeOne(e206, n10, []);
  }
  changeOne(t10, n10, r10) {
    if (_(r10)) this._data.delete(n10, t10) && this._onMarkerChanged.fire([n10]);
    else {
      let i10 = [];
      for (let a10 of r10) {
        let r11 = e156._toMarker(t10, n10, a10);
        r11 && i10.push(r11);
      }
      this._data.set(n10, t10, i10), this._onMarkerChanged.fire([n10]);
    }
  }
  static _toMarker(e206, t10, n10) {
    let { code: r10, severity: i10, message: a10, source: o10, startLineNumber: s10, startColumn: c10, endLineNumber: l10, endColumn: u10, relatedInformation: d10, tags: f10, origin: p10 } = n10;
    if (a10) return s10 = s10 > 0 ? s10 : 1, c10 = c10 > 0 ? c10 : 1, l10 = l10 >= s10 ? l10 : s10, u10 = u10 > 0 ? u10 : c10, { resource: t10, owner: e206, code: r10, severity: i10, message: a10, source: o10, startLineNumber: s10, startColumn: c10, endLineNumber: l10, endColumn: u10, relatedInformation: d10, tags: f10, origin: p10 };
  }
  changeAll(t10, n10) {
    let r10 = [], i10 = this._data.values(t10);
    if (i10) for (let e206 of i10) {
      let n11 = Ut.first(e206);
      n11 && (r10.push(n11.resource), this._data.delete(n11.resource, t10));
    }
    if (v(n10)) {
      let i11 = new wd();
      for (let { resource: a10, marker: o10 } of n10) {
        let n11 = e156._toMarker(t10, a10, o10);
        if (!n11) continue;
        let s10 = i11.get(a10);
        s10 ? s10.push(n11) : (i11.set(a10, [n11]), r10.push(a10));
      }
      for (let [e206, n11] of i11) this._data.set(e206, t10, n11);
    }
    r10.length > 0 && this._onMarkerChanged.fire(r10);
  }
  _createFilteredMarker(e206, t10) {
    let n10 = t10.length === 1 ? C(1738, `Problems are paused because: "{0}"`, t10[0]) : C(1739, `Problems are paused because: "{0}" and {1} more`, t10[0], t10.length - 1);
    return { owner: `markersFilter`, resource: e206, severity: UL.Info, message: n10, startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 };
  }
  read(t10 = /* @__PURE__ */ Object.create(null)) {
    let { owner: n10, resource: r10, severities: i10, take: a10 } = t10;
    if ((!a10 || a10 < 0) && (a10 = -1), n10 && r10) {
      let o10 = t10.ignoreResourceFilters ? void 0 : this._filteredResources.get(r10);
      if (o10?.length) return [this._createFilteredMarker(r10, o10)];
      let s10 = this._data.get(r10, n10);
      if (!s10) return [];
      let c10 = [];
      for (let n11 of s10) {
        if (a10 > 0 && c10.length === a10) break;
        let o11 = t10.ignoreResourceFilters ? void 0 : this._filteredResources.get(r10);
        o11?.length ? c10.push(this._createFilteredMarker(r10, o11)) : e156._accept(n11, i10) && c10.push(n11);
      }
      return c10;
    } else {
      let o10 = !n10 && !r10 ? this._data.values() : this._data.values(r10 ?? n10), s10 = [], c10 = new Zne();
      for (let n11 of o10) for (let r11 of n11) {
        if (c10.has(r11.resource)) continue;
        if (a10 > 0 && s10.length === a10) break;
        let n12 = t10.ignoreResourceFilters ? void 0 : this._filteredResources.get(r11.resource);
        n12?.length ? (s10.push(this._createFilteredMarker(r11.resource, n12)), c10.add(r11.resource)) : e156._accept(r11, i10) && s10.push(r11);
      }
      return s10;
    }
  }
  static _accept(e206, t10) {
    return t10 === void 0 || (t10 & e206.severity) === e206.severity;
  }
  static _merge(e206) {
    let t10 = new wd();
    for (let n10 of e206) for (let e207 of n10) t10.set(e207, true);
    return Array.from(t10.keys());
  }
}, UW = class extends D {
  get configurationModel() {
    return this._configurationModel;
  }
  constructor(e206) {
    super(), this.logService = e206, this._configurationModel = kF.createEmptyModel(e206);
  }
  reload() {
    return this.resetConfigurationModel(), this.configurationModel;
  }
  getConfigurationDefaultOverrides() {
    return {};
  }
  resetConfigurationModel() {
    this._configurationModel = kF.createEmptyModel(this.logService);
    let e206 = cd.as(op.Configuration).getConfigurationProperties();
    this.updateConfigurationModel(Object.keys(e206), e206);
  }
  updateConfigurationModel(e206, t10) {
    let n10 = this.getConfigurationDefaultOverrides();
    for (let r10 of e206) {
      let e207 = n10[r10], i10 = t10[r10];
      e207 === void 0 ? i10 ? this._configurationModel.setValue(r10, et(i10.default)) : this._configurationModel.removeValue(r10) : this._configurationModel.setValue(r10, e207);
    }
  }
}, WW = xu(`accessibilitySignalService`), GW = (_ob = class {
  static register(t10) {
    return new _ob(t10.fileName);
  }
  constructor(e206) {
    this.fileName = e206;
  }
}, _ob.error = _ob.register({ fileName: `error.mp3` }), _ob.warning = _ob.register({ fileName: `warning.mp3` }), _ob.success = _ob.register({ fileName: `success.mp3` }), _ob.foldedArea = _ob.register({ fileName: `foldedAreas.mp3` }), _ob.break = _ob.register({ fileName: `break.mp3` }), _ob.quickFixes = _ob.register({ fileName: `quickFixes.mp3` }), _ob.taskCompleted = _ob.register({ fileName: `taskCompleted.mp3` }), _ob.taskFailed = _ob.register({ fileName: `taskFailed.mp3` }), _ob.terminalBell = _ob.register({ fileName: `terminalBell.mp3` }), _ob.diffLineInserted = _ob.register({ fileName: `diffLineInserted.mp3` }), _ob.diffLineDeleted = _ob.register({ fileName: `diffLineDeleted.mp3` }), _ob.diffLineModified = _ob.register({ fileName: `diffLineModified.mp3` }), _ob.requestSent = _ob.register({ fileName: `requestSent.mp3` }), _ob.responseReceived1 = _ob.register({ fileName: `responseReceived1.mp3` }), _ob.responseReceived2 = _ob.register({ fileName: `responseReceived2.mp3` }), _ob.responseReceived3 = _ob.register({ fileName: `responseReceived3.mp3` }), _ob.responseReceived4 = _ob.register({ fileName: `responseReceived4.mp3` }), _ob.clear = _ob.register({ fileName: `clear.mp3` }), _ob.save = _ob.register({ fileName: `save.mp3` }), _ob.format = _ob.register({ fileName: `format.mp3` }), _ob.voiceRecordingStarted = _ob.register({ fileName: `voiceRecordingStarted.mp3` }), _ob.voiceRecordingStopped = _ob.register({ fileName: `voiceRecordingStopped.mp3` }), _ob.progress = _ob.register({ fileName: `progress.mp3` }), _ob.chatEditModifiedFile = _ob.register({ fileName: `chatEditModifiedFile.mp3` }), _ob.editsKept = _ob.register({ fileName: `editsKept.mp3` }), _ob.editsUndone = _ob.register({ fileName: `editsUndone.mp3` }), _ob.nextEditSuggestion = _ob.register({ fileName: `nextEditSuggestion.mp3` }), _ob.terminalCommandSucceeded = _ob.register({ fileName: `terminalCommandSucceeded.mp3` }), _ob.chatUserActionRequired = _ob.register({ fileName: `chatUserActionRequired.mp3` }), _ob.codeActionTriggered = _ob.register({ fileName: `codeActionTriggered.mp3` }), _ob.codeActionApplied = _ob.register({ fileName: `codeActionApplied.mp3` }), _ob), KW = class {
  constructor(e206) {
    this.randomOneOf = e206;
  }
}, qW = (_pb = class {
  constructor(e206, t10, n10, r10, i10, a10, o10 = false) {
    this.sound = e206, this.name = t10, this.legacySoundSettingsKey = n10, this.settingsKey = r10, this.legacyAnnouncementSettingsKey = i10, this.announcementMessage = a10, this.managesOwnEnablement = o10;
  }
  static register(t10) {
    let n10 = new _pb(new KW(`randomOneOf` in t10.sound ? t10.sound.randomOneOf : [t10.sound]), t10.name, t10.legacySoundSettingsKey, t10.settingsKey, t10.legacyAnnouncementSettingsKey, t10.announcementMessage, t10.managesOwnEnablement);
    return _pb._signals.add(n10), n10;
  }
}, _pb._signals = /* @__PURE__ */ new Set(), _pb.errorAtPosition = _pb.register({ name: C(1576, `Error at Position`), sound: GW.error, announcementMessage: C(1577, `Error`), settingsKey: `accessibility.signals.positionHasError`, delaySettingsKey: `accessibility.signalOptions.delays.errorAtPosition` }), _pb.warningAtPosition = _pb.register({ name: C(1578, `Warning at Position`), sound: GW.warning, announcementMessage: C(1579, `Warning`), settingsKey: `accessibility.signals.positionHasWarning`, delaySettingsKey: `accessibility.signalOptions.delays.warningAtPosition` }), _pb.errorOnLine = _pb.register({ name: C(1580, `Error on Line`), sound: GW.error, legacySoundSettingsKey: `audioCues.lineHasError`, legacyAnnouncementSettingsKey: `accessibility.alert.error`, announcementMessage: C(1581, `Error on Line`), settingsKey: `accessibility.signals.lineHasError` }), _pb.warningOnLine = _pb.register({ name: C(1582, `Warning on Line`), sound: GW.warning, legacySoundSettingsKey: `audioCues.lineHasWarning`, legacyAnnouncementSettingsKey: `accessibility.alert.warning`, announcementMessage: C(1583, `Warning on Line`), settingsKey: `accessibility.signals.lineHasWarning` }), _pb.foldedArea = _pb.register({ name: C(1584, `Folded Area on Line`), sound: GW.foldedArea, legacySoundSettingsKey: `audioCues.lineHasFoldedArea`, legacyAnnouncementSettingsKey: `accessibility.alert.foldedArea`, announcementMessage: C(1585, `Folded`), settingsKey: `accessibility.signals.lineHasFoldedArea` }), _pb.break = _pb.register({ name: C(1586, `Breakpoint on Line`), sound: GW.break, legacySoundSettingsKey: `audioCues.lineHasBreakpoint`, legacyAnnouncementSettingsKey: `accessibility.alert.breakpoint`, announcementMessage: C(1587, `Breakpoint`), settingsKey: `accessibility.signals.lineHasBreakpoint` }), _pb.inlineSuggestion = _pb.register({ name: C(1588, `Inline Suggestion on Line`), sound: GW.quickFixes, legacySoundSettingsKey: `audioCues.lineHasInlineSuggestion`, settingsKey: `accessibility.signals.lineHasInlineSuggestion` }), _pb.nextEditSuggestion = _pb.register({ name: C(1589, `Next Edit Suggestion on Line`), sound: GW.nextEditSuggestion, legacySoundSettingsKey: `audioCues.nextEditSuggestion`, settingsKey: `accessibility.signals.nextEditSuggestion`, announcementMessage: C(1590, `Next Edit Suggestion`) }), _pb.terminalQuickFix = _pb.register({ name: C(1591, `Terminal Quick Fix`), sound: GW.quickFixes, legacySoundSettingsKey: `audioCues.terminalQuickFix`, legacyAnnouncementSettingsKey: `accessibility.alert.terminalQuickFix`, announcementMessage: C(1592, `Quick Fix`), settingsKey: `accessibility.signals.terminalQuickFix` }), _pb.onDebugBreak = _pb.register({ name: C(1593, `Debugger Stopped on Breakpoint`), sound: GW.break, legacySoundSettingsKey: `audioCues.onDebugBreak`, legacyAnnouncementSettingsKey: `accessibility.alert.onDebugBreak`, announcementMessage: C(1594, `Breakpoint`), settingsKey: `accessibility.signals.onDebugBreak` }), _pb.noInlayHints = _pb.register({ name: C(1595, `No Inlay Hints on Line`), sound: GW.error, legacySoundSettingsKey: `audioCues.noInlayHints`, legacyAnnouncementSettingsKey: `accessibility.alert.noInlayHints`, announcementMessage: C(1596, `No Inlay Hints`), settingsKey: `accessibility.signals.noInlayHints` }), _pb.taskCompleted = _pb.register({ name: C(1597, `Task Completed`), sound: GW.taskCompleted, legacySoundSettingsKey: `audioCues.taskCompleted`, legacyAnnouncementSettingsKey: `accessibility.alert.taskCompleted`, announcementMessage: C(1598, `Task Completed`), settingsKey: `accessibility.signals.taskCompleted` }), _pb.taskFailed = _pb.register({ name: C(1599, `Task Failed`), sound: GW.taskFailed, legacySoundSettingsKey: `audioCues.taskFailed`, legacyAnnouncementSettingsKey: `accessibility.alert.taskFailed`, announcementMessage: C(1600, `Task Failed`), settingsKey: `accessibility.signals.taskFailed` }), _pb.terminalCommandFailed = _pb.register({ name: C(1601, `Terminal Command Failed`), sound: GW.error, legacySoundSettingsKey: `audioCues.terminalCommandFailed`, legacyAnnouncementSettingsKey: `accessibility.alert.terminalCommandFailed`, announcementMessage: C(1602, `Command Failed`), settingsKey: `accessibility.signals.terminalCommandFailed` }), _pb.terminalCommandSucceeded = _pb.register({ name: C(1603, `Terminal Command Succeeded`), sound: GW.terminalCommandSucceeded, announcementMessage: C(1604, `Command Succeeded`), settingsKey: `accessibility.signals.terminalCommandSucceeded` }), _pb.terminalBell = _pb.register({ name: C(1605, `Terminal Bell`), sound: GW.terminalBell, legacySoundSettingsKey: `audioCues.terminalBell`, legacyAnnouncementSettingsKey: `accessibility.alert.terminalBell`, announcementMessage: C(1606, `Terminal Bell`), settingsKey: `accessibility.signals.terminalBell` }), _pb.notebookCellCompleted = _pb.register({ name: C(1607, `Notebook Cell Completed`), sound: GW.taskCompleted, legacySoundSettingsKey: `audioCues.notebookCellCompleted`, legacyAnnouncementSettingsKey: `accessibility.alert.notebookCellCompleted`, announcementMessage: C(1608, `Notebook Cell Completed`), settingsKey: `accessibility.signals.notebookCellCompleted` }), _pb.notebookCellFailed = _pb.register({ name: C(1609, `Notebook Cell Failed`), sound: GW.taskFailed, legacySoundSettingsKey: `audioCues.notebookCellFailed`, legacyAnnouncementSettingsKey: `accessibility.alert.notebookCellFailed`, announcementMessage: C(1610, `Notebook Cell Failed`), settingsKey: `accessibility.signals.notebookCellFailed` }), _pb.diffLineInserted = _pb.register({ name: C(1611, `Diff Line Inserted`), sound: GW.diffLineInserted, legacySoundSettingsKey: `audioCues.diffLineInserted`, settingsKey: `accessibility.signals.diffLineInserted` }), _pb.diffLineDeleted = _pb.register({ name: C(1612, `Diff Line Deleted`), sound: GW.diffLineDeleted, legacySoundSettingsKey: `audioCues.diffLineDeleted`, settingsKey: `accessibility.signals.diffLineDeleted` }), _pb.diffLineModified = _pb.register({ name: C(1613, `Diff Line Modified`), sound: GW.diffLineModified, legacySoundSettingsKey: `audioCues.diffLineModified`, settingsKey: `accessibility.signals.diffLineModified` }), _pb.chatEditModifiedFile = _pb.register({ name: C(1614, `Chat Edit Modified File`), sound: GW.chatEditModifiedFile, announcementMessage: C(1615, `File Modified from Chat Edits`), settingsKey: `accessibility.signals.chatEditModifiedFile` }), _pb.chatRequestSent = _pb.register({ name: C(1616, `Chat Request Sent`), sound: GW.requestSent, legacySoundSettingsKey: `audioCues.chatRequestSent`, legacyAnnouncementSettingsKey: `accessibility.alert.chatRequestSent`, announcementMessage: C(1617, `Chat Request Sent`), settingsKey: `accessibility.signals.chatRequestSent` }), _pb.chatResponseReceived = _pb.register({ name: C(1618, `Chat Response Received`), legacySoundSettingsKey: `audioCues.chatResponseReceived`, sound: { randomOneOf: [GW.responseReceived1, GW.responseReceived2, GW.responseReceived3, GW.responseReceived4] }, settingsKey: `accessibility.signals.chatResponseReceived` }), _pb.codeActionTriggered = _pb.register({ name: C(1619, `Code Action Request Triggered`), sound: GW.codeActionTriggered, legacySoundSettingsKey: `audioCues.codeActionRequestTriggered`, legacyAnnouncementSettingsKey: `accessibility.alert.codeActionRequestTriggered`, announcementMessage: C(1620, `Code Action Request Triggered`), settingsKey: `accessibility.signals.codeActionTriggered` }), _pb.codeActionApplied = _pb.register({ name: C(1621, `Code Action Applied`), legacySoundSettingsKey: `audioCues.codeActionApplied`, sound: GW.codeActionApplied, settingsKey: `accessibility.signals.codeActionApplied` }), _pb.progress = _pb.register({ name: C(1622, `Progress`), sound: GW.progress, legacySoundSettingsKey: `audioCues.chatResponsePending`, legacyAnnouncementSettingsKey: `accessibility.alert.progress`, announcementMessage: C(1623, `Progress`), settingsKey: `accessibility.signals.progress` }), _pb.clear = _pb.register({ name: C(1624, `Clear`), sound: GW.clear, legacySoundSettingsKey: `audioCues.clear`, legacyAnnouncementSettingsKey: `accessibility.alert.clear`, announcementMessage: C(1625, `Clear`), settingsKey: `accessibility.signals.clear` }), _pb.save = _pb.register({ name: C(1626, `Save`), sound: GW.save, legacySoundSettingsKey: `audioCues.save`, legacyAnnouncementSettingsKey: `accessibility.alert.save`, announcementMessage: C(1627, `Save`), settingsKey: `accessibility.signals.save` }), _pb.format = _pb.register({ name: C(1628, `Format`), sound: GW.format, legacySoundSettingsKey: `audioCues.format`, legacyAnnouncementSettingsKey: `accessibility.alert.format`, announcementMessage: C(1629, `Format`), settingsKey: `accessibility.signals.format` }), _pb.voiceRecordingStarted = _pb.register({ name: C(1630, `Voice Recording Started`), sound: GW.voiceRecordingStarted, legacySoundSettingsKey: `audioCues.voiceRecordingStarted`, settingsKey: `accessibility.signals.voiceRecordingStarted` }), _pb.voiceRecordingStopped = _pb.register({ name: C(1631, `Voice Recording Stopped`), sound: GW.voiceRecordingStopped, legacySoundSettingsKey: `audioCues.voiceRecordingStopped`, settingsKey: `accessibility.signals.voiceRecordingStopped` }), _pb.editsKept = _pb.register({ name: C(1632, `Edits Kept`), sound: GW.editsKept, announcementMessage: C(1633, `Edits Kept`), settingsKey: `accessibility.signals.editsKept` }), _pb.editsUndone = _pb.register({ name: C(1634, `Undo Edits`), sound: GW.editsUndone, announcementMessage: C(1635, `Edits Undone`), settingsKey: `accessibility.signals.editsUndone` }), _pb.chatUserActionRequired = _pb.register({ name: C(1636, `Chat User Action Required`), sound: GW.chatUserActionRequired, announcementMessage: C(1637, `Chat User Action Required`), settingsKey: `accessibility.signals.chatUserActionRequired`, managesOwnEnablement: true }), _pb), JW = class extends D {
  constructor(e206, t10 = []) {
    super(), this.logger = new cre([e206, ...t10]), this._register(e206.onDidChangeLogLevel((e207) => this.setLevel(e207)));
  }
  get onDidChangeLogLevel() {
    return this.logger.onDidChangeLogLevel;
  }
  setLevel(e206) {
    this.logger.setLevel(e206);
  }
  getLevel() {
    return this.logger.getLevel();
  }
  trace(e206, ...t10) {
    this.logger.trace(e206, ...t10);
  }
  debug(e206, ...t10) {
    this.logger.debug(e206, ...t10);
  }
  info(e206, ...t10) {
    this.logger.info(e206, ...t10);
  }
  warn(e206, ...t10) {
    this.logger.warn(e206, ...t10);
  }
  error(e206, ...t10) {
    this.logger.error(e206, ...t10);
  }
}, YW = [];
function XW(e206) {
  YW.push(e206);
}
function ZW() {
  return YW.slice(0);
}
var QW = class {
  getParserClass() {
    throw Error(`not implemented in StandaloneTreeSitterLibraryService`);
  }
  supportsLanguage(e206, t10) {
    return false;
  }
  getLanguage(e206, t10, n10) {
  }
  getInjectionQueries(e206, t10) {
    return null;
  }
  getHighlightingQueries(e206, t10) {
    return null;
  }
}, $W = xu(`dataChannelService`), eG = class {
  getDataChannel(e206) {
    return { sendData: () => {
    } };
  }
}, tG = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, nG = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, rG = class {
  constructor(e206) {
    this.disposed = false, this.model = e206, this._onWillDispose = new k();
  }
  get textEditorModel() {
    return this.model;
  }
  dispose() {
    this.disposed = true, this._onWillDispose.fire();
  }
}, iG = class {
  constructor(e206) {
    this.modelService = e206;
  }
  createModelReference(e206) {
    let t10 = this.modelService.getModel(e206);
    return t10 ? Promise.resolve(new oee(new rG(t10))) : Promise.reject(Error(`Model not found`));
  }
};
iG = tG([nG(0, Cu)], iG);
var aG = (_qb = class {
  show() {
    return _qb.NULL_PROGRESS_RUNNER;
  }
  async showWhile(e206, t10) {
    await e206;
  }
}, _qb.NULL_PROGRESS_RUNNER = { done: () => {
}, total: () => {
}, worked: () => {
} }, _qb), oG = class {
  withProgress(e206, t10, n10) {
    return t10({ report: () => {
    } });
  }
}, sG = class {
  constructor() {
    this.isExtensionDevelopment = false, this.isBuilt = false;
  }
}, cG = class {
  async confirm(e206) {
    return { confirmed: this.doConfirm(e206.message, e206.detail), checkboxChecked: false };
  }
  doConfirm(e206, t10) {
    let n10 = e206;
    return t10 && (n10 = n10 + `

` + t10), Aa.confirm(n10);
  }
  async prompt(e206) {
    let t10;
    if (this.doConfirm(e206.message, e206.detail)) {
      let n10 = [...e206.buttons ?? []];
      e206.cancelButton && typeof e206.cancelButton != `string` && typeof e206.cancelButton != `boolean` && n10.push(e206.cancelButton), t10 = await n10[0]?.run({ checkboxChecked: false });
    }
    return { result: t10 };
  }
  async error(e206, t10) {
    await this.prompt({ type: lw.Error, message: e206, detail: t10 });
  }
}, lG = (_rb = class {
  info(e206) {
    return this.notify({ severity: lw.Info, message: e206 });
  }
  warn(e206) {
    return this.notify({ severity: lw.Warning, message: e206 });
  }
  error(e206) {
    return this.notify({ severity: lw.Error, message: e206 });
  }
  notify(t10) {
    switch (t10.severity) {
      case lw.Error:
        console.error(t10.message);
        break;
      case lw.Warning:
        console.warn(t10.message);
        break;
      default:
        console.log(t10.message);
        break;
    }
    return _rb.NO_OP;
  }
  prompt(t10, n10, r10, i10) {
    return _rb.NO_OP;
  }
  status(e206, t10) {
    return { close: () => {
    } };
  }
}, _rb.NO_OP = new Mle(), _rb), uG = class {
  constructor(e206) {
    this._onWillExecuteCommand = new k(), this._onDidExecuteCommand = new k(), this.onDidExecuteCommand = this._onDidExecuteCommand.event, this._instantiationService = e206;
  }
  executeCommand(e206, ...t10) {
    let n10 = Nu.getCommand(e206);
    if (!n10) return Promise.reject(Error(`command '${e206}' not found`));
    try {
      this._onWillExecuteCommand.fire({ commandId: e206, args: t10 });
      let r10 = this._instantiationService.invokeFunction.apply(this._instantiationService, [n10.handler, ...t10]);
      return this._onDidExecuteCommand.fire({ commandId: e206, args: t10 }), Promise.resolve(r10);
    } catch (e207) {
      return Promise.reject(e207);
    }
  }
};
uG = tG([nG(0, V)], uG);
var dG = class extends Ghe {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(e206, t10, n10, r10, i10), this._cachedResolver = null, this._dynamicKeybindings = [], this._domNodeListeners = [];
    let o10 = (e207) => {
      let t11 = new E();
      t11.add(L(e207, R.KEY_DOWN, (e208) => {
        let t12 = new Jo(e208);
        this._dispatch(t12, t12.target) && (t12.preventDefault(), t12.stopPropagation());
      })), t11.add(L(e207, R.KEY_UP, (e208) => {
        let t12 = new Jo(e208);
        this._singleModifierDispatch(t12, t12.target) && t12.preventDefault();
      })), this._domNodeListeners.push(new fG(e207, t11));
    }, s10 = (e207) => {
      for (let t11 = 0; t11 < this._domNodeListeners.length; t11++) {
        let n11 = this._domNodeListeners[t11];
        n11.domNode === e207 && (this._domNodeListeners.splice(t11, 1), n11.dispose());
      }
    }, c10 = (e207) => {
      e207.getOption(70) || o10(e207.getContainerDomNode());
    };
    this._register(a10.onCodeEditorAdd(c10)), this._register(a10.onCodeEditorRemove((e207) => {
      e207.getOption(70) || s10(e207.getContainerDomNode());
    })), a10.listCodeEditors().forEach(c10);
    let l10 = (e207) => {
      o10(e207.getContainerDomNode());
    };
    this._register(a10.onDiffEditorAdd(l10)), this._register(a10.onDiffEditorRemove((e207) => {
      s10(e207.getContainerDomNode());
    })), a10.listDiffEditors().forEach(l10);
  }
  addDynamicKeybinding(e206, t10, n10, r10) {
    return qt(Nu.registerCommand(e206, n10), this.addDynamicKeybindings([{ keybinding: t10, command: e206, when: r10 }]));
  }
  addDynamicKeybindings(e206) {
    let t10 = e206.map((e207) => ({ keybinding: Vo(e207.keybinding, Pt), command: e207.command ?? null, commandArgs: e207.commandArgs, when: e207.when, weight1: 1e3, weight2: 0, extensionId: null, isBuiltinExtension: false }));
    return this._dynamicKeybindings = this._dynamicKeybindings.concat(t10), this.updateResolver(), T(() => {
      for (let e207 = 0; e207 < this._dynamicKeybindings.length; e207++) if (this._dynamicKeybindings[e207] === t10[0]) {
        this._dynamicKeybindings.splice(e207, t10.length), this.updateResolver();
        return;
      }
    });
  }
  updateResolver() {
    this._cachedResolver = null, this._onDidUpdateKeybindings.fire();
  }
  _getResolver() {
    return this._cachedResolver || (this._cachedResolver = new Uhe(this._toNormalizedKeybindingItems(ld.getDefaultKeybindings(), true), this._toNormalizedKeybindingItems(this._dynamicKeybindings, false), (e206) => this._log(e206))), this._cachedResolver;
  }
  _documentHasFocus() {
    return Aa.document.hasFocus();
  }
  _toNormalizedKeybindingItems(e206, t10) {
    let n10 = [], r10 = 0;
    for (let i10 of e206) {
      let e207 = i10.when || void 0, a10 = i10.keybinding;
      if (!a10) n10[r10++] = new FF(void 0, i10.command, i10.commandArgs, e207, t10, null, false);
      else {
        let o10 = zF.resolveKeybinding(a10, Pt);
        for (let a11 of o10) n10[r10++] = new FF(a11, i10.command, i10.commandArgs, e207, t10, null, false);
      }
    }
    return n10;
  }
  resolveKeyboardEvent(e206) {
    return new zF([new Uo(e206.ctrlKey, e206.shiftKey, e206.altKey, e206.metaKey, e206.keyCode)], Pt);
  }
};
dG = tG([nG(0, nd), nG(1, Mu), nG(2, bd), nG(3, dw), nG(4, Ud), nG(5, Su)], dG);
var fG = class extends D {
  constructor(e206, t10) {
    super(), this.domNode = e206, this._register(t10);
  }
};
function pG(e206) {
  return !!e206 && typeof e206 == `object` && (!e206.overrideIdentifier || typeof e206.overrideIdentifier == `string`) && (!e206.resource || e206.resource instanceof $r);
}
var mG = class {
  constructor(e206) {
    this.logService = e206, this._onDidChangeConfiguration = new k(), this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
    let t10 = new UW(e206);
    this._configuration = new AF(t10.reload(), kF.createEmptyModel(e206), kF.createEmptyModel(e206), kF.createEmptyModel(e206), kF.createEmptyModel(e206), kF.createEmptyModel(e206), new wd(), kF.createEmptyModel(e206), new wd(), e206), t10.dispose();
  }
  getValue(e206, t10) {
    let n10 = typeof e206 == `string` ? e206 : void 0, r10 = pG(e206) ? e206 : pG(t10) ? t10 : {};
    return this._configuration.getValue(n10, r10, void 0);
  }
  updateValues(e206) {
    let t10 = { data: this._configuration.toData() }, n10 = [];
    for (let t11 of e206) {
      let [e207, r10] = t11;
      this.getValue(e207) !== r10 && (this._configuration.updateValue(e207, r10), n10.push(e207));
    }
    if (n10.length > 0) {
      let e207 = new Bhe({ keys: n10, overrides: [] }, t10, this._configuration, void 0, this.logService);
      e207.source = 8, this._onDidChangeConfiguration.fire(e207);
    }
    return Promise.resolve();
  }
  updateValue(e206, t10, n10, r10) {
    return this.updateValues([[e206, t10]]);
  }
  inspect(e206, t10 = {}) {
    return this._configuration.inspect(e206, t10, void 0);
  }
};
mG = tG([nG(0, Ud)], mG);
var hG = class {
  constructor(e206, t10, n10) {
    this.configurationService = e206, this.modelService = t10, this.languageService = n10, this._onDidChangeConfiguration = new k(), this.configurationService.onDidChangeConfiguration((e207) => {
      this._onDidChangeConfiguration.fire({ affectedKeys: e207.affectedKeys, affectsConfiguration: (t11, n11) => e207.affectsConfiguration(n11) });
    });
  }
  getValue(e206, t10, n10) {
    let r10 = j.isIPosition(t10) ? t10 : null, i10 = r10 ? typeof n10 == `string` ? n10 : void 0 : typeof t10 == `string` ? t10 : void 0, a10 = e206 ? this.getLanguage(e206, r10) : void 0;
    return i10 === void 0 ? this.configurationService.getValue({ resource: e206, overrideIdentifier: a10 }) : this.configurationService.getValue(i10, { resource: e206, overrideIdentifier: a10 });
  }
  getLanguage(e206, t10) {
    let n10 = this.modelService.getModel(e206);
    return n10 ? t10 ? n10.getLanguageIdAtPosition(t10.lineNumber, t10.column) : n10.getLanguageId() : this.languageService.guessLanguageIdByFilepathOrFirstLine(e206);
  }
};
hG = tG([nG(0, Uf), nG(1, Cu), nG(2, Jf)], hG);
var gG = class {
  constructor(e206) {
    this.configurationService = e206;
  }
  getEOL(e206, t10) {
    let n10 = this.configurationService.getValue(`files.eol`, { overrideIdentifier: t10, resource: e206 });
    return n10 && typeof n10 == `string` && n10 !== `auto` ? n10 : Et || Tt ? `
` : `\r
`;
  }
};
gG = tG([nG(0, Uf)], gG);
var _G2 = class {
  publicLog2() {
  }
}, vG = (_sb = class {
  constructor() {
    this.workspace = { id: YF, folders: [new age({ uri: $r.from({ scheme: _sb.SCHEME, authority: `model`, path: `/` }), name: ``, index: 0 })] };
  }
  getWorkspace() {
    return this.workspace;
  }
  getWorkspaceFolder(t10) {
    return t10 && t10.scheme === _sb.SCHEME ? this.workspace.folders[0] : null;
  }
}, _sb.SCHEME = `inmemory`, _sb);
function yG(e206, t10, n10) {
  if (!t10 || !(e206 instanceof mG)) return;
  let r10 = [];
  Object.keys(t10).forEach((e207) => {
    Ihe(e207) && r10.push([`editor.${e207}`, t10[e207]]), n10 && Lhe(e207) && r10.push([`diffEditor.${e207}`, t10[e207]]);
  }), r10.length > 0 && e206.updateValues(r10);
}
var bG = class {
  constructor(e206) {
    this._modelService = e206;
  }
  hasPreviewHandler() {
    return false;
  }
  async apply(e206, t10) {
    let n10 = Array.isArray(e206) ? e206 : yF.convert(e206), r10 = /* @__PURE__ */ new Map();
    for (let e207 of n10) {
      if (!(e207 instanceof bF)) throw Error(`bad edit - only text edits are supported`);
      let t11 = this._modelService.getModel(e207.resource);
      if (!t11) throw Error(`bad edit - model not found`);
      if (typeof e207.versionId == `number` && t11.getVersionId() !== e207.versionId) throw Error(`bad state - model changed in the meantime`);
      let n11 = r10.get(t11);
      n11 || (n11 = [], r10.set(t11, n11)), n11.push(DF.replaceMove(M.lift(e207.textEdit.range), e207.textEdit.text));
    }
    let i10 = 0, a10 = 0;
    for (let [e207, t11] of r10) e207.pushStackElement(), e207.pushEditOperations([], t11, () => []), e207.pushStackElement(), a10 += 1, i10 += t11.length;
    return { ariaSummary: La(rI.bulkEditServiceSummary, i10, a10), isApplied: i10 > 0 };
  }
};
bG = tG([nG(0, Cu)], bG);
var xG = class {
  getUriLabel(e206, t10) {
    return e206.scheme === `file` ? e206.fsPath : e206.path;
  }
  getUriBasenameLabel(e206) {
    return Id(e206);
  }
}, SG = class extends bhe {
  constructor(e206, t10) {
    super(e206), this._codeEditorService = t10;
  }
  showContextView(e206, t10, n10) {
    if (!t10) {
      let e207 = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();
      e207 && (t10 = e207.getContainerDomNode());
    }
    return super.showContextView(e206, t10, n10);
  }
};
SG = tG([nG(0, Bk), nG(1, Su)], SG);
var CG = class {
  constructor() {
    this._neverEmitter = new k(), this.onDidChangeTrust = this._neverEmitter.event;
  }
  isWorkspaceTrusted() {
    return true;
  }
}, wG = class extends gge {
  constructor() {
    super();
  }
}, TG = class extends JW {
  constructor() {
    super(new sre());
  }
}, EG = class extends PL {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(e206, t10, n10, r10, i10, a10), this.configure({ blockMouse: false });
  }
};
EG = tG([nG(0, bd), nG(1, dw), nG(2, pj), nG(3, Dw), nG(4, pd), nG(5, nd)], EG);
var DG = { esmModuleLocation: void 0, label: `editorWorkerService` }, OG = class extends Yh {
  constructor(e206, t10, n10, r10, i10) {
    super(DG, e206, t10, n10, r10, i10);
  }
};
OG = tG([nG(0, Cu), nG(1, Uh), nG(2, Ud), nG(3, bp), nG(4, X)], OG);
var kG = class {
  async playSignal(e206, t10) {
  }
};
Zf(Ud, TG, 0), Zf(Uf, mG, 0), Zf(Uh, hG, 0), Zf(Wh, gG, 0), Zf(qF, vG, 0), Zf(BF, xG, 0), Zf(bd, _G2, 0), Zf(Gk, cG, 0), Zf(oA, sG, 0), Zf(dw, lG, 0), Zf(GL, HW, 0), Zf(Jf, wG, 0), Zf(YU, JU, 0), Zf(Cu, ZL, 0), Zf(qg, qL, 0), Zf(nd, OW, 0), Zf(VF, oG, 0), Zf(UF, aG, 0), Zf(dF, khe, 0), Zf(HL, OG, 0), Zf(vF, bG, 0), Zf(iI, CG, 0), Zf(wu, iG, 0), Zf(e_, QU, 0), Zf(aV, oV, 0), Zf(Mu, uG, 0), Zf(Dw, dG, 0), Zf(aF, aU, 0), Zf(pj, SG, 0), Zf(IP, VL, 0), Zf(hW, mW, 0), Zf(mj, EG, 0), Zf(pd, rW, 0), Zf(WW, kG, 0), Zf(sO, QW, 0), Zf(Wd, dre, 0), Zf($W, eG, 0);
var AG;
(function(e206) {
  let t10 = new kk();
  for (let [e207, n11] of Qf()) t10.set(e207, n11);
  let n10 = new LW(t10, true);
  t10.set(V, n10);
  function r10(e207) {
    i10 || o10({});
    let r11 = t10.get(e207);
    if (!r11) throw Error(`Missing service ` + e207);
    return r11 instanceof Yf ? n10.invokeFunction((t11) => t11.get(e207)) : r11;
  }
  e206.get = r10;
  let i10 = false, a10 = new k();
  function o10(e207) {
    if (i10) return n10;
    i10 = true;
    for (let [e208, n11] of Qf()) t10.get(e208) || t10.set(e208, n11);
    for (let n11 in e207) if (e207.hasOwnProperty(n11)) {
      let r12 = xu(n11);
      t10.get(r12) instanceof Yf && t10.set(r12, e207[n11]);
    }
    let r11 = ZW();
    for (let e208 of r11) try {
      n10.createInstance(e208);
    } catch (e209) {
      be(e209);
    }
    return a10.fire(), n10;
  }
  e206.initialize = o10;
  function s10(e207) {
    if (i10) return e207();
    let t11 = new E(), n11 = t11.add(a10.event(() => {
      n11.dispose(), t11.add(e207());
    }));
    return t11;
  }
  e206.withServices = s10;
})(AG || (AG = {}));
function jG(e206, t10) {
  return e206;
}
function MG(e206) {
  return FI(e206);
}
function NG(e206, t10, n10, r10 = Gs.ofCaller()) {
  return Ec({ debugName: () => `Configuration Key "${e206}"` }, (t11) => n10.onDidChangeConfiguration((n11) => {
    n11.affectsConfiguration(e206) && t11(n11);
  }), () => n10.getValue(e206) ?? t10, r10);
}
function PG(e206, t10, n10, r10 = Gs.ofCaller()) {
  let i10 = e206.bindTo(t10), a10 = new E();
  return dc({ debugName: () => `Set Context Key "${e206.key}"` }, (e207) => {
    let t11 = n10(e207);
    return i10.set(t11), t11;
  }, r10).recomputeInitiallyAndOnChange(a10), a10;
}
var FG = class e157 {
  static capture(t10) {
    if (t10.getScrollTop() === 0 || t10.hasPendingScrollAnimation()) return new e157(t10.getScrollTop(), t10.getContentHeight(), null, 0, null);
    let n10 = null, r10 = 0, i10 = t10.getVisibleRanges();
    if (i10.length > 0) {
      n10 = i10[0].getStartPosition();
      let e206 = t10.getTopForPosition(n10.lineNumber, n10.column);
      r10 = t10.getScrollTop() - e206;
    }
    return new e157(t10.getScrollTop(), t10.getContentHeight(), n10, r10, t10.getPosition());
  }
  constructor(e206, t10, n10, r10, i10) {
    this._initialScrollTop = e206, this._initialContentHeight = t10, this._visiblePosition = n10, this._visiblePositionScrollDelta = r10, this._cursorPosition = i10;
  }
  restore(e206) {
    if (!(this._initialContentHeight === e206.getContentHeight() && this._initialScrollTop === e206.getScrollTop()) && this._visiblePosition) {
      let t10 = e206.getTopForPosition(this._visiblePosition.lineNumber, this._visiblePosition.column);
      e206.setScrollTop(t10 + this._visiblePositionScrollDelta);
    }
  }
  restoreRelativeVerticalPositionOfCursor(e206) {
    if (this._initialContentHeight === e206.getContentHeight() && this._initialScrollTop === e206.getScrollTop()) return;
    let t10 = e206.getPosition();
    if (!this._cursorPosition || !t10) return;
    let n10 = e206.getTopForLineNumber(t10.lineNumber) - e206.getTopForLineNumber(this._cursorPosition.lineNumber);
    e206.setScrollTop(e206.getScrollTop() + n10, 1);
  }
};
function IG(e206, t10, n10, r10) {
  if (e206.length === 0) return t10;
  if (t10.length === 0) return e206;
  let i10 = [], a10 = 0, o10 = 0;
  for (; a10 < e206.length && o10 < t10.length; ) {
    let s10 = e206[a10], c10 = t10[o10], l10 = n10(s10), u10 = n10(c10);
    l10 < u10 ? (i10.push(s10), a10++) : l10 > u10 ? (i10.push(c10), o10++) : (i10.push(r10(s10, c10)), a10++, o10++);
  }
  for (; a10 < e206.length; ) i10.push(e206[a10]), a10++;
  for (; o10 < t10.length; ) i10.push(t10[o10]), o10++;
  return i10;
}
function LG(e206, t10) {
  let n10 = new E(), r10 = e206.createDecorationsCollection();
  return n10.add(gc({ debugName: () => `Apply decorations from ${t10.debugName}` }, (e207) => {
    let n11 = t10.read(e207);
    r10.set(n11);
  })), n10.add({ dispose: () => {
    r10.clear();
  } }), n10;
}
function RG(e206, t10) {
  return e206.appendChild(t10), T(() => {
    t10.remove();
  });
}
function zG(e206, t10) {
  return e206.prepend(t10), T(() => {
    t10.remove();
  });
}
var BG = class extends D {
  get width() {
    return this._width;
  }
  get height() {
    return this._height;
  }
  get automaticLayout() {
    return this._automaticLayout;
  }
  constructor(e206, t10) {
    super(), this._automaticLayout = false, this.elementSizeObserver = this._register(new Yg(e206, t10)), this._width = Ic(this, this.elementSizeObserver.getWidth()), this._height = Ic(this, this.elementSizeObserver.getHeight()), this._register(this.elementSizeObserver.onDidChange((e207) => bc((e208) => {
      this._width.set(this.elementSizeObserver.getWidth(), e208), this._height.set(this.elementSizeObserver.getHeight(), e208);
    })));
  }
  observe(e206) {
    this.elementSizeObserver.observe(e206);
  }
  setAutomaticLayout(e206) {
    this._automaticLayout = e206, e206 ? this.elementSizeObserver.startObserving() : this.elementSizeObserver.stopObserving();
  }
};
function VG(e206, t10, n10) {
  let r10 = t10.get(), i10 = r10, a10 = r10, o10 = Ic(`animatedValue`, r10), s10 = -1, c10;
  n10.add(_c({ changeTracker: { createChangeSummary: () => ({ animate: false }), handleChange: (e207, n11) => (e207.didChange(t10) && (n11.animate = n11.animate || e207.change), true) } }, (n11, o11) => {
    c10 !== void 0 && (e206.cancelAnimationFrame(c10), c10 = void 0), i10 = a10, r10 = t10.read(n11), s10 = Date.now() - (o11.animate ? 0 : 300), l10();
  }));
  function l10() {
    let t11 = Date.now() - s10;
    a10 = Math.floor(HG(t11, i10, r10 - i10, 300)), t11 < 300 ? c10 = e206.requestAnimationFrame(l10) : a10 = r10, o10.set(a10, void 0);
  }
  return o10;
}
function HG(e206, t10, n10, r10) {
  return e206 === r10 ? t10 + n10 : n10 * (-(2 ** (-10 * e206 / r10)) + 1) + t10;
}
var UG = class extends D {
  constructor(e206, t10, n10) {
    super(), this._register(new GG(e206, n10)), this._register(KG(n10, { height: t10.actualHeight, top: t10.actualTop }));
  }
}, WG = class {
  get afterLineNumber() {
    return this._afterLineNumber.get();
  }
  constructor(e206, t10) {
    this._afterLineNumber = e206, this.heightInPx = t10, this.domNode = document.createElement(`div`), this._actualTop = Ic(this, void 0), this._actualHeight = Ic(this, void 0), this.actualTop = this._actualTop, this.actualHeight = this._actualHeight, this.showInHiddenAreas = true, this.onChange = this._afterLineNumber, this.onDomNodeTop = (e207) => {
      this._actualTop.set(e207, void 0);
    }, this.onComputedHeight = (e207) => {
      this._actualHeight.set(e207, void 0);
    };
  }
}, GG = (_tb = class {
  constructor(t10, n10) {
    this._editor = t10, this._domElement = n10, this._overlayWidgetId = `managedOverlayWidget-${_tb._counter++}`, this._overlayWidget = { getId: () => this._overlayWidgetId, getDomNode: () => this._domElement, getPosition: () => null }, this._editor.addOverlayWidget(this._overlayWidget);
  }
  dispose() {
    this._editor.removeOverlayWidget(this._overlayWidget);
  }
}, _tb._counter = 0, _tb);
function KG(e206, t10) {
  return hc((n10) => {
    for (let [r10, i10] of Object.entries(t10)) i10 && typeof i10 == `object` && `read` in i10 && (i10 = i10.read(n10)), typeof i10 == `number` && (i10 = `${i10}px`), r10 = r10.replace(/[A-Z]/g, (e207) => `-` + e207.toLowerCase()), e206.style[r10] = i10;
  });
}
function qG(e206, t10, n10, r10) {
  let i10 = new E(), a10 = [];
  return i10.add(vc((i11, o10) => {
    let s10 = t10.read(i11), c10 = /* @__PURE__ */ new Map(), l10 = /* @__PURE__ */ new Map();
    n10 && n10(true), e206.changeViewZones((e207) => {
      for (let t11 of a10) e207.removeZone(t11), r10?.delete(t11);
      a10.length = 0;
      for (let t11 of s10) {
        let n11 = e207.addZone(t11);
        t11.setZoneId && t11.setZoneId(n11), a10.push(n11), r10?.add(n11), c10.set(t11, n11);
      }
    }), n10 && n10(false), o10.add(_c({ changeTracker: { createChangeSummary() {
      return { zoneIds: [] };
    }, handleChange(e207, t11) {
      let n11 = l10.get(e207.changedObservable);
      return n11 !== void 0 && t11.zoneIds.push(n11), true;
    } } }, (t11, r11) => {
      for (let e207 of s10) e207.onChange && (l10.set(e207.onChange, c10.get(e207)), e207.onChange.read(t11));
      n10 && n10(true), e206.changeViewZones((e207) => {
        for (let t12 of r11.zoneIds) e207.layoutZone(t12);
      }), n10 && n10(false);
    }));
  })), i10.add({ dispose() {
    n10 && n10(true), e206.changeViewZones((e207) => {
      for (let t11 of a10) e207.removeZone(t11);
    }), r10?.clear(), n10 && n10(false);
  } }), i10;
}
var JG = class extends pr {
  dispose() {
    super.dispose(true);
  }
};
function YG(e206, t10) {
  let n10 = Dm(t10, (t11) => t11.original.startLineNumber <= e206.lineNumber);
  if (!n10) return M.fromPositions(e206);
  if (n10.original.endLineNumberExclusive <= e206.lineNumber) {
    let t11 = e206.lineNumber - n10.original.endLineNumberExclusive + n10.modified.endLineNumberExclusive;
    return M.fromPositions(new j(t11, e206.column));
  }
  if (!n10.innerChanges) return M.fromPositions(new j(n10.modified.startLineNumber, 1));
  let r10 = Dm(n10.innerChanges, (t11) => t11.originalRange.getStartPosition().isBeforeOrEqual(e206));
  if (!r10) {
    let t11 = e206.lineNumber - n10.original.startLineNumber + n10.modified.startLineNumber;
    return M.fromPositions(new j(t11, e206.column));
  }
  if (r10.originalRange.containsPosition(e206)) return r10.modifiedRange;
  {
    let t11 = XG(r10.originalRange.getEndPosition(), e206);
    return M.fromPositions(t11.addToPosition(r10.modifiedRange.getEndPosition()));
  }
}
function XG(e206, t10) {
  return e206.lineNumber === t10.lineNumber ? new Vm(0, t10.column - e206.column) : new Vm(t10.lineNumber - e206.lineNumber, t10.column - 1);
}
function ZG(e206, t10) {
  let n10;
  return e206.filter((e207) => {
    let r10 = t10(e207, n10);
    return n10 = e207, r10;
  });
}
var QG = class {
  static create(e206, t10 = void 0) {
    return new $G(e206, e206, t10);
  }
  static createWithDisposable(e206, t10, n10 = void 0) {
    let r10 = new E();
    return r10.add(t10), r10.add(e206), new $G(e206, r10, n10);
  }
}, $G = class extends QG {
  constructor(e206, t10, n10) {
    super(), this.object = e206, this._disposable = t10, this._debugOwner = n10, this._refCount = 1, this._isDisposed = false, this._owners = [], n10 && this._addOwner(n10);
  }
  _addOwner(e206) {
    e206 && this._owners.push(e206);
  }
  createNewRef(e206) {
    return this._refCount++, e206 && this._addOwner(e206), new eK(this, e206);
  }
  dispose() {
    this._isDisposed || (this._isDisposed = true, this._decreaseRefCount(this._debugOwner));
  }
  _decreaseRefCount(e206) {
    if (this._refCount--, this._refCount === 0 && this._disposable.dispose(), e206) {
      let t10 = this._owners.indexOf(e206);
      t10 !== -1 && this._owners.splice(t10, 1);
    }
  }
}, eK = class extends QG {
  constructor(e206, t10) {
    super(), this._base = e206, this._debugOwner = t10, this._isDisposed = false;
  }
  get object() {
    return this._base.object;
  }
  createNewRef(e206) {
    return this._base.createNewRef(e206);
  }
  dispose() {
    this._isDisposed || (this._isDisposed = true, this._base._decreaseRefCount(this._debugOwner));
  }
}, tK = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, nK = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, rK = AU(`diff-review-insert`, F.add, C(97, `Icon for 'Insert' in accessible diff viewer.`)), iK = AU(`diff-review-remove`, F.remove, C(98, `Icon for 'Remove' in accessible diff viewer.`)), aK = AU(`diff-review-close`, F.close, C(99, `Icon for 'Close' in accessible diff viewer.`)), oK = (_ub = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(), this._parentNode = e206, this._visible = t10, this._setVisible = n10, this._canClose = r10, this._width = i10, this._height = a10, this._diffs = o10, this._models = s10, this._instantiationService = c10, this._state = I(this, (e207) => {
      let t11 = this._visible.read(e207);
      if (this._parentNode.style.visibility = t11 ? `visible` : `hidden`, !t11) return null;
      let n11 = e207.store.add(this._instantiationService.createInstance(sK, this._diffs, this._models, this._setVisible, this._canClose));
      return { model: n11, view: e207.store.add(this._instantiationService.createInstance(uK, this._parentNode, n11, this._width, this._height, this._models)) };
    }).recomputeInitiallyAndOnChange(this._store);
  }
  next() {
    bc((e206) => {
      let t10 = this._visible.get();
      this._setVisible(true, e206), t10 && this._state.get().model.nextGroup(e206);
    });
  }
  prev() {
    bc((e206) => {
      this._setVisible(true, e206), this._state.get().model.previousGroup(e206);
    });
  }
  close() {
    bc((e206) => {
      this._setVisible(false, e206);
    });
  }
}, _ub._ttPolicy = _f2(`diffReview`, { createHTML: (e206) => e206 }), _ub);
oK = tK([nK(8, V)], oK);
var sK = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._diffs = e206, this._models = t10, this._setVisible = n10, this.canClose = r10, this._accessibilitySignalService = i10, this._groups = Ic(this, []), this._currentGroupIdx = Ic(this, 0), this._currentElementIdx = Ic(this, 0), this.groups = this._groups, this.currentGroup = this._currentGroupIdx.map((e207, t11) => this._groups.read(t11)[e207]), this.currentGroupIndex = this._currentGroupIdx, this.currentElement = this._currentElementIdx.map((e207, t11) => this.currentGroup.read(t11)?.lines[e207]), this._register(hc((e207) => {
      let t11 = this._diffs.read(e207);
      if (!t11) {
        this._groups.set([], void 0);
        return;
      }
      let n11 = J_e(t11, this._models.getOriginalModel().getLineCount(), this._models.getModifiedModel().getLineCount());
      bc((e208) => {
        let t12 = this._models.getModifiedPosition();
        if (t12) {
          let r11 = n11.findIndex((e209) => t12?.lineNumber < e209.range.modified.endLineNumberExclusive);
          r11 !== -1 && this._currentGroupIdx.set(r11, e208);
        }
        this._groups.set(n11, e208);
      });
    })), this._register(hc((e207) => {
      let t11 = this.currentElement.read(e207);
      t11?.type === lK.Deleted ? this._accessibilitySignalService.playSignal(qW.diffLineDeleted, { source: `accessibleDiffViewer.currentElementChanged` }) : t11?.type === lK.Added && this._accessibilitySignalService.playSignal(qW.diffLineInserted, { source: `accessibleDiffViewer.currentElementChanged` });
    })), this._register(hc((e207) => {
      let t11 = this.currentElement.read(e207);
      if (t11 && t11.type !== lK.Header) {
        let e208 = t11.modifiedLineNumber ?? t11.diff.modified.startLineNumber;
        this._models.modifiedSetSelection(M.fromPositions(new j(e208, 1)));
      }
    }));
  }
  _goToGroupDelta(e206, t10) {
    let n10 = this.groups.get();
    !n10 || n10.length <= 1 || Cc(t10, (t11) => {
      this._currentGroupIdx.set(Tm.ofLength(n10.length).clipCyclic(this._currentGroupIdx.get() + e206), t11), this._currentElementIdx.set(0, t11);
    });
  }
  nextGroup(e206) {
    this._goToGroupDelta(1, e206);
  }
  previousGroup(e206) {
    this._goToGroupDelta(-1, e206);
  }
  _goToLineDelta(e206) {
    let t10 = this.currentGroup.get();
    !t10 || t10.lines.length <= 1 || bc((n10) => {
      this._currentElementIdx.set(Tm.ofLength(t10.lines.length).clip(this._currentElementIdx.get() + e206), n10);
    });
  }
  goToNextLine() {
    this._goToLineDelta(1);
  }
  goToPreviousLine() {
    this._goToLineDelta(-1);
  }
  goToLine(e206) {
    let t10 = this.currentGroup.get();
    if (!t10) return;
    let n10 = t10.lines.indexOf(e206);
    n10 !== -1 && bc((e207) => {
      this._currentElementIdx.set(n10, e207);
    });
  }
  revealCurrentElementInEditor() {
    if (!this.canClose.get()) return;
    this._setVisible(false, void 0);
    let e206 = this.currentElement.get();
    e206 && (e206.type === lK.Deleted ? this._models.originalReveal(M.fromPositions(new j(e206.originalLineNumber, 1))) : this._models.modifiedReveal(e206.type === lK.Header ? void 0 : M.fromPositions(new j(e206.modifiedLineNumber, 1))));
  }
  close() {
    this.canClose.get() && (this._setVisible(false, void 0), this._models.modifiedFocus());
  }
};
sK = tK([nK(4, WW)], sK);
var cK = 3;
function J_e(e206, t10, n10) {
  let r10 = [];
  for (let i10 of f(e206, (e207, t11) => t11.modified.startLineNumber - e207.modified.endLineNumberExclusive < 2 * cK)) {
    let e207 = [];
    e207.push(new X_e());
    let a10 = new zm(Math.max(1, i10[0].original.startLineNumber - cK), Math.min(i10[i10.length - 1].original.endLineNumberExclusive + cK, t10 + 1)), o10 = new zm(Math.max(1, i10[0].modified.startLineNumber - cK), Math.min(i10[i10.length - 1].modified.endLineNumberExclusive + cK, n10 + 1));
    p(i10, (t11, n11) => {
      let r11 = new zm(t11 ? t11.original.endLineNumberExclusive : a10.startLineNumber, n11 ? n11.original.startLineNumber : a10.endLineNumberExclusive), i11 = new zm(t11 ? t11.modified.endLineNumberExclusive : o10.startLineNumber, n11 ? n11.modified.startLineNumber : o10.endLineNumberExclusive);
      r11.forEach((t12) => {
        e207.push(new $_e(t12, i11.startLineNumber + (t12 - r11.startLineNumber)));
      }), n11 && (n11.original.forEach((t12) => {
        e207.push(new Z_e(n11, t12));
      }), n11.modified.forEach((t12) => {
        e207.push(new Q_e(n11, t12));
      }));
    });
    let s10 = i10[0].modified.join(i10[i10.length - 1].modified), c10 = i10[0].original.join(i10[i10.length - 1].original);
    r10.push(new Y_e(new Zm(s10, c10), e207));
  }
  return r10;
}
var lK;
(function(e206) {
  e206[e206.Header = 0] = `Header`, e206[e206.Unchanged = 1] = `Unchanged`, e206[e206.Deleted = 2] = `Deleted`, e206[e206.Added = 3] = `Added`;
})(lK || (lK = {}));
var Y_e = class {
  constructor(e206, t10) {
    this.range = e206, this.lines = t10;
  }
}, X_e = class {
  constructor() {
    this.type = lK.Header;
  }
}, Z_e = class {
  constructor(e206, t10) {
    this.diff = e206, this.originalLineNumber = t10, this.type = lK.Deleted, this.modifiedLineNumber = void 0;
  }
}, Q_e = class {
  constructor(e206, t10) {
    this.diff = e206, this.modifiedLineNumber = t10, this.type = lK.Added, this.originalLineNumber = void 0;
  }
}, $_e = class {
  constructor(e206, t10) {
    this.originalLineNumber = e206, this.modifiedLineNumber = t10, this.type = lK.Unchanged;
  }
}, uK = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._element = e206, this._model = t10, this._width = n10, this._height = r10, this._models = i10, this._languageService = a10, this.domNode = this._element, this.domNode.className = `monaco-component diff-review monaco-editor-background`;
    let o10 = document.createElement(`div`);
    o10.className = `diff-review-actions`, this._actionBar = this._register(new CL(o10)), this._register(hc((e207) => {
      this._actionBar.clear(), this._model.canClose.read(e207) && this._actionBar.push(ku({ id: `diffreview.close`, label: C(100, `Close`), class: `close-diff-review ` + ju.asClassName(aK), enabled: true, run: async () => t10.close() }), { label: false, icon: true });
    })), this._content = document.createElement(`div`), this._content.className = `diff-review-content`, this._content.setAttribute(`role`, `code`), this._scrollbar = this._register(new hx(this._content, {})), Jl(this.domNode, this._scrollbar.getDomNode(), o10), this._register(hc((e207) => {
      this._height.read(e207), this._width.read(e207), this._scrollbar.scanDomNode();
    })), this._register(T(() => {
      Jl(this.domNode);
    })), this._register(KG(this.domNode, { width: this._width, height: this._height })), this._register(KG(this._content, { width: this._width, height: this._height })), this._register(vc((e207, t11) => {
      this._model.currentGroup.read(e207), this._render(t11);
    })), this._register(el(this.domNode, `keydown`, (e207) => {
      (e207.equals(18) || e207.equals(2066) || e207.equals(530)) && (e207.preventDefault(), this._model.goToNextLine()), (e207.equals(16) || e207.equals(2064) || e207.equals(528)) && (e207.preventDefault(), this._model.goToPreviousLine()), (e207.equals(9) || e207.equals(2057) || e207.equals(521) || e207.equals(1033)) && (e207.preventDefault(), this._model.close()), (e207.equals(10) || e207.equals(3)) && (e207.preventDefault(), this._model.revealCurrentElementInEditor());
    }));
  }
  _render(e206) {
    let t10 = this._models.getOriginalOptions(), n10 = this._models.getModifiedOptions(), r10 = document.createElement(`div`);
    r10.className = `diff-review-table`, r10.setAttribute(`role`, `list`), r10.setAttribute(`aria-label`, C(101, `Accessible Diff Viewer. Use arrow up and down to navigate.`)), vu(r10, n10.get(59)), Jl(this._content, r10);
    let i10 = this._models.getOriginalModel(), a10 = this._models.getModifiedModel();
    if (!i10 || !a10) return;
    let o10 = i10.getOptions(), s10 = a10.getOptions(), c10 = n10.get(75), l10 = this._model.currentGroup.get();
    for (let u10 of l10?.lines || []) {
      if (!l10) break;
      let d10;
      if (u10.type === lK.Header) {
        let e207 = document.createElement(`div`);
        e207.className = `diff-review-row`, e207.setAttribute(`role`, `listitem`);
        let t11 = l10.range, n11 = this._model.currentGroupIndex.get(), r11 = this._model.groups.get().length, i11 = (e208) => e208 === 0 ? C(102, `no lines changed`) : e208 === 1 ? C(103, `1 line changed`) : C(104, `{0} lines changed`, e208), a11 = i11(t11.original.length), o11 = i11(t11.modified.length);
        e207.setAttribute(`aria-label`, C(105, `Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}`, n11 + 1, r11, t11.original.startLineNumber, a11, t11.modified.startLineNumber, o11));
        let s11 = document.createElement(`div`);
        s11.className = `diff-review-cell diff-review-summary`, s11.appendChild(document.createTextNode(`${n11 + 1}/${r11}: @@ -${t11.original.startLineNumber},${t11.original.length} +${t11.modified.startLineNumber},${t11.modified.length} @@`)), e207.appendChild(s11), d10 = e207;
      } else d10 = this._createRow(u10, c10, this._width.get(), t10, i10, o10, n10, a10, s10);
      r10.appendChild(d10);
      let f10 = I((e207) => this._model.currentElement.read(e207) === u10);
      e206.add(hc((e207) => {
        let t11 = f10.read(e207);
        d10.tabIndex = t11 ? 0 : -1, t11 && d10.focus();
      })), e206.add(L(d10, `focus`, () => {
        this._model.goToLine(u10);
      }));
    }
    this._scrollbar.scanDomNode();
  }
  _createRow(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let l10 = r10.get(165), u10 = l10.glyphMarginWidth + l10.lineNumbersWidth, d10 = o10.get(165), f10 = 10 + d10.glyphMarginWidth + d10.lineNumbersWidth, p10 = `diff-review-row`, m10 = ``, h10 = null;
    switch (e206.type) {
      case lK.Added:
        p10 = `diff-review-row line-insert`, m10 = ` char-insert`, h10 = rK;
        break;
      case lK.Deleted:
        p10 = `diff-review-row line-delete`, m10 = ` char-delete`, h10 = iK;
        break;
    }
    let g10 = document.createElement(`div`);
    g10.style.minWidth = n10 + `px`, g10.className = p10, g10.setAttribute(`role`, `listitem`), g10.ariaLevel = ``;
    let _10 = document.createElement(`div`);
    _10.className = `diff-review-cell`, _10.style.height = `${t10}px`, g10.appendChild(_10);
    let v10 = document.createElement(`span`);
    v10.style.width = u10 + `px`, v10.style.minWidth = u10 + `px`, v10.className = `diff-review-line-number` + m10, e206.originalLineNumber === void 0 ? v10.innerText = `\xA0` : v10.appendChild(document.createTextNode(String(e206.originalLineNumber))), _10.appendChild(v10);
    let y10 = document.createElement(`span`);
    y10.style.width = f10 + `px`, y10.style.minWidth = f10 + `px`, y10.style.paddingRight = `10px`, y10.className = `diff-review-line-number` + m10, e206.modifiedLineNumber === void 0 ? y10.innerText = `\xA0` : y10.appendChild(document.createTextNode(String(e206.modifiedLineNumber))), _10.appendChild(y10);
    let b10 = document.createElement(`span`);
    if (b10.className = `diff-review-spacer`, h10) {
      let e207 = document.createElement(`span`);
      e207.className = ju.asClassName(h10), e207.innerText = `\xA0\xA0`, b10.appendChild(e207);
    } else b10.innerText = `\xA0\xA0`;
    _10.appendChild(b10);
    let x10;
    if (e206.modifiedLineNumber !== void 0) {
      let t11 = this._getLineHtml(s10, o10, c10.tabSize, e206.modifiedLineNumber, this._languageService.languageIdCodec);
      oK._ttPolicy && (t11 = oK._ttPolicy.createHTML(t11)), _10.insertAdjacentHTML(`beforeend`, t11), x10 = s10.getLineContent(e206.modifiedLineNumber);
    } else {
      let t11 = this._getLineHtml(i10, r10, a10.tabSize, e206.originalLineNumber, this._languageService.languageIdCodec);
      oK._ttPolicy && (t11 = oK._ttPolicy.createHTML(t11)), _10.insertAdjacentHTML(`beforeend`, t11), x10 = i10.getLineContent(e206.originalLineNumber);
    }
    x10.length === 0 && (x10 = C(106, `blank`));
    let S10 = ``;
    switch (e206.type) {
      case lK.Unchanged:
        S10 = e206.originalLineNumber === e206.modifiedLineNumber ? C(107, `{0} unchanged line {1}`, x10, e206.originalLineNumber) : C(108, `{0} original line {1} modified line {2}`, x10, e206.originalLineNumber, e206.modifiedLineNumber);
        break;
      case lK.Added:
        S10 = C(109, `+ {0} modified line {1}`, x10, e206.modifiedLineNumber);
        break;
      case lK.Deleted:
        S10 = C(110, `- {0} original line {1}`, x10, e206.originalLineNumber);
        break;
    }
    return g10.setAttribute(`aria-label`, S10), g10;
  }
  _getLineHtml(e206, t10, n10, r10, i10) {
    let a10 = e206.getLineContent(r10), o10 = t10.get(59), s10 = t10.get(117).verticalScrollbarSize, c10 = rg.createEmpty(a10, i10), l10 = vg.isBasicASCII(a10, e206.mightContainNonBasicASCII()), u10 = vg.containsRTL(a10, l10, e206.mightContainRTL());
    return mg(new lg(o10.isMonospace && !t10.get(40), o10.canUseHalfwidthRightwardsArrow, a10, false, l10, u10, 0, c10, [], n10, 0, o10.spaceWidth, o10.middotWidth, o10.wsmiddotWidth, t10.get(133), t10.get(113), t10.get(108), t10.get(60) !== Gn.OFF, null, null, s10)).html;
  }
};
uK = tK([nK(5, Jf)], uK);
var eve = class {
  constructor(e206) {
    this.editors = e206;
  }
  getOriginalModel() {
    return this.editors.original.getModel();
  }
  getOriginalOptions() {
    return this.editors.original.getOptions();
  }
  originalReveal(e206) {
    this.editors.original.revealRange(e206), this.editors.original.setSelection(e206), this.editors.original.focus();
  }
  getModifiedModel() {
    return this.editors.modified.getModel();
  }
  getModifiedOptions() {
    return this.editors.modified.getOptions();
  }
  modifiedReveal(e206) {
    e206 && (this.editors.modified.revealRange(e206), this.editors.modified.setSelection(e206)), this.editors.modified.focus();
  }
  modifiedSetSelection(e206) {
    this.editors.modified.setSelection(e206);
  }
  modifiedFocus() {
    this.editors.modified.focus();
  }
  getModifiedPosition() {
    return this.editors.modified.getPosition() ?? void 0;
  }
};
Q(`diffEditor.move.border`, `#8b8b8b9c`, C(137, `The border color for text that got moved in the diff editor.`)), Q(`diffEditor.moveActive.border`, `#FFA500`, C(138, `The active border color for text that got moved in the diff editor.`)), Q(`diffEditor.unchangedRegionShadow`, { dark: `#000000`, light: `#737373BF`, hcDark: `#000000`, hcLight: `#737373BF` }, C(139, `The color of the shadow around unchanged region widgets.`));
var tve = AU(`diff-insert`, F.add, C(140, `Line decoration for inserts in the diff editor.`)), dK = AU(`diff-remove`, F.remove, C(141, `Line decoration for removals in the diff editor.`)), fK = UO.register({ className: `line-insert`, description: `line-insert`, isWholeLine: true, linesDecorationsClassName: `insert-sign ` + ju.asClassName(tve), marginClassName: `gutter-insert` }), pK = UO.register({ className: `line-delete`, description: `line-delete`, isWholeLine: true, linesDecorationsClassName: `delete-sign ` + ju.asClassName(dK), marginClassName: `gutter-delete` }), mK = UO.register({ className: `line-insert`, description: `line-insert`, isWholeLine: true, marginClassName: `gutter-insert` }), hK = UO.register({ className: `line-delete`, description: `line-delete`, isWholeLine: true, marginClassName: `gutter-delete` }), gK = UO.register({ className: `char-insert`, description: `char-insert`, shouldFillLineOnLineBreak: true }), nve = UO.register({ className: `char-insert`, description: `char-insert`, isWholeLine: true }), rve = UO.register({ className: `char-insert diff-range-empty`, description: `char-insert diff-range-empty` }), _K2 = UO.register({ className: `char-delete`, description: `char-delete`, shouldFillLineOnLineBreak: true }), ive = UO.register({ className: `char-delete`, description: `char-delete`, isWholeLine: true }), ave = UO.register({ className: `char-delete diff-range-empty`, description: `char-delete diff-range-empty` }), vK = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, yK = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, bK, xK = xu(`diffProviderFactoryService`), SK = class {
  constructor(e206) {
    this.instantiationService = e206;
  }
  createDiffProvider(e206) {
    return this.instantiationService.createInstance(CK, e206);
  }
};
SK = vK([yK(0, V)], SK), Zf(xK, SK, 1);
var CK = (_vb = class {
  constructor(e206, t10, n10) {
    this.editorWorkerService = t10, this.telemetryService = n10, this.onDidChangeEventEmitter = new k(), this.onDidChange = this.onDidChangeEventEmitter.event, this.diffAlgorithm = `advanced`, this.diffAlgorithmOnDidChangeSubscription = void 0, this.setOptions(e206);
  }
  dispose() {
    this.diffAlgorithmOnDidChangeSubscription?.dispose();
  }
  async computeDiff(e206, t10, n10, r10) {
    if (typeof this.diffAlgorithm != `string`) return this.diffAlgorithm.computeDiff(e206, t10, n10, r10);
    if (e206.isDisposed() || t10.isDisposed()) return { changes: [], identical: true, quitEarly: false, moves: [] };
    if (e206.getLineCount() === 1 && e206.getLineMaxColumn(1) === 1) return t10.getLineCount() === 1 && t10.getLineMaxColumn(1) === 1 ? { changes: [], identical: true, quitEarly: false, moves: [] } : { changes: [new eh(new zm(1, 2), new zm(1, t10.getLineCount() + 1), [new th(e206.getFullModelRange(), t10.getFullModelRange())])], identical: false, quitEarly: false, moves: [] };
    let i10 = JSON.stringify([e206.uri.toString(), t10.uri.toString()]), a10 = JSON.stringify([e206.id, t10.id, e206.getAlternativeVersionId(), t10.getAlternativeVersionId(), JSON.stringify(n10)]), o10 = bK.diffCache.get(i10);
    if (o10 && o10.context === a10) return o10.result;
    let s10 = $t.create(), c10 = await this.editorWorkerService.computeDiff(e206.uri, t10.uri, n10, this.diffAlgorithm), l10 = s10.elapsed();
    if (this.telemetryService.publicLog2(`diffEditor.computeDiff`, { timeMs: l10, timedOut: c10?.quitEarly ?? true, detectedMoves: n10.computeMoves ? c10?.moves.length ?? 0 : -1 }), r10.isCancellationRequested) return { changes: [], identical: false, quitEarly: true, moves: [] };
    if (!c10) throw Error(`no diff result available`);
    return bK.diffCache.size > 10 && bK.diffCache.delete(bK.diffCache.keys().next().value), bK.diffCache.set(i10, { result: c10, context: a10 }), c10;
  }
  setOptions(e206) {
    let t10 = false;
    e206.diffAlgorithm && this.diffAlgorithm !== e206.diffAlgorithm && (this.diffAlgorithmOnDidChangeSubscription?.dispose(), this.diffAlgorithmOnDidChangeSubscription = void 0, this.diffAlgorithm = e206.diffAlgorithm, typeof e206.diffAlgorithm != `string` && (this.diffAlgorithmOnDidChangeSubscription = e206.diffAlgorithm.onDidChange(() => this.onDidChangeEventEmitter.fire())), t10 = true), t10 && this.onDidChangeEventEmitter.fire();
  }
}, bK = _vb, _vb.diffCache = /* @__PURE__ */ new Map(), _vb);
CK = bK = vK([yK(1, HL), yK(2, bd)], CK);
function wK(e206, t10, n10, r10) {
  return t10 || (t10 = (e207) => e207 != null), new Promise((i10, a10) => {
    let o10 = true, s10 = false, c10 = e206.map((e207) => ({ isFinished: t10(e207), error: n10 ? n10(e207) : false, state: e207 })), l10 = hc((e207) => {
      let { isFinished: t11, error: n11, state: r11 } = c10.read(e207);
      (t11 || n11) && (o10 ? s10 = true : l10.dispose(), n11 ? a10(n11 === true ? r11 : n11) : i10(r11));
    });
    if (r10) {
      let e207 = r10.onCancellationRequested(() => {
        l10.dispose(), e207.dispose(), a10(new Te());
      });
      if (r10.isCancellationRequested) {
        l10.dispose(), e207.dispose(), a10(new Te());
        return;
      }
    }
    o10 = false, s10 && l10.dispose();
  });
}
function TK(e206, t10, n10 = Gs.ofCaller()) {
  return new ove(typeof e206 == `string` ? e206 : new Zs(e206, void 0, void 0), t10, n10);
}
var ove = class extends sc {
  constructor(e206, t10, n10) {
    super(n10), this.event = t10, this.handleEvent = () => {
      bc((e207) => {
        for (let t11 of this._observers) e207.updateObserver(t11, this), t11.handleChange(this, void 0);
      }, () => this.debugName);
    }, this.debugName = typeof e206 == `string` ? e206 : e206.getDebugName(this) ?? `Observable Signal From Event`;
  }
  onFirstObserverAdded() {
    this.subscription = this.event(this.handleEvent);
  }
  onLastObserverRemoved() {
    this.subscription.dispose(), this.subscription = void 0;
  }
  get() {
  }
}, sve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, cve = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, EK = class extends D {
  setActiveMovedText(e206) {
    this._activeMovedText.set(e206, void 0);
  }
  constructor(e206, t10, n10) {
    super(), this.model = e206, this._options = t10, this._diffProviderFactoryService = n10, this._isDiffUpToDate = Ic(this, false), this.isDiffUpToDate = this._isDiffUpToDate, this._diff = Ic(this, void 0), this.diff = this._diff, this._unchangedRegions = Ic(this, void 0), this.unchangedRegions = I(this, (e207) => this._options.hideUnchangedRegions.read(e207) ? this._unchangedRegions.read(e207)?.regions ?? [] : (bc((e208) => {
      for (let t11 of this._unchangedRegions.read(void 0)?.regions || []) t11.collapseAll(e208);
    }), [])), this.movedTextToCompare = Ic(this, void 0), this._activeMovedText = Ic(this, void 0), this._hoveredMovedText = Ic(this, void 0), this.activeMovedText = I(this, (e207) => this.movedTextToCompare.read(e207) ?? this._hoveredMovedText.read(e207) ?? this._activeMovedText.read(e207)), this._cancellationTokenSource = new pr(), this._diffProvider = I(this, (e207) => {
      let t11 = this._diffProviderFactoryService.createDiffProvider({ diffAlgorithm: this._options.diffAlgorithm.read(e207) });
      return { diffProvider: t11, onChangeSignal: TK(`onDidChange`, t11.onDidChange) };
    }), this._register(T(() => this._cancellationTokenSource.cancel()));
    let r10 = _D2(`contentChangedSignal`), i10 = this._register(new us(() => r10.trigger(void 0), 200));
    this._register(hc((t11) => {
      let n11 = this._unchangedRegions.read(t11);
      if (!n11 || n11.regions.some((e207) => e207.isDragged.read(t11))) return;
      let r11 = n11.originalDecorationIds.map((t12) => e206.original.getDecorationRange(t12)).map((e207) => e207 ? zm.fromRangeInclusive(e207) : void 0), i11 = n11.modifiedDecorationIds.map((t12) => e206.modified.getDecorationRange(t12)).map((e207) => e207 ? zm.fromRangeInclusive(e207) : void 0), a11 = n11.regions.map((e207, n12) => !r11[n12] || !i11[n12] ? void 0 : new OK(r11[n12].startLineNumber, i11[n12].startLineNumber, r11[n12].length, e207.visibleLineCountTop.read(t11), e207.visibleLineCountBottom.read(t11))).filter(Ke), o10 = [], s10 = false;
      for (let e207 of f(a11, (e208, n12) => e208.getHiddenModifiedRange(t11).endLineNumberExclusive === n12.getHiddenModifiedRange(t11).startLineNumber)) if (e207.length > 1) {
        s10 = true;
        let t12 = e207.reduce((e208, t13) => e208 + t13.lineCount, 0), n12 = new OK(e207[0].originalLineNumber, e207[0].modifiedLineNumber, t12, e207[0].visibleLineCountTop.read(void 0), e207[e207.length - 1].visibleLineCountBottom.read(void 0));
        o10.push(n12);
      } else o10.push(e207[0]);
      if (s10) {
        let t12 = e206.original.deltaDecorations(n11.originalDecorationIds, o10.map((e207) => ({ range: e207.originalUnchangedRange.toInclusiveRange(), options: { description: `unchanged` } }))), r12 = e206.modified.deltaDecorations(n11.modifiedDecorationIds, o10.map((e207) => ({ range: e207.modifiedUnchangedRange.toInclusiveRange(), options: { description: `unchanged` } })));
        bc((e207) => {
          this._unchangedRegions.set({ regions: o10, originalDecorationIds: t12, modifiedDecorationIds: r12 }, e207);
        });
      }
    }));
    let a10 = (t11, n11, r11) => {
      let i11 = OK.fromDiffs(t11.changes, e206.original.getLineCount(), e206.modified.getLineCount(), this._options.hideUnchangedRegionsMinimumLineCount.read(r11), this._options.hideUnchangedRegionsContextLineCount.read(r11)), a11, o10 = this._unchangedRegions.get();
      if (o10) {
        let t12 = o10.originalDecorationIds.map((t13) => e206.original.getDecorationRange(t13)).map((e207) => e207 ? zm.fromRangeInclusive(e207) : void 0), n12 = o10.modifiedDecorationIds.map((t13) => e206.modified.getDecorationRange(t13)).map((e207) => e207 ? zm.fromRangeInclusive(e207) : void 0), i12 = ZG(o10.regions.map((e207, r12) => {
          if (!t12[r12] || !n12[r12]) return;
          let i13 = t12[r12].length;
          return new OK(t12[r12].startLineNumber, n12[r12].startLineNumber, i13, Math.min(e207.visibleLineCountTop.get(), i13), Math.min(e207.visibleLineCountBottom.get(), i13 - e207.visibleLineCountTop.get()));
        }).filter(Ke), (e207, t13) => !t13 || e207.modifiedLineNumber >= t13.modifiedLineNumber + t13.lineCount && e207.originalLineNumber >= t13.originalLineNumber + t13.lineCount).map((e207) => new Zm(e207.getHiddenOriginalRange(r11), e207.getHiddenModifiedRange(r11)));
        i12 = Zm.clip(i12, zm.ofLength(1, e206.original.getLineCount()), zm.ofLength(1, e206.modified.getLineCount())), a11 = Zm.inverse(i12, e206.original.getLineCount(), e206.modified.getLineCount());
      }
      let s10 = [];
      if (a11) for (let e207 of i11) {
        let t12 = a11.filter((t13) => t13.original.intersectsStrict(e207.originalUnchangedRange) && t13.modified.intersectsStrict(e207.modifiedUnchangedRange));
        s10.push(...e207.setVisibleRanges(t12, n11));
      }
      else s10.push(...i11);
      let c10 = e206.original.deltaDecorations(o10?.originalDecorationIds || [], s10.map((e207) => ({ range: e207.originalUnchangedRange.toInclusiveRange(), options: { description: `unchanged` } }))), l10 = e206.modified.deltaDecorations(o10?.modifiedDecorationIds || [], s10.map((e207) => ({ range: e207.modifiedUnchangedRange.toInclusiveRange(), options: { description: `unchanged` } })));
      this._unchangedRegions.set({ regions: s10, originalDecorationIds: c10, modifiedDecorationIds: l10 }, n11);
    };
    this._register(e206.modified.onDidChangeContent((t11) => {
      this._diff.get() && (OT.fromModelContentChanges(t11.changes), this._lastDiff, e206.original, e206.modified), this._isDiffUpToDate.set(false, void 0), i10.schedule();
    })), this._register(e206.original.onDidChangeContent((t11) => {
      this._diff.get() && (OT.fromModelContentChanges(t11.changes), this._lastDiff, e206.original, e206.modified), this._isDiffUpToDate.set(false, void 0), i10.schedule();
    })), this._register(vc(async (t11, n11) => {
      this._options.hideUnchangedRegionsMinimumLineCount.read(t11), this._options.hideUnchangedRegionsContextLineCount.read(t11), i10.cancel(), r10.read(t11);
      let o10 = this._diffProvider.read(t11);
      o10.onChangeSignal.read(t11), this._isDiffUpToDate.set(false, void 0);
      let s10 = [];
      n11.add(e206.original.onDidChangeContent((e207) => {
        let t12 = OT.fromModelContentChanges(e207.changes);
        s10 = XT(s10, t12);
      }));
      let c10 = [];
      n11.add(e206.modified.onDidChangeContent((e207) => {
        let t12 = OT.fromModelContentChanges(e207.changes);
        c10 = XT(c10, t12);
      }));
      let l10 = await o10.diffProvider.computeDiff(e206.original, e206.modified, { ignoreTrimWhitespace: this._options.ignoreTrimWhitespace.read(t11), maxComputationTimeMs: this._options.maxComputationTimeMs.read(t11), computeMoves: this._options.showMoves.read(t11) }, this._cancellationTokenSource.token);
      this._cancellationTokenSource.token.isCancellationRequested || e206.original.isDisposed() || e206.modified.isDisposed() || (l10 = lve(l10, e206.original, e206.modified), l10 = (e206.original, e206.modified, l10), l10 = (e206.original, e206.modified, l10), bc((e207) => {
        a10(l10, e207), this._lastDiff = l10;
        let t12 = dve.fromDiffResult(l10);
        this._diff.set(t12, e207), this._isDiffUpToDate.set(true, e207);
        let n12 = this.movedTextToCompare.read(void 0);
        this.movedTextToCompare.set(n12 ? this._lastDiff.moves.find((e208) => e208.lineRangeMapping.modified.intersect(n12.lineRangeMapping.modified)) : void 0, e207);
      }));
    }));
  }
  ensureModifiedLineIsVisible(e206, t10, n10) {
    if (this.diff.get()?.mappings.length === 0) return;
    let r10 = this._unchangedRegions.get()?.regions || [];
    for (let i10 of r10) if (i10.getHiddenModifiedRange(void 0).contains(e206)) {
      i10.showModifiedLine(e206, t10, n10);
      return;
    }
  }
  ensureOriginalLineIsVisible(e206, t10, n10) {
    if (this.diff.get()?.mappings.length === 0) return;
    let r10 = this._unchangedRegions.get()?.regions || [];
    for (let i10 of r10) if (i10.getHiddenOriginalRange(void 0).contains(e206)) {
      i10.showOriginalLine(e206, t10, n10);
      return;
    }
  }
  async waitForDiff() {
    await wK(this.isDiffUpToDate, (e206) => e206);
  }
  serializeState() {
    return { collapsedRegions: this._unchangedRegions.get()?.regions.map((e206) => ({ range: e206.getHiddenModifiedRange(void 0).serialize() })) };
  }
  restoreSerializedState(e206) {
    let t10 = e206.collapsedRegions?.map((e207) => zm.deserialize(e207.range)), n10 = this._unchangedRegions.get();
    !n10 || !t10 || bc((e207) => {
      for (let r10 of n10.regions) for (let n11 of t10) if (r10.modifiedUnchangedRange.intersect(n11)) {
        r10.setHiddenModifiedRange(n11, e207);
        break;
      }
    });
  }
};
EK = sve([cve(2, xK)], EK);
function lve(e206, t10, n10) {
  return { changes: e206.changes.map((e207) => new eh(e207.original, e207.modified, e207.innerChanges ? e207.innerChanges.map((e208) => uve(e208, t10, n10)) : void 0)), moves: e206.moves, identical: e206.identical, quitEarly: e206.quitEarly };
}
function uve(e206, t10, n10) {
  let r10 = e206.originalRange, i10 = e206.modifiedRange;
  return r10.startColumn === 1 && i10.startColumn === 1 && (r10.endColumn !== 1 || i10.endColumn !== 1) && r10.endColumn === t10.getLineMaxColumn(r10.endLineNumber) && i10.endColumn === n10.getLineMaxColumn(i10.endLineNumber) && r10.endLineNumber < t10.getLineCount() && i10.endLineNumber < n10.getLineCount() && (r10 = r10.setEndPosition(r10.endLineNumber + 1, 1), i10 = i10.setEndPosition(i10.endLineNumber + 1, 1)), new th(r10, i10);
}
var dve = class e158 {
  static fromDiffResult(t10) {
    return new e158(t10.changes.map((e206) => new DK(e206)), t10.moves || [], t10.identical, t10.quitEarly);
  }
  constructor(e206, t10, n10, r10) {
    this.mappings = e206, this.movedTexts = t10, this.identical = n10, this.quitEarly = r10;
  }
}, DK = class {
  constructor(e206) {
    this.lineRangeMapping = e206;
  }
}, OK = class e159 {
  static fromDiffs(t10, n10, r10, i10, a10) {
    let o10 = eh.inverse(t10, n10, r10), s10 = [];
    for (let t11 of o10) {
      let o11 = t11.original.startLineNumber, c10 = t11.modified.startLineNumber, l10 = t11.original.length, u10 = o11 === 1 && c10 === 1, d10 = o11 + l10 === n10 + 1 && c10 + l10 === r10 + 1;
      (u10 || d10) && l10 >= a10 + i10 ? (u10 && !d10 && (l10 -= a10), d10 && !u10 && (o11 += a10, c10 += a10, l10 -= a10), s10.push(new e159(o11, c10, l10, 0, 0))) : l10 >= a10 * 2 + i10 && (o11 += a10, c10 += a10, l10 -= a10 * 2, s10.push(new e159(o11, c10, l10, 0, 0)));
    }
    return s10;
  }
  get originalUnchangedRange() {
    return zm.ofLength(this.originalLineNumber, this.lineCount);
  }
  get modifiedUnchangedRange() {
    return zm.ofLength(this.modifiedLineNumber, this.lineCount);
  }
  constructor(e206, t10, n10, r10, i10) {
    this.originalLineNumber = e206, this.modifiedLineNumber = t10, this.lineCount = n10, this._visibleLineCountTop = Ic(this, 0), this.visibleLineCountTop = this._visibleLineCountTop, this._visibleLineCountBottom = Ic(this, 0), this.visibleLineCountBottom = this._visibleLineCountBottom, this._shouldHideControls = I(this, (e207) => this.visibleLineCountTop.read(e207) + this.visibleLineCountBottom.read(e207) === this.lineCount && !this.isDragged.read(e207)), this.isDragged = Ic(this, void 0);
    let a10 = Math.max(Math.min(r10, this.lineCount), 0), o10 = Math.max(Math.min(i10, this.lineCount - r10), 0);
    Fe(r10 === a10), Fe(i10 === o10), this._visibleLineCountTop.set(a10, void 0), this._visibleLineCountBottom.set(o10, void 0);
  }
  setVisibleRanges(t10, n10) {
    let r10 = [], i10 = new Bm(t10.map((e206) => e206.modified)).subtractFrom(this.modifiedUnchangedRange), a10 = this.originalLineNumber, o10 = this.modifiedLineNumber, s10 = this.modifiedLineNumber + this.lineCount;
    if (i10.ranges.length === 0) this.showAll(n10), r10.push(this);
    else {
      let t11 = 0;
      for (let c10 of i10.ranges) {
        let l10 = t11 === i10.ranges.length - 1;
        t11++;
        let u10 = (l10 ? s10 : c10.endLineNumberExclusive) - o10, d10 = new e159(a10, o10, u10, 0, 0);
        d10.setHiddenModifiedRange(c10, n10), r10.push(d10), a10 = d10.originalUnchangedRange.endLineNumberExclusive, o10 = d10.modifiedUnchangedRange.endLineNumberExclusive;
      }
    }
    return r10;
  }
  shouldHideControls(e206) {
    return this._shouldHideControls.read(e206);
  }
  getHiddenOriginalRange(e206) {
    return zm.ofLength(this.originalLineNumber + this._visibleLineCountTop.read(e206), this.lineCount - this._visibleLineCountTop.read(e206) - this._visibleLineCountBottom.read(e206));
  }
  getHiddenModifiedRange(e206) {
    return zm.ofLength(this.modifiedLineNumber + this._visibleLineCountTop.read(e206), this.lineCount - this._visibleLineCountTop.read(e206) - this._visibleLineCountBottom.read(e206));
  }
  setHiddenModifiedRange(e206, t10) {
    let n10 = e206.startLineNumber - this.modifiedLineNumber, r10 = this.modifiedLineNumber + this.lineCount - e206.endLineNumberExclusive;
    this.setState(n10, r10, t10);
  }
  getMaxVisibleLineCountTop() {
    return this.lineCount - this._visibleLineCountBottom.get();
  }
  getMaxVisibleLineCountBottom() {
    return this.lineCount - this._visibleLineCountTop.get();
  }
  showMoreAbove(e206 = 10, t10) {
    let n10 = this.getMaxVisibleLineCountTop();
    this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get() + e206, n10), t10);
  }
  showMoreBelow(e206 = 10, t10) {
    let n10 = this.lineCount - this._visibleLineCountTop.get();
    this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get() + e206, n10), t10);
  }
  showAll(e206) {
    this._visibleLineCountBottom.set(this.lineCount - this._visibleLineCountTop.get(), e206);
  }
  showModifiedLine(e206, t10, n10) {
    let r10 = e206 + 1 - (this.modifiedLineNumber + this._visibleLineCountTop.get()), i10 = this.modifiedLineNumber - this._visibleLineCountBottom.get() + this.lineCount - e206;
    t10 === 0 && r10 < i10 || t10 === 1 ? this._visibleLineCountTop.set(this._visibleLineCountTop.get() + r10, n10) : this._visibleLineCountBottom.set(this._visibleLineCountBottom.get() + i10, n10);
  }
  showOriginalLine(e206, t10, n10) {
    let r10 = e206 - this.originalLineNumber, i10 = this.originalLineNumber + this.lineCount - e206;
    t10 === 0 && r10 < i10 || t10 === 1 ? this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get() + i10 - r10, this.getMaxVisibleLineCountTop()), n10) : this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get() + r10 - i10, this.getMaxVisibleLineCountBottom()), n10);
  }
  collapseAll(e206) {
    this._visibleLineCountTop.set(0, e206), this._visibleLineCountBottom.set(0, e206);
  }
  setState(e206, t10, n10) {
    e206 = Math.max(Math.min(e206, this.lineCount), 0), t10 = Math.max(Math.min(t10, this.lineCount - e206), 0), this._visibleLineCountTop.set(e206, n10), this._visibleLineCountBottom.set(t10, n10);
  }
};
function fve(e206) {
  let { domNode: t10, renderLinesResult: n10, diffEntry: r10, originalModel: i10, clipboardService: a10 } = e206, o10 = new E();
  return o10.add(L(t10, `copy`, (e207) => {
    e207.preventDefault();
    let o11 = t10.ownerDocument.getSelection();
    if (!o11 || o11.rangeCount === 0) return;
    let s10 = o11.getRangeAt(0);
    if (!s10 || s10.collapsed) return;
    let c10 = s10.startContainer.nodeType === Node.TEXT_NODE ? s10.startContainer.parentElement : s10.startContainer, l10 = s10.endContainer.nodeType === Node.TEXT_NODE ? s10.endContainer.parentElement : s10.endContainer;
    if (!c10 || !l10) return;
    let u10 = n10.getModelPositionAt(c10, s10.startOffset), d10 = n10.getModelPositionAt(l10, s10.endOffset);
    if (!u10 || !d10) return;
    let f10 = u10.delta(r10.original.startLineNumber - 1), p10 = d10.delta(r10.original.startLineNumber - 1), m10 = p10.isBefore(f10) ? M.fromPositions(p10, f10) : M.fromPositions(f10, p10), h10 = i10.getValueInRange(m10);
    a10.writeText(h10);
  })), o10;
}
var pve = class extends D {
  get visibility() {
    return this._visibility;
  }
  set visibility(e206) {
    this._visibility !== e206 && (this._visibility = e206, this._diffActions.style.visibility = e206 ? `visible` : `hidden`);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    super(), this._getViewZoneId = e206, this._marginDomNode = t10, this._deletedCodeDomNode = n10, this._modifiedEditor = r10, this._diff = i10, this._editor = a10, this._renderLinesResult = o10, this._originalTextModel = s10, this._contextMenuService = c10, this._clipboardService = l10, this._visibility = false, this._marginDomNode.style.zIndex = `10`, this._diffActions = document.createElement(`div`), this._diffActions.className = ju.asClassName(F.lightBulb) + ` lightbulb-glyph`, this._diffActions.style.position = `absolute`;
    let u10 = this._modifiedEditor.getOption(75);
    this._diffActions.style.right = `0px`, this._diffActions.style.visibility = `hidden`, this._diffActions.style.height = `${u10}px`, this._diffActions.style.lineHeight = `${u10}px`, this._marginDomNode.appendChild(this._diffActions);
    let d10 = 0, f10 = r10.getOption(144) && !kt, p10 = (e207, t11, n11) => {
      this._contextMenuService.showContextMenu({ domForShadowRoot: f10 ? r10.getDomNode() ?? void 0 : void 0, getAnchor: () => e207, onHide: n11, getActions: () => {
        let e208 = [], t12 = i10.modified.isEmpty;
        return e208.push(new Tu(`diff.clipboard.copyDeletedContent`, t12 ? i10.original.length > 1 ? C(112, `Copy deleted lines`) : C(113, `Copy deleted line`) : i10.original.length > 1 ? C(114, `Copy changed lines`) : C(115, `Copy changed line`), void 0, true, async () => {
          let e209 = this._originalTextModel.getValueInRange(i10.original.toExclusiveRange());
          await this._clipboardService.writeText(e209);
        })), i10.original.length > 1 && e208.push(new Tu(`diff.clipboard.copyDeletedLineContent`, t12 ? C(116, `Copy deleted line ({0})`, i10.original.startLineNumber + d10) : C(117, `Copy changed line ({0})`, i10.original.startLineNumber + d10), void 0, true, async () => {
          let e209 = this._originalTextModel.getLineContent(i10.original.startLineNumber + d10);
          e209 === `` && (e209 = this._originalTextModel.getEndOfLineSequence() === 0 ? `
` : `\r
`), await this._clipboardService.writeText(e209);
        })), r10.getOption(104) || e208.push(new Tu(`diff.inline.revertChange`, C(118, `Revert this change`), void 0, true, async () => {
          this._editor.revert(this._diff);
        })), e208;
      }, autoSelectFirstItem: true });
    };
    this._register(el(this._diffActions, `mousedown`, (e207) => {
      if (!e207.leftButton) return;
      let { top: t11, height: n11 } = _l2(this._diffActions), r11 = Math.floor(u10 / 3);
      e207.preventDefault(), p10({ x: e207.posx, y: t11 + n11 + r11 });
    })), this._register(r10.onMouseMove((e207) => {
      (e207.target.type === 8 || e207.target.type === 5) && e207.target.detail.viewZoneId === this._getViewZoneId() ? (d10 = this._updateLightBulbPosition(this._marginDomNode, e207.event.browserEvent.y, u10), this.visibility = true) : this.visibility = false;
    })), this._register(fve({ domNode: this._deletedCodeDomNode, diffEntry: i10, originalModel: this._originalTextModel, renderLinesResult: this._renderLinesResult, clipboardService: l10 }));
  }
  _updateLightBulbPosition(e206, t10, n10) {
    let { top: r10 } = _l2(e206), i10 = t10 - r10, a10 = Math.floor(i10 / n10), o10 = a10 * n10;
    if (this._diffActions.style.top = `${o10}px`, this._renderLinesResult.viewLineCounts) {
      let e207 = 0;
      for (let t11 = 0; t11 < this._renderLinesResult.viewLineCounts.length; t11++) if (e207 += this._renderLinesResult.viewLineCounts[t11], a10 < e207) return t11;
    }
    return a10;
  }
}, kK = _f2(`diffEditorWidget`, { createHTML: (e206) => e206 });
function AK(e206, t10, n10, r10, i10 = false) {
  vu(r10, t10.fontInfo);
  let a10 = n10.length > 0, o10 = new Ff(1e4), s10 = 0, c10 = 0, l10 = [], u10 = [];
  for (let r11 = 0; r11 < e206.lineTokens.length; r11++) {
    let d11 = r11 + 1, f11 = e206.lineTokens[r11], p10 = e206.lineBreakData[r11], m10 = og.filter(n10, d11, 1, 2 ** 53 - 1);
    if (p10) {
      let n11 = 0;
      for (let r12 of p10.breakOffsets) {
        let l11 = f11.sliceAndInflate(n11, r12, 0), d12 = PK(c10, l11, og.extractWrapped(m10, n11, r12), a10, e206.mightContainNonBasicASCII, e206.mightContainRTL, t10, o10, i10);
        s10 = Math.max(s10, d12.maxCharWidth), u10.push(new NK(d12.output.characterMapping, d12.output.containsForeignElements, n11)), c10++, n11 = r12;
      }
      l10.push(p10.breakOffsets.length);
    } else {
      l10.push(1);
      let n11 = PK(c10, f11, m10, a10, e206.mightContainNonBasicASCII, e206.mightContainRTL, t10, o10, i10);
      s10 = Math.max(s10, n11.maxCharWidth), u10.push(new NK(n11.output.characterMapping, n11.output.containsForeignElements, 0)), c10++;
    }
  }
  s10 += t10.scrollBeyondLastColumn;
  let d10 = o10.build();
  r10.innerHTML = kK ? kK.createHTML(d10) : d10;
  let f10 = s10 * t10.typicalHalfwidthCharacterWidth;
  return new mve(c10, f10, l10, u10, e206);
}
var jK = class {
  constructor(e206, t10 = e206.map((e207) => null), n10 = true, r10 = true) {
    this.lineTokens = e206, this.lineBreakData = t10, this.mightContainNonBasicASCII = n10, this.mightContainRTL = r10;
  }
}, MK = class e160 {
  static fromEditor(t10) {
    let n10 = t10.getOptions(), r10 = n10.get(59), i10 = n10.get(165);
    return new e160(t10.getModel()?.getOptions().tabSize || 0, r10, n10.get(40), r10.typicalHalfwidthCharacterWidth, n10.get(118), n10.get(75), i10.decorationsWidth, n10.get(133), n10.get(113), n10.get(108), n10.get(60), n10.get(117).verticalScrollbarSize);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10 = true) {
    this.tabSize = e206, this.fontInfo = t10, this.disableMonospaceOptimizations = n10, this.typicalHalfwidthCharacterWidth = r10, this.scrollBeyondLastColumn = i10, this.lineHeight = a10, this.lineDecorationsWidth = o10, this.stopRenderingLineAfter = s10, this.renderWhitespace = c10, this.renderControlCharacters = l10, this.fontLigatures = u10, this.verticalScrollbarSize = d10, this.setWidth = f10;
  }
  withSetWidth(t10) {
    return new e160(this.tabSize, this.fontInfo, this.disableMonospaceOptimizations, this.typicalHalfwidthCharacterWidth, this.scrollBeyondLastColumn, this.lineHeight, this.lineDecorationsWidth, this.stopRenderingLineAfter, this.renderWhitespace, this.renderControlCharacters, this.fontLigatures, this.verticalScrollbarSize, t10);
  }
  withScrollBeyondLastColumn(t10) {
    return new e160(this.tabSize, this.fontInfo, this.disableMonospaceOptimizations, this.typicalHalfwidthCharacterWidth, t10, this.lineHeight, this.lineDecorationsWidth, this.stopRenderingLineAfter, this.renderWhitespace, this.renderControlCharacters, this.fontLigatures, this.verticalScrollbarSize, this.setWidth);
  }
}, mve = class {
  constructor(e206, t10, n10, r10, i10) {
    this.heightInLines = e206, this.minWidthInPx = t10, this.viewLineCounts = n10, this._renderOutputs = r10, this._source = i10;
  }
  getModelPositionAt(e206, t10) {
    let n10 = e206;
    for (; n10 && !n10.classList.contains(`view-line`); ) n10 = n10.parentElement;
    if (!n10) return;
    let r10 = n10.parentElement;
    if (!r10) return;
    let i10 = r10.querySelectorAll(`.view-line`), a10 = -1;
    for (let e207 = 0; e207 < i10.length; e207++) if (i10[e207] === n10) {
      a10 = e207;
      break;
    }
    if (a10 === -1 || a10 >= this._renderOutputs.length) return;
    let o10 = 1, s10 = a10;
    for (let e207 = 0; e207 < this.viewLineCounts.length; e207++) {
      if (s10 < this.viewLineCounts[e207]) {
        o10 = e207 + 1;
        break;
      }
      s10 -= this.viewLineCounts[e207];
    }
    if (o10 > this._source.lineTokens.length) return;
    let c10 = this._renderOutputs[a10];
    if (!c10) return;
    let l10 = Hb(c10.characterMapping, e206, t10) + c10.offset;
    return new j(o10, l10);
  }
}, NK = class extends fg {
  constructor(e206, t10, n10) {
    super(e206, t10), this.offset = n10;
  }
};
function PK(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
  s10.appendString(`<div class="view-line`), !c10 && !r10 && s10.appendString(` char-delete`), s10.appendString(`" style="top:`), s10.appendString(String(e206 * o10.lineHeight)), o10.setWidth ? s10.appendString(`px;width:1000000px;">`) : s10.appendString(`px;">`);
  let l10 = t10.getLineContent(), u10 = vg.isBasicASCII(l10, i10), d10 = vg.containsRTL(l10, u10, a10), f10 = pg(new lg(o10.fontInfo.isMonospace && !o10.disableMonospaceOptimizations, o10.fontInfo.canUseHalfwidthRightwardsArrow, l10, false, u10, d10, 0, t10, n10, o10.tabSize, 0, o10.fontInfo.spaceWidth, o10.fontInfo.middotWidth, o10.fontInfo.wsmiddotWidth, o10.stopRenderingLineAfter, o10.renderWhitespace, o10.renderControlCharacters, o10.fontLigatures !== Gn.OFF, null, null, o10.verticalScrollbarSize), s10);
  return s10.appendString(`</div>`), { output: f10, maxCharWidth: f10.characterMapping.getHorizontalOffset(f10.characterMapping.length) };
}
var hve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, FK = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, IK = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    super(), this._targetWindow = e206, this._editors = t10, this._diffModel = n10, this._options = r10, this._diffEditorWidget = i10, this._canIgnoreViewZoneUpdateEvent = a10, this._origViewZonesToIgnore = o10, this._modViewZonesToIgnore = s10, this._clipboardService = c10, this._contextMenuService = l10, this._originalTopPadding = Ic(this, 0), this._originalScrollOffset = Ic(this, 0), this._originalScrollOffsetAnimated = VG(this._targetWindow, this._originalScrollOffset, this._store), this._modifiedTopPadding = Ic(this, 0), this._modifiedScrollOffset = Ic(this, 0), this._modifiedScrollOffsetAnimated = VG(this._targetWindow, this._modifiedScrollOffset, this._store);
    let u10 = Ic(`invalidateAlignmentsState`, 0), d10 = this._register(new us(() => {
      u10.set(u10.get() + 1, void 0);
    }, 0));
    this._register(this._editors.original.onDidChangeViewZones((e207) => {
      this._canIgnoreViewZoneUpdateEvent() || d10.schedule();
    })), this._register(this._editors.modified.onDidChangeViewZones((e207) => {
      this._canIgnoreViewZoneUpdateEvent() || d10.schedule();
    })), this._register(this._editors.original.onDidChangeConfiguration((e207) => {
      (e207.hasChanged(166) || e207.hasChanged(75)) && d10.schedule();
    })), this._register(this._editors.modified.onDidChangeConfiguration((e207) => {
      (e207.hasChanged(166) || e207.hasChanged(75)) && d10.schedule();
    }));
    let f10 = this._diffModel.map((e207) => e207 ? Tc(this, e207.model.original.onDidChangeTokens, () => e207.model.original.tokenization.backgroundTokenizationState === 2) : void 0).map((e207, t11) => e207?.read(t11)), p10 = I((e207) => {
      let t11 = this._diffModel.read(e207), n11 = t11?.diff.read(e207);
      if (!t11 || !n11) return null;
      u10.read(e207);
      let r11 = this._options.renderSideBySide.read(e207);
      return LK(this._editors.original, this._editors.modified, n11.mappings, this._origViewZonesToIgnore, this._modViewZonesToIgnore, r11);
    }), m10 = I((e207) => {
      let t11 = this._diffModel.read(e207)?.movedTextToCompare.read(e207);
      if (!t11) return null;
      u10.read(e207);
      let n11 = t11.changes.map((e208) => new DK(e208));
      return LK(this._editors.original, this._editors.modified, n11, this._origViewZonesToIgnore, this._modViewZonesToIgnore, true);
    });
    function h10() {
      let e207 = document.createElement(`div`);
      return e207.className = `diagonal-fill`, e207;
    }
    let g10 = this._register(new E());
    this.viewZones = I(this, (e207) => {
      g10.clear();
      let t11 = p10.read(e207) || [], n11 = [], r11 = [], a11 = this._modifiedTopPadding.read(e207);
      a11 > 0 && r11.push({ afterLineNumber: 0, domNode: document.createElement(`div`), heightInPx: a11, showInHiddenAreas: true, suppressMouseDown: true });
      let o11 = this._originalTopPadding.read(e207);
      o11 > 0 && n11.push({ afterLineNumber: 0, domNode: document.createElement(`div`), heightInPx: o11, showInHiddenAreas: true, suppressMouseDown: true });
      let s11 = this._options.renderSideBySide.read(e207), c11 = s11 ? void 0 : this._editors.modified._getViewModel()?.createLineBreaksComputer();
      if (c11) {
        let e208 = this._editors.original.getModel();
        for (let i11 of t11) if (i11.diff) for (let t12 = i11.originalRange.startLineNumber; t12 < i11.originalRange.endLineNumberExclusive; t12++) {
          if (t12 > e208.getLineCount()) return { orig: n11, mod: r11 };
          c11?.addRequest(e208.getLineContent(t12), null, null);
        }
      }
      let l11 = c11?.finalize() ?? [], u11 = 0, d11 = this._editors.modified.getOption(75), _11 = this._diffModel.read(e207)?.movedTextToCompare.read(e207), v10 = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? false, y10 = this._editors.original.getModel()?.mightContainRTL() ?? false, b10 = MK.fromEditor(this._editors.modified);
      for (let a12 of t11) if (a12.diff && !s11 && (!this._options.useTrueInlineDiffRendering.read(e207) || !zK(a12.diff))) {
        if (!a12.originalRange.isEmpty) {
          f10.read(e207);
          let t13 = document.createElement(`div`);
          t13.classList.add(`view-lines`, `line-delete`, `line-delete-selectable`, `monaco-mouse-cursor-text`);
          let i11 = this._editors.original.getModel();
          if (a12.originalRange.endLineNumberExclusive - 1 > i11.getLineCount()) return { orig: n11, mod: r11 };
          let o12 = new jK(a12.originalRange.mapToLineArray((e208) => i11.tokenization.getLineTokens(e208)), a12.originalRange.mapToLineArray((e208) => l11[u11++]), v10, y10), s12 = [];
          for (let e208 of a12.diff.innerChanges || []) s12.push(new vk(e208.originalRange.delta(-(a12.diff.original.startLineNumber - 1)), _K2.className, 0));
          let c12 = AK(o12, b10, s12, t13), p11 = document.createElement(`div`);
          if (p11.className = `inline-deleted-margin-view-zone`, vu(p11, b10.fontInfo), this._options.renderIndicators.read(e207)) for (let e208 = 0; e208 < c12.heightInLines; e208++) {
            let t14 = document.createElement(`div`);
            t14.className = `delete-sign ${ju.asClassName(dK)}`, t14.setAttribute(`style`, `position:absolute;top:${e208 * d11}px;width:${b10.lineDecorationsWidth}px;height:${d11}px;right:0;`), p11.appendChild(t14);
          }
          let m11;
          g10.add(new pve(() => Ye(m11), p11, t13, this._editors.modified, a12.diff, this._diffEditorWidget, c12, this._editors.original.getModel(), this._contextMenuService, this._clipboardService));
          for (let e208 = 0; e208 < c12.viewLineCounts.length; e208++) {
            let t14 = c12.viewLineCounts[e208];
            t14 > 1 && n11.push({ afterLineNumber: a12.originalRange.startLineNumber + e208, domNode: h10(), heightInPx: (t14 - 1) * d11, showInHiddenAreas: true, suppressMouseDown: true });
          }
          r11.push({ afterLineNumber: a12.modifiedRange.startLineNumber - 1, domNode: t13, heightInPx: c12.heightInLines * d11, minWidthInPx: c12.minWidthInPx, marginDomNode: p11, setZoneId(e208) {
            m11 = e208;
          }, showInHiddenAreas: true, suppressMouseDown: false });
        }
        let t12 = document.createElement(`div`);
        t12.className = `gutter-delete`, n11.push({ afterLineNumber: a12.originalRange.endLineNumberExclusive - 1, domNode: h10(), heightInPx: a12.modifiedHeightInPx, marginDomNode: t12, showInHiddenAreas: true, suppressMouseDown: true });
      } else {
        let t12 = a12.modifiedHeightInPx - a12.originalHeightInPx;
        if (t12 > 0) {
          if (_11?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a12.originalRange.endLineNumberExclusive - 1)) continue;
          n11.push({ afterLineNumber: a12.originalRange.endLineNumberExclusive - 1, domNode: h10(), heightInPx: t12, showInHiddenAreas: true, suppressMouseDown: true });
        } else {
          let n12 = function() {
            let t13 = document.createElement(`div`);
            return t13.className = `arrow-revert-change ` + ju.asClassName(F.arrowRight), e207.store.add(L(t13, `mousedown`, (e208) => e208.stopPropagation())), e207.store.add(L(t13, `click`, (e208) => {
              e208.stopPropagation(), i10.revert(a12.diff);
            })), B(`div`, {}, t13);
          };
          if (_11?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a12.modifiedRange.endLineNumberExclusive - 1)) continue;
          let o12;
          a12.diff && a12.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(e207) && (o12 = n12()), r11.push({ afterLineNumber: a12.modifiedRange.endLineNumberExclusive - 1, domNode: h10(), heightInPx: -t12, marginDomNode: o12, showInHiddenAreas: true, suppressMouseDown: true });
        }
      }
      for (let t12 of m10.read(e207) ?? []) {
        if (!_11?.lineRangeMapping.original.intersect(t12.originalRange) || !_11?.lineRangeMapping.modified.intersect(t12.modifiedRange)) continue;
        let e208 = t12.modifiedHeightInPx - t12.originalHeightInPx;
        e208 > 0 ? n11.push({ afterLineNumber: t12.originalRange.endLineNumberExclusive - 1, domNode: h10(), heightInPx: e208, showInHiddenAreas: true, suppressMouseDown: true }) : r11.push({ afterLineNumber: t12.modifiedRange.endLineNumberExclusive - 1, domNode: h10(), heightInPx: -e208, showInHiddenAreas: true, suppressMouseDown: true });
      }
      return { orig: n11, mod: r11 };
    });
    let _10 = false;
    this._register(this._editors.original.onDidScrollChange((e207) => {
      e207.scrollLeftChanged && !_10 && (_10 = true, this._editors.modified.setScrollLeft(e207.scrollLeft), _10 = false);
    })), this._register(this._editors.modified.onDidScrollChange((e207) => {
      e207.scrollLeftChanged && !_10 && (_10 = true, this._editors.original.setScrollLeft(e207.scrollLeft), _10 = false);
    })), this._originalScrollTop = Tc(this._editors.original.onDidScrollChange, () => this._editors.original.getScrollTop()), this._modifiedScrollTop = Tc(this._editors.modified.onDidScrollChange, () => this._editors.modified.getScrollTop()), this._register(hc((e207) => {
      let t11 = this._originalScrollTop.read(e207) - (this._originalScrollOffsetAnimated.read(void 0) - this._modifiedScrollOffsetAnimated.read(e207)) - (this._originalTopPadding.read(void 0) - this._modifiedTopPadding.read(e207));
      t11 !== this._editors.modified.getScrollTop() && this._editors.modified.setScrollTop(t11, 1);
    })), this._register(hc((e207) => {
      let t11 = this._modifiedScrollTop.read(e207) - (this._modifiedScrollOffsetAnimated.read(void 0) - this._originalScrollOffsetAnimated.read(e207)) - (this._modifiedTopPadding.read(void 0) - this._originalTopPadding.read(e207));
      t11 !== this._editors.original.getScrollTop() && this._editors.original.setScrollTop(t11, 1);
    })), this._register(hc((e207) => {
      let t11 = this._diffModel.read(e207)?.movedTextToCompare.read(e207), n11 = 0;
      if (t11) {
        let e208 = this._editors.original.getTopForLineNumber(t11.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.read(void 0);
        n11 = this._editors.modified.getTopForLineNumber(t11.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.read(void 0) - e208;
      }
      n11 > 0 ? (this._modifiedTopPadding.set(0, void 0), this._originalTopPadding.set(n11, void 0)) : n11 < 0 ? (this._modifiedTopPadding.set(-n11, void 0), this._originalTopPadding.set(0, void 0)) : setTimeout(() => {
        this._modifiedTopPadding.set(0, void 0), this._originalTopPadding.set(0, void 0);
      }, 400), this._editors.modified.hasTextFocus() ? this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0) - n11, void 0, true) : this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0) + n11, void 0, true);
    }));
  }
};
IK = hve([FK(8, hW), FK(9, mj)], IK);
function LK(e206, t10, n10, r10, i10, a10) {
  let o10 = new me(RK(e206, r10)), s10 = new me(RK(t10, i10)), c10 = e206.getOption(75), l10 = t10.getOption(75), u10 = [], d10 = 0, f10 = 0;
  function p10(e207, t11) {
    for (; ; ) {
      let n11 = o10.peek(), r11 = s10.peek();
      if (n11 && n11.lineNumber >= e207 && (n11 = void 0), r11 && r11.lineNumber >= t11 && (r11 = void 0), !n11 && !r11) break;
      let i11 = n11 ? n11.lineNumber - d10 : Number.MAX_VALUE, a11 = r11 ? r11.lineNumber - f10 : Number.MAX_VALUE;
      i11 < a11 ? (o10.dequeue(), r11 = { lineNumber: n11.lineNumber - d10 + f10, heightInPx: 0 }) : i11 > a11 ? (s10.dequeue(), n11 = { lineNumber: r11.lineNumber - f10 + d10, heightInPx: 0 }) : (o10.dequeue(), s10.dequeue()), u10.push({ originalRange: zm.ofLength(n11.lineNumber, 1), modifiedRange: zm.ofLength(r11.lineNumber, 1), originalHeightInPx: c10 + n11.heightInPx, modifiedHeightInPx: l10 + r11.heightInPx, diff: void 0 });
    }
  }
  for (let t11 of n10) {
    let h10 = function(e207, n12, a11 = false) {
      if (e207 < m10 || n12 < i11) return;
      if (r11) r11 = false;
      else if (!a11 && (e207 === m10 || n12 === i11)) return;
      let d11 = new zm(m10, e207), f11 = new zm(i11, n12);
      if (d11.isEmpty && f11.isEmpty) return;
      let p11 = o10.takeWhile((t12) => t12.lineNumber < e207)?.reduce((e208, t12) => e208 + t12.heightInPx, 0) ?? 0, h11 = s10.takeWhile((e208) => e208.lineNumber < n12)?.reduce((e208, t12) => e208 + t12.heightInPx, 0) ?? 0;
      u10.push({ originalRange: d11, modifiedRange: f11, originalHeightInPx: d11.length * c10 + p11, modifiedHeightInPx: f11.length * l10 + h11, diff: t11.lineRangeMapping }), m10 = e207, i11 = n12;
    };
    let n11 = t11.lineRangeMapping;
    p10(n11.original.startLineNumber, n11.modified.startLineNumber);
    let r11 = true, i11 = n11.modified.startLineNumber, m10 = n11.original.startLineNumber;
    if (a10) for (let t12 of n11.innerChanges || []) {
      t12.originalRange.startColumn > 1 && t12.modifiedRange.startColumn > 1 && h10(t12.originalRange.startLineNumber, t12.modifiedRange.startLineNumber);
      let n12 = e206.getModel(), r12 = t12.originalRange.endLineNumber <= n12.getLineCount() ? n12.getLineMaxColumn(t12.originalRange.endLineNumber) : 2 ** 53 - 1;
      t12.originalRange.endColumn < r12 && h10(t12.originalRange.endLineNumber, t12.modifiedRange.endLineNumber);
    }
    h10(n11.original.endLineNumberExclusive, n11.modified.endLineNumberExclusive, true), d10 = n11.original.endLineNumberExclusive, f10 = n11.modified.endLineNumberExclusive;
  }
  return p10(Number.MAX_VALUE, Number.MAX_VALUE), u10;
}
function RK(e206, t10) {
  let n10 = [], r10 = [], i10 = e206.getOption(166).wrappingColumn !== -1, a10 = e206._getViewModel().coordinatesConverter, o10 = e206.getOption(75);
  if (i10) for (let t11 = 1; t11 <= e206.getModel().getLineCount(); t11++) {
    let e207 = a10.getModelLineViewLineCount(t11);
    e207 > 1 && r10.push({ lineNumber: t11, heightInPx: o10 * (e207 - 1) });
  }
  for (let r11 of e206.getWhitespaces()) {
    if (t10.has(r11.id)) continue;
    let e207 = r11.afterLineNumber === 0 ? 0 : a10.convertViewPositionToModelPosition(new j(r11.afterLineNumber, 1)).lineNumber;
    n10.push({ lineNumber: e207, heightInPx: r11.height });
  }
  return IG(n10, r10, (e207) => e207.lineNumber, (e207, t11) => ({ lineNumber: e207.lineNumber, heightInPx: e207.heightInPx + t11.heightInPx }));
}
function zK(e206) {
  return e206.innerChanges ? e206.innerChanges.every((e207) => BK(e207.modifiedRange) && BK(e207.originalRange) || e207.originalRange.equalsRange(new M(1, 1, 1, 1))) : false;
}
function BK(e206) {
  return e206.startLineNumber === e206.endLineNumber;
}
var VK = (_wb = class extends D {
  constructor(t10, n10, r10, i10, a10) {
    super(), this._rootElement = t10, this._diffModel = n10, this._originalEditorLayoutInfo = r10, this._modifiedEditorLayoutInfo = i10, this._editors = a10, this._originalScrollTop = Tc(this, this._editors.original.onDidScrollChange, () => this._editors.original.getScrollTop()), this._modifiedScrollTop = Tc(this, this._editors.modified.onDidScrollChange, () => this._editors.modified.getScrollTop()), this._viewZonesChanged = TK(`onDidChangeViewZones`, this._editors.modified.onDidChangeViewZones), this.width = Ic(this, 0), this._modifiedViewZonesChangedSignal = TK(`modified.onDidChangeViewZones`, this._editors.modified.onDidChangeViewZones), this._originalViewZonesChangedSignal = TK(`original.onDidChangeViewZones`, this._editors.original.onDidChangeViewZones), this._state = I(this, (t11) => {
      this._element.replaceChildren();
      let n11 = this._diffModel.read(t11), r11 = n11?.diff.read(t11)?.movedTexts;
      if (!r11 || r11.length === 0) {
        this.width.set(0, void 0);
        return;
      }
      this._viewZonesChanged.read(t11);
      let i11 = this._originalEditorLayoutInfo.read(t11), a11 = this._modifiedEditorLayoutInfo.read(t11);
      if (!i11 || !a11) {
        this.width.set(0, void 0);
        return;
      }
      this._modifiedViewZonesChangedSignal.read(t11), this._originalViewZonesChangedSignal.read(t11);
      let o11 = r11.map((e206) => {
        function n12(e207, t12) {
          return (t12.getTopForLineNumber(e207.startLineNumber, true) + t12.getTopForLineNumber(e207.endLineNumberExclusive, true)) / 2;
        }
        let r12 = n12(e206.lineRangeMapping.original, this._editors.original), i12 = this._originalScrollTop.read(t11), a12 = n12(e206.lineRangeMapping.modified, this._editors.modified), o12 = this._modifiedScrollTop.read(t11), s12 = r12 - i12, c12 = a12 - o12;
        return { range: new Tm(Math.min(r12, a12), Math.max(r12, a12)), from: s12, to: c12, fromWithoutScroll: r12, toWithoutScroll: a12, move: e206 };
      });
      o11.sort(le(ce((e206) => e206.fromWithoutScroll > e206.toWithoutScroll, de), ce((e206) => e206.fromWithoutScroll > e206.toWithoutScroll ? e206.fromWithoutScroll : -e206.toWithoutScroll, ue)));
      let s11 = gve.compute(o11.map((e206) => e206.range)), c11 = i11.verticalScrollbarWidth, l11 = (s11.getTrackCount() - 1) * 10 + 20, u10 = c11 + l11 + (a11.contentLeft - _wb.movedCodeBlockPadding), d10 = 0;
      for (let e206 of o11) {
        let r12 = s11.getTrack(d10), i12 = c11 + 10 + r12 * 10, o12 = u10, l12 = a11.glyphMarginWidth + a11.lineNumbersWidth, f10 = document.createElementNS(`http://www.w3.org/2000/svg`, `rect`);
        f10.classList.add(`arrow-rectangle`), f10.setAttribute(`x`, `${o12 - l12}`), f10.setAttribute(`y`, `${e206.to - 18 / 2}`), f10.setAttribute(`width`, `${l12}`), f10.setAttribute(`height`, `18`), this._element.appendChild(f10);
        let p10 = document.createElementNS(`http://www.w3.org/2000/svg`, `g`), m10 = document.createElementNS(`http://www.w3.org/2000/svg`, `path`);
        m10.setAttribute(`d`, `M 0 ${e206.from} L ${i12} ${e206.from} L ${i12} ${e206.to} L ${o12 - 15} ${e206.to}`), m10.setAttribute(`fill`, `none`), p10.appendChild(m10);
        let h10 = document.createElementNS(`http://www.w3.org/2000/svg`, `polygon`);
        h10.classList.add(`arrow`), t11.store.add(hc((t12) => {
          m10.classList.toggle(`currentMove`, e206.move === n11.activeMovedText.read(t12)), h10.classList.toggle(`currentMove`, e206.move === n11.activeMovedText.read(t12));
        })), h10.setAttribute(`points`, `${o12 - 15},${e206.to - 15 / 2} ${o12},${e206.to} ${o12 - 15},${e206.to + 15 / 2}`), p10.appendChild(h10), this._element.appendChild(p10), d10++;
      }
      this.width.set(l11, void 0);
    }), this._element = document.createElementNS(`http://www.w3.org/2000/svg`, `svg`), this._element.setAttribute(`class`, `moved-blocks-lines`), this._rootElement.appendChild(this._element), this._register(T(() => this._element.remove())), this._register(hc((t11) => {
      let n11 = this._originalEditorLayoutInfo.read(t11), r11 = this._modifiedEditorLayoutInfo.read(t11);
      !n11 || !r11 || (this._element.style.left = `${n11.width - n11.verticalScrollbarWidth}px`, this._element.style.height = `${n11.height}px`, this._element.style.width = `${n11.verticalScrollbarWidth + n11.contentLeft - _wb.movedCodeBlockPadding + this.width.read(t11)}px`);
    })), this._register(kc(this._state));
    let o10 = I((e206) => {
      let t11 = this._diffModel.read(e206)?.diff.read(e206);
      return t11 ? t11.movedTexts.map((e207) => ({ move: e207, original: new WG(FI(e207.lineRangeMapping.original.startLineNumber - 1), 18), modified: new WG(FI(e207.lineRangeMapping.modified.startLineNumber - 1), 18) })) : [];
    });
    this._register(qG(this._editors.original, o10.map((e206) => e206.map((e207) => e207.original)))), this._register(qG(this._editors.modified, o10.map((e206) => e206.map((e207) => e207.modified)))), this._register(vc((e206, t11) => {
      let n11 = o10.read(e206);
      for (let e207 of n11) t11.add(new HK(this._editors.original, e207.original, e207.move, `original`, this._diffModel.get())), t11.add(new HK(this._editors.modified, e207.modified, e207.move, `modified`, this._diffModel.get()));
    }));
    let s10 = TK(`original.onDidFocusEditorWidget`, (e206) => this._editors.original.onDidFocusEditorWidget(() => setTimeout(() => e206(void 0), 0))), c10 = TK(`modified.onDidFocusEditorWidget`, (e206) => this._editors.modified.onDidFocusEditorWidget(() => setTimeout(() => e206(void 0), 0))), l10 = `modified`;
    this._register(_c({ changeTracker: { createChangeSummary: () => void 0, handleChange: (e206, t11) => (e206.didChange(s10) && (l10 = `original`), e206.didChange(c10) && (l10 = `modified`), true) } }, (e206) => {
      s10.read(e206), c10.read(e206);
      let t11 = this._diffModel.read(e206);
      if (!t11) return;
      let n11 = t11.diff.read(e206), r11;
      if (n11 && l10 === `original`) {
        let t12 = this._editors.originalCursor.read(e206);
        t12 && (r11 = n11.movedTexts.find((e207) => e207.lineRangeMapping.original.contains(t12.lineNumber)));
      }
      if (n11 && l10 === `modified`) {
        let t12 = this._editors.modifiedCursor.read(e206);
        t12 && (r11 = n11.movedTexts.find((e207) => e207.lineRangeMapping.modified.contains(t12.lineNumber)));
      }
      r11 !== t11.movedTextToCompare.read(void 0) && t11.movedTextToCompare.set(void 0, void 0), t11.setActiveMovedText(r11);
    }));
  }
}, _wb.movedCodeBlockPadding = 4, _wb), gve = class e161 {
  static compute(t10) {
    let n10 = [], r10 = [];
    for (let e206 of t10) {
      let t11 = n10.findIndex((t12) => !t12.intersectsStrict(e206));
      t11 === -1 && (n10.length >= 6 ? t11 = Lm(n10, ce((t12) => t12.intersectWithRangeLength(e206), ue)) : (t11 = n10.length, n10.push(new Em()))), n10[t11].addRange(e206), r10.push(t11);
    }
    return new e161(n10.length, r10);
  }
  constructor(e206, t10) {
    this._trackCount = e206, this.trackPerLineIdx = t10;
  }
  getTrack(e206) {
    return this.trackPerLineIdx[e206];
  }
  getTrackCount() {
    return this._trackCount;
  }
}, HK = class extends UG {
  constructor(e206, t10, n10, r10, i10) {
    let a10 = nu(`div.diff-hidden-lines-widget`);
    super(e206, t10, a10.root), this._editor = e206, this._move = n10, this._kind = r10, this._diffModel = i10, this._nodes = nu(`div.diff-moved-code-block`, { style: { marginRight: `4px` } }, [nu(`div.text-content@textContent`), nu(`div.action-bar@actionBar`)]), a10.root.appendChild(this._nodes.root);
    let o10 = Tc(this._editor.onDidLayoutChange, () => this._editor.getLayoutInfo());
    this._register(KG(this._nodes.root, { paddingRight: o10.map((e207) => e207.verticalScrollbarWidth) }));
    let s10;
    s10 = n10.changes.length > 0 ? this._kind === `original` ? C(131, `Code moved with changes to line {0}-{1}`, this._move.lineRangeMapping.modified.startLineNumber, this._move.lineRangeMapping.modified.endLineNumberExclusive - 1) : C(132, `Code moved with changes from line {0}-{1}`, this._move.lineRangeMapping.original.startLineNumber, this._move.lineRangeMapping.original.endLineNumberExclusive - 1) : this._kind === `original` ? C(133, `Code moved to line {0}-{1}`, this._move.lineRangeMapping.modified.startLineNumber, this._move.lineRangeMapping.modified.endLineNumberExclusive - 1) : C(134, `Code moved from line {0}-{1}`, this._move.lineRangeMapping.original.startLineNumber, this._move.lineRangeMapping.original.endLineNumberExclusive - 1);
    let c10 = this._register(new CL(this._nodes.actionBar, { highlightToggledItems: true })), l10 = new Tu(``, s10, ``, false);
    c10.push(l10, { icon: false, label: true });
    let u10 = new Tu(``, `Compare`, ju.asClassName(F.compareChanges), true, () => {
      this._editor.focus(), this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get() === n10 ? void 0 : this._move, void 0);
    });
    this._register(hc((e207) => {
      u10.checked = this._diffModel.movedTextToCompare.read(e207) === n10;
    })), c10.push(u10, { icon: false, label: true });
  }
}, _ve = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editors = e206, this._diffModel = t10, this._options = n10, this._decorations = I(this, (e207) => {
      let t11 = this._diffModel.read(e207), n11 = t11?.diff.read(e207);
      if (!n11) return null;
      let r11 = this._diffModel.read(e207).movedTextToCompare.read(e207), i10 = this._options.renderIndicators.read(e207), a10 = this._options.showEmptyDecorations.read(e207), o10 = [], s10 = [];
      if (!r11) for (let r12 of n11.mappings) if (r12.lineRangeMapping.original.isEmpty || o10.push({ range: r12.lineRangeMapping.original.toInclusiveRange(), options: i10 ? pK : hK }), r12.lineRangeMapping.modified.isEmpty || s10.push({ range: r12.lineRangeMapping.modified.toInclusiveRange(), options: i10 ? fK : mK }), r12.lineRangeMapping.modified.isEmpty || r12.lineRangeMapping.original.isEmpty) r12.lineRangeMapping.original.isEmpty || o10.push({ range: r12.lineRangeMapping.original.toInclusiveRange(), options: ive }), r12.lineRangeMapping.modified.isEmpty || s10.push({ range: r12.lineRangeMapping.modified.toInclusiveRange(), options: nve });
      else {
        let n12 = this._options.useTrueInlineDiffRendering.read(e207) && zK(r12.lineRangeMapping);
        for (let e208 of r12.lineRangeMapping.innerChanges || []) if (r12.lineRangeMapping.original.contains(e208.originalRange.startLineNumber) && o10.push({ range: e208.originalRange, options: e208.originalRange.isEmpty() && a10 ? ave : _K2 }), r12.lineRangeMapping.modified.contains(e208.modifiedRange.startLineNumber) && s10.push({ range: e208.modifiedRange, options: e208.modifiedRange.isEmpty() && a10 && !n12 ? rve : gK }), n12) {
          let n13 = t11.model.original.getValueInRange(e208.originalRange);
          s10.push({ range: e208.modifiedRange, options: { description: `deleted-text`, before: { content: n13, inlineClassName: `inline-deleted-text` }, zIndex: 1e5, showIfCollapsed: true } });
        }
      }
      if (r11) for (let e208 of r11.changes) {
        let t12 = e208.original.toInclusiveRange();
        t12 && o10.push({ range: t12, options: i10 ? pK : hK });
        let n12 = e208.modified.toInclusiveRange();
        n12 && s10.push({ range: n12, options: i10 ? fK : mK });
        for (let t13 of e208.innerChanges || []) o10.push({ range: t13.originalRange, options: _K2 }), s10.push({ range: t13.modifiedRange, options: gK });
      }
      let c10 = this._diffModel.read(e207).activeMovedText.read(e207);
      for (let e208 of n11.movedTexts) o10.push({ range: e208.lineRangeMapping.original.toInclusiveRange(), options: { description: `moved`, blockClassName: `movedOriginal` + (e208 === c10 ? ` currentMove` : ``), blockPadding: [VK.movedCodeBlockPadding, 0, VK.movedCodeBlockPadding, VK.movedCodeBlockPadding] } }), s10.push({ range: e208.lineRangeMapping.modified.toInclusiveRange(), options: { description: `moved`, blockClassName: `movedModified` + (e208 === c10 ? ` currentMove` : ``), blockPadding: [4, 0, 4, 4] } });
      return { originalDecorations: o10, modifiedDecorations: s10 };
    }), this._register(LG(this._editors.original, this._decorations.map((e207) => e207?.originalDecorations || []))), this._register(LG(this._editors.modified, this._decorations.map((e207) => e207?.modifiedDecorations || [])));
  }
}, UK = class e162 {
  static equals(e206, t10) {
    return e206.x === t10.x && e206.y === t10.y;
  }
  constructor(e206, t10) {
    this.x = e206, this.y = t10;
  }
  add(t10) {
    return new e162(this.x + t10.x, this.y + t10.y);
  }
  deltaX(t10) {
    return new e162(this.x + t10, this.y);
  }
  deltaY(t10) {
    return new e162(this.x, this.y + t10);
  }
  toString() {
    return `(${this.x},${this.y})`;
  }
  subtract(t10) {
    return new e162(this.x - t10.x, this.y - t10.y);
  }
  scale(t10) {
    return new e162(this.x * t10, this.y * t10);
  }
  mapComponents(t10) {
    return new e162(t10(this.x), t10(this.y));
  }
  isZero() {
    return this.x === 0 && this.y === 0;
  }
  withThreshold(e206) {
    return this.mapComponents((t10) => t10 > e206 ? t10 - e206 : t10 < -e206 ? t10 + e206 : 0);
  }
};
function WK(e206) {
  return vve.get(e206);
}
var vve = (_xb = class extends D {
  static get(t10) {
    let n10 = _xb._map.get(t10);
    if (!n10) {
      n10 = new _xb(t10), _xb._map.set(t10, n10);
      let r10 = t10.onDidDispose(() => {
        let n11 = _xb._map.get(t10);
        n11 && (_xb._map.delete(t10), n11.dispose(), r10.dispose());
      });
    }
    return n10;
  }
  _beginUpdate() {
    this._updateCounter++, this._updateCounter === 1 && (this._currentTransaction = new wc(() => {
    }));
  }
  _endUpdate() {
    if (this._updateCounter--, this._updateCounter === 0) {
      let e206 = this._currentTransaction;
      this._currentTransaction = void 0, e206.finish();
    }
  }
  constructor(e206) {
    super(), this.editor = e206, this._updateCounter = 0, this._currentTransaction = void 0, this._model = Ic(this, this.editor.getModel()), this.model = this._model, this.isReadonly = Tc(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(104)), this._versionId = yD({ owner: this, lazy: true }, this.editor.getModel()?.getVersionId() ?? null), this.versionId = this._versionId, this._selections = yD({ owner: this, equalsFn: Ys(qs(N.selectionsEqual)), lazy: true }, this.editor.getSelections() ?? null), this.selections = this._selections, this.positions = dc({ owner: this, equalsFn: Ys(qs(j.equals)) }, (e207) => this.selections.read(e207)?.map((e208) => e208.getStartPosition()) ?? null), this.isFocused = Tc(this, (e207) => {
      let t10 = this.editor.onDidFocusEditorWidget(e207), n10 = this.editor.onDidBlurEditorWidget(e207);
      return { dispose() {
        t10.dispose(), n10.dispose();
      } };
    }, () => this.editor.hasWidgetFocus()), this.isTextFocused = Tc(this, (e207) => {
      let t10 = this.editor.onDidFocusEditorText(e207), n10 = this.editor.onDidBlurEditorText(e207);
      return { dispose() {
        t10.dispose(), n10.dispose();
      } };
    }, () => this.editor.hasTextFocus()), this.inComposition = Tc(this, (e207) => {
      let t10 = this.editor.onDidCompositionStart(() => {
        e207(void 0);
      }), n10 = this.editor.onDidCompositionEnd(() => {
        e207(void 0);
      });
      return { dispose() {
        t10.dispose(), n10.dispose();
      } };
    }, () => this.editor.inComposition), this.value = uc(this, (e207) => (this.versionId.read(e207), this.model.read(e207)?.getValue() ?? ``), (e207, t10) => {
      let n10 = this.model.get();
      n10 !== null && e207 !== n10.getValue() && n10.setValue(e207);
    }), this.valueIsEmpty = I(this, (e207) => (this.versionId.read(e207), this.editor.getModel()?.getValueLength() === 0)), this.cursorSelection = dc({ owner: this, equalsFn: Ys(N.selectionsEqual) }, (e207) => this.selections.read(e207)?.[0] ?? null), this.cursorPosition = dc({ owner: this, equalsFn: j.equals }, (e207) => this.selections.read(e207)?.[0]?.getPosition() ?? null), this.cursorLineNumber = I(this, (e207) => this.cursorPosition.read(e207)?.lineNumber ?? null), this.onDidType = _D2(this), this.onDidPaste = _D2(this), this.scrollTop = Tc(this.editor.onDidScrollChange, () => this.editor.getScrollTop()), this.scrollLeft = Tc(this.editor.onDidScrollChange, () => this.editor.getScrollLeft()), this.layoutInfo = Tc(this.editor.onDidLayoutChange, () => this.editor.getLayoutInfo()), this.layoutInfoContentLeft = this.layoutInfo.map((e207) => e207.contentLeft), this.layoutInfoDecorationsLeft = this.layoutInfo.map((e207) => e207.decorationsLeft), this.layoutInfoWidth = this.layoutInfo.map((e207) => e207.width), this.layoutInfoHeight = this.layoutInfo.map((e207) => e207.height), this.layoutInfoMinimap = this.layoutInfo.map((e207) => e207.minimap), this.layoutInfoVerticalScrollbarWidth = this.layoutInfo.map((e207) => e207.verticalScrollbarWidth), this.contentWidth = Tc(this.editor.onDidContentSizeChange, () => this.editor.getContentWidth()), this.contentHeight = Tc(this.editor.onDidContentSizeChange, () => this.editor.getContentHeight()), this._widgetCounter = 0, this.openedPeekWidgets = Ic(this, 0), this._register(this.editor.onBeginUpdate(() => this._beginUpdate())), this._register(this.editor.onEndUpdate(() => this._endUpdate())), this._register(this.editor.onDidChangeModel(() => {
      this._beginUpdate();
      try {
        this._model.set(this.editor.getModel(), this._currentTransaction), this._forceUpdate();
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidType((e207) => {
      this._beginUpdate();
      try {
        this._forceUpdate(), this.onDidType.trigger(this._currentTransaction, e207);
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidPaste((e207) => {
      this._beginUpdate();
      try {
        this._forceUpdate(), this.onDidPaste.trigger(this._currentTransaction, e207);
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidChangeModelContent((e207) => {
      this._beginUpdate();
      try {
        this._versionId.set(this.editor.getModel()?.getVersionId() ?? null, this._currentTransaction, e207), this._forceUpdate();
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidChangeCursorSelection((e207) => {
      this._beginUpdate();
      try {
        this._selections.set(this.editor.getSelections(), this._currentTransaction, e207), this._forceUpdate();
      } finally {
        this._endUpdate();
      }
    })), this.domNode = I((e207) => (this.model.read(e207), this.editor.getDomNode()));
  }
  forceUpdate(e206) {
    this._beginUpdate();
    try {
      return this._forceUpdate(), e206 ? e206(this._currentTransaction) : void 0;
    } finally {
      this._endUpdate();
    }
  }
  _forceUpdate() {
    this._beginUpdate();
    try {
      this._model.set(this.editor.getModel(), this._currentTransaction), this._versionId.set(this.editor.getModel()?.getVersionId() ?? null, this._currentTransaction, void 0), this._selections.set(this.editor.getSelections(), this._currentTransaction, void 0);
    } finally {
      this._endUpdate();
    }
  }
  getOption(e206, t10 = Gs.ofCaller()) {
    return Tc(this, (t11) => this.editor.onDidChangeConfiguration((n10) => {
      n10.hasChanged(e206) && t11(void 0);
    }), () => this.editor.getOption(e206), t10);
  }
  setDecorations(e206) {
    let t10 = new E(), n10 = this.editor.createDecorationsCollection();
    return t10.add(gc({ owner: this, debugName: () => `Apply decorations from ${e206.debugName}` }, (t11) => {
      let r10 = e206.read(t11);
      n10.set(r10);
    })), t10.add({ dispose: () => {
      n10.clear();
    } }), t10;
  }
  createOverlayWidget(e206) {
    let t10 = `observableOverlayWidget` + this._widgetCounter++, n10 = { getDomNode: () => e206.domNode, getPosition: () => e206.position.get(), getId: () => t10, allowEditorOverflow: e206.allowEditorOverflow, getMinContentWidthInPx: () => e206.minContentWidthInPx.get() };
    this.editor.addOverlayWidget(n10);
    let r10 = hc((t11) => {
      e206.position.read(t11), e206.minContentWidthInPx.read(t11), this.editor.layoutOverlayWidget(n10);
    });
    return T(() => {
      r10.dispose(), this.editor.removeOverlayWidget(n10);
    });
  }
  createContentWidget(e206) {
    let t10 = `observableContentWidget` + this._widgetCounter++, n10 = { getDomNode: () => e206.domNode, getPosition: () => e206.position.get(), getId: () => t10, allowEditorOverflow: e206.allowEditorOverflow };
    this.editor.addContentWidget(n10);
    let r10 = hc((t11) => {
      e206.position.read(t11), this.editor.layoutContentWidget(n10);
    });
    return T(() => {
      r10.dispose(), this.editor.removeContentWidget(n10);
    });
  }
  observeLineOffsetRange(e206, t10) {
    let n10 = this.observePosition(e206.map((e207) => new j(e207.startLineNumber, 1)), t10), r10 = this.observePosition(e206.map((e207) => new j(e207.endLineNumberExclusive + 1, 1)), t10);
    return I((t11) => {
      n10.read(t11), r10.read(t11);
      let i10 = e206.read(t11), a10 = this.model.read(t11)?.getLineCount(), o10 = (a10 !== void 0 && i10.startLineNumber > a10 ? this.editor.getBottomForLineNumber(a10) : this.editor.getTopForLineNumber(i10.startLineNumber)) - this.scrollTop.read(t11);
      return new Tm(o10, i10.isEmpty ? o10 : this.editor.getBottomForLineNumber(i10.endLineNumberExclusive - 1) - this.scrollTop.read(t11));
    });
  }
  observePosition(e206, t10) {
    let n10 = e206.get(), r10 = yD({ owner: this, debugName: () => `topLeftOfPosition${n10?.toString()}`, equalsFn: Ys(UK.equals) }, new UK(0, 0)), i10 = `observablePositionWidget` + this._widgetCounter++, a10 = document.createElement(`div`), o10 = { getDomNode: () => a10, getPosition: () => n10 ? { preference: [0], position: e206.get() } : null, getId: () => i10, allowEditorOverflow: false, afterRender: (e207, t11) => {
      let i11 = this._model.get();
      i11 && n10 && n10.lineNumber > i11.getLineCount() ? r10.set(new UK(0, this.editor.getBottomForLineNumber(i11.getLineCount()) - this.scrollTop.get()), void 0) : r10.set(t11 ? new UK(t11.left, t11.top) : null, void 0);
    } };
    return this.editor.addContentWidget(o10), t10.add(hc((t11) => {
      n10 = e206.read(t11), this.editor.layoutContentWidget(o10);
    })), t10.add(T(() => {
      this.editor.removeContentWidget(o10);
    })), r10;
  }
  isTargetHovered(e206, t10) {
    let n10 = Ic(`isInjectedTextHovered`, false);
    return t10.add(this.editor.onMouseMove((t11) => {
      let r10 = e206(t11);
      n10.set(r10, void 0);
    })), t10.add(this.editor.onMouseLeave((e207) => {
      n10.set(false, void 0);
    })), n10;
  }
  observeLineHeightForPosition(e206) {
    return I((t10) => {
      let n10 = e206 instanceof j ? e206 : e206.read(t10);
      return n10 === null ? null : (this.getOption(75).read(t10), this.editor.getLineHeightForPosition(n10));
    });
  }
  observeLineHeightForLine(e206) {
    return typeof e206 == `number` ? this.observeLineHeightForPosition(new j(e206, 1)) : I((t10) => {
      let n10 = e206.read(t10);
      return n10 === null ? null : this.observeLineHeightForPosition(new j(n10, 1)).read(t10);
    });
  }
  observeLineHeightsForLineRange(e206) {
    return I((t10) => {
      let n10 = e206 instanceof zm ? e206 : e206.read(t10), r10 = [];
      for (let e207 = n10.startLineNumber; e207 < n10.endLineNumberExclusive; e207++) r10.push(this.observeLineHeightForLine(e207).read(t10));
      return r10;
    });
  }
}, _xb._map = /* @__PURE__ */ new Map(), _xb), yve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, bve = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, GK, KK = (_yb = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this._editors = e206, this._rootElement = t10, this._diffModel = n10, this._rootWidth = r10, this._rootHeight = i10, this._modifiedEditorLayoutInfo = a10, this._themeService = o10, this.width = GK.ENTIRE_DIFF_OVERVIEW_WIDTH;
    let s10 = Tc(this._themeService.onDidColorThemeChange, () => this._themeService.getColorTheme()), c10 = I((e207) => {
      let t11 = s10.read(e207);
      return { insertColor: t11.getColor(Vv) || (t11.getColor(Rv) || Iv).transparent(2), removeColor: t11.getColor(Hv) || (t11.getColor(zv) || Lv).transparent(2) };
    }), l10 = _u(document.createElement(`div`));
    l10.setClassName(`diffViewport`), l10.setPosition(`absolute`);
    let u10 = nu(`div.diffOverview`, { style: { position: `absolute`, top: `0px`, width: GK.ENTIRE_DIFF_OVERVIEW_WIDTH + `px` } }).root;
    this._register(RG(u10, l10.domNode)), this._register(el(u10, R.POINTER_DOWN, (e207) => {
      this._editors.modified.delegateVerticalScrollbarPointerDown(e207);
    })), this._register(L(u10, R.MOUSE_WHEEL, (e207) => {
      this._editors.modified.delegateScrollFromMouseWheelEvent(e207);
    }, { passive: false })), this._register(RG(this._rootElement, u10)), this._register(vc((e207, t11) => {
      let n11 = this._diffModel.read(e207), r11 = this._editors.original.createOverviewRuler(`original diffOverviewRuler`);
      r11 && (t11.add(r11), t11.add(RG(u10, r11.getDomNode())));
      let i11 = this._editors.modified.createOverviewRuler(`modified diffOverviewRuler`);
      if (i11 && (t11.add(i11), t11.add(RG(u10, i11.getDomNode()))), !r11 || !i11) return;
      let a11 = TK(`viewZoneChanged`, this._editors.original.onDidChangeViewZones), o11 = TK(`viewZoneChanged`, this._editors.modified.onDidChangeViewZones), s11 = TK(`hiddenRangesChanged`, this._editors.original.onDidChangeHiddenAreas), d10 = TK(`hiddenRangesChanged`, this._editors.modified.onDidChangeHiddenAreas);
      t11.add(hc((e208) => {
        a11.read(e208), o11.read(e208), s11.read(e208), d10.read(e208);
        let t12 = c10.read(e208), l11 = n11?.diff.read(e208)?.mappings;
        function u11(e209, t13, n12) {
          let r12 = n12._getViewModel();
          return r12 ? e209.filter((e211) => e211.length > 0).map((e211) => {
            let n13 = r12.coordinatesConverter.convertModelPositionToViewPosition(new j(e211.startLineNumber, 1)), i12 = r12.coordinatesConverter.convertModelPositionToViewPosition(new j(e211.endLineNumberExclusive, 1)), a12 = i12.lineNumber - n13.lineNumber;
            return new UC(n13.lineNumber, i12.lineNumber, a12, t13.toString());
          }) : [];
        }
        let f10 = u11((l11 || []).map((e209) => e209.lineRangeMapping.original), t12.removeColor, this._editors.original), p10 = u11((l11 || []).map((e209) => e209.lineRangeMapping.modified), t12.insertColor, this._editors.modified);
        r11?.setZones(f10), i11?.setZones(p10);
      })), t11.add(hc((e208) => {
        let t12 = this._rootHeight.read(e208), n12 = this._rootWidth.read(e208), a12 = this._modifiedEditorLayoutInfo.read(e208);
        if (a12) {
          let n13 = GK.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * GK.ONE_OVERVIEW_WIDTH;
          r11.setLayout({ top: 0, height: t12, right: n13 + GK.ONE_OVERVIEW_WIDTH, width: GK.ONE_OVERVIEW_WIDTH }), i11.setLayout({ top: 0, height: t12, right: 0, width: GK.ONE_OVERVIEW_WIDTH });
          let o12 = this._editors.modifiedScrollTop.read(e208), s12 = this._editors.modifiedScrollHeight.read(e208), c11 = this._editors.modified.getOption(117), u11 = new ax(c11.verticalHasArrows ? c11.arrowSize : 0, c11.verticalScrollbarSize, 0, a12.height, s12, o12);
          l10.setTop(u11.getSliderPosition()), l10.setHeight(u11.getSliderSize());
        } else l10.setTop(0), l10.setHeight(0);
        u10.style.height = t12 + `px`, u10.style.left = n12 - GK.ENTIRE_DIFF_OVERVIEW_WIDTH + `px`, l10.setWidth(GK.ENTIRE_DIFF_OVERVIEW_WIDTH);
      }));
    }));
  }
}, GK = _yb, _yb.ONE_OVERVIEW_WIDTH = 15, _yb.ENTIRE_DIFF_OVERVIEW_WIDTH = _yb.ONE_OVERVIEW_WIDTH * 2, _yb);
KK = GK = yve([bve(6, US)], KK);
var xve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, qK = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, JK = class extends D {
  get onDidContentSizeChange() {
    return this._onDidContentSizeChange.event;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(), this.originalEditorElement = e206, this.modifiedEditorElement = t10, this._options = n10, this._argCodeEditorWidgetOptions = r10, this._createInnerEditor = i10, this._contextKeyService = a10, this._instantiationService = o10, this._keybindingService = s10, this.original = this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(), this._argCodeEditorWidgetOptions.originalEditor || {})), this.modified = this._register(this._createRightHandSideEditor(this._options.editorOptions.get(), this._argCodeEditorWidgetOptions.modifiedEditor || {})), this._onDidContentSizeChange = this._register(new k()), this.modifiedScrollTop = Tc(this, this.modified.onDidScrollChange, () => this.modified.getScrollTop()), this.modifiedScrollHeight = Tc(this, this.modified.onDidScrollChange, () => this.modified.getScrollHeight()), this.modifiedObs = WK(this.modified), this.originalObs = WK(this.original), this.modifiedModel = this.modifiedObs.model, this.modifiedSelections = Tc(this, this.modified.onDidChangeCursorSelection, () => this.modified.getSelections() ?? []), this.modifiedCursor = dc({ owner: this, equalsFn: j.equals }, (e207) => this.modifiedSelections.read(e207)[0]?.getPosition() ?? new j(1, 1)), this.originalCursor = Tc(this, this.original.onDidChangeCursorPosition, () => this.original.getPosition() ?? new j(1, 1)), this.isOriginalFocused = WK(this.original).isFocused, this.isModifiedFocused = WK(this.modified).isFocused, this.isFocused = I(this, (e207) => this.isOriginalFocused.read(e207) || this.isModifiedFocused.read(e207)), this._argCodeEditorWidgetOptions = null, this._register(_c({ changeTracker: { createChangeSummary: () => ({}), handleChange: (e207, t11) => (e207.didChange(n10.editorOptions) && Object.assign(t11, e207.change.changedOptions), true) } }, (e207, t11) => {
      n10.editorOptions.read(e207), this._options.renderSideBySide.read(e207), this.modified.updateOptions(this._adjustOptionsForRightHandSide(e207, t11)), this.original.updateOptions(this._adjustOptionsForLeftHandSide(e207, t11));
    }));
  }
  _createLeftHandSideEditor(e206, t10) {
    let n10 = this._adjustOptionsForLeftHandSide(void 0, e206), r10 = this._constructInnerEditor(this._instantiationService, this.originalEditorElement, n10, t10), i10 = this._contextKeyService.createKey(`isInDiffLeftEditor`, r10.hasWidgetFocus());
    return this._register(r10.onDidFocusEditorWidget(() => i10.set(true))), this._register(r10.onDidBlurEditorWidget(() => i10.set(false))), r10;
  }
  _createRightHandSideEditor(e206, t10) {
    let n10 = this._adjustOptionsForRightHandSide(void 0, e206), r10 = this._constructInnerEditor(this._instantiationService, this.modifiedEditorElement, n10, t10), i10 = this._contextKeyService.createKey(`isInDiffRightEditor`, r10.hasWidgetFocus());
    return this._register(r10.onDidFocusEditorWidget(() => i10.set(true))), this._register(r10.onDidBlurEditorWidget(() => i10.set(false))), r10;
  }
  _constructInnerEditor(e206, t10, n10, r10) {
    let i10 = this._createInnerEditor(e206, t10, n10, r10);
    return this._register(i10.onDidContentSizeChange((e207) => {
      let t11 = this.original.getContentWidth() + this.modified.getContentWidth() + KK.ENTIRE_DIFF_OVERVIEW_WIDTH, n11 = Math.max(this.modified.getContentHeight(), this.original.getContentHeight());
      this._onDidContentSizeChange.fire({ contentHeight: n11, contentWidth: t11, contentHeightChanged: e207.contentHeightChanged, contentWidthChanged: e207.contentWidthChanged });
    })), i10;
  }
  _adjustOptionsForLeftHandSide(e206, t10) {
    let n10 = this._adjustOptionsForSubEditor(t10);
    return this._options.renderSideBySide.get() ? (n10.unicodeHighlight = this._options.editorOptions.get().unicodeHighlight || {}, n10.wordWrapOverride1 = this._options.diffWordWrap.get()) : (n10.wordWrapOverride1 = `off`, n10.wordWrapOverride2 = `off`, n10.stickyScroll = { enabled: false }, n10.unicodeHighlight = { nonBasicASCII: false, ambiguousCharacters: false, invisibleCharacters: false }), n10.glyphMargin = this._options.renderSideBySide.get(), t10.originalAriaLabel && (n10.ariaLabel = t10.originalAriaLabel), n10.ariaLabel = this._updateAriaLabel(n10.ariaLabel), n10.readOnly = !this._options.originalEditable.get(), n10.dropIntoEditor = { enabled: !n10.readOnly }, n10.extraEditorClassName = `original-in-monaco-diff-editor`, n10;
  }
  _adjustOptionsForRightHandSide(e206, t10) {
    let n10 = this._adjustOptionsForSubEditor(t10);
    return t10.modifiedAriaLabel && (n10.ariaLabel = t10.modifiedAriaLabel), n10.ariaLabel = this._updateAriaLabel(n10.ariaLabel), n10.wordWrapOverride1 = this._options.diffWordWrap.get(), n10.revealHorizontalRightPadding = lr.revealHorizontalRightPadding.defaultValue + KK.ENTIRE_DIFF_OVERVIEW_WIDTH, n10.scrollbar.verticalHasArrows = false, n10.extraEditorClassName = `modified-in-monaco-diff-editor`, n10;
  }
  _adjustOptionsForSubEditor(e206) {
    let t10 = { ...e206, dimension: { height: 0, width: 0 } };
    return t10.inDiffEditor = true, t10.automaticLayout = false, t10.allowVariableLineHeights = false, t10.allowVariableFonts = false, t10.allowVariableFontsInAccessibilityMode = false, t10.scrollbar = { ...t10.scrollbar || {} }, t10.folding = false, t10.codeLens = this._options.diffCodeLens.get(), t10.fixedOverflowWidgets = true, t10.minimap = { ...t10.minimap || {} }, t10.minimap.enabled = false, this._options.hideUnchangedRegions.get() ? t10.stickyScroll = { enabled: false } : t10.stickyScroll = this._options.editorOptions.get().stickyScroll, t10;
  }
  _updateAriaLabel(e206) {
    e206 || (e206 = ``);
    let t10 = C(111, ` use {0} to open the accessibility help.`, this._keybindingService.lookupKeybinding(`editor.action.accessibilityHelp`)?.getAriaLabel());
    return this._options.accessibilityVerbose.get() ? e206 + t10 : e206 ? e206.replaceAll(t10, ``) : ``;
  }
};
JK = xve([qK(5, nd), qK(6, V), qK(7, Dw)], JK);
var Sve = class {
  resetSash() {
    this._sashRatio.set(void 0, void 0);
  }
  constructor(e206, t10) {
    this._options = e206, this.dimensions = t10, this.sashLeft = uc(this, (e207) => {
      let t11 = this._sashRatio.read(e207) ?? this._options.splitViewDefaultRatio.read(e207);
      return this._computeSashLeft(t11, e207);
    }, (e207, t11) => {
      let n10 = this.dimensions.width.get();
      this._sashRatio.set(e207 / n10, t11);
    }), this._sashRatio = Ic(this, void 0);
  }
  _computeSashLeft(e206, t10) {
    let n10 = this.dimensions.width.read(t10), r10 = Math.floor(this._options.splitViewDefaultRatio.read(t10) * n10), i10 = this._options.enableSplitViewResizing.read(t10) ? Math.floor(e206 * n10) : r10;
    return n10 <= 200 ? r10 : i10 < 100 ? 100 : i10 > n10 - 100 ? n10 - 100 : i10;
  }
}, YK = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._domNode = e206, this._dimensions = t10, this._enabled = n10, this._boundarySashes = r10, this.sashLeft = i10, this._resetSash = a10, this._sash = this._register(new nB(this._domNode, { getVerticalSashTop: (e207) => 0, getVerticalSashLeft: (e207) => this.sashLeft.get(), getVerticalSashHeight: (e207) => this._dimensions.height.get() }, { orientation: 0 })), this._startSashPosition = void 0, this._register(this._sash.onDidStart(() => {
      this._startSashPosition = this.sashLeft.get();
    })), this._register(this._sash.onDidChange((e207) => {
      this.sashLeft.set(this._startSashPosition + (e207.currentX - e207.startX), void 0);
    })), this._register(this._sash.onDidEnd(() => this._sash.layout())), this._register(this._sash.onDidReset(() => this._resetSash())), this._register(hc((e207) => {
      let t11 = this._boundarySashes.read(e207);
      t11 && (this._sash.orthogonalEndSash = t11.bottom);
    })), this._register(hc((e207) => {
      let t11 = this._enabled.read(e207);
      this._sash.state = t11 ? 3 : 0, this.sashLeft.read(e207), this._dimensions.height.read(e207), this._sash.layout();
    }));
  }
}, Cve = (_zb = class extends D {
  constructor() {
    super(...arguments), this._id = ++_zb.idCounter, this._onDidDispose = this._register(new k()), this.onDidDispose = this._onDidDispose.event;
  }
  getId() {
    return this.getEditorType() + `:v2:` + this._id;
  }
  getVisibleColumnFromPosition(e206) {
    return this._targetEditor.getVisibleColumnFromPosition(e206);
  }
  getPosition() {
    return this._targetEditor.getPosition();
  }
  setPosition(e206, t10 = `api`) {
    this._targetEditor.setPosition(e206, t10);
  }
  revealLine(e206, t10 = 0) {
    this._targetEditor.revealLine(e206, t10);
  }
  revealLineInCenter(e206, t10 = 0) {
    this._targetEditor.revealLineInCenter(e206, t10);
  }
  revealLineInCenterIfOutsideViewport(e206, t10 = 0) {
    this._targetEditor.revealLineInCenterIfOutsideViewport(e206, t10);
  }
  revealLineNearTop(e206, t10 = 0) {
    this._targetEditor.revealLineNearTop(e206, t10);
  }
  revealPosition(e206, t10 = 0) {
    this._targetEditor.revealPosition(e206, t10);
  }
  revealPositionInCenter(e206, t10 = 0) {
    this._targetEditor.revealPositionInCenter(e206, t10);
  }
  revealPositionInCenterIfOutsideViewport(e206, t10 = 0) {
    this._targetEditor.revealPositionInCenterIfOutsideViewport(e206, t10);
  }
  revealPositionNearTop(e206, t10 = 0) {
    this._targetEditor.revealPositionNearTop(e206, t10);
  }
  getSelection() {
    return this._targetEditor.getSelection();
  }
  getSelections() {
    return this._targetEditor.getSelections();
  }
  setSelection(e206, t10 = `api`) {
    this._targetEditor.setSelection(e206, t10);
  }
  setSelections(e206, t10 = `api`) {
    this._targetEditor.setSelections(e206, t10);
  }
  revealLines(e206, t10, n10 = 0) {
    this._targetEditor.revealLines(e206, t10, n10);
  }
  revealLinesInCenter(e206, t10, n10 = 0) {
    this._targetEditor.revealLinesInCenter(e206, t10, n10);
  }
  revealLinesInCenterIfOutsideViewport(e206, t10, n10 = 0) {
    this._targetEditor.revealLinesInCenterIfOutsideViewport(e206, t10, n10);
  }
  revealLinesNearTop(e206, t10, n10 = 0) {
    this._targetEditor.revealLinesNearTop(e206, t10, n10);
  }
  revealRange(e206, t10 = 0, n10 = false, r10 = true) {
    this._targetEditor.revealRange(e206, t10, n10, r10);
  }
  revealRangeInCenter(e206, t10 = 0) {
    this._targetEditor.revealRangeInCenter(e206, t10);
  }
  revealRangeInCenterIfOutsideViewport(e206, t10 = 0) {
    this._targetEditor.revealRangeInCenterIfOutsideViewport(e206, t10);
  }
  revealRangeNearTop(e206, t10 = 0) {
    this._targetEditor.revealRangeNearTop(e206, t10);
  }
  revealRangeNearTopIfOutsideViewport(e206, t10 = 0) {
    this._targetEditor.revealRangeNearTopIfOutsideViewport(e206, t10);
  }
  revealRangeAtTop(e206, t10 = 0) {
    this._targetEditor.revealRangeAtTop(e206, t10);
  }
  getSupportedActions() {
    return this._targetEditor.getSupportedActions();
  }
  focus() {
    this._targetEditor.focus();
  }
  trigger(e206, t10, n10) {
    this._targetEditor.trigger(e206, t10, n10);
  }
  createDecorationsCollection(e206) {
    return this._targetEditor.createDecorationsCollection(e206);
  }
  changeDecorations(e206) {
    return this._targetEditor.changeDecorations(e206);
  }
}, _zb.idCounter = 0, _zb);
function wve(e206, t10) {
  return Ac(e206, (e207, n10) => n10 ?? t10(e207));
}
var Tve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Eve = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, XK = class {
  get editorOptions() {
    return this._options;
  }
  constructor(e206, t10) {
    this._accessibilityService = t10, this._diffEditorWidth = Ic(this, 0), this._screenReaderMode = Tc(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized()), this.couldShowInlineViewBecauseOfSize = I(this, (e207) => this._options.read(e207).renderSideBySide && this._diffEditorWidth.read(e207) <= this._options.read(e207).renderSideBySideInlineBreakpoint), this.renderOverviewRuler = I(this, (e207) => this._options.read(e207).renderOverviewRuler), this.renderSideBySide = I(this, (e207) => this.compactMode.read(e207) && this.shouldRenderInlineViewInSmartMode.read(e207) ? false : this._options.read(e207).renderSideBySide && !(this._options.read(e207).useInlineViewWhenSpaceIsLimited && this.couldShowInlineViewBecauseOfSize.read(e207) && !this._screenReaderMode.read(e207))), this.readOnly = I(this, (e207) => this._options.read(e207).readOnly), this.shouldRenderOldRevertArrows = I(this, (e207) => !(!this._options.read(e207).renderMarginRevertIcon || !this.renderSideBySide.read(e207) || this.readOnly.read(e207) || this.shouldRenderGutterMenu.read(e207))), this.shouldRenderGutterMenu = I(this, (e207) => this._options.read(e207).renderGutterMenu), this.renderIndicators = I(this, (e207) => this._options.read(e207).renderIndicators), this.enableSplitViewResizing = I(this, (e207) => this._options.read(e207).enableSplitViewResizing), this.splitViewDefaultRatio = I(this, (e207) => this._options.read(e207).splitViewDefaultRatio), this.ignoreTrimWhitespace = I(this, (e207) => this._options.read(e207).ignoreTrimWhitespace), this.maxComputationTimeMs = I(this, (e207) => this._options.read(e207).maxComputationTime), this.showMoves = I(this, (e207) => this._options.read(e207).experimental.showMoves && this.renderSideBySide.read(e207)), this.isInEmbeddedEditor = I(this, (e207) => this._options.read(e207).isInEmbeddedEditor), this.diffWordWrap = I(this, (e207) => this._options.read(e207).diffWordWrap), this.originalEditable = I(this, (e207) => this._options.read(e207).originalEditable), this.diffCodeLens = I(this, (e207) => this._options.read(e207).diffCodeLens), this.accessibilityVerbose = I(this, (e207) => this._options.read(e207).accessibilityVerbose), this.diffAlgorithm = I(this, (e207) => this._options.read(e207).diffAlgorithm), this.showEmptyDecorations = I(this, (e207) => this._options.read(e207).experimental.showEmptyDecorations), this.onlyShowAccessibleDiffViewer = I(this, (e207) => this._options.read(e207).onlyShowAccessibleDiffViewer), this.compactMode = I(this, (e207) => this._options.read(e207).compactMode), this.trueInlineDiffRenderingEnabled = I(this, (e207) => this._options.read(e207).experimental.useTrueInlineView), this.useTrueInlineDiffRendering = I(this, (e207) => !this.renderSideBySide.read(e207) && this.trueInlineDiffRenderingEnabled.read(e207)), this.hideUnchangedRegions = I(this, (e207) => this._options.read(e207).hideUnchangedRegions.enabled), this.hideUnchangedRegionsRevealLineCount = I(this, (e207) => this._options.read(e207).hideUnchangedRegions.revealLineCount), this.hideUnchangedRegionsContextLineCount = I(this, (e207) => this._options.read(e207).hideUnchangedRegions.contextLineCount), this.hideUnchangedRegionsMinimumLineCount = I(this, (e207) => this._options.read(e207).hideUnchangedRegions.minimumLineCount), this._model = Ic(this, void 0), this.shouldRenderInlineViewInSmartMode = this._model.map(this, (e207) => wve(this, (t11) => {
      let n11 = e207?.diff.read(t11);
      return n11 ? Dve(n11, this.trueInlineDiffRenderingEnabled.read(t11)) : void 0;
    })).flatten().map(this, (e207) => !!e207), this.inlineViewHideOriginalLineNumbers = this.compactMode;
    let n10 = { ...e206, ...ZK(e206, SF) };
    this._options = Ic(this, n10);
  }
  updateOptions(e206) {
    let t10 = ZK(e206, this._options.get()), n10 = { ...this._options.get(), ...e206, ...t10 };
    this._options.set(n10, void 0, { changedOptions: e206 });
  }
  setWidth(e206) {
    this._diffEditorWidth.set(e206, void 0);
  }
  setModel(e206) {
    this._model.set(e206, void 0);
  }
};
XK = Tve([Eve(1, e_)], XK);
function Dve(e206, t10) {
  return e206.mappings.every((e207) => Ove(e207.lineRangeMapping) || kve(e207.lineRangeMapping) || t10 && zK(e207.lineRangeMapping));
}
function Ove(e206) {
  return e206.original.length === 0;
}
function kve(e206) {
  return e206.modified.length === 0;
}
function ZK(e206, t10) {
  return { enableSplitViewResizing: Nn(e206.enableSplitViewResizing, t10.enableSplitViewResizing), splitViewDefaultRatio: Ln(e206.splitViewDefaultRatio, 0.5, 0.1, 0.9), renderSideBySide: Nn(e206.renderSideBySide, t10.renderSideBySide), renderMarginRevertIcon: Nn(e206.renderMarginRevertIcon, t10.renderMarginRevertIcon), maxComputationTime: Fn(e206.maxComputationTime, t10.maxComputationTime, 0, 1073741824), maxFileSize: Fn(e206.maxFileSize, t10.maxFileSize, 0, 1073741824), ignoreTrimWhitespace: Nn(e206.ignoreTrimWhitespace, t10.ignoreTrimWhitespace), renderIndicators: Nn(e206.renderIndicators, t10.renderIndicators), originalEditable: Nn(e206.originalEditable, t10.originalEditable), diffCodeLens: Nn(e206.diffCodeLens, t10.diffCodeLens), renderOverviewRuler: Nn(e206.renderOverviewRuler, t10.renderOverviewRuler), diffWordWrap: Bn(e206.diffWordWrap, t10.diffWordWrap, [`off`, `on`, `inherit`]), diffAlgorithm: Bn(e206.diffAlgorithm, t10.diffAlgorithm, [`legacy`, `advanced`], { smart: `legacy`, experimental: `advanced` }), accessibilityVerbose: Nn(e206.accessibilityVerbose, t10.accessibilityVerbose), experimental: { showMoves: Nn(e206.experimental?.showMoves, t10.experimental.showMoves), showEmptyDecorations: Nn(e206.experimental?.showEmptyDecorations, t10.experimental.showEmptyDecorations), useTrueInlineView: Nn(e206.experimental?.useTrueInlineView, t10.experimental.useTrueInlineView) }, hideUnchangedRegions: { enabled: Nn(e206.hideUnchangedRegions?.enabled ?? e206.experimental?.collapseUnchangedRegions, t10.hideUnchangedRegions.enabled), contextLineCount: Fn(e206.hideUnchangedRegions?.contextLineCount, t10.hideUnchangedRegions.contextLineCount, 0, 1073741824), minimumLineCount: Fn(e206.hideUnchangedRegions?.minimumLineCount, t10.hideUnchangedRegions.minimumLineCount, 0, 1073741824), revealLineCount: Fn(e206.hideUnchangedRegions?.revealLineCount, t10.hideUnchangedRegions.revealLineCount, 0, 1073741824) }, isInEmbeddedEditor: Nn(e206.isInEmbeddedEditor, t10.isInEmbeddedEditor), onlyShowAccessibleDiffViewer: Nn(e206.onlyShowAccessibleDiffViewer, t10.onlyShowAccessibleDiffViewer), renderSideBySideInlineBreakpoint: Fn(e206.renderSideBySideInlineBreakpoint, t10.renderSideBySideInlineBreakpoint, 0, 1073741824), useInlineViewWhenSpaceIsLimited: Nn(e206.useInlineViewWhenSpaceIsLimited, t10.useInlineViewWhenSpaceIsLimited), renderGutterMenu: Nn(e206.renderGutterMenu, t10.renderGutterMenu), compactMode: Nn(e206.compactMode, t10.compactMode) };
}
var QK = 24, Ave = class extends D {
  get onDidChangeDropdownVisibility() {
    return this._onDidChangeDropdownVisibility.event;
  }
  constructor(e206, t10, n10 = { orientation: 0 }) {
    if (super(), this.submenuActionViewItems = [], this.hasSecondaryActions = false, this._onDidChangeDropdownVisibility = this._register(new dee()), this.originalPrimaryActions = [], this.originalSecondaryActions = [], this.hiddenActions = [], this.disposables = this._register(new E()), n10.hoverDelegate = n10.hoverDelegate ?? this._register(wI()), this.options = n10, this.toggleMenuAction = this._register(new $K(() => this.toggleMenuActionViewItem?.show(), n10.toggleMenuTitle)), this.element = document.createElement(`div`), this.element.className = `monaco-toolbar`, e206.appendChild(this.element), this.actionBar = this._register(new CL(this.element, { orientation: n10.orientation, ariaLabel: n10.ariaLabel, actionRunner: n10.actionRunner, allowContextMenu: n10.allowContextMenu, highlightToggledItems: n10.highlightToggledItems, hoverDelegate: n10.hoverDelegate, actionViewItemProvider: (e207, r10) => {
      if (e207.id === $K.ID) return this.toggleMenuActionViewItem = new iL(e207, { getActions: () => this.toggleMenuAction.menuActions }, t10, { actionViewItemProvider: this.options.actionViewItemProvider, actionRunner: this.actionRunner, keybindingProvider: this.options.getKeyBinding, classNames: ju.asClassNameArray(n10.moreIcon ?? F.toolBarMore), anchorAlignmentProvider: this.options.anchorAlignmentProvider, menuAsChild: !!this.options.renderDropdownAsChildElement, skipTelemetry: this.options.skipTelemetry, isMenu: true, hoverDelegate: this.options.hoverDelegate }), this.toggleMenuActionViewItem.setActionContext(this.actionBar.context), this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)), this.toggleMenuActionViewItem;
      if (n10.actionViewItemProvider) {
        let t11 = n10.actionViewItemProvider(e207, r10);
        if (t11) return t11;
      }
      if (e207 instanceof Ou) {
        let n11 = new iL(e207, e207.actions, t10, { actionViewItemProvider: this.options.actionViewItemProvider, actionRunner: this.actionRunner, keybindingProvider: this.options.getKeyBinding, classNames: e207.class, anchorAlignmentProvider: this.options.anchorAlignmentProvider, menuAsChild: !!this.options.renderDropdownAsChildElement, skipTelemetry: this.options.skipTelemetry, hoverDelegate: this.options.hoverDelegate });
        return n11.setActionContext(this.actionBar.context), this.submenuActionViewItems.push(n11), this.disposables.add(this._onDidChangeDropdownVisibility.add(n11.onDidChangeVisibility)), n11;
      }
    } })), this.options.responsive) {
      this.element.classList.add(`responsive`);
      let e207 = new ResizeObserver(() => {
        this.setToolbarMaxWidth(this.element.getBoundingClientRect().width);
      });
      e207.observe(this.element), this._store.add(T(() => e207.disconnect()));
    }
  }
  set actionRunner(e206) {
    this.actionBar.actionRunner = e206;
  }
  get actionRunner() {
    return this.actionBar.actionRunner;
  }
  set context(e206) {
    this.actionBar.context = e206, this.toggleMenuActionViewItem?.setActionContext(e206);
    for (let t10 of this.submenuActionViewItems) t10.setActionContext(e206);
  }
  getElement() {
    return this.element;
  }
  getItemAction(e206) {
    return this.actionBar.getAction(e206);
  }
  getItemWidth(e206) {
    return this.actionBar.getWidth(e206);
  }
  setActions(e206, t10) {
    this.clear(), this.originalPrimaryActions = e206 ? e206.slice(0) : [], this.originalSecondaryActions = t10 ? t10.slice(0) : [];
    let n10 = e206 ? e206.slice(0) : [];
    this.hasSecondaryActions = !!(t10 && t10.length > 0), this.hasSecondaryActions && t10 && (this.toggleMenuAction.menuActions = t10.slice(0), n10.push(this.toggleMenuAction)), n10.length > 0 && this.options.trailingSeparator && n10.push(new Du()), n10.forEach((e207) => {
      this.actionBar.push(e207, { icon: this.options.icon ?? true, label: this.options.label ?? false, keybinding: this.getKeybindingLabel(e207) });
    }), this.options.responsive && (this.hiddenActions.length = 0, this.setToolbarMaxWidth(this.element.getBoundingClientRect().width));
  }
  getKeybindingLabel(e206) {
    return this.options.getKeyBinding?.(e206)?.getLabel() ?? void 0;
  }
  getItemsWidthResponsive() {
    return this.actionBar.length() * QK;
  }
  setToolbarMaxWidth(e206) {
    if (this.actionBar.isEmpty() || this.getItemsWidthResponsive() <= e206 && this.hiddenActions.length === 0) return;
    if (this.getItemsWidthResponsive() > e206) for (; this.getItemsWidthResponsive() > e206 && this.actionBar.length() > 0; ) {
      let e207 = this.originalPrimaryActions.length - this.hiddenActions.length - 1;
      if (e207 < 0) break;
      let t11 = Math.min(QK, this.getItemWidth(e207)), n10 = this.originalPrimaryActions[e207];
      this.hiddenActions.unshift({ action: n10, size: t11 }), this.actionBar.pull(e207), this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1 && this.actionBar.push(this.toggleMenuAction, { icon: this.options.icon ?? true, label: this.options.label ?? false, keybinding: this.getKeybindingLabel(this.toggleMenuAction) });
    }
    else for (; this.hiddenActions.length > 0; ) {
      let t11 = this.hiddenActions.shift();
      if (this.getItemsWidthResponsive() + t11.size > e206) {
        this.hiddenActions.unshift(t11);
        break;
      }
      this.actionBar.push(t11.action, { icon: this.options.icon ?? true, label: this.options.label ?? false, keybinding: this.getKeybindingLabel(t11.action), index: this.originalPrimaryActions.length - this.hiddenActions.length - 1 }), this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1 && (this.toggleMenuAction.menuActions = [], this.actionBar.pull(this.actionBar.length() - 1));
    }
    let t10 = this.hiddenActions.map((e207) => e207.action);
    if (this.originalSecondaryActions.length > 0 || t10.length > 0) {
      let e207 = this.originalSecondaryActions.slice(0);
      this.toggleMenuAction.menuActions = Du.join(t10, e207);
    }
  }
  clear() {
    this.submenuActionViewItems = [], this.disposables.clear(), this.actionBar.clear();
  }
  dispose() {
    this.clear(), this.disposables.dispose(), super.dispose();
  }
}, $K = (_Ab = class extends Tu {
  constructor(t10, n10) {
    n10 || (n10 = C(17, `More Actions...`)), super(_Ab.ID, n10, void 0, true), this._menuActions = [], this.toggleDropdownMenu = t10;
  }
  async run() {
    this.toggleDropdownMenu();
  }
  get menuActions() {
    return this._menuActions;
  }
  set menuActions(e206) {
    this._menuActions = e206;
  }
}, _Ab.ID = `toolbar.toggle.more`, _Ab), eq = xu(`IActionViewItemService`);
Zf(eq, class {
  constructor() {
    this._providers = /* @__PURE__ */ new Map(), this._onDidChange = new k(), this.onDidChange = this._onDidChange.event;
  }
  dispose() {
    this._onDidChange.dispose();
  }
  lookUp(e206, t10) {
    return this._providers.get(this._makeKey(e206, t10));
  }
  _makeKey(e206, t10) {
    return `${e206.id}/${t10 instanceof W ? t10.id : t10}`;
  }
}, 1);
var tq = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, nq = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, rq = class extends Ave {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(e206, i10, { getKeyBinding: (e207) => a10.lookupKeybinding(e207.id) ?? void 0, ...t10, allowContextMenu: true, skipTelemetry: typeof t10?.telemetrySource == `string` }), this._options = t10, this._menuService = n10, this._contextKeyService = r10, this._contextMenuService = i10, this._keybindingService = a10, this._commandService = o10, this._sessionDisposables = this._store.add(new E());
    let c10 = t10?.telemetrySource;
    c10 && this._store.add(this.actionBar.onDidRun((e207) => s10.publicLog2(`workbenchActionExecuted`, { id: e207.action.id, from: c10 })));
  }
  setActions(e206, t10 = [], n10) {
    this._sessionDisposables.clear();
    let r10 = e206.slice(), i10 = t10.slice(), a10 = [], o10 = 0, s10 = [], c10 = false;
    if (this._options?.hiddenItemStrategy !== -1) for (let e207 = 0; e207 < r10.length; e207++) {
      let t11 = r10[e207];
      !(t11 instanceof _d2) && !(t11 instanceof gd) || t11.hideActions && (a10.push(t11.hideActions.toggle), t11.hideActions.toggle.checked && o10++, t11.hideActions.isHidden && (c10 = true, r10[e207] = void 0, this._options?.hiddenItemStrategy !== 0 && (s10[e207] = t11)));
    }
    if (this._options?.overflowBehavior !== void 0) {
      let e207 = OO(new Set(this._options.overflowBehavior.exempted), Ut.map(r10, (e208) => e208?.id)), t11 = this._options.overflowBehavior.maxItems - e207.size, n11 = 0;
      for (let i11 = 0; i11 < r10.length; i11++) {
        let a11 = r10[i11];
        a11 && (n11++, !e207.has(a11.id) && n11 >= t11 && (r10[i11] = void 0, s10[i11] = a11));
      }
    }
    g(r10), g(s10), super.setActions(r10, Du.join(s10, i10)), (a10.length > 0 || r10.length > 0) && this._sessionDisposables.add(L(this.getElement(), `contextmenu`, (e207) => {
      let t11 = new Xo(Vc(this.getElement()), e207), r11 = this.getItemAction(t11.target);
      if (!r11) return;
      t11.preventDefault(), t11.stopPropagation();
      let i11 = [];
      if (r11 instanceof _d2 && r11.menuKeybinding) i11.push(r11.menuKeybinding);
      else if (!(r11 instanceof gd || r11 instanceof $K)) {
        let e208 = !!this._keybindingService.lookupKeybinding(r11.id);
        i11.push(lW(this._commandService, this._keybindingService, r11.id, void 0, e208));
      }
      if (a10.length > 0) {
        let e208 = false;
        if (o10 === 1 && this._options?.hiddenItemStrategy === 0) {
          e208 = true;
          for (let e209 = 0; e209 < a10.length; e209++) if (a10[e209].checked) {
            a10[e209] = ku({ id: r11.id, label: r11.label, checked: true, enabled: false, run() {
            } });
            break;
          }
        }
        if (!e208 && (r11 instanceof _d2 || r11 instanceof gd)) {
          if (!r11.hideActions) return;
          i11.push(r11.hideActions.hide);
        } else i11.push(ku({ id: `label`, label: C(1649, `Hide`), enabled: false, run() {
        } }));
      }
      let s11 = Du.join(i11, a10);
      this._options?.resetMenu && !n10 && (n10 = [this._options.resetMenu]), c10 && n10 && (s11.push(new Du()), s11.push(ku({ id: `resetThisMenu`, label: C(1650, `Reset Menu`), run: () => this._menuService.resetHiddenStates(n10) }))), s11.length !== 0 && this._contextMenuService.showContextMenu({ getAnchor: () => t11, getActions: () => s11, menuId: this._options?.contextMenu, menuActionOptions: { renderShortTitle: true, ...this._options?.menuOptions }, skipTelemetry: typeof this._options?.telemetrySource == `string`, contextKeyService: this._contextKeyService });
    }));
  }
};
rq = tq([nq(2, pd), nq(3, nd), nq(4, mj), nq(5, Dw), nq(6, Mu), nq(7, bd)], rq);
var iq = class extends rq {
  get onDidChangeMenuItems() {
    return this._onDidChangeMenuItems.event;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    super(e206, { resetMenu: t10, ...n10, actionViewItemProvider: (r11, i11) => {
      let a11 = l10.lookUp(t10, r11 instanceof gd ? r11.item.submenu.id : r11.id);
      return a11 || (a11 = n10?.actionViewItemProvider), a11?.(r11, i11, u10, Vc(e206).vscodeWindowId) || SL(u10, r11, i11);
    } }, r10, i10, a10, o10, s10, c10), this._onDidChangeMenuItems = this._store.add(new k());
    let d10 = this._store.add(r10.createMenu(t10, i10, { emitEventsForSubmenuChanges: true, eventDebounceDelay: n10?.eventDebounceDelay })), f10 = () => {
      let { primary: t11, secondary: r11 } = hL(d10.getActions(n10?.menuOptions), n10?.toolbarOptions?.primaryGroup, n10?.toolbarOptions?.shouldInlineSubmenu, n10?.toolbarOptions?.useSeparatorsInPrimaryActions);
      e206.classList.toggle(`has-no-actions`, t11.length === 0 && r11.length === 0), super.setActions(t11, r11);
    };
    this._store.add(d10.onDidChange(() => {
      f10(), this._onDidChangeMenuItems.fire(this);
    })), this._store.add(l10.onDidChange((e207) => {
      e207 === t10 && f10();
    })), f10();
  }
  setActions() {
    throw new je(`This toolbar is populated from a menu.`);
  }
};
iq = tq([nq(3, pd), nq(4, nd), nq(5, mj), nq(6, Dw), nq(7, Mu), nq(8, bd), nq(9, eq), nq(10, V)], iq);
var aq = class extends Gm {
  constructor(e206) {
    super(), this._textModel = e206;
  }
  getValueOfRange(e206) {
    return this._textModel.getValueInRange(e206);
  }
  getLineLength(e206) {
    return this._textModel.getLineLength(e206);
  }
  get length() {
    let e206 = this._textModel.getLineCount(), t10 = this._textModel.getLineLength(e206);
    return new Vm(e206 - 1, t10);
  }
}, oq = class extends Eu {
  constructor(e206) {
    super(), this._getContext = e206;
  }
  runAction(e206, t10) {
    let n10 = this._getContext();
    return super.runAction(e206, n10);
  }
}, jve = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._domNode = t10, this.itemProvider = n10, this.scrollTop = Tc(this, this._editor.onDidScrollChange, (e207) => this._editor.getScrollTop()), this.isScrollTopZero = this.scrollTop.map((e207) => e207 === 0), this.modelAttached = Tc(this, this._editor.onDidChangeModel, (e207) => this._editor.hasModel()), this.editorOnDidChangeViewZones = TK(`onDidChangeViewZones`, this._editor.onDidChangeViewZones), this.editorOnDidContentSizeChange = TK(`onDidContentSizeChange`, this._editor.onDidContentSizeChange), this.domNodeSizeChanged = _D2(`domNodeSizeChanged`), this.views = /* @__PURE__ */ new Map(), this._domNode.className = `gutter monaco-editor`;
    let r10 = this._domNode.appendChild(nu(`div.scroll-decoration`, { role: `presentation`, ariaHidden: `true`, style: { width: `100%` } }).root), i10 = new ResizeObserver(() => {
      bc((e207) => {
        this.domNodeSizeChanged.trigger(e207);
      });
    });
    i10.observe(this._domNode), this._register(T(() => i10.disconnect())), this._register(hc((e207) => {
      r10.className = this.isScrollTopZero.read(e207) ? `` : `scroll-decoration`;
    })), this._register(hc((e207) => this.render(e207)));
  }
  dispose() {
    super.dispose(), Jl(this._domNode);
  }
  render(e206) {
    if (!this.modelAttached.read(e206)) return;
    this.domNodeSizeChanged.read(e206), this.editorOnDidChangeViewZones.read(e206), this.editorOnDidContentSizeChange.read(e206);
    let t10 = this.scrollTop.read(e206), n10 = this._editor.getVisibleRanges(), r10 = new Set(this.views.keys()), i10 = Tm.ofStartAndLength(0, this._domNode.clientHeight);
    if (!i10.isEmpty) for (let a10 of n10) {
      let n11 = new zm(a10.startLineNumber, a10.endLineNumber + 1), o10 = this.itemProvider.getIntersectingGutterItems(n11, e206);
      bc((e207) => {
        for (let a11 of o10) {
          if (!a11.range.intersect(n11)) continue;
          r10.delete(a11.id);
          let o11 = this.views.get(a11.id);
          if (o11) o11.item.set(a11, e207);
          else {
            let e208 = document.createElement(`div`);
            this._domNode.appendChild(e208);
            let t11 = Ic(`item`, a11);
            o11 = new Mve(t11, this.itemProvider.createView(t11, e208), e208), this.views.set(a11.id, o11);
          }
          let s10 = a11.range.startLineNumber <= this._editor.getModel().getLineCount() ? this._editor.getTopForLineNumber(a11.range.startLineNumber, true) - t10 : a11.range.startLineNumber > 1 ? this._editor.getBottomForLineNumber(a11.range.startLineNumber - 1, false) - t10 : 0, c10 = (a11.range.endLineNumberExclusive === 1 ? Math.max(s10, this._editor.getTopForLineNumber(a11.range.startLineNumber, false) - t10) : Math.max(s10, this._editor.getBottomForLineNumber(a11.range.endLineNumberExclusive - 1, true) - t10)) - s10;
          o11.domNode.style.top = `${s10}px`, o11.domNode.style.height = `${c10}px`, o11.gutterItemView.layout(Tm.ofStartAndLength(s10, c10), i10);
        }
      });
    }
    for (let e207 of r10) {
      let t11 = this.views.get(e207);
      t11.gutterItemView.dispose(), t11.domNode.remove(), this.views.delete(e207);
    }
  }
}, Mve = class {
  constructor(e206, t10, n10) {
    this.item = e206, this.gutterItemView = t10, this.domNode = n10;
  }
}, sq = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, cq = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, lq = [], uq = 35, dq = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(), this._diffModel = t10, this._editors = n10, this._options = r10, this._sashLayout = i10, this._boundarySashes = a10, this._instantiationService = o10, this._contextKeyService = s10, this._menuService = c10, this._menu = this._register(this._menuService.createMenu(W.DiffEditorHunkToolbar, this._contextKeyService)), this._actions = Tc(this, this._menu.onDidChange, () => this._menu.getActions()), this._hasActions = this._actions.map((e207) => e207.length > 0), this._showSash = I(this, (e207) => this._options.renderSideBySide.read(e207) && this._hasActions.read(e207)), this.width = I(this, (e207) => this._hasActions.read(e207) ? uq : 0), this.elements = nu(`div.gutter@gutter`, { style: { position: `absolute`, height: `100%`, width: uq + `px` } }, []), this._currentDiff = I(this, (e207) => {
      let t11 = this._diffModel.read(e207);
      if (!t11) return;
      let n11 = t11.diff.read(e207)?.mappings, r11 = this._editors.modifiedCursor.read(e207);
      if (r11) return n11?.find((e208) => e208.lineRangeMapping.modified.contains(r11.lineNumber));
    }), this._selectedDiffs = I(this, (e207) => {
      let t11 = this._diffModel.read(e207)?.diff.read(e207);
      if (!t11) return lq;
      let n11 = this._editors.modifiedSelections.read(e207);
      if (n11.every((e208) => e208.isEmpty())) return lq;
      let r11 = new Bm(n11.map((e208) => zm.fromRangeInclusive(e208))), i11 = t11.mappings.filter((e208) => e208.lineRangeMapping.innerChanges && r11.intersects(e208.lineRangeMapping.modified)).map((e208) => ({ mapping: e208, rangeMappings: e208.lineRangeMapping.innerChanges.filter((e209) => n11.some((t12) => M.areIntersecting(e209.modifiedRange, t12))) }));
      return i11.length === 0 || i11.every((e208) => e208.rangeMappings.length === 0) ? lq : i11;
    }), this._register(zG(e206, this.elements.root)), this._register(L(this.elements.root, `click`, () => {
      this._editors.modified.focus();
    })), this._register(KG(this.elements.root, { display: this._hasActions.map((e207) => e207 ? `block` : `none`) })), pc(this, (t11) => this._showSash.read(t11) ? new YK(e206, this._sashLayout.dimensions, this._options.enableSplitViewResizing, this._boundarySashes, uc(this, (e207) => this._sashLayout.sashLeft.read(e207) - uq, (e207, t12) => this._sashLayout.sashLeft.set(e207 + uq, t12)), () => this._sashLayout.resetSash()) : void 0).recomputeInitiallyAndOnChange(this._store);
    let l10 = I(this, (e207) => {
      let t11 = this._diffModel.read(e207);
      if (!t11) return [];
      let n11 = t11.diff.read(e207);
      if (!n11) return [];
      let r11 = this._selectedDiffs.read(e207);
      if (r11.length > 0) return [new fq(eh.fromRangeMappings(r11.flatMap((e208) => e208.rangeMappings)), true, W.DiffEditorSelectionToolbar, void 0, t11.model.original.uri, t11.model.modified.uri)];
      let i11 = this._currentDiff.read(e207);
      return n11.mappings.map((e208) => new fq(e208.lineRangeMapping.withInnerChangesFromLineRanges(), e208.lineRangeMapping === i11?.lineRangeMapping, W.DiffEditorHunkToolbar, void 0, t11.model.original.uri, t11.model.modified.uri));
    });
    this._register(new jve(this._editors.modified, this.elements.root, { getIntersectingGutterItems: (e207, t11) => l10.read(t11), createView: (e207, t11) => this._instantiationService.createInstance(pq, e207, t11, this) })), this._register(L(this.elements.gutter, R.MOUSE_WHEEL, (e207) => {
      this._editors.modified.getOption(117).handleMouseWheel && this._editors.modified.delegateScrollFromMouseWheelEvent(e207);
    }, { passive: false }));
  }
  computeStagedValue(e206) {
    let t10 = e206.innerChanges ?? [], n10 = new aq(this._editors.modifiedModel.get()), r10 = new aq(this._editors.original.getModel());
    return new Jm(t10.map((e207) => e207.toTextEdit(n10))).apply(r10);
  }
  layout(e206) {
    this.elements.gutter.style.left = e206 + `px`;
  }
};
dq = sq([cq(6, V), cq(7, nd), cq(8, pd)], dq);
var fq = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this.mapping = e206, this.showAlways = t10, this.menuId = n10, this.rangeOverride = r10, this.originalUri = i10, this.modifiedUri = a10;
  }
  get id() {
    return this.mapping.modified.toString();
  }
  get range() {
    return this.rangeOverride ?? this.mapping.modified;
  }
}, pq = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._item = e206, this._elements = nu(`div.gutterItem`, { style: { height: `20px`, width: `34px` } }, [nu(`div.background@background`, {}, []), nu(`div.buttons@buttons`, {}, [])]), this._showAlways = this._item.map(this, (e207) => e207.showAlways), this._menuId = this._item.map(this, (e207) => e207.menuId), this._isSmall = Ic(this, false), this._lastItemRange = void 0, this._lastViewRange = void 0;
    let i10 = this._register(r10.createInstance(dj, `element`, { instantHover: true }, { position: { hoverPosition: 1 } }));
    this._register(RG(t10, this._elements.root)), this._register(hc((e207) => {
      let t11 = this._showAlways.read(e207);
      this._elements.root.classList.toggle(`noTransition`, true), this._elements.root.classList.toggle(`showAlways`, t11), setTimeout(() => {
        this._elements.root.classList.toggle(`noTransition`, false);
      }, 0);
    })), this._register(vc((e207, t11) => {
      this._elements.buttons.replaceChildren();
      let a10 = t11.add(r10.createInstance(iq, this._elements.buttons, this._menuId.read(e207), { orientation: 1, hoverDelegate: i10, toolbarOptions: { primaryGroup: (e208) => e208.startsWith(`primary`) }, overflowBehavior: { maxItems: this._isSmall.read(e207) ? 1 : 3 }, hiddenItemStrategy: 0, actionRunner: t11.add(new oq(() => {
        let e208 = this._item.read(void 0), t12 = e208.mapping;
        return { mapping: t12, originalWithModifiedChanges: n10.computeStagedValue(t12), originalUri: e208.originalUri, modifiedUri: e208.modifiedUri };
      })), menuOptions: { shouldForwardArgs: true } }));
      t11.add(a10.onDidChangeMenuItems(() => {
        this._lastItemRange && this.layout(this._lastItemRange, this._lastViewRange);
      }));
    }));
  }
  layout(e206, t10) {
    this._lastItemRange = e206, this._lastViewRange = t10;
    let n10 = this._elements.buttons.clientHeight;
    this._isSmall.set(this._item.get().mapping.original.startLineNumber === 1 && e206.length < 30, void 0), n10 = this._elements.buttons.clientHeight;
    let r10 = e206.length / 2 - n10 / 2, i10 = n10, a10 = e206.start + r10, o10 = Tm.tryCreate(i10, t10.endExclusive - i10 - n10), s10 = Tm.tryCreate(e206.start + i10, e206.endExclusive - n10 - i10);
    s10 && o10 && s10.start < s10.endExclusive && (a10 = o10.clip(a10), a10 = s10.clip(a10)), this._elements.buttons.style.top = `${a10 - e206.start}px`;
  }
};
pq = sq([cq(3, V)], pq);
var Nve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Pve = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, mq, hq = (_Bb = class extends D {
  static setBreadcrumbsSourceFactory(e206) {
    this._breadcrumbsSourceFactory.set(e206, void 0);
  }
  get isUpdatingHiddenAreas() {
    return this._isUpdatingHiddenAreas;
  }
  constructor(e206, t10, n10, r10) {
    super(), this._editors = e206, this._diffModel = t10, this._options = n10, this._instantiationService = r10, this._modifiedOutlineSource = pc(this, (e207) => {
      let t11 = this._editors.modifiedModel.read(e207), n11 = mq._breadcrumbsSourceFactory.read(e207);
      return !t11 || !n11 ? void 0 : n11(t11, this._instantiationService);
    }), this._isUpdatingHiddenAreas = false, this._register(this._editors.original.onDidChangeCursorPosition((e207) => {
      if (e207.reason === 1) return;
      let t11 = this._diffModel.get();
      bc((e208) => {
        for (let n11 of this._editors.original.getSelections() || []) t11?.ensureOriginalLineIsVisible(n11.getStartPosition().lineNumber, 0, e208), t11?.ensureOriginalLineIsVisible(n11.getEndPosition().lineNumber, 0, e208);
      });
    })), this._register(this._editors.modified.onDidChangeCursorPosition((e207) => {
      if (e207.reason === 1) return;
      let t11 = this._diffModel.get();
      bc((e208) => {
        for (let n11 of this._editors.modified.getSelections() || []) t11?.ensureModifiedLineIsVisible(n11.getStartPosition().lineNumber, 0, e208), t11?.ensureModifiedLineIsVisible(n11.getEndPosition().lineNumber, 0, e208);
      });
    }));
    let i10 = this._diffModel.map((e207, t11) => {
      let n11 = e207?.unchangedRegions.read(t11) ?? [];
      return n11.length === 1 && n11[0].modifiedLineNumber === 1 && n11[0].lineCount === this._editors.modifiedModel.read(t11)?.getLineCount() ? [] : n11;
    });
    this.viewZones = I(this, (e207) => {
      let t11 = this._modifiedOutlineSource.read(e207);
      if (!t11) return { origViewZones: [], modViewZones: [] };
      let n11 = [], r11 = [], a11 = this._options.renderSideBySide.read(e207), o11 = this._options.compactMode.read(e207), s10 = i10.read(e207);
      for (let i11 = 0; i11 < s10.length; i11++) {
        let c10 = s10[i11];
        if (!c10.shouldHideControls(e207) && !(o11 && (i11 === 0 || i11 === s10.length - 1))) if (o11) {
          {
            let t12 = new WG(I(this, (e208) => c10.getHiddenOriginalRange(e208).startLineNumber - 1), 12);
            n11.push(t12), e207.store.add(new gq(this._editors.original, t12, c10, !a11));
          }
          {
            let t12 = new WG(I(this, (e208) => c10.getHiddenModifiedRange(e208).startLineNumber - 1), 12);
            r11.push(t12), e207.store.add(new gq(this._editors.modified, t12, c10));
          }
        } else {
          {
            let r12 = new WG(I(this, (e208) => c10.getHiddenOriginalRange(e208).startLineNumber - 1), 24);
            n11.push(r12), e207.store.add(new _q2(this._editors.original, r12, c10, c10.originalUnchangedRange, !a11, t11, (e208) => this._diffModel.get().ensureModifiedLineIsVisible(e208, 2, void 0), this._options));
          }
          {
            let n12 = new WG(I(this, (e208) => c10.getHiddenModifiedRange(e208).startLineNumber - 1), 24);
            r11.push(n12), e207.store.add(new _q2(this._editors.modified, n12, c10, c10.modifiedUnchangedRange, false, t11, (e208) => this._diffModel.get().ensureModifiedLineIsVisible(e208, 2, void 0), this._options));
          }
        }
      }
      return { origViewZones: n11, modViewZones: r11 };
    });
    let a10 = { description: `unchanged lines`, className: `diff-unchanged-lines`, isWholeLine: true }, o10 = { description: `Fold Unchanged`, glyphMarginHoverMessage: new PM(void 0, { isTrusted: true, supportThemeIcons: true }).appendMarkdown(C(124, `Fold Unchanged Region`)), glyphMarginClassName: `fold-unchanged ` + ju.asClassName(F.fold), zIndex: 10001 };
    this._register(LG(this._editors.original, I(this, (e207) => {
      let t11 = i10.read(e207), n11 = t11.map((e208) => ({ range: e208.originalUnchangedRange.toInclusiveRange(), options: a10 }));
      for (let r11 of t11) r11.shouldHideControls(e207) && n11.push({ range: M.fromPositions(new j(r11.originalLineNumber, 1)), options: o10 });
      return n11;
    }))), this._register(LG(this._editors.modified, I(this, (e207) => {
      let t11 = i10.read(e207), n11 = t11.map((e208) => ({ range: e208.modifiedUnchangedRange.toInclusiveRange(), options: a10 }));
      for (let r11 of t11) r11.shouldHideControls(e207) && n11.push({ range: zm.ofLength(r11.modifiedLineNumber, 1).toInclusiveRange(), options: o10 });
      return n11;
    }))), this._register(hc((e207) => {
      let t11 = i10.read(e207);
      this._isUpdatingHiddenAreas = true;
      try {
        this._editors.original.setHiddenAreas(t11.map((t12) => t12.getHiddenOriginalRange(e207).toInclusiveRange()).filter(Ke)), this._editors.modified.setHiddenAreas(t11.map((t12) => t12.getHiddenModifiedRange(e207).toInclusiveRange()).filter(Ke));
      } finally {
        this._isUpdatingHiddenAreas = false;
      }
    })), this._register(this._editors.modified.onMouseUp((e207) => {
      if (!e207.event.rightButton && e207.target.position && e207.target.element?.className.includes(`fold-unchanged`)) {
        let t11 = e207.target.position.lineNumber, n11 = this._diffModel.get();
        if (!n11) return;
        let r11 = n11.unchangedRegions.get().find((e208) => e208.modifiedUnchangedRange.contains(t11));
        if (!r11) return;
        r11.collapseAll(void 0), e207.event.stopPropagation(), e207.event.preventDefault();
      }
    })), this._register(this._editors.original.onMouseUp((e207) => {
      if (!e207.event.rightButton && e207.target.position && e207.target.element?.className.includes(`fold-unchanged`)) {
        let t11 = e207.target.position.lineNumber, n11 = this._diffModel.get();
        if (!n11) return;
        let r11 = n11.unchangedRegions.get().find((e208) => e208.originalUnchangedRange.contains(t11));
        if (!r11) return;
        r11.collapseAll(void 0), e207.event.stopPropagation(), e207.event.preventDefault();
      }
    }));
  }
}, mq = _Bb, _Bb._breadcrumbsSourceFactory = Ic(_Bb, () => ({ dispose() {
}, getBreadcrumbItems(e206, t10) {
  return [];
} })), _Bb);
hq = mq = Nve([Pve(3, V)], hq);
var gq = class extends UG {
  constructor(e206, t10, n10, r10 = false) {
    let i10 = nu(`div.diff-hidden-lines-widget`);
    super(e206, t10, i10.root), this._unchangedRegion = n10, this._hide = r10, this._nodes = nu(`div.diff-hidden-lines-compact`, [nu(`div.line-left`, []), nu(`div.text@text`, []), nu(`div.line-right`, [])]), i10.root.appendChild(this._nodes.root), this._hide && this._nodes.root.replaceChildren(), this._register(hc((e207) => {
      if (!this._hide) {
        let t11 = this._unchangedRegion.getHiddenModifiedRange(e207).length, n11 = C(125, `{0} hidden lines`, t11);
        this._nodes.text.innerText = n11;
      }
    }));
  }
}, _q2 = class extends UG {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    let c10 = nu(`div.diff-hidden-lines-widget`);
    super(e206, t10, c10.root), this._editor = e206, this._unchangedRegion = n10, this._unchangedRegionRange = r10, this._hide = i10, this._modifiedOutlineSource = a10, this._revealModifiedHiddenLine = o10, this._options = s10, this._nodes = nu(`div.diff-hidden-lines`, [nu(`div.top@top`, { title: C(126, `Click or drag to show more above`) }), nu(`div.center@content`, { style: { display: `flex` } }, [nu(`div@first`, { style: { display: `flex`, justifyContent: `center`, alignItems: `center`, flexShrink: `0` } }, [B(`a`, { title: C(127, `Show Unchanged Region`), role: `button`, onclick: () => {
      this._unchangedRegion.showAll(void 0);
    } }, ...CP(`$(unfold)`))]), nu(`div@others`, { style: { display: `flex`, justifyContent: `center`, alignItems: `center` } })]), nu(`div.bottom@bottom`, { title: C(128, `Click or drag to show more below`), role: `button` })]), c10.root.appendChild(this._nodes.root), this._hide ? Jl(this._nodes.first) : this._register(KG(this._nodes.first, { width: WK(this._editor).layoutInfoContentLeft })), this._register(hc((e207) => {
      let t11 = this._unchangedRegion.visibleLineCountTop.read(e207) + this._unchangedRegion.visibleLineCountBottom.read(e207) === this._unchangedRegion.lineCount;
      this._nodes.bottom.classList.toggle(`canMoveTop`, !t11), this._nodes.bottom.classList.toggle(`canMoveBottom`, this._unchangedRegion.visibleLineCountBottom.read(e207) > 0), this._nodes.top.classList.toggle(`canMoveTop`, this._unchangedRegion.visibleLineCountTop.read(e207) > 0), this._nodes.top.classList.toggle(`canMoveBottom`, !t11);
      let n11 = this._unchangedRegion.isDragged.read(e207), r11 = this._editor.getDomNode();
      r11 && (r11.classList.toggle(`draggingUnchangedRegion`, !!n11), n11 === `top` ? (r11.classList.toggle(`canMoveTop`, this._unchangedRegion.visibleLineCountTop.read(e207) > 0), r11.classList.toggle(`canMoveBottom`, !t11)) : n11 === `bottom` ? (r11.classList.toggle(`canMoveTop`, !t11), r11.classList.toggle(`canMoveBottom`, this._unchangedRegion.visibleLineCountBottom.read(e207) > 0)) : (r11.classList.toggle(`canMoveTop`, false), r11.classList.toggle(`canMoveBottom`, false)));
    }));
    let l10 = this._editor;
    this._register(L(this._nodes.top, `mousedown`, (e207) => {
      if (e207.button !== 0) return;
      this._nodes.top.classList.toggle(`dragging`, true), this._nodes.root.classList.toggle(`dragging`, true), e207.preventDefault();
      let t11 = e207.clientY, n11 = false, r11 = this._unchangedRegion.visibleLineCountTop.get();
      this._unchangedRegion.isDragged.set(`top`, void 0);
      let i11 = Vc(this._nodes.top), a11 = L(i11, `mousemove`, (e208) => {
        let i12 = e208.clientY - t11;
        n11 || (n11 = Math.abs(i12) > 2);
        let a12 = Math.round(i12 / l10.getOption(75)), o12 = Math.max(0, Math.min(r11 + a12, this._unchangedRegion.getMaxVisibleLineCountTop()));
        this._unchangedRegion.visibleLineCountTop.set(o12, void 0);
      }), o11 = L(i11, `mouseup`, (e208) => {
        n11 || this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(), void 0), this._nodes.top.classList.toggle(`dragging`, false), this._nodes.root.classList.toggle(`dragging`, false), this._unchangedRegion.isDragged.set(void 0, void 0), a11.dispose(), o11.dispose();
      });
    })), this._register(L(this._nodes.bottom, `mousedown`, (e207) => {
      if (e207.button !== 0) return;
      this._nodes.bottom.classList.toggle(`dragging`, true), this._nodes.root.classList.toggle(`dragging`, true), e207.preventDefault();
      let t11 = e207.clientY, n11 = false, r11 = this._unchangedRegion.visibleLineCountBottom.get();
      this._unchangedRegion.isDragged.set(`bottom`, void 0);
      let i11 = Vc(this._nodes.bottom), a11 = L(i11, `mousemove`, (e208) => {
        let i12 = e208.clientY - t11;
        n11 || (n11 = Math.abs(i12) > 2);
        let a12 = Math.round(i12 / l10.getOption(75)), o12 = Math.max(0, Math.min(r11 - a12, this._unchangedRegion.getMaxVisibleLineCountBottom())), s11 = this._unchangedRegionRange.endLineNumberExclusive > l10.getModel().getLineCount() ? l10.getContentHeight() : l10.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
        this._unchangedRegion.visibleLineCountBottom.set(o12, void 0);
        let c11 = this._unchangedRegionRange.endLineNumberExclusive > l10.getModel().getLineCount() ? l10.getContentHeight() : l10.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
        l10.setScrollTop(l10.getScrollTop() + (c11 - s11));
      }), o11 = L(i11, `mouseup`, (e208) => {
        if (this._unchangedRegion.isDragged.set(void 0, void 0), !n11) {
          let e209 = l10.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
          this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(), void 0);
          let t12 = l10.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
          l10.setScrollTop(l10.getScrollTop() + (t12 - e209));
        }
        this._nodes.bottom.classList.toggle(`dragging`, false), this._nodes.root.classList.toggle(`dragging`, false), a11.dispose(), o11.dispose();
      });
    })), this._register(hc((e207) => {
      let t11 = [];
      if (!this._hide) {
        let r11 = n10.getHiddenModifiedRange(e207).length, i11 = C(129, `{0} hidden lines`, r11), a11 = B(`span`, { title: C(130, `Double click to unfold`) }, i11);
        a11.addEventListener(`dblclick`, (e208) => {
          e208.button === 0 && (e208.preventDefault(), this._unchangedRegion.showAll(void 0));
        }), t11.push(a11);
        let o11 = this._unchangedRegion.getHiddenModifiedRange(e207), s11 = this._modifiedOutlineSource.getBreadcrumbItems(o11, e207);
        if (s11.length > 0) {
          t11.push(B(`span`, void 0, `\xA0\xA0|\xA0\xA0`));
          for (let e208 = 0; e208 < s11.length; e208++) {
            let n11 = s11[e208], r12 = nu(`div.breadcrumb-item`, { style: { display: `flex`, alignItems: `center` } }, [wP(Di.toIcon(n11.kind)), `\xA0`, n11.name, ...e208 === s11.length - 1 ? [] : [wP(F.chevronRight)]]).root;
            t11.push(r12), r12.onclick = () => {
              this._revealModifiedHiddenLine(n11.startLineNumber);
            };
          }
        }
      }
      Jl(this._nodes.others, ...t11);
    }));
  }
}, vq = [], Fve = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editors = e206, this._diffModel = t10, this._options = n10, this._widget = r10, this._selectedDiffs = I(this, (e207) => {
      let t11 = this._diffModel.read(e207)?.diff.read(e207);
      if (!t11) return vq;
      let n11 = this._editors.modifiedSelections.read(e207);
      if (n11.every((e208) => e208.isEmpty())) return vq;
      let r11 = new Bm(n11.map((e208) => zm.fromRangeInclusive(e208))), i10 = t11.mappings.filter((e208) => e208.lineRangeMapping.innerChanges && r11.intersects(e208.lineRangeMapping.modified)).map((e208) => ({ mapping: e208, rangeMappings: e208.lineRangeMapping.innerChanges.filter((e209) => n11.some((t12) => M.areIntersecting(e209.modifiedRange, t12))) }));
      return i10.length === 0 || i10.every((e208) => e208.rangeMappings.length === 0) ? vq : i10;
    }), this._register(vc((e207, t11) => {
      if (!this._options.shouldRenderOldRevertArrows.read(e207)) return;
      let n11 = this._diffModel.read(e207), r11 = n11?.diff.read(e207);
      if (!n11 || !r11 || n11.movedTextToCompare.read(e207)) return;
      let i10 = [], a10 = this._selectedDiffs.read(e207), o10 = new Set(a10.map((e208) => e208.mapping));
      if (a10.length > 0) {
        let n12 = this._editors.modifiedSelections.read(e207), r12 = t11.add(new yq(n12[n12.length - 1].positionLineNumber, this._widget, a10.flatMap((e208) => e208.rangeMappings), true));
        this._editors.modified.addGlyphMarginWidget(r12), i10.push(r12);
      }
      for (let e208 of r11.mappings) if (!o10.has(e208) && !e208.lineRangeMapping.modified.isEmpty && e208.lineRangeMapping.innerChanges) {
        let n12 = t11.add(new yq(e208.lineRangeMapping.modified.startLineNumber, this._widget, e208.lineRangeMapping, false));
        this._editors.modified.addGlyphMarginWidget(n12), i10.push(n12);
      }
      t11.add(T(() => {
        for (let e208 of i10) this._editors.modified.removeGlyphMarginWidget(e208);
      }));
    }));
  }
}, yq = (_Cb = class extends D {
  getId() {
    return this._id;
  }
  constructor(t10, n10, r10, i10) {
    super(), this._lineNumber = t10, this._widget = n10, this._diffs = r10, this._revertSelection = i10, this._id = `revertButton${_Cb.counter++}`, this._domNode = nu(`div.revertButton`, { title: this._revertSelection ? C(135, `Revert Selected Changes`) : C(136, `Revert Change`) }, [wP(F.arrowRight)]).root, this._register(L(this._domNode, R.MOUSE_DOWN, (e206) => {
      e206.button !== 2 && (e206.stopPropagation(), e206.preventDefault());
    })), this._register(L(this._domNode, R.MOUSE_UP, (e206) => {
      e206.stopPropagation(), e206.preventDefault();
    })), this._register(L(this._domNode, R.CLICK, (e206) => {
      this._diffs instanceof Zm ? this._widget.revert(this._diffs) : this._widget.revertRangeMappings(this._diffs), e206.stopPropagation(), e206.preventDefault();
    }));
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return { lane: $p.Right, range: { startColumn: 1, startLineNumber: this._lineNumber, endColumn: 1, endLineNumber: this._lineNumber }, zIndex: 10001 };
  }
}, _Cb.counter = 0, _Cb), Ive = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, bq = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, xq = class extends Cve {
  get onDidContentSizeChange() {
    return this._editors.onDidContentSizeChange;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(), this._domElement = e206, this._parentContextKeyService = r10, this._parentInstantiationService = i10, this._codeEditorService = a10, this._accessibilitySignalService = o10, this._editorProgressService = s10, this.elements = nu(`div.monaco-diff-editor.side-by-side`, { style: { position: `relative`, height: `100%` } }, [nu(`div.editor.original@original`, { style: { position: `absolute`, height: `100%` } }), nu(`div.editor.modified@modified`, { style: { position: `absolute`, height: `100%` } }), nu(`div.accessibleDiffViewer@accessibleDiffViewer`, { style: { position: `absolute`, height: `100%` } })]), this._diffModelSrc = this._register(Rc(this, void 0)), this._diffModel = I(this, (e207) => this._diffModelSrc.read(e207)?.object), this.onDidChangeModel = O.fromObservableLight(this._diffModel), this._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._domElement)), this._instantiationService = this._register(this._parentInstantiationService.createChild(new kk([nd, this._contextKeyService]))), this._boundarySashes = Ic(this, void 0), this._accessibleDiffViewerShouldBeVisible = Ic(this, false), this._accessibleDiffViewerVisible = I(this, (e207) => this._options.onlyShowAccessibleDiffViewer.read(e207) ? true : this._accessibleDiffViewerShouldBeVisible.read(e207)), this._movedBlocksLinesPart = Ic(this, void 0), this._layoutInfo = I(this, (e207) => {
      let t11 = this._rootSizeObserver.width.read(e207), n11 = this._rootSizeObserver.height.read(e207);
      this._rootSizeObserver.automaticLayout ? this.elements.root.style.height = `100%` : this.elements.root.style.height = n11 + `px`;
      let r11 = this._sash.read(e207), i11 = this._gutter.read(e207), a11 = i11?.width.read(e207) ?? 0, o11 = this._overviewRulerPart.read(e207)?.width ?? 0, s11, c11, l11, u11, d11;
      if (r11) {
        let n12 = r11.sashLeft.read(e207), i12 = this._movedBlocksLinesPart.read(e207)?.width.read(e207) ?? 0;
        s11 = 0, c11 = n12 - a11 - i12, d11 = n12 - a11, l11 = n12, u11 = t11 - l11 - o11;
      } else {
        d11 = 0;
        let n12 = this._options.inlineViewHideOriginalLineNumbers.read(e207);
        s11 = a11, c11 = n12 ? 0 : Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(e207)), l11 = a11 + c11, u11 = t11 - l11 - o11;
      }
      return this.elements.original.style.left = s11 + `px`, this.elements.original.style.width = c11 + `px`, this._editors.original.layout({ width: c11, height: n11 }, true), i11?.layout(d11), this.elements.modified.style.left = l11 + `px`, this.elements.modified.style.width = u11 + `px`, this._editors.modified.layout({ width: u11, height: n11 }, true), { modifiedEditor: this._editors.modified.getLayoutInfo(), originalEditor: this._editors.original.getLayoutInfo() };
    }), this._diffValue = this._diffModel.map((e207, t11) => e207?.diff.read(t11)), this.onDidUpdateDiff = O.fromObservableLight(this._diffValue), this._codeEditorService.willCreateDiffEditor(), this._contextKeyService.createKey(`isInDiffEditor`, true), this._domElement.appendChild(this.elements.root), this._register(T(() => this.elements.root.remove())), this._rootSizeObserver = this._register(new BG(this.elements.root, t10.dimension)), this._rootSizeObserver.setAutomaticLayout(t10.automaticLayout ?? false), this._options = this._instantiationService.createInstance(XK, t10), this._register(hc((e207) => {
      this._options.setWidth(this._rootSizeObserver.width.read(e207));
    })), this._contextKeyService.createKey($.isEmbeddedDiffEditor.key, false), this._register(PG($.isEmbeddedDiffEditor, this._contextKeyService, (e207) => this._options.isInEmbeddedEditor.read(e207))), this._register(PG($.comparingMovedCode, this._contextKeyService, (e207) => !!this._diffModel.read(e207)?.movedTextToCompare.read(e207))), this._register(PG($.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService, (e207) => this._options.couldShowInlineViewBecauseOfSize.read(e207))), this._register(PG($.diffEditorInlineMode, this._contextKeyService, (e207) => !this._options.renderSideBySide.read(e207))), this._register(PG($.hasChanges, this._contextKeyService, (e207) => (this._diffModel.read(e207)?.diff.read(e207)?.mappings.length ?? 0) > 0)), this._editors = this._register(this._instantiationService.createInstance(JK, this.elements.original, this.elements.modified, this._options, n10, (e207, t11, n11, r11) => this._createInnerEditor(e207, t11, n11, r11))), this._register(PG($.diffEditorOriginalWritable, this._contextKeyService, (e207) => this._options.originalEditable.read(e207))), this._register(PG($.diffEditorModifiedWritable, this._contextKeyService, (e207) => !this._options.readOnly.read(e207))), this._register(PG($.diffEditorOriginalUri, this._contextKeyService, (e207) => this._diffModel.read(e207)?.model.original.uri.toString() ?? ``)), this._register(PG($.diffEditorModifiedUri, this._contextKeyService, (e207) => this._diffModel.read(e207)?.model.modified.uri.toString() ?? ``)), this._overviewRulerPart = pc(this, (e207) => this._options.renderOverviewRuler.read(e207) ? this._instantiationService.createInstance(jG(KK), this._editors, this.elements.root, this._diffModel, this._rootSizeObserver.width, this._rootSizeObserver.height, this._layoutInfo.map((e208) => e208.modifiedEditor)) : void 0).recomputeInitiallyAndOnChange(this._store);
    let c10 = { height: this._rootSizeObserver.height, width: this._rootSizeObserver.width.map((e207, t11) => e207 - (this._overviewRulerPart.read(t11)?.width ?? 0)) };
    this._sashLayout = new Sve(this._options, c10), this._sash = pc(this, (e207) => {
      let t11 = this._options.renderSideBySide.read(e207);
      return this.elements.root.classList.toggle(`side-by-side`, t11), t11 ? new YK(this.elements.root, c10, this._options.enableSplitViewResizing, this._boundarySashes, this._sashLayout.sashLeft, () => this._sashLayout.resetSash()) : void 0;
    }).recomputeInitiallyAndOnChange(this._store);
    let l10 = pc(this, (e207) => this._instantiationService.createInstance(jG(hq), this._editors, this._diffModel, this._options)).recomputeInitiallyAndOnChange(this._store);
    pc(this, (e207) => this._instantiationService.createInstance(jG(_ve), this._editors, this._diffModel, this._options, this)).recomputeInitiallyAndOnChange(this._store);
    let u10 = /* @__PURE__ */ new Set(), d10 = /* @__PURE__ */ new Set(), f10 = false, p10 = pc(this, (e207) => this._instantiationService.createInstance(jG(IK), Vc(this._domElement), this._editors, this._diffModel, this._options, this, () => f10 || l10.read(void 0).isUpdatingHiddenAreas, u10, d10)).recomputeInitiallyAndOnChange(this._store), m10 = I(this, (e207) => {
      let t11 = p10.read(e207).viewZones.read(e207).orig, n11 = l10.read(e207).viewZones.read(e207).origViewZones;
      return t11.concat(n11);
    }), h10 = I(this, (e207) => {
      let t11 = p10.read(e207).viewZones.read(e207).mod, n11 = l10.read(e207).viewZones.read(e207).modViewZones;
      return t11.concat(n11);
    });
    this._register(qG(this._editors.original, m10, (e207) => {
      f10 = e207;
    }, u10));
    let g10;
    this._register(qG(this._editors.modified, h10, (e207) => {
      f10 = e207, f10 ? g10 = FG.capture(this._editors.modified) : (g10?.restore(this._editors.modified), g10 = void 0);
    }, d10)), this._accessibleDiffViewer = pc(this, (e207) => this._instantiationService.createInstance(jG(oK), this.elements.accessibleDiffViewer, this._accessibleDiffViewerVisible, (e208, t11) => this._accessibleDiffViewerShouldBeVisible.set(e208, t11), this._options.onlyShowAccessibleDiffViewer.map((e208) => !e208), this._rootSizeObserver.width, this._rootSizeObserver.height, this._diffModel.map((e208, t11) => e208?.diff.read(t11)?.mappings.map((e209) => e209.lineRangeMapping)), new eve(this._editors))).recomputeInitiallyAndOnChange(this._store);
    let _10 = this._accessibleDiffViewerVisible.map((e207) => e207 ? `hidden` : `visible`);
    this._register(KG(this.elements.modified, { visibility: _10 })), this._register(KG(this.elements.original, { visibility: _10 })), this._createDiffEditorContributions(), this._codeEditorService.addDiffEditor(this), this._register(T(() => {
      this._codeEditorService.removeDiffEditor(this);
    })), this._gutter = pc(this, (e207) => this._options.shouldRenderGutterMenu.read(e207) ? this._instantiationService.createInstance(jG(dq), this.elements.root, this._diffModel, this._editors, this._options, this._sashLayout, this._boundarySashes) : void 0), this._register(kc(this._layoutInfo)), pc(this, (e207) => new (jG(VK))(this.elements.root, this._diffModel, this._layoutInfo.map((e208) => e208.originalEditor), this._layoutInfo.map((e208) => e208.modifiedEditor), this._editors)).recomputeInitiallyAndOnChange(this._store, (e207) => {
      this._movedBlocksLinesPart.set(e207, void 0);
    }), this._register(O.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, (e207) => this._handleCursorPositionChange(e207, true))), this._register(O.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, (e207) => this._handleCursorPositionChange(e207, false)));
    let v10 = this._diffModel.map(this, (e207, t11) => {
      if (e207) return e207.diff.read(t11) === void 0 && !e207.isDiffUpToDate.read(t11);
    });
    this._register(vc((e207, t11) => {
      if (v10.read(e207) === true) {
        let e208 = this._editorProgressService.show(true, 1e3);
        t11.add(T(() => e208.done()));
      }
    })), this._register(vc((e207, t11) => {
      t11.add(new (jG(Fve))(this._editors, this._diffModel, this._options, this));
    })), this._register(vc((e207, t11) => {
      let n11 = this._diffModel.read(e207);
      if (n11) for (let e208 of [n11.model.original, n11.model.modified]) t11.add(e208.onWillDispose((e209) => {
        be(new je(`TextModel got disposed before DiffEditorWidget model got reset`)), this.setModel(null);
      }));
    })), this._register(hc((e207) => {
      this._options.setModel(this._diffModel.read(e207));
    }));
  }
  _createInnerEditor(e206, t10, n10, r10) {
    return e206.createInstance(Mk, t10, n10, r10);
  }
  _createDiffEditorContributions() {
    let e206 = of.getDiffEditorContributions();
    for (let t10 of e206) try {
      this._register(this._instantiationService.createInstance(t10.ctor, this));
    } catch (e207) {
      be(e207);
    }
  }
  get _targetEditor() {
    return this._editors.modified;
  }
  getEditorType() {
    return Qh.IDiffEditor;
  }
  layout(e206) {
    this._rootSizeObserver.observe(e206);
  }
  hasTextFocus() {
    return this._editors.original.hasTextFocus() || this._editors.modified.hasTextFocus();
  }
  saveViewState() {
    return { original: this._editors.original.saveViewState(), modified: this._editors.modified.saveViewState(), modelState: this._diffModel.get()?.serializeState() };
  }
  restoreViewState(e206) {
    if (e206 && e206.original && e206.modified) {
      let t10 = e206;
      this._editors.original.restoreViewState(t10.original), this._editors.modified.restoreViewState(t10.modified), t10.modelState && this._diffModel.get()?.restoreSerializedState(t10.modelState);
    }
  }
  handleInitialized() {
    this._editors.original.handleInitialized(), this._editors.modified.handleInitialized();
  }
  createViewModel(e206) {
    return this._instantiationService.createInstance(EK, e206, this._options);
  }
  getModel() {
    return this._diffModel.get()?.model ?? null;
  }
  setModel(e206) {
    let t10 = e206 ? `model` in e206 ? QG.create(e206).createNewRef(this) : QG.create(this.createViewModel(e206), this) : null;
    this.setDiffModel(t10);
  }
  setDiffModel(e206, t10) {
    let n10 = this._diffModel.get();
    !e206 && n10 && this._accessibleDiffViewer.get().close(), this._diffModel.get() !== e206?.object && Cc(t10, (t11) => {
      let n11 = e206?.object;
      Tc.batchEventsGlobally(t11, () => {
        this._editors.original.setModel(n11 ? n11.model.original : null), this._editors.modified.setModel(n11 ? n11.model.modified : null);
      });
      let r10 = this._diffModelSrc.get()?.createNewRef(this);
      this._diffModelSrc.set(e206?.createNewRef(this), t11), setTimeout(() => {
        r10?.dispose();
      }, 0);
    });
  }
  updateOptions(e206) {
    this._options.updateOptions(e206);
  }
  getContainerDomNode() {
    return this._domElement;
  }
  getOriginalEditor() {
    return this._editors.original;
  }
  getModifiedEditor() {
    return this._editors.modified;
  }
  getLineChanges() {
    let e206 = this._diffModel.get()?.diff.get();
    return e206 ? Lve(e206) : null;
  }
  getDiffComputationResult() {
    let e206 = this._diffModel.get()?.diff.get();
    return e206 ? { changes: this.getLineChanges(), changes2: e206.mappings.map((e207) => e207.lineRangeMapping), identical: e206.identical, quitEarly: e206.quitEarly } : null;
  }
  revert(e206) {
    let t10 = this._diffModel.get();
    !t10 || !t10.isDiffUpToDate.get() || (this._editors.modified.pushUndoStop(), this._editors.modified.executeEdits(`diffEditor`, [{ range: e206.modified.toExclusiveRange(), text: t10.model.original.getValueInRange(e206.original.toExclusiveRange()) }]), this._editors.modified.pushUndoStop());
  }
  revertRangeMappings(e206) {
    let t10 = this._diffModel.get();
    if (!t10 || !t10.isDiffUpToDate.get()) return;
    let n10 = e206.map((e207) => ({ range: e207.modifiedRange, text: t10.model.original.getValueInRange(e207.originalRange) }));
    this._editors.modified.pushUndoStop(), this._editors.modified.executeEdits(`diffEditor`, n10), this._editors.modified.pushUndoStop();
  }
  revertFocusedRangeMappings() {
    let e206 = this._diffModel.get();
    if (!e206 || !e206.isDiffUpToDate.get()) return;
    let t10 = this._diffModel.get()?.diff.get()?.mappings;
    if (!t10 || t10.length === 0) return;
    let n10 = this._editors.modified;
    if (!n10.hasTextFocus()) return;
    let r10 = n10.getPosition().lineNumber, i10 = n10.getSelection(), a10 = zm.fromRange(i10 || new M(r10, 0, r10, 0)), o10 = t10.filter((e207) => e207.lineRangeMapping.modified.intersect(a10));
    n10.pushUndoStop(), n10.executeEdits(`diffEditor`, o10.map((t11) => ({ range: t11.lineRangeMapping.modified.toExclusiveRange(), text: e206.model.original.getValueInRange(t11.lineRangeMapping.original.toExclusiveRange()) }))), n10.pushUndoStop();
  }
  _goTo(e206) {
    this._editors.modified.setPosition(new j(e206.lineRangeMapping.modified.startLineNumber, 1)), this._editors.modified.revealRangeInCenter(e206.lineRangeMapping.modified.toExclusiveRange());
  }
  goToDiff(e206) {
    let t10 = this._diffModel.get()?.diff.get()?.mappings;
    if (!t10 || t10.length === 0) return;
    let n10 = this._editors.modified.getPosition().lineNumber, r10;
    r10 = e206 === `next` ? this._editors.modified.getModel().getLineCount() === n10 ? t10[0] : t10.find((e207) => e207.lineRangeMapping.modified.startLineNumber > n10) ?? t10[0] : Dm(t10, (e207) => e207.lineRangeMapping.modified.startLineNumber < n10) ?? t10[t10.length - 1], this._goTo(r10), r10.lineRangeMapping.modified.isEmpty ? this._accessibilitySignalService.playSignal(qW.diffLineDeleted, { source: `diffEditor.goToDiff` }) : r10.lineRangeMapping.original.isEmpty ? this._accessibilitySignalService.playSignal(qW.diffLineInserted, { source: `diffEditor.goToDiff` }) : r10 && this._accessibilitySignalService.playSignal(qW.diffLineModified, { source: `diffEditor.goToDiff` });
  }
  revealFirstDiff() {
    let e206 = this._diffModel.get();
    e206 && this.waitForDiff().then(() => {
      let t10 = e206.diff.get()?.mappings;
      !t10 || t10.length === 0 || this._goTo(t10[0]);
    });
  }
  accessibleDiffViewerNext() {
    this._accessibleDiffViewer.get().next();
  }
  accessibleDiffViewerPrev() {
    this._accessibleDiffViewer.get().prev();
  }
  async waitForDiff() {
    let e206 = this._diffModel.get();
    e206 && await e206.waitForDiff();
  }
  mapToOtherSide() {
    let e206 = this._editors.modified.hasWidgetFocus(), t10 = e206 ? this._editors.modified : this._editors.original, n10 = e206 ? this._editors.original : this._editors.modified, r10, i10 = t10.getSelection();
    if (i10) {
      let t11 = this._diffModel.get()?.diff.get()?.mappings.map((t12) => e206 ? t12.lineRangeMapping.flip() : t12.lineRangeMapping);
      if (t11) {
        let e207 = YG(i10.getStartPosition(), t11), n11 = YG(i10.getEndPosition(), t11);
        r10 = M.plusRange(e207, n11);
      }
    }
    return { destination: n10, destinationSelection: r10 };
  }
  switchSide() {
    let { destination: e206, destinationSelection: t10 } = this.mapToOtherSide();
    e206.focus(), t10 && e206.setSelection(t10);
  }
  exitCompareMove() {
    let e206 = this._diffModel.get();
    e206 && e206.movedTextToCompare.set(void 0, void 0);
  }
  collapseAllUnchangedRegions() {
    let e206 = this._diffModel.get()?.unchangedRegions.get();
    e206 && bc((t10) => {
      for (let n10 of e206) n10.collapseAll(t10);
    });
  }
  showAllUnchangedRegions() {
    let e206 = this._diffModel.get()?.unchangedRegions.get();
    e206 && bc((t10) => {
      for (let n10 of e206) n10.showAll(t10);
    });
  }
  _handleCursorPositionChange(e206, t10) {
    if (e206?.reason === 3) {
      let n10 = this._diffModel.get()?.diff.get()?.mappings.find((n11) => t10 ? n11.lineRangeMapping.modified.contains(e206.position.lineNumber) : n11.lineRangeMapping.original.contains(e206.position.lineNumber));
      n10?.lineRangeMapping.modified.isEmpty ? this._accessibilitySignalService.playSignal(qW.diffLineDeleted, { source: `diffEditor.cursorPositionChanged` }) : n10?.lineRangeMapping.original.isEmpty ? this._accessibilitySignalService.playSignal(qW.diffLineInserted, { source: `diffEditor.cursorPositionChanged` }) : n10 && this._accessibilitySignalService.playSignal(qW.diffLineModified, { source: `diffEditor.cursorPositionChanged` });
    }
  }
};
xq = Ive([bq(3, nd), bq(4, V), bq(5, Su), bq(6, WW), bq(7, UF)], xq);
function Lve(e206) {
  return e206.mappings.map((e207) => {
    let t10 = e207.lineRangeMapping, n10, r10, i10, a10, o10 = t10.innerChanges;
    return t10.original.isEmpty ? (n10 = t10.original.startLineNumber - 1, r10 = 0, o10 = void 0) : (n10 = t10.original.startLineNumber, r10 = t10.original.endLineNumberExclusive - 1), t10.modified.isEmpty ? (i10 = t10.modified.startLineNumber - 1, a10 = 0, o10 = void 0) : (i10 = t10.modified.startLineNumber, a10 = t10.modified.endLineNumberExclusive - 1), { originalStartLineNumber: n10, originalEndLineNumber: r10, modifiedStartLineNumber: i10, modifiedEndLineNumber: a10, charChanges: o10?.map((e208) => ({ originalStartLineNumber: e208.originalRange.startLineNumber, originalStartColumn: e208.originalRange.startColumn, originalEndLineNumber: e208.originalRange.endLineNumber, originalEndColumn: e208.originalRange.endColumn, modifiedStartLineNumber: e208.modifiedRange.startLineNumber, modifiedStartColumn: e208.modifiedRange.startColumn, modifiedEndLineNumber: e208.modifiedRange.endLineNumber, modifiedEndColumn: e208.modifiedRange.endColumn })) };
  });
}
function Sq(e206) {
  return e206 && typeof e206.getEditorType == `function` ? e206.getEditorType() === Qh.ICodeEditor : false;
}
function Cq(e206) {
  return e206 && typeof e206.getEditorType == `function` ? e206.getEditorType() === Qh.IDiffEditor : false;
}
function Rve(e206) {
  return !!e206 && typeof e206 == `object` && typeof e206.onDidChangeActiveEditor == `function`;
}
function wq(e206) {
  return Sq(e206) ? e206 : Cq(e206) ? e206.getModifiedEditor() : Rve(e206) && Sq(e206.activeCodeEditor) ? e206.activeCodeEditor : null;
}
var zve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Tq = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Eq, Dq = (_Db = class {
  constructor(e206, t10) {
    this._configurationService = e206, this._languageService = t10;
  }
  async renderCodeBlock(e206, t10, n10) {
    let r10 = Sq(n10.context) ? n10.context : void 0, i10;
    e206 ? i10 = this._languageService.getLanguageIdByLanguageName(e206) : r10 && (i10 = r10.getModel()?.getLanguageId()), i10 || (i10 = hp);
    let a10 = await jfe(this._languageService, t10, i10), o10 = Eq._ttpTokenizer ? Eq._ttpTokenizer.createHTML(a10) ?? a10 : a10, s10 = document.createElement(`span`);
    s10.innerHTML = o10;
    let c10 = s10.querySelector(`.monaco-tokenized-source`);
    return Fl(c10) ? (vu(c10, this.getFontInfo(r10)), s10) : document.createElement(`span`);
  }
  getFontInfo(e206) {
    return e206 ? e206.getOption(59) : Fae({ fontFamily: this._configurationService.getValue(`editor`).fontFamily }, 1);
  }
}, Eq = _Db, _Db._ttpTokenizer = _f2(`tokenizeToString`, { createHTML(e206) {
  return e206;
} }), _Db);
Dq = Eq = zve([Tq(0, Uf), Tq(1, Jf)], Dq);
var Oq = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, kq = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Bve = 0, Aq = false;
function Vve(e206) {
  if (!e206) {
    if (Aq) return;
    Aq = true;
  }
  kae(e206 || Aa.document.body);
}
var jq = class extends Mk {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10, p10) {
    let m10 = { ...t10 };
    m10.ariaLabel = m10.ariaLabel || tI.editorViewAccessibleLabel, super(e206, m10, {}, n10, r10, i10, a10, c10, l10, u10, d10, f10), s10 instanceof dG ? this._standaloneKeybindingService = s10 : this._standaloneKeybindingService = null, Vve(m10.ariaContainerElement), yge((e207, t11) => n10.createInstance(dj, e207, { instantHover: t11 }, {})), bge(o10), p10.setDefaultCodeBlockRenderer(n10.createInstance(Dq));
  }
  addCommand(e206, t10, n10) {
    if (!this._standaloneKeybindingService) return console.warn(`Cannot add command because the editor is configured with an unrecognized KeybindingService`), null;
    let r10 = `DYNAMIC_` + ++Bve, i10 = H.deserialize(n10);
    return this._standaloneKeybindingService.addDynamicKeybinding(r10, e206, t10, i10), r10;
  }
  createContextKey(e206, t10) {
    return this._contextKeyService.createKey(e206, t10);
  }
  addAction(e206) {
    if (typeof e206.id != `string` || typeof e206.label != `string` || typeof e206.run != `function`) throw Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");
    if (!this._standaloneKeybindingService) return console.warn(`Cannot add keybinding because the editor is configured with an unrecognized KeybindingService`), D.None;
    let t10 = e206.id, n10 = e206.label, r10 = H.and(H.equals(`editorId`, this.getId()), H.deserialize(e206.precondition)), i10 = e206.keybindings, a10 = H.and(r10, H.deserialize(e206.keybindingContext)), o10 = e206.contextMenuGroupId || null, s10 = e206.contextMenuOrder || 0, c10 = (t11, ...n11) => Promise.resolve(e206.run(this, ...n11)), l10 = new E(), u10 = this.getId() + `:` + t10;
    if (l10.add(Nu.registerCommand(u10, c10)), o10) {
      let e207 = { command: { id: u10, title: n10 }, when: r10, group: o10, order: s10 };
      l10.add(hd.appendMenuItem(W.EditorContext, e207));
    }
    if (Array.isArray(i10)) for (let e207 of i10) l10.add(this._standaloneKeybindingService.addDynamicKeybinding(u10, e207, c10, a10));
    let d10 = new fT(u10, n10, n10, void 0, r10, (...t11) => Promise.resolve(e206.run(this, ...t11)), this._contextKeyService);
    return this._actions.set(t10, d10), l10.add(T(() => {
      this._actions.delete(t10);
    })), l10;
  }
  _triggerCommand(e206, t10) {
    if (this._codeEditorService instanceof zk) try {
      this._codeEditorService.setActiveCodeEditor(this), super._triggerCommand(e206, t10);
    } finally {
      this._codeEditorService.setActiveCodeEditor(null);
    }
    else super._triggerCommand(e206, t10);
  }
};
jq = Oq([kq(2, V), kq(3, Su), kq(4, Mu), kq(5, nd), kq(6, uj), kq(7, Dw), kq(8, US), kq(9, dw), kq(10, e_), kq(11, bp), kq(12, X), kq(13, LP)], jq);
var Mq = class extends jq {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10, p10, m10, h10, g10) {
    let _10 = { ...t10 };
    yG(u10, _10, false);
    let v10 = c10.registerEditorContainer(e206);
    typeof _10.theme == `string` && c10.setTheme(_10.theme), _10.autoDetectHighContrast !== void 0 && c10.setAutoDetectHighContrast(!!_10.autoDetectHighContrast);
    let y10 = _10.model;
    delete _10.model, super(e206, _10, n10, r10, i10, a10, o10, s10, c10, l10, d10, m10, h10, g10), this._configurationService = u10, this._standaloneThemeService = c10, this._register(v10);
    let b10;
    if (y10 === void 0) {
      let e207 = p10.getLanguageIdByMimeType(_10.language) || _10.language || `plaintext`;
      b10 = Pq(f10, p10, _10.value || ``, e207, void 0), this._ownsModel = true;
    } else b10 = y10, this._ownsModel = false;
    if (this._attachModel(b10), b10) {
      let e207 = { oldModelUrl: null, newModelUrl: b10.uri };
      this._onDidChangeModel.fire(e207);
    }
  }
  dispose() {
    super.dispose();
  }
  updateOptions(e206) {
    yG(this._configurationService, e206, false), typeof e206.theme == `string` && this._standaloneThemeService.setTheme(e206.theme), e206.autoDetectHighContrast !== void 0 && this._standaloneThemeService.setAutoDetectHighContrast(!!e206.autoDetectHighContrast), super.updateOptions(e206);
  }
  _postDetachModelCleanup(e206) {
    super._postDetachModelCleanup(e206), e206 && this._ownsModel && (e206.dispose(), this._ownsModel = false);
  }
};
Mq = Oq([kq(2, V), kq(3, Su), kq(4, Mu), kq(5, nd), kq(6, uj), kq(7, Dw), kq(8, YU), kq(9, dw), kq(10, Uf), kq(11, e_), kq(12, Cu), kq(13, Jf), kq(14, bp), kq(15, X), kq(16, LP)], Mq);
var Nq = class extends xq {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10) {
    let f10 = { ...t10 };
    yG(s10, f10, true);
    let p10 = a10.registerEditorContainer(e206);
    typeof f10.theme == `string` && a10.setTheme(f10.theme), f10.autoDetectHighContrast !== void 0 && a10.setAutoDetectHighContrast(!!f10.autoDetectHighContrast), super(e206, f10, {}, r10, n10, i10, d10, l10), this._configurationService = s10, this._standaloneThemeService = a10, this._register(p10);
  }
  dispose() {
    super.dispose();
  }
  updateOptions(e206) {
    yG(this._configurationService, e206, true), typeof e206.theme == `string` && this._standaloneThemeService.setTheme(e206.theme), e206.autoDetectHighContrast !== void 0 && this._standaloneThemeService.setAutoDetectHighContrast(!!e206.autoDetectHighContrast), super.updateOptions(e206);
  }
  _createInnerEditor(e206, t10, n10) {
    return e206.createInstance(jq, t10, n10);
  }
  getOriginalEditor() {
    return super.getOriginalEditor();
  }
  getModifiedEditor() {
    return super.getModifiedEditor();
  }
  addCommand(e206, t10, n10) {
    return this.getModifiedEditor().addCommand(e206, t10, n10);
  }
  createContextKey(e206, t10) {
    return this.getModifiedEditor().createContextKey(e206, t10);
  }
  addAction(e206) {
    return this.getModifiedEditor().addAction(e206);
  }
};
Nq = Oq([kq(2, V), kq(3, nd), kq(4, Su), kq(5, YU), kq(6, dw), kq(7, Uf), kq(8, mj), kq(9, UF), kq(10, hW), kq(11, WW)], Nq);
function Pq(e206, t10, n10, r10, i10) {
  if (n10 || (n10 = ``), !r10) {
    let r11 = n10.indexOf(`
`), a10 = n10;
    return r11 !== -1 && (a10 = n10.substring(0, r11)), Fq(e206, n10, t10.createByFilepathOrFirstLine(i10 || null, a10), i10);
  }
  return Fq(e206, n10, t10.createById(r10), i10);
}
function Fq(e206, t10, n10, r10) {
  return e206.createModel(t10, n10, r10);
}
Q(`multiDiffEditor.headerBackground`, { dark: `#262626`, light: `tab.inactiveBackground`, hcDark: `tab.inactiveBackground`, hcLight: `tab.inactiveBackground` }, C(142, `The background color of the diff editor's header`)), Q(`multiDiffEditor.background`, rv, C(143, `The background color of the multi file diff editor`)), Q(`multiDiffEditor.border`, { dark: `sideBarSectionHeader.border`, light: `#cccccc`, hcDark: `sideBarSectionHeader.border`, hcLight: `#cccccc` }, C(144, `The border color of the multi file diff editor`));
var Hve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Iq = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Uve = class {
  constructor(e206, t10) {
    this.viewModel = e206, this.deltaScrollVertical = t10;
  }
  getId() {
    return this.viewModel;
  }
}, Lq = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._container = e206, this._overflowWidgetsDomNode = t10, this._workbenchUIElementFactory = n10, this._instantiationService = r10, this._viewModel = Ic(this, void 0), this._collapsed = I(this, (e207) => this._viewModel.read(e207)?.collapsed.read(e207)), this._editorContentHeight = Ic(this, 500), this.contentHeight = I(this, (e207) => (this._collapsed.read(e207) ? 0 : this._editorContentHeight.read(e207)) + this._outerEditorHeight), this._modifiedContentWidth = Ic(this, 0), this._modifiedWidth = Ic(this, 0), this._originalContentWidth = Ic(this, 0), this._originalWidth = Ic(this, 0), this.maxScroll = I(this, (e207) => {
      let t11 = this._modifiedContentWidth.read(e207) - this._modifiedWidth.read(e207), n11 = this._originalContentWidth.read(e207) - this._originalWidth.read(e207);
      return t11 > n11 ? { maxScroll: t11, width: this._modifiedWidth.read(e207) } : { maxScroll: n11, width: this._originalWidth.read(e207) };
    }), this._elements = nu(`div.multiDiffEntry`, [nu(`div.header@header`, [nu(`div.header-content`, [nu(`div.collapse-button@collapseButton`), nu(`div.file-path`, [nu(`div.title.modified.show-file-icons@primaryPath`, []), nu(`div.status.deleted@status`, [`R`]), nu(`div.title.original.show-file-icons@secondaryPath`, [])]), nu(`div.actions@actions`)])]), nu(`div.editorParent`, [nu(`div.editorContainer@editor`)])]), this.editor = this._register(this._instantiationService.createInstance(xq, this._elements.editor, { overflowWidgetsDomNode: this._overflowWidgetsDomNode, fixedOverflowWidgets: true }, {})), this.isModifedFocused = WK(this.editor.getModifiedEditor()).isFocused, this.isOriginalFocused = WK(this.editor.getOriginalEditor()).isFocused, this.isFocused = I(this, (e207) => this.isModifedFocused.read(e207) || this.isOriginalFocused.read(e207)), this._resourceLabel = this._workbenchUIElementFactory.createResourceLabel ? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)) : void 0, this._resourceLabel2 = this._workbenchUIElementFactory.createResourceLabel ? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)) : void 0, this._dataStore = this._register(new E()), this._headerHeight = 40, this._lastScrollTop = -1, this._isSettingScrollTop = false;
    let a10 = new yR(this._elements.collapseButton, {});
    this._register(hc((e207) => {
      a10.element.className = ``, a10.icon = this._collapsed.read(e207) ? F.chevronRight : F.chevronDown;
    })), this._register(a10.onDidClick(() => {
      this._viewModel.get()?.collapsed.set(!this._collapsed.get(), void 0);
    })), this._register(hc((e207) => {
      this._elements.editor.style.display = this._collapsed.read(e207) ? `none` : `block`;
    })), this._register(this.editor.getModifiedEditor().onDidLayoutChange((e207) => {
      let t11 = this.editor.getModifiedEditor().getLayoutInfo().contentWidth;
      this._modifiedWidth.set(t11, void 0);
    })), this._register(this.editor.getOriginalEditor().onDidLayoutChange((e207) => {
      let t11 = this.editor.getOriginalEditor().getLayoutInfo().contentWidth;
      this._originalWidth.set(t11, void 0);
    })), this._register(this.editor.onDidContentSizeChange((e207) => {
      Sc((t11) => {
        this._editorContentHeight.set(e207.contentHeight, t11), this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), t11), this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), t11);
      });
    })), this._register(this.editor.getOriginalEditor().onDidScrollChange((e207) => {
      if (this._isSettingScrollTop || !e207.scrollTopChanged || !this._data) return;
      let t11 = e207.scrollTop - this._lastScrollTop;
      this._data.deltaScrollVertical(t11);
    })), this._register(hc((e207) => {
      let t11 = this._viewModel.read(e207)?.isActive.read(e207);
      this._elements.root.classList.toggle(`active`, t11);
    })), this._container.appendChild(this._elements.root), this._outerEditorHeight = this._headerHeight, this._contextKeyService = this._register(i10.createScoped(this._elements.actions));
    let o10 = this._register(this._instantiationService.createChild(new kk([nd, this._contextKeyService])));
    this._register(o10.createInstance(iq, this._elements.actions, W.MultiDiffEditorFileToolbar, { actionRunner: this._register(new oq(() => this._viewModel.get()?.modifiedUri ?? this._viewModel.get()?.originalUri)), menuOptions: { shouldForwardArgs: true }, toolbarOptions: { primaryGroup: (e207) => e207.startsWith(`navigation`) }, actionViewItemProvider: (e207, t11) => SL(o10, e207, t11) }));
  }
  setScrollLeft(e206) {
    this._modifiedContentWidth.get() - this._modifiedWidth.get() > this._originalContentWidth.get() - this._originalWidth.get() ? this.editor.getModifiedEditor().setScrollLeft(e206) : this.editor.getOriginalEditor().setScrollLeft(e206);
  }
  setData(e206) {
    this._data = e206;
    function t10(e207) {
      return { ...e207, scrollBeyondLastLine: false, hideUnchangedRegions: { enabled: true }, scrollbar: { vertical: `hidden`, horizontal: `hidden`, handleMouseWheel: false, useShadows: false }, renderOverviewRuler: false, fixedOverflowWidgets: true, overviewRulerBorder: false };
    }
    if (!e206) {
      Sc((e207) => {
        this._viewModel.set(void 0, e207), this.editor.setDiffModel(null, e207), this._dataStore.clear();
      });
      return;
    }
    let n10 = e206.viewModel.documentDiffItem;
    if (Sc((r10) => {
      this._resourceLabel?.setUri(e206.viewModel.modifiedUri ?? e206.viewModel.originalUri, { strikethrough: e206.viewModel.modifiedUri === void 0 });
      let i10 = false, a10 = false, o10 = false, s10 = ``;
      e206.viewModel.modifiedUri && e206.viewModel.originalUri && e206.viewModel.modifiedUri.path !== e206.viewModel.originalUri.path ? (s10 = `R`, i10 = true) : e206.viewModel.modifiedUri ? e206.viewModel.originalUri || (s10 = `A`, o10 = true) : (s10 = `D`, a10 = true), this._elements.status.classList.toggle(`renamed`, i10), this._elements.status.classList.toggle(`deleted`, a10), this._elements.status.classList.toggle(`added`, o10), this._elements.status.innerText = s10, this._resourceLabel2?.setUri(i10 ? e206.viewModel.originalUri : void 0, { strikethrough: true }), this._dataStore.clear(), this._viewModel.set(e206.viewModel, r10), this.editor.setDiffModel(e206.viewModel.diffEditorViewModelRef, r10), this.editor.updateOptions(t10(n10.options ?? {}));
    }), n10.onOptionsDidChange && this._dataStore.add(n10.onOptionsDidChange(() => {
      this.editor.updateOptions(t10(n10.options ?? {}));
    })), e206.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, (e207) => {
      e207 || this.setData(void 0);
    }), e206.viewModel.documentDiffItem.contextKeys) for (let [t11, n11] of Object.entries(e206.viewModel.documentDiffItem.contextKeys)) this._contextKeyService.createKey(t11, n11);
  }
  render(e206, t10, n10, r10) {
    this._elements.root.style.visibility = `visible`, this._elements.root.style.top = `${e206.start}px`, this._elements.root.style.height = `${e206.length}px`, this._elements.root.style.width = `${t10}px`, this._elements.root.style.position = `absolute`;
    let i10 = e206.length - this._headerHeight, a10 = Math.max(0, Math.min(r10.start - e206.start, i10));
    this._elements.header.style.transform = `translateY(${a10}px)`, Sc((n11) => {
      this.editor.layout({ width: t10 - 16 - 2, height: e206.length - this._outerEditorHeight });
    });
    try {
      this._isSettingScrollTop = true, this._lastScrollTop = n10, this.editor.getOriginalEditor().setScrollTop(n10);
    } finally {
      this._isSettingScrollTop = false;
    }
    this._elements.header.classList.toggle(`shadow`, a10 > 0 || n10 > 0), this._elements.header.classList.toggle(`collapsed`, a10 === i10);
  }
  hide() {
    this._elements.root.style.top = `-100000px`, this._elements.root.style.visibility = `hidden`;
  }
};
Lq = Hve([Iq(3, V), Iq(4, nd)], Lq);
var Wve = class {
  constructor(e206) {
    this._create = e206, this._unused = /* @__PURE__ */ new Set(), this._used = /* @__PURE__ */ new Set(), this._itemData = /* @__PURE__ */ new Map();
  }
  getUnusedObj(e206) {
    let t10;
    if (this._unused.size === 0) t10 = this._create(e206), this._itemData.set(t10, e206);
    else {
      let n10 = [...this._unused.values()];
      t10 = n10.find((t11) => this._itemData.get(t11).getId() === e206.getId()) ?? n10[0], this._unused.delete(t10), this._itemData.set(t10, e206), t10.setData(e206);
    }
    return this._used.add(t10), { object: t10, dispose: () => {
      this._used.delete(t10), this._unused.size > 5 ? t10.dispose() : this._unused.add(t10);
    } };
  }
  dispose() {
    for (let e206 of this._used) e206.dispose();
    for (let e206 of this._unused) e206.dispose();
    this._used.clear(), this._unused.clear();
  }
}, Gve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Rq = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, zq = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._element = e206, this._dimension = t10, this._viewModel = n10, this._workbenchUIElementFactory = r10, this._parentContextKeyService = i10, this._parentInstantiationService = a10, this._scrollableElements = nu(`div.scrollContent`, [nu(`div@content`, { style: { overflow: `hidden` } }), nu(`div.monaco-editor@overflowWidgetsDomNode`, {})]), this._scrollable = this._register(new ox({ forceIntegerValues: false, scheduleAtNextAnimationFrame: (e207) => cl(Vc(this._element), e207), smoothScrollDuration: 100 })), this._scrollableElement = this._register(new mx(this._scrollableElements.root, { vertical: 1, horizontal: 1, useShadows: false }, this._scrollable)), this._elements = nu(`div.monaco-component.multiDiffEditor`, {}, [nu(`div`, {}, [this._scrollableElement.getDomNode()]), nu(`div.placeholder@placeholder`, {}, [nu(`div`)])]), this._sizeObserver = this._register(new BG(this._element, void 0)), this._objectPool = this._register(new Wve((e207) => {
      let t11 = this._instantiationService.createInstance(Lq, this._scrollableElements.content, this._scrollableElements.overflowWidgetsDomNode, this._workbenchUIElementFactory);
      return t11.setData(e207), t11;
    })), this.scrollTop = Tc(this, this._scrollableElement.onScroll, () => this._scrollableElement.getScrollPosition().scrollTop), this.scrollLeft = Tc(this, this._scrollableElement.onScroll, () => this._scrollableElement.getScrollPosition().scrollLeft), this._viewItemsInfo = I(this, (e207) => {
      let t11 = this._viewModel.read(e207);
      if (!t11) return { items: [], getItem: (e208) => {
        throw new je();
      } };
      let n11 = t11.items.read(e207), r11 = /* @__PURE__ */ new Map();
      return { items: n11.map((t12) => {
        let n12 = e207.store.add(new qve(t12, this._objectPool, this.scrollLeft, (e208) => {
          this._scrollableElement.setScrollPosition({ scrollTop: this._scrollableElement.getScrollPosition().scrollTop + e208 });
        })), i11 = this._lastDocStates?.[n12.getKey()];
        return i11 && bc((e208) => {
          n12.setViewState(i11, e208);
        }), r11.set(t12, n12), n12;
      }), getItem: (e208) => r11.get(e208) };
    }), this._viewItems = this._viewItemsInfo.map(this, (e207) => e207.items), this._spaceBetweenPx = 0, this._totalHeight = this._viewItems.map(this, (e207, t11) => e207.reduce((e208, n11) => e208 + n11.contentHeight.read(t11) + this._spaceBetweenPx, 0)), this.activeControl = I(this, (e207) => {
      let t11 = this._viewModel.read(e207)?.activeDiffItem.read(e207);
      if (t11) return this._viewItemsInfo.read(e207).getItem(t11).template.read(e207)?.editor;
    }), this._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._element)), this._instantiationService = this._register(this._parentInstantiationService.createChild(new kk([nd, this._contextKeyService]))), this._contextKeyService.createKey($.inMultiDiffEditor.key, true), this._lastDocStates = {}, this._register(vc((e207, t11) => {
      let n11 = this._viewModel.read(e207);
      if (n11 && n11.contextKeys) for (let [e208, r11] of Object.entries(n11.contextKeys)) {
        let n12 = this._contextKeyService.createKey(e208, void 0);
        n12.set(r11), t11.add(T(() => n12.reset()));
      }
    }));
    let o10 = this._parentContextKeyService.createKey($.multiDiffEditorAllCollapsed.key, false);
    this._register(hc((e207) => {
      let t11 = this._viewModel.read(e207);
      if (t11) {
        let n11 = t11.items.read(e207).every((t12) => t12.collapsed.read(e207));
        o10.set(n11);
      }
    })), this._register(hc((e207) => {
      let t11 = this._dimension.read(e207);
      this._sizeObserver.observe(t11);
    }));
    let s10 = I((e207) => {
      if (this._viewItems.read(e207).length > 0) return;
      let t11 = this._viewModel.read(e207);
      return !t11 || t11.isLoading.read(e207) ? C(145, `Loading...`) : C(146, `No Changed Files`);
    });
    this._register(hc((e207) => {
      let t11 = s10.read(e207);
      this._elements.placeholder.innerText = t11 ?? ``, this._elements.placeholder.classList.toggle(`visible`, !!t11);
    })), this._scrollableElements.content.style.position = `relative`, this._register(hc((e207) => {
      let t11 = this._sizeObserver.height.read(e207);
      this._scrollableElements.root.style.height = `${t11}px`;
      let n11 = this._totalHeight.read(e207);
      this._scrollableElements.content.style.height = `${n11}px`;
      let r11 = this._sizeObserver.width.read(e207), i11 = r11, a11 = Pm(this._viewItems.read(e207), ce((t12) => t12.maxScroll.read(e207).maxScroll, ue));
      a11 && (i11 = r11 + a11.maxScroll.read(e207).maxScroll), this._scrollableElement.setScrollDimensions({ width: r11, height: t11, scrollHeight: n11, scrollWidth: i11 });
    })), e206.replaceChildren(this._elements.root), this._register(T(() => {
      e206.replaceChildren();
    })), this._register(hc((e207) => {
      let t11 = this._viewModel.read(e207);
      if (t11 && !t11.isLoading.read(e207)) {
        if (t11.items.read(e207).length === 0 || t11.activeDiffItem.read(e207)) return;
        this.goToNextChange();
      }
    })), this._register(this._register(hc((e207) => {
      Sc((t11) => {
        this.render(e207);
      });
    })));
  }
  reveal(e206, t10) {
    let n10 = this._viewItems.get(), r10 = n10.findIndex((t11) => t11.viewModel.originalUri?.toString() === e206.original?.toString() && t11.viewModel.modifiedUri?.toString() === e206.modified?.toString());
    if (r10 === -1) throw new je(`Resource not found in diff editor`);
    let i10 = n10[r10];
    this._viewModel.get().activeDiffItem.setCache(i10.viewModel, void 0);
    let a10 = 0;
    for (let e207 = 0; e207 < r10; e207++) a10 += n10[e207].contentHeight.get() + this._spaceBetweenPx;
    this._scrollableElement.setScrollPosition({ scrollTop: a10 });
    let o10 = i10.template.get()?.editor, s10 = `original` in e206 ? o10?.getOriginalEditor() : o10?.getModifiedEditor();
    s10 && t10?.range && (s10.revealRangeInCenter(t10.range), Kve(s10, t10.range));
  }
  goToNextChange() {
    this._navigateToChange(`next`);
  }
  _navigateToChange(e206) {
    let t10 = this._viewItems.get();
    if (t10.length === 0) return;
    let n10 = this._viewModel.get()?.activeDiffItem.get(), r10 = n10 ? t10.findIndex((e207) => e207.viewModel === n10) : -1;
    if (r10 === -1) {
      this._goToFile(0, `first`);
      return;
    }
    let i10 = t10[r10];
    i10.viewModel.collapsed.get() && i10.viewModel.collapsed.set(false, void 0);
    let a10 = i10.template.get()?.editor;
    if (a10?.getDiffComputationResult()?.changes2?.length) {
      let t11 = a10.getModifiedEditor().getPosition()?.lineNumber || 1, n11 = a10.getDiffComputationResult().changes2;
      if (e206 === `next` ? n11.some((e207) => e207.modified.startLineNumber > t11) : n11.some((e207) => e207.modified.endLineNumberExclusive <= t11)) {
        a10.goToDiff(e206);
        return;
      }
    }
    let o10 = (r10 + (e206 === `next` ? 1 : -1) + t10.length) % t10.length;
    this._goToFile(o10, e206 === `next` ? `first` : `last`);
  }
  _goToFile(e206, t10) {
    let n10 = this._viewItems.get()[e206];
    n10.viewModel.collapsed.get() && n10.viewModel.collapsed.set(false, void 0), this.reveal({ original: n10.viewModel.originalUri, modified: n10.viewModel.modifiedUri });
    let r10 = n10.template.get()?.editor;
    if (r10?.getDiffComputationResult()?.changes2?.length) if (t10 === `first`) r10.revealFirstDiff();
    else {
      let e207 = r10.getDiffComputationResult().changes2.at(-1), t11 = r10.getModifiedEditor();
      t11.setPosition({ lineNumber: e207.modified.startLineNumber, column: 1 }), t11.revealLineInCenter(e207.modified.startLineNumber);
    }
    r10?.focus();
  }
  render(e206) {
    let t10 = this.scrollTop.read(e206), n10 = 0, r10 = 0, i10 = 0, a10 = this._sizeObserver.height.read(e206), o10 = Tm.ofStartAndLength(t10, a10), s10 = this._sizeObserver.width.read(e206);
    for (let c10 of this._viewItems.read(e206)) {
      let l10 = c10.contentHeight.read(e206), u10 = Math.min(l10, a10), d10 = Tm.ofStartAndLength(r10, u10), f10 = Tm.ofStartAndLength(i10, l10);
      if (f10.isBefore(o10)) n10 -= l10 - u10, c10.hide();
      else if (f10.isAfter(o10)) c10.hide();
      else {
        let e207 = Math.max(0, Math.min(o10.start - f10.start, l10 - u10));
        n10 -= e207;
        let r11 = Tm.ofStartAndLength(t10 + n10, a10);
        c10.render(d10, e207, s10, r11);
      }
      r10 += u10 + this._spaceBetweenPx, i10 += l10 + this._spaceBetweenPx;
    }
    this._scrollableElements.content.style.transform = `translateY(${-(t10 + n10)}px)`;
  }
};
zq = Gve([Rq(4, nd), Rq(5, V)], zq);
function Kve(e206, t10) {
  let n10 = e206.getModel(), r10 = e206.createDecorationsCollection([{ range: t10, options: { description: `symbol-navigate-action-highlight`, className: `symbolHighlight` } }]);
  setTimeout(() => {
    e206.getModel() === n10 && r10.clear();
  }, 350);
}
var qve = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this.viewModel = e206, this._objectPool = t10, this._scrollLeft = n10, this._deltaScrollVertical = r10, this._templateRef = this._register(Rc(this, void 0)), this.contentHeight = I(this, (e207) => this._templateRef.read(e207)?.object.contentHeight?.read(e207) ?? this.viewModel.lastTemplateData.read(e207).contentHeight), this.maxScroll = I(this, (e207) => this._templateRef.read(e207)?.object.maxScroll.read(e207) ?? { maxScroll: 0, scrollWidth: 0 }), this.template = I(this, (e207) => this._templateRef.read(e207)?.object), this._isHidden = Ic(this, false), this._isFocused = I(this, (e207) => this.template.read(e207)?.isFocused.read(e207) ?? false), this.viewModel.setIsFocused(this._isFocused, void 0), this._register(hc((e207) => {
      let t11 = this._scrollLeft.read(e207);
      this._templateRef.read(e207)?.object.setScrollLeft(t11);
    })), this._register(hc((e207) => {
      let t11 = this._templateRef.read(e207);
      t11 && this._isHidden.read(e207) && (t11.object.isFocused.read(e207) || this._clear());
    }));
  }
  dispose() {
    this._clear(), super.dispose();
  }
  toString() {
    return `VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`;
  }
  getKey() {
    return this.viewModel.getKey();
  }
  setViewState(e206, t10) {
    this.viewModel.collapsed.set(e206.collapsed, t10), this._updateTemplateData(t10);
    let n10 = this.viewModel.lastTemplateData.get(), r10 = e206.selections?.map(N.liftSelection);
    this.viewModel.lastTemplateData.set({ ...n10, selections: r10 }, t10);
    let i10 = this._templateRef.get();
    i10 && r10 && i10.object.editor.setSelections(r10);
  }
  _updateTemplateData(e206) {
    let t10 = this._templateRef.get();
    t10 && this.viewModel.lastTemplateData.set({ contentHeight: t10.object.contentHeight.get(), selections: t10.object.editor.getSelections() ?? void 0 }, e206);
  }
  _clear() {
    let e206 = this._templateRef.get();
    e206 && bc((t10) => {
      this._updateTemplateData(t10), e206.object.hide(), this._templateRef.set(void 0, t10);
    });
  }
  hide() {
    this._isHidden.set(true, void 0);
  }
  render(e206, t10, n10, r10) {
    this._isHidden.set(false, void 0);
    let i10 = this._templateRef.get();
    if (!i10) {
      i10 = this._objectPool.getUnusedObj(new Uve(this.viewModel, this._deltaScrollVertical)), this._templateRef.set(i10, void 0);
      let e207 = this.viewModel.lastTemplateData.get().selections;
      e207 && i10.object.editor.setSelections(e207);
    }
    i10.object.render(e206, n10, t10, r10);
  }
}, Jve = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Yve = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Bq = class extends D {
  constructor(e206, t10, n10) {
    super(), this._element = e206, this._workbenchUIElementFactory = t10, this._instantiationService = n10, this._dimension = Ic(this, void 0), this._viewModel = Ic(this, void 0), this._widgetImpl = I(this, (e207) => e207.store.add(this._instantiationService.createInstance(jG(zq), this._element, this._dimension, this._viewModel, this._workbenchUIElementFactory))), this._register(kc(this._widgetImpl));
  }
};
Bq = Jve([Yve(2, V)], Bq);
function Xve(e206, t10, n10) {
  return AG.initialize(n10 || {}).createInstance(Mq, e206, t10);
}
function Zve(e206) {
  return AG.get(Su).onCodeEditorAdd((t10) => {
    e206(t10);
  });
}
function Qve(e206) {
  return AG.get(Su).onDiffEditorAdd((t10) => {
    e206(t10);
  });
}
function $ve() {
  return AG.get(Su).listCodeEditors();
}
function eye() {
  return AG.get(Su).listDiffEditors();
}
function tye(e206, t10, n10) {
  return AG.initialize(n10 || {}).createInstance(Nq, e206, t10);
}
function nye(e206, t10) {
  return new Bq(e206, {}, AG.initialize(t10 || {}));
}
function rye(e206) {
  if (typeof e206.id != `string` || typeof e206.run != `function`) throw Error("Invalid command descriptor, `id` and `run` are required properties!");
  return Nu.registerCommand(e206.id, e206.run);
}
function iye(e206) {
  if (typeof e206.id != `string` || typeof e206.label != `string` || typeof e206.run != `function`) throw Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");
  let t10 = H.deserialize(e206.precondition), n10 = (n11, ...r11) => $d.runEditorCommand(n11, r11, t10, (t11, n12, r12) => Promise.resolve(e206.run(n12, ...r12))), r10 = new E();
  if (r10.add(Nu.registerCommand(e206.id, n10)), e206.contextMenuGroupId) {
    let n11 = { command: { id: e206.id, title: e206.label }, when: t10, group: e206.contextMenuGroupId, order: e206.contextMenuOrder || 0 };
    r10.add(hd.appendMenuItem(W.EditorContext, n11));
  }
  if (Array.isArray(e206.keybindings)) {
    let n11 = AG.get(Dw);
    if (!(n11 instanceof dG)) console.warn(`Cannot add keybinding because the editor is configured with an unrecognized KeybindingService`);
    else {
      let i10 = H.and(t10, H.deserialize(e206.keybindingContext));
      r10.add(n11.addDynamicKeybindings(e206.keybindings.map((t11) => ({ keybinding: t11, command: e206.id, when: i10 }))));
    }
  }
  return r10;
}
function aye(e206) {
  return Vq([e206]);
}
function Vq(e206) {
  let t10 = AG.get(Dw);
  return t10 instanceof dG ? t10.addDynamicKeybindings(e206.map((e207) => ({ keybinding: e207.keybinding, command: e207.command, commandArgs: e207.commandArgs, when: H.deserialize(e207.when) }))) : (console.warn(`Cannot add keybinding because the editor is configured with an unrecognized KeybindingService`), D.None);
}
function oye(e206, t10, n10) {
  let r10 = AG.get(Jf), i10 = r10.getLanguageIdByMimeType(t10) || t10;
  return Pq(AG.get(Cu), r10, e206, i10, n10);
}
function sye(e206, t10) {
  let n10 = AG.get(Jf), r10 = n10.getLanguageIdByMimeType(t10) || t10 || `plaintext`;
  e206.setLanguage(n10.createById(r10));
}
function cye(e206, t10, n10) {
  e206 && AG.get(GL).changeOne(t10, e206.uri, n10);
}
function lye(e206) {
  AG.get(GL).changeAll(e206, []);
}
function uye(e206) {
  return AG.get(GL).read(e206);
}
function dye(e206) {
  return AG.get(GL).onMarkerChanged(e206);
}
function fye(e206) {
  return AG.get(Cu).getModel(e206);
}
function pye() {
  return AG.get(Cu).getModels();
}
function mye(e206) {
  return AG.get(Cu).onModelAdded(e206);
}
function hye(e206) {
  return AG.get(Cu).onModelRemoved(e206);
}
function gye(e206) {
  return AG.get(Cu).onModelLanguageChanged((t10) => {
    e206({ model: t10.model, oldLanguage: t10.oldLanguageId });
  });
}
function _ye(e206) {
  return Xie(AG.get(Cu), e206);
}
function vye(e206, t10) {
  let n10 = AG.get(Jf), r10 = AG.get(YU);
  return Ig.colorizeElement(r10, n10, e206, t10).then(() => {
    r10.registerEditorContainer(e206);
  });
}
function yye(e206, t10, n10) {
  let r10 = AG.get(Jf);
  return AG.get(YU).registerEditorContainer(Aa.document.body), Ig.colorize(r10, e206, t10, n10);
}
function bye(e206, t10, n10 = 4) {
  return AG.get(YU).registerEditorContainer(Aa.document.body), Ig.colorizeModelLine(e206, t10, n10);
}
function xye(e206) {
  return Pi.get(e206) || { getInitialState: () => $h, tokenize: (t10, n10, r10) => eg(e206, r10) };
}
function Sye(e206, t10) {
  Pi.getOrCreate(t10);
  let n10 = xye(t10), r10 = Wa(e206), i10 = [], a10 = n10.getInitialState();
  for (let e207 = 0, t11 = r10.length; e207 < t11; e207++) {
    let t12 = r10[e207], o10 = n10.tokenize(t12, true, a10);
    i10[e207] = o10.tokens, a10 = o10.endState;
  }
  return i10;
}
function Cye(e206, t10) {
  AG.get(YU).defineTheme(e206, t10);
}
function wye(e206) {
  AG.get(YU).setTheme(e206);
}
function Tye() {
  yu.clearAllFontInfos();
}
function Eye(e206, t10) {
  return Nu.registerCommand({ id: e206, handler: t10 });
}
function Dye(e206) {
  return AG.get(IP).registerOpener({ async open(t10) {
    return typeof t10 == `string` && (t10 = $r.parse(t10)), e206.open(t10);
  } });
}
function Oye(e206) {
  return AG.get(Su).registerCodeEditorOpenHandler(async (t10, n10, r10) => {
    if (!n10) return null;
    let i10 = t10.options?.selection, a10;
    return i10 && typeof i10.endLineNumber == `number` && typeof i10.endColumn == `number` ? a10 = i10 : i10 && (a10 = { lineNumber: i10.startLineNumber, column: i10.startColumn }), await e206.openCodeEditor(n10, t10.resource, a10) ? n10 : null;
  });
}
function kye() {
  return { create: Xve, getEditors: $ve, getDiffEditors: eye, onDidCreateEditor: Zve, onDidCreateDiffEditor: Qve, createDiffEditor: tye, addCommand: rye, addEditorAction: iye, addKeybindingRule: aye, addKeybindingRules: Vq, createModel: oye, setModelLanguage: sye, setModelMarkers: cye, getModelMarkers: uye, removeAllMarkers: lye, onDidChangeMarkers: dye, getModels: pye, getModel: fye, onDidCreateModel: mye, onWillDisposeModel: hye, onDidChangeModelLanguage: gye, createWebWorker: _ye, colorizeElement: vye, colorize: yye, colorizeModelLine: bye, tokenize: Sye, defineTheme: Cye, setTheme: wye, remeasureFonts: Tye, registerCommand: Eye, registerLinkOpener: Dye, registerEditorOpener: Oye, AccessibilitySupport: Fi, ContentWidgetPositionPreference: Vi, CursorChangeReason: Hi, DefaultEndOfLine: Ui, EditorAutoIndentStrategy: Gi, EditorOption: Ki, EndOfLinePreference: qi, EndOfLineSequence: Ji, MinimapPosition: oa, MinimapSectionHeaderStyle: sa, MouseTargetType: ca, OverlayWidgetPositionPreference: da, OverviewRulerLane: fa, GlyphMarginLane: Yi, RenderLineNumbersType: ha, RenderMinimap: ga, ScrollbarVisibility: va, ScrollType: _a2, TextEditorCursorBlinkingStyle: Ta, TextEditorCursorStyle: Ea, TrackedRangeStickiness: Da, WrappingIndent: Oa, InjectedTextCursorStops: Qi, PositionAffinity: ma, ShowLightbulbIconMode: ba, TextDirection: wa, ConfigurationChangedEvent: En, BareFontInfo: mn, FontInfo: hn, TextModelResolvedOptions: nm, FindMatch: rm, ApplyUpdateResult: kn, EditorZoom: pn, createMultiFileDiffEditor: nye, EditorType: Qh, EditorOptions: lr };
}
function Aye(e206, t10) {
  if (!t10 || !Array.isArray(t10)) return false;
  for (let n10 of t10) if (!e206(n10)) return false;
  return true;
}
function Hq(e206, t10) {
  return typeof e206 == `boolean` ? e206 : t10;
}
function Uq(e206, t10) {
  return typeof e206 == `string` ? e206 : t10;
}
function jye(e206) {
  let t10 = {};
  for (let n10 of e206) t10[n10] = true;
  return t10;
}
function Wq(e206, t10 = false) {
  t10 && (e206 = e206.map(function(e207) {
    return e207.toLowerCase();
  }));
  let n10 = jye(e206);
  return t10 ? function(e207) {
    return n10[e207.toLowerCase()] !== void 0 && n10.hasOwnProperty(e207.toLowerCase());
  } : function(e207) {
    return n10[e207] !== void 0 && n10.hasOwnProperty(e207);
  };
}
function Gq(e206, t10, n10) {
  t10 = t10.replace(/@@/g, ``);
  let r10 = 0, i10;
  do
    i10 = false, t10 = t10.replace(/@(\w+)/g, function(n11, r11) {
      i10 = true;
      let a11 = ``;
      if (typeof e206[r11] == `string`) a11 = e206[r11];
      else if (e206[r11] && e206[r11] instanceof RegExp) a11 = e206[r11].source;
      else if (e206[r11] === void 0) throw Tg(e206, `language definition does not contain attribute '` + r11 + `', used at: ` + t10);
      else throw Tg(e206, `attribute reference '` + r11 + `' must be a string, used at: ` + t10);
      return Sg(a11) ? `` : `(?:` + a11 + `)`;
    }), r10++;
  while (i10 && r10 < 5);
  t10 = t10.replace(/\x01/g, `@`);
  let a10 = (e206.ignoreCase ? `i` : ``) + (e206.unicode ? `u` : ``);
  if (n10 && t10.match(/\$[sS](\d\d?)/g)) {
    let n11 = null, r11 = null;
    return (i11) => r11 && n11 === i11 ? r11 : (n11 = i11, r11 = new RegExp(yae(e206, t10, i11), a10), r11);
  }
  return new RegExp(t10, a10);
}
function Mye(e206, t10, n10, r10) {
  if (r10 < 0) return e206;
  if (r10 < t10.length) return t10[r10];
  if (r10 >= 100) {
    r10 -= 100;
    let e207 = n10.split(`.`);
    if (e207.unshift(n10), r10 < e207.length) return e207[r10];
  }
  return null;
}
function Nye(e206, t10, n10, r10) {
  let i10 = -1, a10 = n10, o10 = n10.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);
  o10 && (o10[3] && (i10 = parseInt(o10[3]), o10[2] && (i10 += 100)), a10 = o10[4]);
  let s10 = `~`, c10 = a10;
  !a10 || a10.length === 0 ? (s10 = `!=`, c10 = ``) : /^\w*$/.test(c10) ? s10 = `==` : (o10 = a10.match(/^(@|!@|~|!~|==|!=)(.*)$/), o10 && (s10 = o10[1], c10 = o10[2]));
  let l10;
  if ((s10 === `~` || s10 === `!~`) && /^(\w|\|)*$/.test(c10)) {
    let t11 = Wq(c10.split(`|`), e206.ignoreCase);
    l10 = function(e207) {
      return s10 === `~` ? t11(e207) : !t11(e207);
    };
  } else if (s10 === `@` || s10 === `!@`) {
    let n11 = e206[c10];
    if (!n11) throw Tg(e206, `the @ match target '` + c10 + `' is not defined, in rule: ` + t10);
    if (!Aye(function(e207) {
      return typeof e207 == `string`;
    }, n11)) throw Tg(e206, `the @ match target '` + c10 + `' must be an array of strings, in rule: ` + t10);
    let r11 = Wq(n11, e206.ignoreCase);
    l10 = function(e207) {
      return s10 === `@` ? r11(e207) : !r11(e207);
    };
  } else if (s10 === `~` || s10 === `!~`) if (c10.indexOf(`$`) < 0) {
    let t11 = Gq(e206, `^` + c10 + `$`, false);
    l10 = function(e207) {
      return s10 === `~` ? t11.test(e207) : !t11.test(e207);
    };
  } else l10 = function(t11, n11, r11, i11) {
    return Gq(e206, `^` + Eg(e206, c10, n11, r11, i11) + `$`, false).test(t11);
  };
  else if (c10.indexOf(`$`) < 0) {
    let t11 = Cg(e206, c10);
    l10 = function(e207) {
      return s10 === `==` ? e207 === t11 : e207 !== t11;
    };
  } else {
    let t11 = Cg(e206, c10);
    l10 = function(n11, r11, i11, a11, o11) {
      let c11 = Eg(e206, t11, r11, i11, a11);
      return s10 === `==` ? n11 === c11 : n11 !== c11;
    };
  }
  return i10 === -1 ? { name: n10, value: r10, test: function(e207, t11, n11, r11) {
    return l10(e207, e207, t11, n11, r11);
  } } : { name: n10, value: r10, test: function(e207, t11, n11, r11) {
    let a11 = Mye(e207, t11, n11, i10);
    return l10(a11 || ``, e207, t11, n11, r11);
  } };
}
function Kq(e206, t10, n10) {
  if (!n10) return { token: `` };
  if (typeof n10 == `string`) return n10;
  if (n10.token || n10.token === ``) {
    if (typeof n10.token != `string`) throw Tg(e206, `a 'token' attribute must be of type string, in rule: ` + t10);
    {
      let r10 = { token: n10.token };
      if (n10.token.indexOf(`$`) >= 0 && (r10.tokenSubst = true), typeof n10.bracket == `string`) if (n10.bracket === `@open`) r10.bracket = 1;
      else if (n10.bracket === `@close`) r10.bracket = -1;
      else throw Tg(e206, `a 'bracket' attribute must be either '@open' or '@close', in rule: ` + t10);
      if (n10.next) {
        if (typeof n10.next != `string`) throw Tg(e206, `the next state must be a string value in rule: ` + t10);
        {
          let i10 = n10.next;
          if (!/^(@pop|@push|@popall)$/.test(i10) && (i10[0] === `@` && (i10 = i10.substr(1)), i10.indexOf(`$`) < 0 && !bae(e206, Eg(e206, i10, ``, [], ``)))) throw Tg(e206, `the next state '` + n10.next + `' is not defined in rule: ` + t10);
          r10.next = i10;
        }
      }
      return typeof n10.goBack == `number` && (r10.goBack = n10.goBack), typeof n10.switchTo == `string` && (r10.switchTo = n10.switchTo), typeof n10.log == `string` && (r10.log = n10.log), typeof n10.nextEmbedded == `string` && (r10.nextEmbedded = n10.nextEmbedded, e206.usesEmbedded = true), r10;
    }
  } else if (Array.isArray(n10)) {
    let r10 = [];
    for (let i10 = 0, a10 = n10.length; i10 < a10; i10++) r10[i10] = Kq(e206, t10, n10[i10]);
    return { group: r10 };
  } else if (n10.cases) {
    let r10 = [], i10 = false;
    for (let a11 in n10.cases) if (n10.cases.hasOwnProperty(a11)) {
      let o10 = Kq(e206, t10, n10.cases[a11]);
      a11 === `@default` || a11 === `@` || a11 === `` ? r10.push({ test: void 0, value: o10, name: a11 }) : a11 === `@eos` ? r10.push({ test: function(e207, t11, n11, r11) {
        return r11;
      }, value: o10, name: a11 }) : r10.push(Nye(e206, t10, a11, o10)), i10 || (i10 = !Re(o10) && (o10.hasEmbeddedEndInCases || [`@pop`, `@popall`].includes(o10.nextEmbedded || ``)));
    }
    let a10 = e206.defaultToken;
    return { hasEmbeddedEndInCases: i10, test: function(e207, t11, n11, i11) {
      for (let a11 of r10) if (!a11.test || a11.test(e207, t11, n11, i11)) return a11.value;
      return a10;
    } };
  } else throw Tg(e206, `an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: ` + t10);
}
var Pye = class {
  constructor(e206) {
    this.regex = RegExp(``), this.action = { token: `` }, this.matchOnlyAtLineStart = false, this.name = ``, this.name = e206;
  }
  setRegex(e206, t10) {
    let n10;
    if (typeof t10 == `string`) n10 = t10;
    else if (t10 instanceof RegExp) n10 = t10.source;
    else throw Tg(e206, `rules must start with a match string or regular expression: ` + this.name);
    this.matchOnlyAtLineStart = n10.length > 0 && n10[0] === `^`, this.name = this.name + `: ` + n10, this.regex = Gq(e206, `^(?:` + (this.matchOnlyAtLineStart ? n10.substr(1) : n10) + `)`, true);
  }
  setAction(e206, t10) {
    this.action = Kq(e206, this.name, t10);
  }
  resolveRegex(e206) {
    return this.regex instanceof RegExp ? this.regex : this.regex(e206);
  }
};
function qq(e206, t10) {
  if (!t10 || typeof t10 != `object`) throw Error(`Monarch: expecting a language definition object`);
  let n10 = { languageId: e206, includeLF: Hq(t10.includeLF, false), noThrow: false, maxStack: 100, start: typeof t10.start == `string` ? t10.start : null, ignoreCase: Hq(t10.ignoreCase, false), unicode: Hq(t10.unicode, false), tokenPostfix: Uq(t10.tokenPostfix, `.` + e206), defaultToken: Uq(t10.defaultToken, `source`), usesEmbedded: false, stateNames: {}, tokenizer: {}, brackets: [] }, r10 = t10;
  r10.languageId = e206, r10.includeLF = n10.includeLF, r10.ignoreCase = n10.ignoreCase, r10.unicode = n10.unicode, r10.noThrow = n10.noThrow, r10.usesEmbedded = n10.usesEmbedded, r10.stateNames = t10.tokenizer, r10.defaultToken = n10.defaultToken;
  function i10(e207, a11, o10) {
    for (let s10 of o10) {
      let o11 = s10.include;
      if (o11) {
        if (typeof o11 != `string`) throw Tg(n10, `an 'include' attribute must be a string at: ` + e207);
        if (o11[0] === `@` && (o11 = o11.substr(1)), !t10.tokenizer[o11]) throw Tg(n10, `include target '` + o11 + `' is not defined at: ` + e207);
        i10(e207 + `.` + o11, a11, t10.tokenizer[o11]);
      } else {
        let t11 = new Pye(e207);
        if (Array.isArray(s10) && s10.length >= 1 && s10.length <= 3) if (t11.setRegex(r10, s10[0]), s10.length >= 3) if (typeof s10[1] == `string`) t11.setAction(r10, { token: s10[1], next: s10[2] });
        else if (typeof s10[1] == `object`) {
          let e208 = s10[1];
          e208.next = s10[2], t11.setAction(r10, e208);
        } else throw Tg(n10, `a next state as the last element of a rule can only be given if the action is either an object or a string, at: ` + e207);
        else t11.setAction(r10, s10[1]);
        else {
          if (!s10.regex) throw Tg(n10, `a rule must either be an array, or an object with a 'regex' or 'include' field at: ` + e207);
          s10.name && typeof s10.name == `string` && (t11.name = s10.name), s10.matchOnlyAtStart && (t11.matchOnlyAtLineStart = Hq(s10.matchOnlyAtLineStart, false)), t11.setRegex(r10, s10.regex), t11.setAction(r10, s10.action);
        }
        a11.push(t11);
      }
    }
  }
  if (!t10.tokenizer || typeof t10.tokenizer != `object`) throw Tg(n10, `a language definition must define the 'tokenizer' attribute as an object`);
  n10.tokenizer = [];
  for (let e207 in t10.tokenizer) if (t10.tokenizer.hasOwnProperty(e207)) {
    n10.start || (n10.start = e207);
    let r11 = t10.tokenizer[e207];
    n10.tokenizer[e207] = [], i10(`tokenizer.` + e207, n10.tokenizer[e207], r11);
  }
  if (n10.usesEmbedded = r10.usesEmbedded, t10.brackets) {
    if (!Array.isArray(t10.brackets)) throw Tg(n10, `the 'brackets' attribute must be defined as an array`);
  } else t10.brackets = [{ open: `{`, close: `}`, token: `delimiter.curly` }, { open: `[`, close: `]`, token: `delimiter.square` }, { open: `(`, close: `)`, token: `delimiter.parenthesis` }, { open: `<`, close: `>`, token: `delimiter.angle` }];
  let a10 = [];
  for (let e207 of t10.brackets) {
    let t11 = e207;
    if (t11 && Array.isArray(t11) && t11.length === 3 && (t11 = { token: t11[2], open: t11[0], close: t11[1] }), t11.open === t11.close) throw Tg(n10, `open and close brackets in a 'brackets' attribute must be different: ` + t11.open + `
 hint: use the 'bracket' attribute if matching on equal brackets is required.`);
    if (typeof t11.open == `string` && typeof t11.token == `string` && typeof t11.close == `string`) a10.push({ token: t11.token + n10.tokenPostfix, open: Cg(n10, t11.open), close: Cg(n10, t11.close) });
    else throw Tg(n10, `every element in the 'brackets' array must be a '{open,close,token}' object or array`);
  }
  return n10.brackets = a10, n10.noThrow = true, n10;
}
function Fye(e206) {
  mp.registerLanguage(e206);
}
function Iye() {
  let e206 = [];
  return e206 = e206.concat(mp.getLanguages()), e206;
}
function Lye(e206) {
  return AG.get(Jf).languageIdCodec.encodeLanguageId(e206);
}
function Rye(e206, t10) {
  return AG.withServices(() => {
    let n10 = AG.get(Jf).onDidRequestRichLanguageFeatures((r10) => {
      r10 === e206 && (n10.dispose(), t10());
    });
    return n10;
  });
}
function zye(e206, t10) {
  return AG.withServices(() => {
    let n10 = AG.get(Jf).onDidRequestBasicLanguageFeatures((r10) => {
      r10 === e206 && (n10.dispose(), t10());
    });
    return n10;
  });
}
function Bye(e206, t10) {
  if (!AG.get(Jf).isRegisteredLanguageId(e206)) throw Error(`Cannot set configuration for unknown language ${e206}`);
  return AG.get(bp).register(e206, t10, 100);
}
var Vye = class {
  constructor(e206, t10) {
    this._languageId = e206, this._actual = t10;
  }
  dispose() {
  }
  getInitialState() {
    return this._actual.getInitialState();
  }
  tokenize(e206, t10, n10) {
    if (typeof this._actual.tokenize == `function`) return Jq.adaptTokenize(this._languageId, this._actual, e206, n10);
    throw Error(`Not supported!`);
  }
  tokenizeEncoded(e206, t10, n10) {
    let r10 = this._actual.tokenizeEncoded(e206, n10);
    return new pi(r10.tokens, r10.endState);
  }
}, Jq = class e163 {
  constructor(e206, t10, n10, r10) {
    this._languageId = e206, this._actual = t10, this._languageService = n10, this._standaloneThemeService = r10;
  }
  dispose() {
  }
  getInitialState() {
    return this._actual.getInitialState();
  }
  static _toClassicTokens(e206, t10) {
    let n10 = [], r10 = 0;
    for (let i10 = 0, a10 = e206.length; i10 < a10; i10++) {
      let a11 = e206[i10], o10 = a11.startIndex;
      i10 === 0 ? o10 = 0 : o10 < r10 && (o10 = r10), n10[i10] = new di(o10, a11.scopes, t10), r10 = o10;
    }
    return n10;
  }
  static adaptTokenize(t10, n10, r10, i10) {
    let a10 = n10.tokenize(r10, i10), o10 = e163._toClassicTokens(a10.tokens, t10), s10;
    return s10 = a10.endState.equals(i10) ? i10 : a10.endState, new fi(o10, s10);
  }
  tokenize(t10, n10, r10) {
    return e163.adaptTokenize(this._languageId, this._actual, t10, r10);
  }
  _toBinaryTokens(e206, t10) {
    let n10 = e206.encodeLanguageId(this._languageId), r10 = this._standaloneThemeService.getColorTheme().tokenTheme, i10 = [], a10 = 0, o10 = 0;
    for (let e207 = 0, s11 = t10.length; e207 < s11; e207++) {
      let s12 = t10[e207], c10 = r10.match(n10, s12.scopes) | 1024;
      if (a10 > 0 && i10[a10 - 1] === c10) continue;
      let l10 = s12.startIndex;
      e207 === 0 ? l10 = 0 : l10 < o10 && (l10 = o10), i10[a10++] = l10, i10[a10++] = c10, o10 = l10;
    }
    let s10 = new Uint32Array(a10);
    for (let e207 = 0; e207 < a10; e207++) s10[e207] = i10[e207];
    return s10;
  }
  tokenizeEncoded(e206, t10, n10) {
    let r10 = this._actual.tokenize(e206, n10), i10 = this._toBinaryTokens(this._languageService.languageIdCodec, r10.tokens), a10;
    return a10 = r10.endState.equals(n10) ? n10 : r10.endState, new pi(i10, a10);
  }
};
function Hye(e206) {
  return typeof e206.getInitialState == `function`;
}
function Uye(e206) {
  return `tokenizeEncoded` in e206;
}
function Yq(e206) {
  return e206 && typeof e206.then == `function`;
}
function Wye(e206) {
  let t10 = AG.get(YU);
  if (e206) {
    let n10 = [null];
    for (let t11 = 1, r10 = e206.length; t11 < r10; t11++) n10[t11] = Y.fromHex(e206[t11]);
    t10.setColorMapOverride(n10);
  } else t10.setColorMapOverride(null);
}
function Xq(e206, t10) {
  return Uye(t10) ? new Vye(e206, t10) : new Jq(e206, t10, AG.get(Jf), AG.get(YU));
}
function Zq(e206, t10) {
  let n10 = new Ni(async () => {
    let n11 = await Promise.resolve(t10.create());
    return n11 ? Hye(n11) ? Xq(e206, n11) : new Fg(AG.get(Jf), AG.get(YU), e206, qq(e206, n11), AG.get(Uf)) : null;
  });
  return Pi.registerFactory(e206, n10);
}
function Gye(e206, t10) {
  if (!AG.get(Jf).isRegisteredLanguageId(e206)) throw Error(`Cannot set tokens provider for unknown language ${e206}`);
  return Yq(t10) ? Zq(e206, { create: () => t10 }) : Pi.register(e206, Xq(e206, t10));
}
function Kye(e206, t10) {
  return Yq(t10) ? Zq(e206, { create: () => t10 }) : Pi.register(e206, ((t11) => new Fg(AG.get(Jf), AG.get(YU), e206, qq(e206, t11), AG.get(Uf)))(t10));
}
function qye(e206, t10) {
  return AG.get(X).referenceProvider.register(e206, t10);
}
function Jye(e206, t10) {
  return AG.get(X).renameProvider.register(e206, t10);
}
function Yye(e206, t10) {
  return AG.get(X).newSymbolNamesProvider.register(e206, t10);
}
function Xye(e206, t10) {
  return AG.get(X).signatureHelpProvider.register(e206, t10);
}
function Zye(e206, t10) {
  return AG.get(X).hoverProvider.register(e206, { provideHover: async (e207, n10, r10, i10) => {
    let a10 = e207.getWordAtPosition(n10);
    return Promise.resolve(t10.provideHover(e207, n10, r10, i10)).then((e208) => {
      if (e208) return !e208.range && a10 && (e208.range = new M(n10.lineNumber, a10.startColumn, n10.lineNumber, a10.endColumn)), e208.range || (e208.range = new M(n10.lineNumber, n10.column, n10.lineNumber, n10.column)), e208;
    });
  } });
}
function Qye(e206, t10) {
  return AG.get(X).documentSymbolProvider.register(e206, t10);
}
function $ye(e206, t10) {
  return AG.get(X).documentHighlightProvider.register(e206, t10);
}
function ebe(e206, t10) {
  return AG.get(X).linkedEditingRangeProvider.register(e206, t10);
}
function tbe(e206, t10) {
  return AG.get(X).definitionProvider.register(e206, t10);
}
function nbe(e206, t10) {
  return AG.get(X).implementationProvider.register(e206, t10);
}
function rbe(e206, t10) {
  return AG.get(X).typeDefinitionProvider.register(e206, t10);
}
function ibe(e206, t10) {
  return AG.get(X).codeLensProvider.register(e206, t10);
}
function abe(e206, t10, n10) {
  return AG.get(X).codeActionProvider.register(e206, { providedCodeActionKinds: n10?.providedCodeActionKinds, documentation: n10?.documentation, provideCodeActions: (e207, n11, r10, i10) => {
    let a10 = AG.get(GL).read({ resource: e207.uri }).filter((e208) => M.areIntersectingOrTouching(e208, n11));
    return t10.provideCodeActions(e207, n11, { markers: a10, only: r10.only, trigger: r10.trigger }, i10);
  }, resolveCodeAction: t10.resolveCodeAction });
}
function obe(e206, t10) {
  return AG.get(X).documentFormattingEditProvider.register(e206, t10);
}
function sbe(e206, t10) {
  return AG.get(X).documentRangeFormattingEditProvider.register(e206, t10);
}
function cbe(e206, t10) {
  return AG.get(X).onTypeFormattingEditProvider.register(e206, t10);
}
function lbe(e206, t10) {
  return AG.get(X).linkProvider.register(e206, t10);
}
function ube(e206, t10) {
  return AG.get(X).completionProvider.register(e206, t10);
}
function dbe(e206, t10) {
  return AG.get(X).colorProvider.register(e206, t10);
}
function fbe(e206, t10) {
  return AG.get(X).foldingRangeProvider.register(e206, t10);
}
function pbe(e206, t10) {
  return AG.get(X).declarationProvider.register(e206, t10);
}
function mbe(e206, t10) {
  return AG.get(X).selectionRangeProvider.register(e206, t10);
}
function hbe(e206, t10) {
  return AG.get(X).documentSemanticTokensProvider.register(e206, t10);
}
function gbe(e206, t10) {
  return AG.get(X).documentRangeSemanticTokensProvider.register(e206, t10);
}
function _be(e206, t10) {
  return AG.get(X).inlineCompletionsProvider.register(e206, t10);
}
function vbe(e206, t10) {
  return AG.get(X).inlayHintsProvider.register(e206, t10);
}
function ybe() {
  return { register: Fye, getLanguages: Iye, onLanguage: Rye, onLanguageEncountered: zye, getEncodedLanguageId: Lye, setLanguageConfiguration: Bye, setColorMap: Wye, registerTokensProviderFactory: Zq, setTokensProvider: Gye, setMonarchTokensProvider: Kye, registerReferenceProvider: qye, registerRenameProvider: Jye, registerNewSymbolNameProvider: Yye, registerCompletionItemProvider: ube, registerSignatureHelpProvider: Xye, registerHoverProvider: Zye, registerDocumentSymbolProvider: Qye, registerDocumentHighlightProvider: $ye, registerLinkedEditingRangeProvider: ebe, registerDefinitionProvider: tbe, registerImplementationProvider: nbe, registerTypeDefinitionProvider: rbe, registerCodeLensProvider: ibe, registerCodeActionProvider: abe, registerDocumentFormattingEditProvider: obe, registerDocumentRangeFormattingEditProvider: sbe, registerOnTypeFormattingEditProvider: cbe, registerLinkProvider: lbe, registerColorProvider: dbe, registerFoldingRangeProvider: fbe, registerDeclarationProvider: pbe, registerSelectionRangeProvider: mbe, registerDocumentSemanticTokensProvider: hbe, registerDocumentRangeSemanticTokensProvider: gbe, registerInlineCompletionsProvider: _be, registerInlayHintsProvider: vbe, DocumentHighlightKind: Wi, CompletionItemKind: Ri, CompletionItemTag: zi, CompletionItemInsertTextRule: Li, SymbolKind: Sa, SymbolTag: Ca, IndentAction: Zi, CompletionTriggerKind: Bi, SignatureHelpTriggerKind: xa, InlayHintKind: $i, InlineCompletionTriggerKind: na, CodeActionTriggerType: Ii, NewSymbolNameTag: la, NewSymbolNameTriggerKind: ua, PartialAcceptTriggerKind: pa, HoverVerbosityAction: Xi, InlineCompletionEndOfLifeReasonKind: ea, InlineCompletionHintStyle: ta, FoldingRangeKind: Oi, SelectedSuggestionInfo: _i2, EditDeltaInfo: _E2 };
}
var Qq = xu(`IEditorCancelService`), $q = new U(`cancellableOperation`, false, C(939, `Whether the editor runs a cancellable operation, e.g. like 'Peek References'`));
Zf(Qq, class {
  constructor() {
    this._tokens = /* @__PURE__ */ new WeakMap();
  }
  add(e206, t10) {
    let n10 = this._tokens.get(e206);
    n10 || (n10 = e206.invokeWithinContext((e207) => ({ key: $q.bindTo(e207.get(nd)), tokens: new Qt() })), this._tokens.set(e206, n10));
    let r10;
    return n10.key.set(true), r10 = n10.tokens.push(t10), () => {
      r10 && (r10 = (r10(), n10.key.set(!n10.tokens.isEmpty()), void 0));
    };
  }
  cancel(e206) {
    let t10 = this._tokens.get(e206);
    if (!t10) return;
    let n10 = t10.tokens.pop();
    n10 && (n10.cancel(), t10.key.set(!t10.tokens.isEmpty()));
  }
}, 1);
var bbe = class extends pr {
  constructor(e206, t10) {
    super(t10), this.editor = e206, this._unregister = e206.invokeWithinContext((t11) => t11.get(Qq).add(e206, this));
  }
  dispose() {
    this._unregister(), super.dispose();
  }
};
K(new class extends $d {
  constructor() {
    super({ id: `editor.cancelOperation`, kbOpts: { weight: 100, primary: 9 }, precondition: $q });
  }
  runEditorCommand(e206, t10) {
    e206.get(Qq).cancel(t10);
  }
}());
var eJ = class e164 {
  constructor(e206, t10) {
    if (this.flags = t10, this.flags & 1) {
      let t11 = e206.getModel();
      this.modelVersionId = t11 ? La(`{0}#{1}`, t11.uri.toString(), t11.getVersionId()) : null;
    } else this.modelVersionId = null;
    this.flags & 4 ? this.position = e206.getPosition() : this.position = null, this.flags & 2 ? this.selection = e206.getSelection() : this.selection = null, this.flags & 8 ? (this.scrollLeft = e206.getScrollLeft(), this.scrollTop = e206.getScrollTop()) : (this.scrollLeft = -1, this.scrollTop = -1);
  }
  _equals(t10) {
    if (!(t10 instanceof e164)) return false;
    let n10 = t10;
    return !(this.modelVersionId !== n10.modelVersionId || this.scrollLeft !== n10.scrollLeft || this.scrollTop !== n10.scrollTop || !this.position && n10.position || this.position && !n10.position || this.position && n10.position && !this.position.equals(n10.position) || !this.selection && n10.selection || this.selection && !n10.selection || this.selection && n10.selection && !this.selection.equalsRange(n10.selection));
  }
  validate(t10) {
    return this._equals(new e164(t10, this.flags));
  }
}, tJ = class extends bbe {
  constructor(e206, t10, n10, r10) {
    super(e206, r10), this._listener = new E(), t10 & 4 && this._listener.add(e206.onDidChangeCursorPosition((e207) => {
      (!n10 || !M.containsPosition(n10, e207.position)) && this.cancel();
    })), t10 & 2 && this._listener.add(e206.onDidChangeCursorSelection((e207) => {
      (!n10 || !M.containsRange(n10, e207.selection)) && this.cancel();
    })), t10 & 8 && this._listener.add(e206.onDidScrollChange((e207) => this.cancel())), t10 & 1 && (this._listener.add(e206.onDidChangeModel((e207) => this.cancel())), this._listener.add(e206.onDidChangeModelContent((e207) => this.cancel())));
  }
  dispose() {
    this._listener.dispose(), super.dispose();
  }
}, nJ = class extends pr {
  constructor(e206, t10) {
    super(t10), this._listener = e206.onDidChangeContent(() => this.cancel());
  }
  dispose() {
    this._listener.dispose(), super.dispose();
  }
}, rJ = class e165 {
  static _handleEolEdits(e206, t10) {
    let n10, r10 = [];
    for (let e207 of t10) typeof e207.eol == `number` && (n10 = e207.eol), e207.range && typeof e207.text == `string` && r10.push(e207);
    return typeof n10 == `number` && e206.hasModel() && e206.getModel().pushEOL(n10), r10;
  }
  static _isFullModelReplaceEdit(e206, t10) {
    if (!e206.hasModel()) return false;
    let n10 = e206.getModel(), r10 = n10.validateRange(t10.range);
    return n10.getFullModelRange().equalsRange(r10);
  }
  static execute(t10, n10, r10) {
    r10 && t10.pushUndoStop();
    let i10 = FG.capture(t10), a10 = e165._handleEolEdits(t10, n10);
    a10.length === 1 && e165._isFullModelReplaceEdit(t10, a10[0]) ? t10.executeEdits(`formatEditsCommand`, a10.map((e206) => DF.replace(M.lift(e206.range), e206.text))) : t10.executeEdits(`formatEditsCommand`, a10.map((e206) => DF.replaceMove(M.lift(e206.range), e206.text))), r10 && t10.pushUndoStop(), i10.restoreRelativeVerticalPositionOfCursor(t10);
  }
}, iJ = class {
  constructor(e206) {
    this.value = e206, this._lower = e206.toLowerCase();
  }
  static toKey(e206) {
    return typeof e206 == `string` ? e206.toLowerCase() : e206._lower;
  }
}, xbe = class {
  constructor(e206) {
    if (this._set = /* @__PURE__ */ new Set(), e206) for (let t10 of e206) this.add(t10);
  }
  add(e206) {
    this._set.add(iJ.toKey(e206));
  }
  has(e206) {
    return this._set.has(iJ.toKey(e206));
  }
};
function aJ(e206, t10, n10) {
  let r10 = [], i10 = new xbe(), a10 = e206.ordered(n10);
  for (let e207 of a10) r10.push(e207), e207.extensionId && i10.add(e207.extensionId);
  let o10 = t10.ordered(n10);
  for (let e207 of o10) {
    if (e207.extensionId) {
      if (i10.has(e207.extensionId)) continue;
      i10.add(e207.extensionId);
    }
    r10.push({ displayName: e207.displayName, extensionId: e207.extensionId, provideDocumentFormattingEdits(t11, n11, r11) {
      return e207.provideDocumentRangeFormattingEdits(t11, t11.getFullModelRange(), n11, r11);
    } });
  }
  return r10;
}
var oJ = (_Eb = class {
  static setFormatterSelector(t10) {
    return { dispose: _Eb._selectors.unshift(t10) };
  }
  static async select(t10, n10, r10, i10) {
    if (t10.length === 0) return;
    let a10 = Ut.first(_Eb._selectors);
    if (a10) return await a10(t10, n10, r10, i10);
  }
}, _Eb._selectors = new Qt(), _Eb);
async function sJ(e206, t10, n10, r10, i10, a10, o10) {
  let s10 = e206.get(V), { documentRangeFormattingEditProvider: c10 } = e206.get(X), l10 = Sq(t10) ? t10.getModel() : t10, u10 = c10.ordered(l10), d10 = await oJ.select(u10, l10, r10, 2);
  d10 && (i10.report(d10), await s10.invokeFunction(Sbe, d10, t10, n10, a10, o10));
}
async function Sbe(e206, t10, n10, r10, i10, a10) {
  let o10 = e206.get(HL), s10 = e206.get(Ud), c10 = e206.get(WW), l10, u10;
  Sq(n10) ? (l10 = n10.getModel(), u10 = new tJ(n10, 5, void 0, i10)) : (l10 = n10, u10 = new nJ(n10, i10));
  let d10 = [], f10 = 0;
  for (let e207 of re(r10).sort(M.compareRangesUsingStarts)) f10 > 0 && M.areIntersectingOrTouching(d10[f10 - 1], e207) ? d10[f10 - 1] = M.fromPositions(d10[f10 - 1].getStartPosition(), e207.getEndPosition()) : f10 = d10.push(e207);
  let p10 = async (e207) => {
    s10.trace(`[format][provideDocumentRangeFormattingEdits] (request)`, t10.extensionId?.value, e207);
    let n11 = await t10.provideDocumentRangeFormattingEdits(l10, e207, l10.getFormattingOptions(), u10.token) || [];
    return s10.trace(`[format][provideDocumentRangeFormattingEdits] (response)`, t10.extensionId?.value, n11), n11;
  }, m10 = (e207, t11) => {
    if (!e207.length || !t11.length) return false;
    let n11 = e207.reduce((e208, t12) => M.plusRange(e208, t12.range), e207[0].range);
    if (!t11.some((e208) => M.intersectRanges(n11, e208.range))) return false;
    for (let n12 of e207) for (let e208 of t11) if (M.intersectRanges(n12.range, e208.range)) return true;
    return false;
  }, h10 = [], g10 = [];
  try {
    if (typeof t10.provideDocumentRangesFormattingEdits == `function`) {
      s10.trace(`[format][provideDocumentRangeFormattingEdits] (request)`, t10.extensionId?.value, d10);
      let e207 = await t10.provideDocumentRangesFormattingEdits(l10, d10, l10.getFormattingOptions(), u10.token) || [];
      s10.trace(`[format][provideDocumentRangeFormattingEdits] (response)`, t10.extensionId?.value, e207), g10.push(e207);
    } else {
      for (let e207 of d10) {
        if (u10.token.isCancellationRequested) return true;
        g10.push(await p10(e207));
      }
      for (let e207 = 0; e207 < d10.length; ++e207) for (let t11 = e207 + 1; t11 < d10.length; ++t11) {
        if (u10.token.isCancellationRequested) return true;
        if (m10(g10[e207], g10[t11])) {
          let n11 = M.plusRange(d10[e207], d10[t11]), r11 = await p10(n11);
          d10.splice(t11, 1), d10.splice(e207, 1), d10.push(n11), g10.splice(t11, 1), g10.splice(e207, 1), g10.push(r11), e207 = 0, t11 = 0;
        }
      }
    }
    for (let e207 of g10) {
      if (u10.token.isCancellationRequested) return true;
      let t11 = await o10.computeMoreMinimalEdits(l10.uri, e207);
      t11 && h10.push(...t11);
    }
    if (u10.token.isCancellationRequested) return true;
  } finally {
    u10.dispose();
  }
  if (h10.length === 0) return false;
  if (Sq(n10)) rJ.execute(n10, h10, true), n10.revealPositionInCenterIfOutsideViewport(n10.getPosition(), 1);
  else {
    let [{ range: e207 }] = h10, t11 = new N(e207.startLineNumber, e207.startColumn, e207.endLineNumber, e207.endColumn);
    l10.pushEditOperations([t11], h10.map((e208) => ({ text: e208.text, range: M.lift(e208.range), forceMoveMarkers: true })), (e208) => {
      for (let { range: n11 } of e208) if (M.areIntersectingOrTouching(n11, t11)) return [new N(n11.startLineNumber, n11.startColumn, n11.endLineNumber, n11.endColumn)];
      return null;
    });
  }
  return c10.playSignal(qW.format, { userGesture: a10 }), true;
}
async function Cbe(e206, t10, n10, r10, i10, a10) {
  let o10 = e206.get(V), s10 = e206.get(X), c10 = Sq(t10) ? t10.getModel() : t10, l10 = aJ(s10.documentFormattingEditProvider, s10.documentRangeFormattingEditProvider, c10), u10 = await oJ.select(l10, c10, n10, 1);
  u10 && (r10.report(u10), await o10.invokeFunction(wbe, u10, t10, n10, i10, a10));
}
async function wbe(e206, t10, n10, r10, i10, a10) {
  let o10 = e206.get(HL), s10 = e206.get(WW), c10, l10;
  Sq(n10) ? (c10 = n10.getModel(), l10 = new tJ(n10, 5, void 0, i10)) : (c10 = n10, l10 = new nJ(n10, i10));
  let u10;
  try {
    let e207 = await t10.provideDocumentFormattingEdits(c10, c10.getFormattingOptions(), l10.token);
    if (u10 = await o10.computeMoreMinimalEdits(c10.uri, e207), l10.token.isCancellationRequested) return true;
  } finally {
    l10.dispose();
  }
  if (!u10 || u10.length === 0) return false;
  if (Sq(n10)) rJ.execute(n10, u10, r10 !== 2), r10 !== 2 && n10.revealPositionInCenterIfOutsideViewport(n10.getPosition(), 1);
  else {
    let [{ range: e207 }] = u10, t11 = new N(e207.startLineNumber, e207.startColumn, e207.endLineNumber, e207.endColumn);
    c10.pushEditOperations([t11], u10.map((e208) => ({ text: e208.text, range: M.lift(e208.range), forceMoveMarkers: true })), (e208) => {
      for (let { range: n11 } of e208) if (M.areIntersectingOrTouching(n11, t11)) return [new N(n11.startLineNumber, n11.startColumn, n11.endLineNumber, n11.endColumn)];
      return null;
    });
  }
  return s10.playSignal(qW.format, { userGesture: a10 }), true;
}
async function Tbe(e206, t10, n10, r10, i10, a10) {
  let o10 = t10.documentRangeFormattingEditProvider.ordered(n10);
  for (let t11 of o10) {
    let o11 = await Promise.resolve(t11.provideDocumentRangeFormattingEdits(n10, r10, i10, a10)).catch(xe);
    if (v(o11)) return await e206.computeMoreMinimalEdits(n10.uri, o11);
  }
}
async function Ebe(e206, t10, n10, r10, i10) {
  let a10 = aJ(t10.documentFormattingEditProvider, t10.documentRangeFormattingEditProvider, n10);
  for (let t11 of a10) {
    let a11 = await Promise.resolve(t11.provideDocumentFormattingEdits(n10, r10, i10)).catch(xe);
    if (v(a11)) return await e206.computeMoreMinimalEdits(n10.uri, a11);
  }
}
function cJ(e206, t10, n10, r10, i10, a10, o10) {
  let s10 = t10.onTypeFormattingEditProvider.ordered(n10);
  return s10.length === 0 || s10[0].autoFormatTriggerCharacters.indexOf(i10) < 0 ? Promise.resolve(void 0) : Promise.resolve(s10[0].provideOnTypeFormattingEdits(n10, r10, i10, a10, o10)).catch(xe).then((t11) => e206.computeMoreMinimalEdits(n10.uri, t11));
}
Nu.registerCommand(`_executeFormatRangeProvider`, async function(e206, ...t10) {
  let [n10, r10, i10] = t10;
  Je($r.isUri(n10)), Je(M.isIRange(r10));
  let a10 = e206.get(wu), o10 = e206.get(HL), s10 = e206.get(X), c10 = await a10.createModelReference(n10);
  try {
    return Tbe(o10, s10, c10.object.textEditorModel, M.lift(r10), i10, dr.None);
  } finally {
    c10.dispose();
  }
}), Nu.registerCommand(`_executeFormatDocumentProvider`, async function(e206, ...t10) {
  let [n10, r10] = t10;
  Je($r.isUri(n10));
  let i10 = e206.get(wu), a10 = e206.get(HL), o10 = e206.get(X), s10 = await i10.createModelReference(n10);
  try {
    return Ebe(a10, o10, s10.object.textEditorModel, r10, dr.None);
  } finally {
    s10.dispose();
  }
}), Nu.registerCommand(`_executeFormatOnTypeProvider`, async function(e206, ...t10) {
  let [n10, r10, i10, a10] = t10;
  Je($r.isUri(n10)), Je(j.isIPosition(r10)), Je(typeof i10 == `string`);
  let o10 = e206.get(wu), s10 = e206.get(HL), c10 = e206.get(X), l10 = await o10.createModelReference(n10);
  try {
    return cJ(s10, c10, l10.object.textEditorModel, j.lift(r10), i10, a10, dr.None);
  } finally {
    l10.dispose();
  }
});
var Dbe = e({ CancellationTokenSource: () => uJ, Emitter: () => dJ, KeyCode: () => fJ, KeyMod: () => pJ, MarkerSeverity: () => vJ, MarkerTag: () => yJ, Position: () => mJ, Range: () => hJ, Selection: () => gJ, SelectionDirection: () => _J2, Token: () => xJ, Uri: () => bJ, editor: () => SJ, languages: () => CJ });
lr.wrappingIndent.defaultValue = 0, lr.glyphMargin.defaultValue = false, lr.autoIndent.defaultValue = 3, lr.overviewRulerLanes.defaultValue = 2, oJ.setFormatterSelector((e206, t10, n10) => Promise.resolve(e206[0]));
var lJ = ka();
lJ.editor = kye(), lJ.languages = ybe();
var uJ = lJ.CancellationTokenSource, dJ = lJ.Emitter, fJ = lJ.KeyCode, pJ = lJ.KeyMod, mJ = lJ.Position, hJ = lJ.Range, gJ = lJ.Selection, _J2 = lJ.SelectionDirection, vJ = lJ.MarkerSeverity, yJ = lJ.MarkerTag, bJ = lJ.Uri, xJ = lJ.Token, SJ = lJ.editor, CJ = lJ.languages, Obe = zo(), wJ = globalThis;
(Obe?.globalAPI || typeof wJ.define == `function` && wJ.define.amd) && (wJ.monaco = lJ), wJ.require !== void 0 && typeof wJ.require.config == `function` && wJ.require.config({ ignoreDuplicateModules: [`vscode-languageserver-types`, `vscode-languageserver-types/main`, `vscode-languageserver-textdocument`, `vscode-languageserver-textdocument/main`, `vscode-nls`, `vscode-nls/vscode-nls`, `jsonc-parser`, `jsonc-parser/main`, `vscode-uri`, `vscode-uri/index`, `vs/basic-languages/typescript/typescript`] });
var kbe = class extends vd {
  constructor() {
    super({ id: `diffEditor.toggleCollapseUnchangedRegions`, title: w(85, `Toggle Collapse Unchanged Regions`), icon: F.map, toggled: H.has(`config.diffEditor.hideUnchangedRegions.enabled`), precondition: H.has(`isInDiffEditor`), menu: { when: H.has(`isInDiffEditor`), id: W.EditorTitle, order: 22, group: `navigation` } });
  }
  run(e206, ...t10) {
    let n10 = e206.get(Uf), r10 = !n10.getValue(`diffEditor.hideUnchangedRegions.enabled`);
    n10.updateValue(`diffEditor.hideUnchangedRegions.enabled`, r10);
  }
}, TJ = class extends vd {
  constructor() {
    super({ id: `diffEditor.toggleShowMovedCodeBlocks`, title: w(86, `Toggle Show Moved Code Blocks`), precondition: H.has(`isInDiffEditor`) });
  }
  run(e206, ...t10) {
    let n10 = e206.get(Uf), r10 = !n10.getValue(`diffEditor.experimental.showMoves`);
    n10.updateValue(`diffEditor.experimental.showMoves`, r10);
  }
}, EJ = class extends vd {
  constructor() {
    super({ id: `diffEditor.toggleUseInlineViewWhenSpaceIsLimited`, title: w(87, `Toggle Use Inline View When Space Is Limited`), precondition: H.has(`isInDiffEditor`) });
  }
  run(e206, ...t10) {
    let n10 = e206.get(Uf), r10 = !n10.getValue(`diffEditor.useInlineViewWhenSpaceIsLimited`);
    n10.updateValue(`diffEditor.useInlineViewWhenSpaceIsLimited`, r10);
  }
}, DJ = w(88, `Diff Editor`), Abe = class extends tf {
  constructor() {
    super({ id: `diffEditor.switchSide`, title: w(89, `Switch Side`), icon: F.arrowSwap, precondition: H.has(`isInDiffEditor`), f1: true, category: DJ });
  }
  runEditorCommand(e206, t10, n10) {
    let r10 = MJ(e206);
    if (r10 instanceof xq) {
      if (n10 && n10.dryRun) return { destinationSelection: r10.mapToOtherSide().destinationSelection };
      r10.switchSide();
    }
  }
}, jbe = class extends tf {
  constructor() {
    super({ id: `diffEditor.exitCompareMove`, title: w(90, `Exit Compare Move`), icon: F.close, precondition: $.comparingMovedCode, f1: false, category: DJ, keybinding: { weight: 1e4, primary: 9 } });
  }
  runEditorCommand(e206, t10, ...n10) {
    let r10 = MJ(e206);
    r10 instanceof xq && r10.exitCompareMove();
  }
}, Mbe = class extends tf {
  constructor() {
    super({ id: `diffEditor.collapseAllUnchangedRegions`, title: w(91, `Collapse All Unchanged Regions`), icon: F.fold, precondition: H.has(`isInDiffEditor`), f1: true, category: DJ });
  }
  runEditorCommand(e206, t10, ...n10) {
    let r10 = MJ(e206);
    r10 instanceof xq && r10.collapseAllUnchangedRegions();
  }
}, Nbe = class extends tf {
  constructor() {
    super({ id: `diffEditor.showAllUnchangedRegions`, title: w(92, `Show All Unchanged Regions`), icon: F.unfold, precondition: H.has(`isInDiffEditor`), f1: true, category: DJ });
  }
  runEditorCommand(e206, t10, ...n10) {
    let r10 = MJ(e206);
    r10 instanceof xq && r10.showAllUnchangedRegions();
  }
}, OJ = class extends vd {
  constructor() {
    super({ id: `diffEditor.revert`, title: w(93, `Revert`), f1: true, category: DJ, precondition: H.has(`isInDiffEditor`) });
  }
  run(e206, t10) {
    return t10 ? this.runViaToolbarContext(e206, t10) : this.runViaCursorOrSelection(e206);
  }
  runViaCursorOrSelection(e206) {
    let t10 = MJ(e206);
    t10 instanceof xq && t10.revertFocusedRangeMappings();
  }
  runViaToolbarContext(e206, t10) {
    let n10 = Pbe(e206, t10.originalUri, t10.modifiedUri);
    n10 instanceof xq && n10.revertRangeMappings(t10.mapping.innerChanges ?? []);
  }
}, kJ = w(94, `Accessible Diff Viewer`), AJ = (_Fb = class extends vd {
  constructor() {
    super({ id: _Fb.id, title: w(95, `Go to Next Difference`), category: kJ, precondition: H.has(`isInDiffEditor`), keybinding: { primary: 65, weight: 100 }, f1: true });
  }
  run(e206) {
    MJ(e206)?.accessibleDiffViewerNext();
  }
}, _Fb.id = `editor.action.accessibleDiffViewer.next`, _Fb), jJ = (_Gb = class extends vd {
  constructor() {
    super({ id: _Gb.id, title: w(96, `Go to Previous Difference`), category: kJ, precondition: H.has(`isInDiffEditor`), keybinding: { primary: 1089, weight: 100 }, f1: true });
  }
  run(e206) {
    MJ(e206)?.accessibleDiffViewerPrev();
  }
}, _Gb.id = `editor.action.accessibleDiffViewer.prev`, _Gb);
function Pbe(e206, t10, n10) {
  return e206.get(Su).listDiffEditors().find((e207) => {
    let r10 = e207.getModifiedEditor(), i10 = e207.getOriginalEditor();
    return r10 && r10.getModel()?.uri.toString() === n10.toString() && i10 && i10.getModel()?.uri.toString() === t10.toString();
  }) || null;
}
function MJ(e206) {
  let t10 = e206.get(Su).listDiffEditors(), n10 = kl();
  if (n10) {
    for (let e207 of t10) if (e207.getContainerDomNode().contains(n10)) return e207;
  }
  return null;
}
yd(kbe), yd(TJ), yd(EJ), hd.appendMenuItem(W.EditorTitle, { command: { id: new EJ().desc.id, title: C(119, `Use Inline View When Space Is Limited`), toggled: H.has(`config.diffEditor.useInlineViewWhenSpaceIsLimited`), precondition: H.has(`isInDiffEditor`) }, order: 11, group: `1_diff`, when: H.and($.diffEditorRenderSideBySideInlineBreakpointReached, H.has(`isInDiffEditor`)) }), hd.appendMenuItem(W.EditorTitle, { command: { id: new TJ().desc.id, title: C(120, `Show Moved Code Blocks`), icon: F.move, toggled: Hu.create(`config.diffEditor.experimental.showMoves`, true), precondition: H.has(`isInDiffEditor`) }, order: 10, group: `1_diff`, when: H.has(`isInDiffEditor`) }), yd(OJ);
for (let e206 of [{ icon: F.arrowRight, key: $.diffEditorInlineMode.toNegated() }, { icon: F.discard, key: $.diffEditorInlineMode }]) hd.appendMenuItem(W.DiffEditorHunkToolbar, { command: { id: new OJ().desc.id, title: C(121, `Revert Block`), icon: e206.icon }, when: H.and($.diffEditorModifiedWritable, e206.key), order: 5, group: `primary` }), hd.appendMenuItem(W.DiffEditorSelectionToolbar, { command: { id: new OJ().desc.id, title: C(122, `Revert Selection`), icon: e206.icon }, when: H.and($.diffEditorModifiedWritable, e206.key), order: 5, group: `primary` });
yd(Abe), yd(jbe), yd(Mbe), yd(Nbe), hd.appendMenuItem(W.EditorTitle, { command: { id: AJ.id, title: C(123, `Open Accessible Diff Viewer`), precondition: H.has(`isInDiffEditor`) }, order: 10, group: `2_diff`, when: H.and($.accessibleDiffViewerVisible.negate(), H.has(`isInDiffEditor`)) }), Nu.registerCommandAlias(`editor.action.diffReview.next`, AJ.id), yd(AJ), Nu.registerCommandAlias(`editor.action.diffReview.prev`, jJ.id), yd(jJ);
var Fbe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Ibe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, NJ, PJ = new U(`selectionAnchorSet`, false), FJ = (_Hb = class {
  static get(e206) {
    return e206.getContribution(NJ.ID);
  }
  constructor(e206, t10) {
    this.editor = e206, this.selectionAnchorSetContextKey = PJ.bindTo(t10), this.modelChangeListener = e206.onDidChangeModel(() => this.selectionAnchorSetContextKey.reset());
  }
  setSelectionAnchor() {
    if (this.editor.hasModel()) {
      let e206 = this.editor.getPosition();
      this.editor.changeDecorations((t10) => {
        this.decorationId && t10.removeDecoration(this.decorationId), this.decorationId = t10.addDecoration(N.fromPositions(e206, e206), { description: `selection-anchor`, stickiness: 1, hoverMessage: new PM().appendText(C(798, `Selection Anchor`)), className: `selection-anchor` });
      }), this.selectionAnchorSetContextKey.set(!!this.decorationId), Wg(C(799, `Anchor set at {0}:{1}`, e206.lineNumber, e206.column));
    }
  }
  goToSelectionAnchor() {
    if (this.editor.hasModel() && this.decorationId) {
      let e206 = this.editor.getModel().getDecorationRange(this.decorationId);
      e206 && this.editor.setPosition(e206.getStartPosition());
    }
  }
  selectFromAnchorToCursor() {
    if (this.editor.hasModel() && this.decorationId) {
      let e206 = this.editor.getModel().getDecorationRange(this.decorationId);
      if (e206) {
        let t10 = this.editor.getPosition();
        this.editor.setSelection(N.fromPositions(e206.getStartPosition(), t10)), this.cancelSelectionAnchor();
      }
    }
  }
  cancelSelectionAnchor() {
    if (this.decorationId) {
      let e206 = this.decorationId;
      this.editor.changeDecorations((t10) => {
        t10.removeDecoration(e206), this.decorationId = void 0;
      }), this.selectionAnchorSetContextKey.set(false);
    }
  }
  dispose() {
    this.cancelSelectionAnchor(), this.modelChangeListener.dispose();
  }
}, NJ = _Hb, _Hb.ID = `editor.contrib.selectionAnchorController`, _Hb);
FJ = NJ = Fbe([Ibe(1, nd)], FJ);
var Lbe = class extends G {
  constructor() {
    super({ id: `editor.action.setSelectionAnchor`, label: w(800, `Set Selection Anchor`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2080), weight: 100 } });
  }
  async run(e206, t10) {
    FJ.get(t10)?.setSelectionAnchor();
  }
}, Rbe = class extends G {
  constructor() {
    super({ id: `editor.action.goToSelectionAnchor`, label: w(801, `Go to Selection Anchor`), precondition: PJ });
  }
  async run(e206, t10) {
    FJ.get(t10)?.goToSelectionAnchor();
  }
}, zbe = class extends G {
  constructor() {
    super({ id: `editor.action.selectFromAnchorToCursor`, label: w(802, `Select from Anchor to Cursor`), precondition: PJ, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2089), weight: 100 } });
  }
  async run(e206, t10) {
    FJ.get(t10)?.selectFromAnchorToCursor();
  }
}, Bbe = class extends G {
  constructor() {
    super({ id: `editor.action.cancelSelectionAnchor`, label: w(803, `Cancel Selection Anchor`), precondition: PJ, kbOpts: { kbExpr: $.editorTextFocus, primary: 9, weight: 100 } });
  }
  async run(e206, t10) {
    FJ.get(t10)?.cancelSelectionAnchor();
  }
};
af(FJ.ID, FJ, 4), q(Lbe), q(Rbe), q(zbe), q(Bbe);
var Vbe = Q(`editorOverviewRuler.bracketMatchForeground`, `#A0A0A0`, C(804, `Overview ruler marker color for matching brackets.`)), Hbe = class extends G {
  constructor() {
    super({ id: `editor.action.jumpToBracket`, label: w(806, `Go to Bracket`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 3165, weight: 100 } });
  }
  run(e206, t10) {
    IJ.get(t10)?.jumpToBracket();
  }
}, Ube = class extends G {
  constructor() {
    super({ id: `editor.action.selectToBracket`, label: w(807, `Select to Bracket`), precondition: void 0, metadata: { description: w(808, `Select the text inside and including the brackets or curly braces`), args: [{ name: `args`, schema: { type: `object`, properties: { selectBrackets: { type: `boolean`, default: true } } } }] } });
  }
  run(e206, t10, n10) {
    let r10 = true;
    n10 && n10.selectBrackets === false && (r10 = false), IJ.get(t10)?.selectToBracket(r10);
  }
}, Wbe = class extends G {
  constructor() {
    super({ id: `editor.action.removeBrackets`, label: w(809, `Remove Brackets`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 2561, weight: 100 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    IJ.get(t10)?.removeBrackets(this.id);
  }
}, Gbe = class {
  constructor(e206, t10, n10) {
    this.position = e206, this.brackets = t10, this.options = n10;
  }
}, IJ = (_Ib = class extends D {
  static get(t10) {
    return t10.getContribution(_Ib.ID);
  }
  constructor(e206) {
    super(), this._editor = e206, this._lastBracketsData = [], this._lastVersionId = 0, this._decorations = this._editor.createDecorationsCollection(), this._updateBracketsSoon = this._register(new us(() => this._updateBrackets(), 50)), this._matchBrackets = this._editor.getOption(80), this._updateBracketsSoon.schedule(), this._register(e206.onDidChangeCursorPosition((e207) => {
      this._matchBrackets !== `never` && this._updateBracketsSoon.schedule();
    })), this._register(e206.onDidChangeModelContent((e207) => {
      this._updateBracketsSoon.schedule();
    })), this._register(e206.onDidChangeModel((e207) => {
      this._lastBracketsData = [], this._updateBracketsSoon.schedule();
    })), this._register(e206.onDidChangeModelLanguageConfiguration((e207) => {
      this._lastBracketsData = [], this._updateBracketsSoon.schedule();
    })), this._register(e206.onDidChangeConfiguration((e207) => {
      e207.hasChanged(80) && (this._matchBrackets = this._editor.getOption(80), this._decorations.clear(), this._lastBracketsData = [], this._lastVersionId = 0, this._updateBracketsSoon.schedule());
    })), this._register(e206.onDidBlurEditorWidget(() => {
      this._updateBracketsSoon.schedule();
    })), this._register(e206.onDidFocusEditorWidget(() => {
      this._updateBracketsSoon.schedule();
    }));
  }
  jumpToBracket() {
    if (!this._editor.hasModel()) return;
    let e206 = this._editor.getModel(), t10 = this._editor.getSelections().map((t11) => {
      let n10 = t11.getStartPosition(), r10 = e206.bracketPairs.matchBracket(n10), i10 = null;
      if (r10) r10[0].containsPosition(n10) && !r10[1].containsPosition(n10) ? i10 = r10[1].getStartPosition() : r10[1].containsPosition(n10) && (i10 = r10[0].getStartPosition());
      else {
        let t12 = e206.bracketPairs.findEnclosingBrackets(n10);
        if (t12) i10 = t12[1].getStartPosition();
        else {
          let t13 = e206.bracketPairs.findNextBracket(n10);
          t13 && t13.range && (i10 = t13.range.getStartPosition());
        }
      }
      return i10 ? new N(i10.lineNumber, i10.column, i10.lineNumber, i10.column) : new N(n10.lineNumber, n10.column, n10.lineNumber, n10.column);
    });
    this._editor.setSelections(t10), this._editor.revealRange(t10[0]);
  }
  selectToBracket(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._editor.getModel(), n10 = [];
    this._editor.getSelections().forEach((r10) => {
      let i10 = r10.getStartPosition(), a10 = t10.bracketPairs.matchBracket(i10);
      if (!a10 && (a10 = t10.bracketPairs.findEnclosingBrackets(i10), !a10)) {
        let e207 = t10.bracketPairs.findNextBracket(i10);
        e207 && e207.range && (a10 = t10.bracketPairs.matchBracket(e207.range.getStartPosition()));
      }
      let o10 = null, s10 = null;
      if (a10) {
        a10.sort(M.compareRangesUsingStarts);
        let [t11, n11] = a10;
        if (o10 = e206 ? t11.getStartPosition() : t11.getEndPosition(), s10 = e206 ? n11.getEndPosition() : n11.getStartPosition(), n11.containsPosition(i10)) {
          let e207 = o10;
          o10 = s10, s10 = e207;
        }
      }
      o10 && s10 && n10.push(new N(o10.lineNumber, o10.column, s10.lineNumber, s10.column));
    }), n10.length > 0 && (this._editor.setSelections(n10), this._editor.revealRange(n10[0]));
  }
  removeBrackets(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._editor.getModel();
    this._editor.getSelections().forEach((n10) => {
      let r10 = n10.getPosition(), i10 = t10.bracketPairs.matchBracket(r10);
      i10 || (i10 = t10.bracketPairs.findEnclosingBrackets(r10)), i10 && (this._editor.pushUndoStop(), this._editor.executeEdits(e206, [{ range: i10[0], text: `` }, { range: i10[1], text: `` }]), this._editor.pushUndoStop());
    });
  }
  _updateBrackets() {
    if (this._matchBrackets === `never`) return;
    this._recomputeBrackets();
    let e206 = [], t10 = 0;
    for (let n10 of this._lastBracketsData) {
      let r10 = n10.brackets;
      r10 && (e206[t10++] = { range: r10[0], options: n10.options }, e206[t10++] = { range: r10[1], options: n10.options });
    }
    this._decorations.set(e206);
  }
  _recomputeBrackets() {
    if (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) {
      this._lastBracketsData = [], this._lastVersionId = 0;
      return;
    }
    let t10 = this._editor.getSelections();
    if (t10.length > 100) {
      this._lastBracketsData = [], this._lastVersionId = 0;
      return;
    }
    let n10 = this._editor.getModel(), r10 = n10.getVersionId(), i10 = [];
    this._lastVersionId === r10 && (i10 = this._lastBracketsData);
    let a10 = [], o10 = 0;
    for (let e206 = 0, n11 = t10.length; e206 < n11; e206++) {
      let n12 = t10[e206];
      n12.isEmpty() && (a10[o10++] = n12.getStartPosition());
    }
    a10.length > 1 && a10.sort(j.compare);
    let s10 = [], c10 = 0, l10 = 0, u10 = i10.length;
    for (let t11 = 0, r11 = a10.length; t11 < r11; t11++) {
      let r12 = a10[t11];
      for (; l10 < u10 && i10[l10].position.isBefore(r12); ) l10++;
      if (l10 < u10 && i10[l10].position.equals(r12)) s10[c10++] = i10[l10];
      else {
        let t12 = n10.bracketPairs.matchBracket(r12, 20), i11 = _Ib._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;
        !t12 && this._matchBrackets === `always` && (t12 = n10.bracketPairs.findEnclosingBrackets(r12, 20), i11 = _Ib._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER), s10[c10++] = new Gbe(r12, t12, i11);
      }
    }
    this._lastBracketsData = s10, this._lastVersionId = r10;
  }
}, _Ib.ID = `editor.contrib.bracketMatchingController`, _Ib._DECORATION_OPTIONS_WITH_OVERVIEW_RULER = UO.register({ description: `bracket-match-overview`, stickiness: 1, className: `bracket-match`, overviewRuler: { color: WS(Vbe), position: Qp.Center } }), _Ib._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER = UO.register({ description: `bracket-match-no-overview`, stickiness: 1, className: `bracket-match` }), _Ib);
af(IJ.ID, IJ, 1), q(Ube), q(Hbe), q(Wbe), hd.appendMenuItem(W.MenubarGoMenu, { group: `5_infile_nav`, command: { id: `editor.action.jumpToBracket`, title: C(805, `Go to &&Bracket`) }, order: 2 });
var Kbe = class {
  constructor(e206, t10) {
    this._selection = e206, this._isMovingLeft = t10;
  }
  getEditOperations(e206, t10) {
    if (this._selection.startLineNumber !== this._selection.endLineNumber || this._selection.isEmpty()) return;
    let n10 = this._selection.startLineNumber, r10 = this._selection.startColumn, i10 = this._selection.endColumn;
    if (!(this._isMovingLeft && r10 === 1) && !(!this._isMovingLeft && i10 === e206.getLineMaxColumn(n10))) if (this._isMovingLeft) {
      let a10 = new M(n10, r10 - 1, n10, r10), o10 = e206.getValueInRange(a10);
      t10.addEditOperation(a10, null), t10.addEditOperation(new M(n10, i10, n10, i10), o10);
    } else {
      let a10 = new M(n10, i10, n10, i10 + 1), o10 = e206.getValueInRange(a10);
      t10.addEditOperation(a10, null), t10.addEditOperation(new M(n10, r10, n10, r10), o10);
    }
  }
  computeCursorState(e206, t10) {
    return this._isMovingLeft ? new N(this._selection.startLineNumber, this._selection.startColumn - 1, this._selection.endLineNumber, this._selection.endColumn - 1) : new N(this._selection.startLineNumber, this._selection.startColumn + 1, this._selection.endLineNumber, this._selection.endColumn + 1);
  }
}, LJ = class extends G {
  constructor(e206, t10) {
    super(t10), this.left = e206;
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = [], r10 = t10.getSelections();
    for (let e207 of r10) n10.push(new Kbe(e207, this.left));
    t10.pushUndoStop(), t10.executeCommands(this.id, n10), t10.pushUndoStop();
  }
}, qbe = class extends LJ {
  constructor() {
    super(true, { id: `editor.action.moveCarretLeftAction`, label: w(810, `Move Selected Text Left`), precondition: $.writable });
  }
}, Jbe = class extends LJ {
  constructor() {
    super(false, { id: `editor.action.moveCarretRightAction`, label: w(811, `Move Selected Text Right`), precondition: $.writable });
  }
};
q(qbe), q(Jbe), q(class extends G {
  constructor() {
    super({ id: `editor.action.transposeLetters`, label: w(812, `Transpose Letters`), precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 306 }, weight: 100 } });
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getModel(), r10 = [], i10 = t10.getSelections();
    for (let e207 of i10) {
      if (!e207.isEmpty()) continue;
      let t11 = e207.startLineNumber, i11 = e207.startColumn, a10 = n10.getLineMaxColumn(t11);
      if (t11 === 1 && (i11 === 1 || i11 === 2 && a10 === 2)) continue;
      let o10 = i11 === a10 ? e207.getPosition() : Wx.rightPosition(n10, e207.getPosition().lineNumber, e207.getPosition().column), s10 = Wx.leftPosition(n10, o10), c10 = Wx.leftPosition(n10, s10), l10 = n10.getValueInRange(M.fromPositions(c10, s10)), u10 = n10.getValueInRange(M.fromPositions(s10, o10)), d10 = M.fromPositions(c10, o10);
      r10.push(new Lx(d10, u10 + l10));
    }
    r10.length > 0 && (t10.pushUndoStop(), t10.executeCommands(this.id, r10), t10.pushUndoStop());
  }
});
var Ybe = xu(`productService`);
function RJ(e206, t10) {
  return { id: t10, asString: async () => e206, asFile: () => void 0, value: typeof e206 == `string` ? e206 : void 0 };
}
function Xbe(e206, t10, n10, r10) {
  let i10 = { id: Tx(), name: e206, uri: t10, data: n10 };
  return { id: r10, asString: async () => ``, asFile: () => i10, value: void 0 };
}
var zJ = class {
  constructor() {
    this._entries = /* @__PURE__ */ new Map();
  }
  get size() {
    let e206 = 0;
    for (let t10 of this._entries) e206++;
    return e206;
  }
  has(e206) {
    return this._entries.has(this.toKey(e206));
  }
  matches(e206) {
    let t10 = [...this._entries.keys()];
    return Ut.some(this, ([e207, t11]) => t11.asFile()) && t10.push(`files`), HJ(BJ(e206), t10);
  }
  get(e206) {
    return this._entries.get(this.toKey(e206))?.[0];
  }
  append(e206, t10) {
    let n10 = this._entries.get(e206);
    n10 ? n10.push(t10) : this._entries.set(this.toKey(e206), [t10]);
  }
  replace(e206, t10) {
    this._entries.set(this.toKey(e206), [t10]);
  }
  delete(e206) {
    this._entries.delete(this.toKey(e206));
  }
  *[Symbol.iterator]() {
    for (let [e206, t10] of this._entries) for (let n10 of t10) yield [e206, n10];
  }
  toKey(e206) {
    return BJ(e206);
  }
};
function BJ(e206) {
  return e206.toLowerCase();
}
function VJ(e206, t10) {
  return HJ(BJ(e206), t10.map(BJ));
}
function HJ(e206, t10) {
  if (e206 === `*/*`) return t10.length > 0;
  if (t10.includes(e206)) return true;
  let n10 = e206.match(/^([a-z]+)\/([a-z]+|\*)$/i);
  if (!n10) return false;
  let [r10, i10, a10] = n10;
  return a10 === `*` ? t10.some((e207) => e207.startsWith(i10 + `/`)) : false;
}
var UJ = Object.freeze({ create: (e206) => y(e206.map((e207) => e207.toString())).join(`\r
`), split: (e206) => e206.split(`\r
`), parse: (e206) => UJ.split(e206).filter((e207) => !e207.startsWith(`#`)) }), WJ = (_Jb = class {
  constructor(e206) {
    this.value = e206;
  }
  equals(e206) {
    return this.value === e206.value;
  }
  contains(t10) {
    return this.equals(t10) || this.value === `` || t10.value.startsWith(this.value + _Jb.sep);
  }
  intersects(e206) {
    return this.contains(e206) || e206.contains(this);
  }
  append(...t10) {
    return new _Jb((this.value ? [this.value, ...t10] : t10).join(_Jb.sep));
  }
}, _Jb.sep = `.`, _Jb.None = new _Jb(`@@none@@`), _Jb.Empty = new _Jb(``), _Jb), GJ = { EDITORS: `CodeEditors`, FILES: `CodeFiles` }, Zbe = class {
};
cd.add({ DragAndDropContribution: `workbench.contributions.dragAndDrop` }.DragAndDropContribution, new Zbe());
var Qbe = (_Kb = class {
  constructor() {
  }
  static getInstance() {
    return _Kb.INSTANCE;
  }
  hasData(e206) {
    return e206 && e206 === this.proto;
  }
  getData(e206) {
    if (this.hasData(e206)) return this.data;
  }
}, _Kb.INSTANCE = new _Kb(), _Kb);
function KJ(e206) {
  if (Dt && typeof globalThis.vscode?.webUtils?.getPathForFile == `function`) return globalThis.vscode?.webUtils?.getPathForFile(e206);
}
function qJ(e206) {
  let t10 = new zJ();
  for (let n10 of e206.items) {
    let e207 = n10.type;
    if (n10.kind === `string`) {
      let r10 = new Promise((e208) => n10.getAsString(e208));
      t10.append(e207, RJ(r10));
    } else if (n10.kind === `file`) {
      let r10 = n10.getAsFile();
      r10 && t10.append(e207, $be(r10));
    }
  }
  return t10;
}
function $be(e206) {
  let t10 = KJ(e206), n10 = t10 ? $r.parse(t10) : void 0;
  return Xbe(e206.name, n10, async () => new Uint8Array(await e206.arrayBuffer()));
}
var exe = Object.freeze([GJ.EDITORS, GJ.FILES, xI.RESOURCES, xI.INTERNAL_URI_LIST]);
function JJ(e206, t10 = false) {
  let n10 = qJ(e206), r10 = n10.get(xI.INTERNAL_URI_LIST);
  if (r10) n10.replace($f.uriList, r10);
  else if (t10 || !n10.has($f.uriList)) {
    let t11 = [];
    for (let n11 of e206.items) {
      let e207 = n11.getAsFile();
      if (e207) {
        let n12 = KJ(e207);
        try {
          n12 ? t11.push($r.file(n12).toString()) : t11.push($r.parse(e207.name, true).toString());
        } catch {
        }
      }
    }
    t11.length && n10.replace($f.uriList, RJ(UJ.create(t11)));
  }
  for (let e207 of exe) n10.delete(e207);
  return n10;
}
var txe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, nxe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, rxe = UO.register({ description: `inline-progress-widget`, stickiness: 1, showIfCollapsed: true, after: { content: `\xA0`, inlineClassName: `inline-editor-progress-decoration`, inlineClassNameAffectsLetterSpacing: true } }), ixe = (_Lb = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this.typeId = e206, this.editor = t10, this.range = n10, this.delegate = i10, this.allowEditorOverflow = false, this.suppressMouseDown = true, this.create(r10), this.editor.addContentWidget(this), this.editor.layoutContentWidget(this);
  }
  create(e206) {
    this.domNode = B(`.inline-progress-widget`), this.domNode.role = `button`, this.domNode.title = e206;
    let t10 = B(`span.icon`);
    this.domNode.append(t10), t10.classList.add(...ju.asClassNameArray(F.loading), `codicon-modifier-spin`);
    let n10 = () => {
      let e207 = this.editor.getOption(75);
      this.domNode.style.height = `${e207}px`, this.domNode.style.width = `${Math.ceil(0.8 * e207)}px`;
    };
    n10(), this._register(this.editor.onDidChangeConfiguration((e207) => {
      (e207.hasChanged(61) || e207.hasChanged(75)) && n10();
    })), this._register(L(this.domNode, R.CLICK, (e207) => {
      this.delegate.cancel();
    }));
  }
  getId() {
    return _Lb.baseId + `.` + this.typeId;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return { position: { lineNumber: this.range.startLineNumber, column: this.range.startColumn }, preference: [0] };
  }
  dispose() {
    super.dispose(), this.editor.removeContentWidget(this);
  }
}, _Lb.baseId = `editor.widget.inlineProgressWidget`, _Lb), YJ = class extends D {
  constructor(e206, t10, n10) {
    super(), this.id = e206, this._editor = t10, this._instantiationService = n10, this._showDelay = 500, this._showPromise = this._register(new Jt()), this._currentWidget = this._register(new Jt()), this._operationIdPool = 0, this._currentDecorations = t10.createDecorationsCollection();
  }
  dispose() {
    super.dispose(), this._currentDecorations.clear();
  }
  async showWhile(e206, t10, n10, r10, i10) {
    let a10 = this._operationIdPool++;
    this._currentOperation = a10, this.clear(), this._showPromise.value = as(() => {
      let n11 = M.fromPositions(e206);
      this._currentDecorations.set([{ range: n11, options: rxe }]).length > 0 && (this._currentWidget.value = this._instantiationService.createInstance(ixe, this.id, this._editor, n11, t10, r10));
    }, i10 ?? this._showDelay);
    try {
      return await n10;
    } finally {
      this._currentOperation === a10 && (this.clear(), this._currentOperation = void 0);
    }
  }
  clear() {
    this._showPromise.clear(), this._currentDecorations.clear(), this._currentWidget.clear();
  }
};
YJ = txe([nxe(2, V)], YJ);
var axe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, XJ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, ZJ, QJ = (_Mb = class {
  static get(e206) {
    return e206.getContribution(ZJ.ID);
  }
  constructor(e206, t10, n10) {
    this._openerService = n10, this._messageWidget = new Jt(), this._messageListeners = new E(), this._mouseOverMessage = false, this._editor = e206, this._visible = ZJ.MESSAGE_VISIBLE.bindTo(t10);
  }
  dispose() {
    this._messageListeners.dispose(), this._messageWidget.dispose(), this._visible.reset();
  }
  showMessage(e206, t10) {
    if (Wg(IM(e206) ? e206.value : e206), this._visible.set(true), this._messageWidget.clear(), this._messageListeners.clear(), IM(e206)) {
      let n11 = this._messageListeners.add(EP(e206, { actionHandler: (e207, t11) => {
        this.closeMessage(), zP(this._openerService, e207, t11.isTrusted);
      } }));
      this._messageWidget.value = new $J(this._editor, t10, n11.element);
    } else this._messageWidget.value = new $J(this._editor, t10, e206);
    this._messageListeners.add(O.debounce(this._editor.onDidBlurEditorText, (e207, t11) => t11, 0)(() => {
      this._mouseOverMessage || this._messageWidget.value && Cl(kl(), this._messageWidget.value.getDomNode()) || this.closeMessage();
    })), this._messageListeners.add(this._editor.onDidChangeCursorPosition(() => this.closeMessage())), this._messageListeners.add(this._editor.onDidDispose(() => this.closeMessage())), this._messageListeners.add(this._editor.onDidChangeModel(() => this.closeMessage())), this._messageListeners.add(L(this._messageWidget.value.getDomNode(), R.MOUSE_ENTER, () => this._mouseOverMessage = true, true)), this._messageListeners.add(L(this._messageWidget.value.getDomNode(), R.MOUSE_LEAVE, () => this._mouseOverMessage = false, true));
    let n10;
    this._messageListeners.add(this._editor.onMouseMove((e207) => {
      e207.target.position && (n10 ? n10.containsPosition(e207.target.position) || this.closeMessage() : n10 = new M(t10.lineNumber - 3, 1, e207.target.position.lineNumber + 3, 1));
    }));
  }
  closeMessage() {
    this._visible.reset(), this._messageListeners.clear(), this._messageWidget.value && this._messageListeners.add($J.fadeOut(this._messageWidget.value));
  }
}, ZJ = _Mb, _Mb.ID = `editor.contrib.messageController`, _Mb.MESSAGE_VISIBLE = new U(`messageVisible`, false, C(1287, `Whether the editor is currently showing an inline message`)), _Mb);
QJ = ZJ = axe([XJ(1, nd), XJ(2, IP)], QJ), K(new ($d.bindToContribution(QJ.get))({ id: `leaveEditorMessage`, precondition: QJ.MESSAGE_VISIBLE, handler: (e206) => e206.closeMessage(), kbOpts: { weight: 130, primary: 9 } }));
var $J = class {
  static fadeOut(e206) {
    let t10 = () => {
      e206.dispose(), clearTimeout(n10), e206.getDomNode().removeEventListener(`animationend`, t10);
    }, n10 = setTimeout(t10, 110);
    return e206.getDomNode().addEventListener(`animationend`, t10), e206.getDomNode().classList.add(`fadeOut`), { dispose: t10 };
  }
  constructor(e206, { lineNumber: t10, column: n10 }, r10) {
    this.allowEditorOverflow = true, this.suppressMouseDown = false, this._editor = e206, this._editor.revealLinesInCenterIfOutsideViewport(t10, t10, 0), this._position = { lineNumber: t10, column: n10 }, this._domNode = document.createElement(`div`), this._domNode.classList.add(`monaco-editor-overlaymessage`), this._domNode.style.marginLeft = `-6px`;
    let i10 = document.createElement(`div`);
    i10.classList.add(`anchor`, `top`), this._domNode.appendChild(i10);
    let a10 = document.createElement(`div`);
    typeof r10 == `string` ? (a10.classList.add(`message`), a10.textContent = r10) : (r10.classList.add(`message`), a10.appendChild(r10)), this._domNode.appendChild(a10);
    let o10 = document.createElement(`div`);
    o10.classList.add(`anchor`, `below`), this._domNode.appendChild(o10), this._editor.addContentWidget(this), this._domNode.classList.add(`fadeIn`);
  }
  dispose() {
    this._editor.removeContentWidget(this);
  }
  getId() {
    return `messageoverlay`;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return { position: this._position, preference: [1, 2], positionAffinity: 1 };
  }
  afterRender(e206) {
    this._domNode.classList.toggle(`below`, e206 === 2);
  }
};
af(QJ.ID, QJ, 4);
var eY = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, tY = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, nY = class {
  constructor(e206) {
    this.copyMimeTypes = [], this.kind = e206, this.providedDropEditKinds = [this.kind], this.providedPasteEditKinds = [this.kind];
  }
  async provideDocumentPasteEdits(e206, t10, n10, r10, i10) {
    let a10 = await this.getEdit(n10, i10);
    if (a10) return { edits: [{ insertText: a10.insertText, title: a10.title, kind: a10.kind, handledMimeType: a10.handledMimeType, yieldTo: a10.yieldTo }], dispose() {
    } };
  }
  async provideDocumentDropEdits(e206, t10, n10, r10) {
    let i10 = await this.getEdit(n10, r10);
    if (i10) return { edits: [{ insertText: i10.insertText, title: i10.title, kind: i10.kind, handledMimeType: i10.handledMimeType, yieldTo: i10.yieldTo }], dispose() {
    } };
  }
}, rY = (_Nb = class extends nY {
  constructor() {
    super(WJ.Empty.append(`text`, `plain`)), this.id = _Nb.id, this.dropMimeTypes = [$f.text], this.pasteMimeTypes = [$f.text];
  }
  async getEdit(e206, t10) {
    let n10 = e206.get($f.text);
    if (!n10 || e206.has($f.uriList)) return;
    let r10 = await n10.asString();
    return { handledMimeType: $f.text, title: C(926, `Insert Plain Text`), insertText: r10, kind: this.kind };
  }
}, _Nb.id = `text`, _Nb), iY = class extends nY {
  constructor() {
    super(WJ.Empty.append(`uri`, `path`, `absolute`)), this.dropMimeTypes = [$f.uriList], this.pasteMimeTypes = [$f.uriList];
  }
  async getEdit(e206, t10) {
    let n10 = await oY(e206);
    if (!n10.length || t10.isCancellationRequested) return;
    let r10 = 0, i10 = n10.map(({ uri: e207, originalText: t11 }) => e207.scheme === xs.file ? e207.fsPath : (r10++, t11)).join(` `), a10;
    return a10 = r10 > 0 ? n10.length > 1 ? C(927, `Insert Uris`) : C(928, `Insert Uri`) : n10.length > 1 ? C(929, `Insert Paths`) : C(930, `Insert Path`), { handledMimeType: $f.uriList, insertText: i10, title: a10, kind: this.kind };
  }
}, aY = class extends nY {
  constructor(e206) {
    super(WJ.Empty.append(`uri`, `path`, `relative`)), this._workspaceContextService = e206, this.dropMimeTypes = [$f.uriList], this.pasteMimeTypes = [$f.uriList];
  }
  async getEdit(e206, t10) {
    let n10 = await oY(e206);
    if (!n10.length || t10.isCancellationRequested) return;
    let r10 = h(n10.map(({ uri: e207 }) => {
      let t11 = this._workspaceContextService.getWorkspaceFolder(e207);
      return t11 ? ore(t11.uri, e207) : void 0;
    }));
    if (r10.length) return { handledMimeType: $f.uriList, insertText: r10.join(` `), title: n10.length > 1 ? C(931, `Insert Relative Paths`) : C(932, `Insert Relative Path`), kind: this.kind };
  }
};
aY = eY([tY(0, qF)], aY);
var oxe = class {
  constructor() {
    this.kind = new WJ(`html`), this.providedPasteEditKinds = [this.kind], this.copyMimeTypes = [], this.pasteMimeTypes = [`text/html`], this._yieldTo = [{ mimeType: $f.text }];
  }
  async provideDocumentPasteEdits(e206, t10, n10, r10, i10) {
    if (r10.triggerKind !== xi.PasteAs && !r10.only?.contains(this.kind)) return;
    let a10 = await n10.get(`text/html`)?.asString();
    if (!(!a10 || i10.isCancellationRequested)) return { dispose() {
    }, edits: [{ insertText: a10, yieldTo: this._yieldTo, title: C(933, `Insert HTML`), kind: this.kind }] };
  }
};
async function oY(e206) {
  let t10 = e206.get($f.uriList);
  if (!t10) return [];
  let n10 = await t10.asString(), r10 = [];
  for (let e207 of UJ.parse(n10)) try {
    r10.push({ uri: $r.parse(e207), originalText: e207 });
  } catch {
  }
  return r10;
}
var sY = { scheme: `*`, hasAccessToAllModels: true }, cY = class extends D {
  constructor(e206, t10) {
    super(), this._register(e206.documentDropEditProvider.register(sY, new rY())), this._register(e206.documentDropEditProvider.register(sY, new iY())), this._register(e206.documentDropEditProvider.register(sY, new aY(t10)));
  }
};
cY = eY([tY(0, X), tY(1, qF)], cY);
var lY = class extends D {
  constructor(e206, t10) {
    super(), this._register(e206.documentPasteEditProvider.register(sY, new rY())), this._register(e206.documentPasteEditProvider.register(sY, new iY())), this._register(e206.documentPasteEditProvider.register(sY, new aY(t10))), this._register(e206.documentPasteEditProvider.register(sY, new oxe()));
  }
};
lY = eY([tY(0, X), tY(1, qF)], lY);
var sxe = (_Ob = class {
  constructor() {
    this.value = ``, this.pos = 0;
  }
  static isDigitCharacter(e206) {
    return e206 >= 48 && e206 <= 57;
  }
  static isVariableCharacter(e206) {
    return e206 === 95 || e206 >= 97 && e206 <= 122 || e206 >= 65 && e206 <= 90;
  }
  text(e206) {
    this.value = e206, this.pos = 0;
  }
  tokenText(e206) {
    return this.value.substr(e206.pos, e206.len);
  }
  next() {
    if (this.pos >= this.value.length) return { type: 14, pos: this.pos, len: 0 };
    let t10 = this.pos, n10 = 0, r10 = this.value.charCodeAt(t10), i10;
    if (i10 = _Ob._table[r10], typeof i10 == `number`) return this.pos += 1, { type: i10, pos: t10, len: 1 };
    if (_Ob.isDigitCharacter(r10)) {
      i10 = 8;
      do
        n10 += 1, r10 = this.value.charCodeAt(t10 + n10);
      while (_Ob.isDigitCharacter(r10));
      return this.pos += n10, { type: i10, pos: t10, len: n10 };
    }
    if (_Ob.isVariableCharacter(r10)) {
      i10 = 9;
      do
        r10 = this.value.charCodeAt(t10 + ++n10);
      while (_Ob.isVariableCharacter(r10) || _Ob.isDigitCharacter(r10));
      return this.pos += n10, { type: i10, pos: t10, len: n10 };
    }
    i10 = 10;
    do
      n10 += 1, r10 = this.value.charCodeAt(t10 + n10);
    while (!isNaN(r10) && _Ob._table[r10] === void 0 && !_Ob.isDigitCharacter(r10) && !_Ob.isVariableCharacter(r10));
    return this.pos += n10, { type: i10, pos: t10, len: n10 };
  }
}, _Ob._table = { 36: 0, 58: 1, 44: 2, 123: 3, 125: 4, 92: 5, 47: 6, 124: 7, 43: 11, 45: 12, 63: 13 }, _Ob), uY = class {
  constructor() {
    this._children = [];
  }
  appendChild(e206) {
    return e206 instanceof dY && this._children[this._children.length - 1] instanceof dY ? this._children[this._children.length - 1].value += e206.value : (e206.parent = this, this._children.push(e206)), this;
  }
  replace(e206, t10) {
    let { parent: n10 } = e206, r10 = n10.children.indexOf(e206), i10 = n10.children.slice(0);
    i10.splice(r10, 1, ...t10), n10._children = i10, (function e207(t11, n11) {
      for (let r11 of t11) r11.parent = n11, e207(r11.children, r11);
    })(t10, n10);
  }
  get children() {
    return this._children;
  }
  get rightMostDescendant() {
    return this._children.length > 0 ? this._children[this._children.length - 1].rightMostDescendant : this;
  }
  get snippet() {
    let e206 = this;
    for (; ; ) {
      if (!e206) return;
      if (e206 instanceof vY) return e206;
      e206 = e206.parent;
    }
  }
  toString() {
    return this.children.reduce((e206, t10) => e206 + t10.toString(), ``);
  }
  len() {
    return 0;
  }
}, dY = class e166 extends uY {
  constructor(e206) {
    super(), this.value = e206;
  }
  toString() {
    return this.value;
  }
  len() {
    return this.value.length;
  }
  clone() {
    return new e166(this.value);
  }
}, fY = class extends uY {
}, pY = class e167 extends fY {
  static compareByIndex(e206, t10) {
    return e206.index === t10.index ? 0 : e206.isFinalTabstop ? 1 : t10.isFinalTabstop || e206.index < t10.index ? -1 : +(e206.index > t10.index);
  }
  constructor(e206) {
    super(), this.index = e206;
  }
  get isFinalTabstop() {
    return this.index === 0;
  }
  get choice() {
    return this._children.length === 1 && this._children[0] instanceof mY ? this._children[0] : void 0;
  }
  clone() {
    let t10 = new e167(this.index);
    return this.transform && (t10.transform = this.transform.clone()), t10._children = this.children.map((e206) => e206.clone()), t10;
  }
}, mY = class e168 extends uY {
  constructor() {
    super(...arguments), this.options = [];
  }
  appendChild(e206) {
    return e206 instanceof dY && (e206.parent = this, this.options.push(e206)), this;
  }
  toString() {
    return this.options[0].value;
  }
  len() {
    return this.options[0].len();
  }
  clone() {
    let t10 = new e168();
    return this.options.forEach(t10.appendChild, t10), t10;
  }
}, cxe = class e169 extends uY {
  constructor() {
    super(...arguments), this.regexp = RegExp(``);
  }
  resolve(e206) {
    let t10 = this, n10 = false, r10 = e206.replace(this.regexp, function() {
      return n10 = true, t10._replace(Array.prototype.slice.call(arguments, 0, -2));
    });
    return !n10 && this._children.some((e207) => e207 instanceof hY && !!e207.elseValue) && (r10 = this._replace([])), r10;
  }
  _replace(e206) {
    let t10 = ``;
    for (let n10 of this._children) if (n10 instanceof hY) {
      let r10 = e206[n10.index] || ``;
      r10 = n10.resolve(r10), t10 += r10;
    } else t10 += n10.toString();
    return t10;
  }
  toString() {
    return ``;
  }
  clone() {
    let t10 = new e169();
    return t10.regexp = new RegExp(this.regexp.source, (this.regexp.ignoreCase ? `i` : ``) + (this.regexp.global ? `g` : ``)), t10._children = this.children.map((e206) => e206.clone()), t10;
  }
}, hY = class e170 extends uY {
  constructor(e206, t10, n10, r10) {
    super(), this.index = e206, this.shorthandName = t10, this.ifValue = n10, this.elseValue = r10;
  }
  resolve(e206) {
    return this.shorthandName === `upcase` ? e206 ? e206.toLocaleUpperCase() : `` : this.shorthandName === `downcase` ? e206 ? e206.toLocaleLowerCase() : `` : this.shorthandName === `capitalize` ? e206 ? e206[0].toLocaleUpperCase() + e206.substr(1) : `` : this.shorthandName === `pascalcase` ? e206 ? this._toPascalCase(e206) : `` : this.shorthandName === `camelcase` ? e206 ? this._toCamelCase(e206) : `` : e206 && typeof this.ifValue == `string` ? this.ifValue : !e206 && typeof this.elseValue == `string` ? this.elseValue : e206 || ``;
  }
  _toPascalCase(e206) {
    let t10 = e206.match(/[a-z0-9]+/gi);
    return t10 ? t10.map((e207) => e207.charAt(0).toUpperCase() + e207.substr(1)).join(``) : e206;
  }
  _toCamelCase(e206) {
    let t10 = e206.match(/[a-z0-9]+/gi);
    return t10 ? t10.map((e207, t11) => t11 === 0 ? e207.charAt(0).toLowerCase() + e207.substr(1) : e207.charAt(0).toUpperCase() + e207.substr(1)).join(``) : e206;
  }
  clone() {
    return new e170(this.index, this.shorthandName, this.ifValue, this.elseValue);
  }
}, gY = class e171 extends fY {
  constructor(e206) {
    super(), this.name = e206;
  }
  resolve(e206) {
    let t10 = e206.resolve(this);
    return this.transform && (t10 = this.transform.resolve(t10 || ``)), t10 === void 0 ? false : (this._children = [new dY(t10)], true);
  }
  clone() {
    let t10 = new e171(this.name);
    return this.transform && (t10.transform = this.transform.clone()), t10._children = this.children.map((e206) => e206.clone()), t10;
  }
};
function _Y2(e206, t10) {
  let n10 = [...e206];
  for (; n10.length > 0; ) {
    let e207 = n10.shift();
    if (!t10(e207)) break;
    n10.unshift(...e207.children);
  }
}
var vY = class e172 extends uY {
  get placeholderInfo() {
    if (!this._placeholders) {
      let e206 = [], t10;
      this.walk(function(n10) {
        return n10 instanceof pY && (e206.push(n10), t10 = !t10 || t10.index < n10.index ? n10 : t10), true;
      }), this._placeholders = { all: e206, last: t10 };
    }
    return this._placeholders;
  }
  get placeholders() {
    let { all: e206 } = this.placeholderInfo;
    return e206;
  }
  offset(e206) {
    let t10 = 0, n10 = false;
    return this.walk((r10) => r10 === e206 ? (n10 = true, false) : (t10 += r10.len(), true)), n10 ? t10 : -1;
  }
  fullLen(e206) {
    let t10 = 0;
    return _Y2([e206], (e207) => (t10 += e207.len(), true)), t10;
  }
  enclosingPlaceholders(e206) {
    let t10 = [], { parent: n10 } = e206;
    for (; n10; ) n10 instanceof pY && t10.push(n10), n10 = n10.parent;
    return t10;
  }
  resolveVariables(e206) {
    return this.walk((t10) => (t10 instanceof gY && t10.resolve(e206) && (this._placeholders = void 0), true)), this;
  }
  appendChild(e206) {
    return this._placeholders = void 0, super.appendChild(e206);
  }
  replace(e206, t10) {
    return this._placeholders = void 0, super.replace(e206, t10);
  }
  clone() {
    let t10 = new e172();
    return this._children = this.children.map((e206) => e206.clone()), t10;
  }
  walk(e206) {
    _Y2(this.children, e206);
  }
}, yY = class {
  constructor() {
    this._scanner = new sxe(), this._token = { type: 14, pos: 0, len: 0 };
  }
  static escape(e206) {
    return e206.replace(/\$|}|\\/g, `\\$&`);
  }
  static guessNeedsClipboard(e206) {
    return /\${?CLIPBOARD/.test(e206);
  }
  parse(e206, t10, n10) {
    let r10 = new vY();
    return this.parseFragment(e206, r10), this.ensureFinalTabstop(r10, n10 ?? false, t10 ?? false), r10;
  }
  parseFragment(e206, t10) {
    let n10 = t10.children.length;
    for (this._scanner.text(e206), this._token = this._scanner.next(); this._parse(t10); ) ;
    let r10 = /* @__PURE__ */ new Map(), i10 = [];
    t10.walk((e207) => (e207 instanceof pY && (e207.isFinalTabstop ? r10.set(0, void 0) : !r10.has(e207.index) && e207.children.length > 0 ? r10.set(e207.index, e207.children) : i10.push(e207)), true));
    let a10 = (e207, n11) => {
      let i11 = r10.get(e207.index);
      if (!i11) return;
      let o11 = new pY(e207.index);
      o11.transform = e207.transform;
      for (let e208 of i11) {
        let t11 = e208.clone();
        o11.appendChild(t11), t11 instanceof pY && r10.has(t11.index) && !n11.has(t11.index) && (n11.add(t11.index), a10(t11, n11), n11.delete(t11.index));
      }
      t10.replace(e207, [o11]);
    }, o10 = /* @__PURE__ */ new Set();
    for (let e207 of i10) a10(e207, o10);
    return t10.children.slice(n10);
  }
  ensureFinalTabstop(e206, t10, n10) {
    (t10 || n10 && e206.placeholders.length > 0) && (e206.placeholders.find((e207) => e207.index === 0) || e206.appendChild(new pY(0)));
  }
  _accept(e206, t10) {
    if (e206 === void 0 || this._token.type === e206) {
      let e207 = t10 ? this._scanner.tokenText(this._token) : true;
      return this._token = this._scanner.next(), e207;
    }
    return false;
  }
  _backTo(e206) {
    return this._scanner.pos = e206.pos + e206.len, this._token = e206, false;
  }
  _until(e206) {
    let t10 = this._token;
    for (; this._token.type !== e206; ) {
      if (this._token.type === 14) return false;
      if (this._token.type === 5) {
        let e207 = this._scanner.next();
        if (e207.type !== 0 && e207.type !== 4 && e207.type !== 5) return false;
      }
      this._token = this._scanner.next();
    }
    let n10 = this._scanner.value.substring(t10.pos, this._token.pos).replace(/\\(\$|}|\\)/g, `$1`);
    return this._token = this._scanner.next(), n10;
  }
  _parse(e206) {
    return this._parseEscaped(e206) || this._parseTabstopOrVariableName(e206) || this._parseComplexPlaceholder(e206) || this._parseComplexVariable(e206) || this._parseAnything(e206);
  }
  _parseEscaped(e206) {
    let t10;
    return (t10 = this._accept(5, true)) ? (t10 = this._accept(0, true) || this._accept(4, true) || this._accept(5, true) || t10, e206.appendChild(new dY(t10)), true) : false;
  }
  _parseTabstopOrVariableName(e206) {
    let t10, n10 = this._token;
    return this._accept(0) && (t10 = this._accept(9, true) || this._accept(8, true)) ? (e206.appendChild(/^\d+$/.test(t10) ? new pY(Number(t10)) : new gY(t10)), true) : this._backTo(n10);
  }
  _parseComplexPlaceholder(e206) {
    let t10, n10 = this._token;
    if (!(this._accept(0) && this._accept(3) && (t10 = this._accept(8, true)))) return this._backTo(n10);
    let r10 = new pY(Number(t10));
    if (this._accept(1)) for (; ; ) {
      if (this._accept(4)) return e206.appendChild(r10), true;
      if (!this._parse(r10)) return e206.appendChild(new dY("${" + t10 + `:`)), r10.children.forEach(e206.appendChild, e206), true;
    }
    else if (r10.index > 0 && this._accept(7)) {
      let t11 = new mY();
      for (; ; ) {
        if (this._parseChoiceElement(t11)) {
          if (this._accept(2)) continue;
          if (this._accept(7) && (r10.appendChild(t11), this._accept(4))) return e206.appendChild(r10), true;
        }
        return this._backTo(n10), false;
      }
    } else if (this._accept(6)) return this._parseTransform(r10) ? (e206.appendChild(r10), true) : (this._backTo(n10), false);
    else if (this._accept(4)) return e206.appendChild(r10), true;
    else return this._backTo(n10);
  }
  _parseChoiceElement(e206) {
    let t10 = this._token, n10 = [];
    for (; !(this._token.type === 2 || this._token.type === 7); ) {
      let e207;
      if (e207 = (e207 = this._accept(5, true)) ? this._accept(2, true) || this._accept(7, true) || this._accept(5, true) || e207 : this._accept(void 0, true), !e207) return this._backTo(t10), false;
      n10.push(e207);
    }
    return n10.length === 0 ? (this._backTo(t10), false) : (e206.appendChild(new dY(n10.join(``))), true);
  }
  _parseComplexVariable(e206) {
    let t10, n10 = this._token;
    if (!(this._accept(0) && this._accept(3) && (t10 = this._accept(9, true)))) return this._backTo(n10);
    let r10 = new gY(t10);
    if (this._accept(1)) for (; ; ) {
      if (this._accept(4)) return e206.appendChild(r10), true;
      if (!this._parse(r10)) return e206.appendChild(new dY("${" + t10 + `:`)), r10.children.forEach(e206.appendChild, e206), true;
    }
    else if (this._accept(6)) return this._parseTransform(r10) ? (e206.appendChild(r10), true) : (this._backTo(n10), false);
    else if (this._accept(4)) return e206.appendChild(r10), true;
    else return this._backTo(n10);
  }
  _parseTransform(e206) {
    let t10 = new cxe(), n10 = ``, r10 = ``;
    for (; !this._accept(6); ) {
      let e207;
      if (e207 = this._accept(5, true)) {
        e207 = this._accept(6, true) || e207, n10 += e207;
        continue;
      }
      if (this._token.type !== 14) {
        n10 += this._accept(void 0, true);
        continue;
      }
      return false;
    }
    for (; !this._accept(6); ) {
      let e207;
      if (e207 = this._accept(5, true)) {
        e207 = this._accept(5, true) || this._accept(6, true) || e207, t10.appendChild(new dY(e207));
        continue;
      }
      if (!(this._parseFormatString(t10) || this._parseAnything(t10))) return false;
    }
    for (; !this._accept(4); ) {
      if (this._token.type !== 14) {
        r10 += this._accept(void 0, true);
        continue;
      }
      return false;
    }
    try {
      t10.regexp = new RegExp(n10, r10);
    } catch {
      return false;
    }
    return e206.transform = t10, true;
  }
  _parseFormatString(e206) {
    let t10 = this._token;
    if (!this._accept(0)) return false;
    let n10 = false;
    this._accept(3) && (n10 = true);
    let r10 = this._accept(8, true);
    if (!r10) return this._backTo(t10), false;
    if (!n10 || this._accept(4)) return e206.appendChild(new hY(Number(r10))), true;
    if (!this._accept(1)) return this._backTo(t10), false;
    if (this._accept(6)) {
      let n11 = this._accept(9, true);
      return !n11 || !this._accept(4) ? (this._backTo(t10), false) : (e206.appendChild(new hY(Number(r10), n11)), true);
    } else if (this._accept(11)) {
      let t11 = this._until(4);
      if (t11) return e206.appendChild(new hY(Number(r10), void 0, t11, void 0)), true;
    } else if (this._accept(12)) {
      let t11 = this._until(4);
      if (t11) return e206.appendChild(new hY(Number(r10), void 0, void 0, t11)), true;
    } else if (this._accept(13)) {
      let t11 = this._until(1);
      if (t11) {
        let n11 = this._until(4);
        if (n11) return e206.appendChild(new hY(Number(r10), void 0, t11, n11)), true;
      }
    } else {
      let t11 = this._until(4);
      if (t11) return e206.appendChild(new hY(Number(r10), void 0, void 0, t11)), true;
    }
    return this._backTo(t10), false;
  }
  _parseAnything(e206) {
    return this._token.type === 14 ? false : (e206.appendChild(new dY(this._scanner.tokenText(this._token))), this._accept(void 0), true);
  }
};
function bY(e206, t10, n10) {
  return (typeof n10.insertText == `string` ? n10.insertText === `` : n10.insertText.snippet === ``) ? { edits: n10.additionalEdit?.edits ?? [] } : { edits: [...t10.map((t11) => new bF(e206, { range: t11, text: typeof n10.insertText == `string` ? yY.escape(n10.insertText) + `$0` : n10.insertText.snippet, insertAsSnippet: true })), ...n10.additionalEdit?.edits ?? []] };
}
function xY(e206) {
  function t10(e207, t11) {
    return `mimeType` in e207 ? e207.mimeType === t11.handledMimeType : !!t11.kind && e207.kind.contains(t11.kind);
  }
  let n10 = /* @__PURE__ */ new Map();
  for (let r11 of e206) for (let i11 of r11.yieldTo ?? []) for (let a11 of e206) if (a11 !== r11 && t10(i11, a11)) {
    let e207 = n10.get(r11);
    e207 || (e207 = [], n10.set(r11, e207)), e207.push(a11);
  }
  if (!n10.size) return Array.from(e206);
  let r10 = /* @__PURE__ */ new Set(), i10 = [];
  function a10(e207) {
    if (!e207.length) return [];
    let t11 = e207[0];
    if (i10.includes(t11)) return console.warn(`Yield to cycle detected`, t11), e207;
    if (r10.has(t11)) return a10(e207.slice(1));
    let o10 = [], s10 = n10.get(t11);
    return s10 && (i10.push(t11), o10 = a10(s10), i10.pop()), r10.add(t11), [...o10, t11, ...a10(e207.slice(1))];
  }
  return a10(Array.from(e206));
}
function SY(e206, t10) {
  return t10 && (e206.stack || e206.stacktrace) ? C(29, `{0}: {1}`, wY(e206), CY(e206.stack) || CY(e206.stacktrace)) : wY(e206);
}
function CY(e206) {
  return Array.isArray(e206) ? e206.join(`
`) : e206;
}
function wY(e206) {
  return e206.code === `ERR_UNC_HOST_NOT_ALLOWED` ? `${e206.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.` : typeof e206.code == `string` && typeof e206.errno == `number` && typeof e206.syscall == `string` ? C(30, `A system error occurred ({0})`, e206.message) : e206.message || C(31, `An unknown error occurred. Please consult the log for more details.`);
}
function TY(e206 = null, t10 = false) {
  if (!e206) return C(32, `An unknown error occurred. Please consult the log for more details.`);
  if (Array.isArray(e206)) {
    let n10 = h(e206), r10 = TY(n10[0], t10);
    return n10.length > 1 ? C(33, `{0} ({1} errors in total)`, r10, n10.length) : r10;
  }
  if (Re(e206)) return e206;
  if (e206.detail) {
    let n10 = e206.detail;
    if (n10.error) return SY(n10.error, t10);
    if (n10.exception) return SY(n10.exception, t10);
  }
  return e206.stack ? SY(e206, t10) : e206.message ? e206.message : C(34, `An unknown error occurred. Please consult the log for more details.`);
}
var EY = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, DY = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, OY = `acceptSelectedCodeAction`, kY = `previewSelectedCodeAction`, lxe = class {
  get templateId() {
    return `header`;
  }
  renderTemplate(e206) {
    e206.classList.add(`group-header`);
    let t10 = document.createElement(`span`);
    return e206.append(t10), { container: e206, text: t10 };
  }
  renderElement(e206, t10, n10) {
    n10.text.textContent = e206.group?.title ?? e206.label ?? ``;
  }
  disposeTemplate(e206) {
  }
}, uxe = class {
  get templateId() {
    return `separator`;
  }
  renderTemplate(e206) {
    e206.classList.add(`separator`);
    let t10 = document.createElement(`span`);
    return e206.append(t10), { container: e206, text: t10 };
  }
  renderElement(e206, t10, n10) {
    n10.text.textContent = e206.label ?? ``;
  }
  disposeTemplate(e206) {
  }
}, AY = class {
  get templateId() {
    return `action`;
  }
  constructor(e206, t10) {
    this._supportsPreview = e206, this._keybindingService = t10;
  }
  renderTemplate(e206) {
    e206.classList.add(this.templateId);
    let t10 = document.createElement(`div`);
    t10.className = `icon`, e206.append(t10);
    let n10 = document.createElement(`span`);
    n10.className = `title`, e206.append(n10);
    let r10 = document.createElement(`span`);
    return r10.className = `description`, e206.append(r10), { container: e206, icon: t10, text: n10, description: r10, keybinding: new QR(e206, Pt) };
  }
  renderElement(e206, t10, n10) {
    if (e206.group?.icon ? (n10.icon.className = ju.asClassName(e206.group.icon), e206.group.icon.color && (n10.icon.style.color = Z(e206.group.icon.color.id))) : (n10.icon.className = ju.asClassName(F.lightBulb), n10.icon.style.color = `var(--vscode-editorLightBulb-foreground)`), !e206.item || !e206.label) return;
    gne(!e206.hideIcon, n10.icon), n10.text.textContent = NY(e206.label), e206.keybinding ? (n10.description.textContent = e206.keybinding.getLabel(), n10.description.style.display = `inline`, n10.description.style.letterSpacing = `0.5px`) : e206.description ? (n10.description.textContent = NY(e206.description), n10.description.style.display = `inline`) : (n10.description.textContent = ``, n10.description.style.display = `none`);
    let r10 = this._keybindingService.lookupKeybinding(OY)?.getLabel(), i10 = this._keybindingService.lookupKeybinding(kY)?.getLabel();
    n10.container.classList.toggle(`option-disabled`, e206.disabled), e206.tooltip ? n10.container.title = e206.tooltip : e206.disabled ? n10.container.title = e206.label : r10 && i10 ? this._supportsPreview && e206.canPreview ? n10.container.title = C(1653, `{0} to Apply, {1} to Preview`, r10, i10) : n10.container.title = C(1654, `{0} to Apply`, r10) : n10.container.title = ``;
  }
  disposeTemplate(e206) {
    e206.keybinding.dispose();
  }
};
AY = EY([DY(1, Dw)], AY);
var dxe = class extends UIEvent {
  constructor() {
    super(`acceptSelectedAction`);
  }
}, jY = class extends UIEvent {
  constructor() {
    super(`previewSelectedAction`);
  }
};
function fxe(e206) {
  if (e206.kind === `action`) return e206.label;
}
var MY = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(), this._delegate = r10, this._contextViewService = a10, this._keybindingService = o10, this._layoutService = s10, this._actionLineHeight = 28, this._headerLineHeight = 28, this._separatorLineHeight = 8, this.cts = this._register(new pr()), this.domNode = document.createElement(`div`), this.domNode.classList.add(`actionList`), this._list = this._register(new $I(e206, this.domNode, { getHeight: (e207) => {
      switch (e207.kind) {
        case `header`:
          return this._headerLineHeight;
        case `separator`:
          return this._separatorLineHeight;
        default:
          return this._actionLineHeight;
      }
    }, getTemplateId: (e207) => e207.kind }, [new AY(t10, this._keybindingService), new lxe(), new uxe()], { keyboardSupport: false, typeNavigationEnabled: true, keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: fxe }, accessibilityProvider: { getAriaLabel: (e207) => {
      if (e207.kind === `action`) {
        let t11 = e207.label ? NY(e207?.label) : ``;
        return e207.description && (t11 = t11 + `, ` + NY(e207.description)), e207.disabled && (t11 = C(1655, `{0}, Disabled Reason: {1}`, t11, e207.disabled)), t11;
      }
      return null;
    }, getWidgetAriaLabel: () => C(1656, `Action Widget`), getRole: (e207) => {
      switch (e207.kind) {
        case `action`:
          return `option`;
        case `separator`:
          return `separator`;
        default:
          return `separator`;
      }
    }, getWidgetRole: () => `listbox`, ...i10 } })), this._list.style(uL), this._register(this._list.onMouseClick((e207) => this.onListClick(e207))), this._register(this._list.onMouseOver((e207) => this.onListHover(e207))), this._register(this._list.onDidChangeFocus(() => this.onFocus())), this._register(this._list.onDidChangeSelection((e207) => this.onListSelection(e207))), this._allMenuItems = n10, this._list.splice(0, this._list.length, this._allMenuItems), this._list.length && this.focusNext();
  }
  focusCondition(e206) {
    return !e206.disabled && e206.kind === `action`;
  }
  hide(e206) {
    this._delegate.onHide(e206), this.cts.cancel(), this._contextViewService.hideContextView();
  }
  layout(e206) {
    let t10 = this._allMenuItems.filter((e207) => e207.kind === `header`).length, n10 = this._allMenuItems.filter((e207) => e207.kind === `separator`).length, r10 = this._allMenuItems.length * this._actionLineHeight + t10 * this._headerLineHeight - t10 * this._actionLineHeight + n10 * this._separatorLineHeight - n10 * this._actionLineHeight;
    this._list.layout(r10);
    let i10 = e206;
    if (this._allMenuItems.length >= 50) i10 = 380;
    else {
      let t11 = this._allMenuItems.map((e207, t12) => {
        let n11 = this.domNode.ownerDocument.getElementById(this._list.getElementID(t12));
        if (n11) {
          n11.style.width = `auto`;
          let e208 = n11.getBoundingClientRect().width;
          return n11.style.width = ``, e208;
        }
        return 0;
      });
      i10 = Math.max(...t11, e206);
    }
    let a10 = Math.min(r10, this._layoutService.getContainer(Vc(this.domNode)).clientHeight * 0.7);
    return this._list.layout(a10, i10), this.domNode.style.height = `${a10}px`, this._list.domFocus(), i10;
  }
  focusPrevious() {
    this._list.focusPrevious(1, true, void 0, this.focusCondition);
  }
  focusNext() {
    this._list.focusNext(1, true, void 0, this.focusCondition);
  }
  acceptSelected(e206) {
    let t10 = this._list.getFocus();
    if (t10.length === 0) return;
    let n10 = t10[0], r10 = this._list.element(n10);
    if (!this.focusCondition(r10)) return;
    let i10 = e206 ? new jY() : new dxe();
    this._list.setSelection([n10], i10);
  }
  onListSelection(e206) {
    if (!e206.elements.length) return;
    let t10 = e206.elements[0];
    t10.item && this.focusCondition(t10) ? this._delegate.onSelect(t10.item, e206.browserEvent instanceof jY) : this._list.setSelection([]);
  }
  onFocus() {
    let e206 = this._list.getFocus();
    if (e206.length === 0) return;
    let t10 = e206[0], n10 = this._list.element(t10);
    this._delegate.onFocus?.(n10.item);
  }
  async onListHover(e206) {
    let t10 = e206.element;
    if (t10 && t10.item && this.focusCondition(t10)) {
      if (this._delegate.onHover && !t10.disabled && t10.kind === `action`) {
        let e207 = await this._delegate.onHover(t10.item, this.cts.token);
        t10.canPreview = e207 ? e207.canPreview : void 0;
      }
      e206.index && this._list.splice(e206.index, 1, [t10]);
    }
    this._list.setFocus(typeof e206.index == `number` ? [e206.index] : []);
  }
  onListClick(e206) {
    e206.element && this.focusCondition(e206.element) && this._list.setFocus([]);
  }
};
MY = EY([DY(5, pj), DY(6, Dw), DY(7, Bk)], MY);
function NY(e206) {
  return e206.replace(/\r\n|\r|\n/g, ` `);
}
var pxe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, PY = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
};
Q(`actionBar.toggledBackground`, wy, C(1657, `Background color for toggled action items in action bar.`));
var FY = { Visible: new U(`codeActionMenuVisible`, false, C(1658, `Whether the action widget list is visible`)) }, IY = xu(`actionWidgetService`), LY = class extends D {
  get isVisible() {
    return FY.Visible.getValue(this._contextKeyService) || false;
  }
  constructor(e206, t10, n10) {
    super(), this._contextViewService = e206, this._contextKeyService = t10, this._instantiationService = n10, this._list = this._register(new Jt());
  }
  show(e206, t10, n10, r10, i10, a10, o10, s10) {
    let c10 = FY.Visible.bindTo(this._contextKeyService), l10 = this._instantiationService.createInstance(MY, e206, t10, n10, r10, s10);
    this._contextViewService.showContextView({ getAnchor: () => i10, render: (e207) => (c10.set(true), this._renderWidget(e207, l10, o10 ?? [])), onHide: (e207) => {
      c10.reset(), this._onWidgetClosed(e207);
    } }, a10, false);
  }
  acceptSelected(e206) {
    this._list.value?.acceptSelected(e206);
  }
  focusPrevious() {
    this._list?.value?.focusPrevious();
  }
  focusNext() {
    this._list?.value?.focusNext();
  }
  hide(e206) {
    this._list.value?.hide(e206), this._list.clear();
  }
  _renderWidget(e206, t10, n10) {
    let r10 = document.createElement(`div`);
    if (r10.classList.add(`action-widget`), e206.appendChild(r10), this._list.value = t10, this._list.value) r10.appendChild(this._list.value.domNode);
    else throw Error(`List has no value`);
    let i10 = new E(), a10 = document.createElement(`div`), o10 = e206.appendChild(a10);
    o10.classList.add(`context-view-block`), i10.add(L(o10, R.MOUSE_DOWN, (e207) => e207.stopPropagation()));
    let s10 = document.createElement(`div`), c10 = e206.appendChild(s10);
    c10.classList.add(`context-view-pointerBlock`), i10.add(L(c10, R.POINTER_MOVE, () => c10.remove())), i10.add(L(c10, R.MOUSE_DOWN, () => c10.remove()));
    let l10 = 0;
    if (n10.length) {
      let e207 = this._createActionBar(`.action-widget-action-bar`, n10);
      e207 && (r10.appendChild(e207.getContainer().parentElement), i10.add(e207), l10 = e207.getContainer().offsetWidth);
    }
    let u10 = this._list.value?.layout(l10);
    r10.style.width = `${u10}px`;
    let d10 = i10.add(Gl(e206));
    return i10.add(d10.onDidBlur(() => this.hide(true))), i10;
  }
  _createActionBar(e206, t10) {
    if (!t10.length) return;
    let n10 = new CL(B(e206));
    return n10.push(t10, { icon: false, label: true }), n10;
  }
  _onWidgetClosed(e206) {
    this._list.value?.hide(e206);
  }
};
LY = pxe([PY(0, pj), PY(1, nd), PY(2, V)], LY), Zf(IY, LY, 1);
var RY = 1100;
yd(class extends vd {
  constructor() {
    super({ id: `hideCodeActionWidget`, title: w(1659, `Hide action widget`), precondition: FY.Visible, keybinding: { weight: RY, primary: 9, secondary: [1033] } });
  }
  run(e206) {
    e206.get(IY).hide(true);
  }
}), yd(class extends vd {
  constructor() {
    super({ id: `selectPrevCodeAction`, title: w(1660, `Select previous action`), precondition: FY.Visible, keybinding: { weight: RY, primary: 16, secondary: [2064], mac: { primary: 16, secondary: [2064, 302] } } });
  }
  run(e206) {
    let t10 = e206.get(IY);
    t10 instanceof LY && t10.focusPrevious();
  }
}), yd(class extends vd {
  constructor() {
    super({ id: `selectNextCodeAction`, title: w(1661, `Select next action`), precondition: FY.Visible, keybinding: { weight: RY, primary: 18, secondary: [2066], mac: { primary: 18, secondary: [2066, 300] } } });
  }
  run(e206) {
    let t10 = e206.get(IY);
    t10 instanceof LY && t10.focusNext();
  }
}), yd(class extends vd {
  constructor() {
    super({ id: OY, title: w(1662, `Accept selected action`), precondition: FY.Visible, keybinding: { weight: RY, primary: 3, secondary: [2137] } });
  }
  run(e206) {
    let t10 = e206.get(IY);
    t10 instanceof LY && t10.acceptSelected();
  }
}), yd(class extends vd {
  constructor() {
    super({ id: kY, title: w(1663, `Preview selected action`), precondition: FY.Visible, keybinding: { weight: RY, primary: 2051 } });
  }
  run(e206) {
    let t10 = e206.get(IY);
    t10 instanceof LY && t10.acceptSelected(true);
  }
});
var zY = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, BY = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, VY, HY = (_Pb = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    super(), this.typeId = e206, this.editor = t10, this.showCommand = r10, this.range = i10, this.edits = a10, this.onSelectNewEdit = o10, this.additionalActions = s10, this._keybindingService = l10, this._actionWidgetService = u10, this.allowEditorOverflow = true, this.suppressMouseDown = true, this.create(), this.visibleContext = n10.bindTo(c10), this.visibleContext.set(true), this._register(T(() => this.visibleContext.reset())), this.editor.addContentWidget(this), this.editor.layoutContentWidget(this), this._register(T((() => this.editor.removeContentWidget(this)))), this._register(this.editor.onDidChangeCursorPosition((e207) => {
      this.dispose();
    })), this._register(O.runAndSubscribe(l10.onDidUpdateKeybindings, () => {
      this._updateButtonTitle();
    }));
  }
  _updateButtonTitle() {
    let e206 = this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();
    this.button.element.title = this.showCommand.label + (e206 ? ` (${e206})` : ``);
  }
  create() {
    this.domNode = B(`.post-edit-widget`), this.button = this._register(new yR(this.domNode, { supportIcons: true })), this.button.label = `$(insert)`, this._register(L(this.domNode, R.CLICK, () => this.showSelector()));
  }
  getId() {
    return VY.baseId + `.` + this.typeId;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return { position: this.range.getEndPosition(), preference: [2] };
  }
  showSelector() {
    let e206 = _l2(this.button.element), t10 = { x: e206.left + e206.width, y: e206.top + e206.height };
    this._actionWidgetService.show(`postEditWidget`, false, this.edits.allEdits.map((e207, t11) => ({ kind: `action`, item: e207, label: e207.title, disabled: false, canPreview: false, group: { title: ``, icon: ju.fromId(t11 === this.edits.activeEditIndex ? F.check.id : F.blank.id) } })), { onHide: () => {
      this.editor.focus();
    }, onSelect: (e207) => {
      this._actionWidgetService.hide(false);
      let t11 = this.edits.allEdits.findIndex((t12) => t12 === e207);
      if (t11 !== this.edits.activeEditIndex) return this.onSelectNewEdit(t11);
    } }, t10, this.editor.getDomNode() ?? void 0, this.additionalActions);
  }
}, VY = _Pb, _Pb.baseId = `editor.widget.postEditWidget`, _Pb);
HY = VY = zY([BY(8, nd), BY(9, Dw), BY(10, IY)], HY);
var UY = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(), this._id = e206, this._editor = t10, this._visibleContext = n10, this._showCommand = r10, this._getAdditionalActions = i10, this._instantiationService = a10, this._bulkEditService = o10, this._notificationService = s10, this._currentWidget = this._register(new Jt()), this._register(O.any(t10.onDidChangeModel, t10.onDidChangeModelContent)(() => this.clear()));
  }
  async applyEditAndShowIfNeeded(e206, t10, n10, r10, i10) {
    if (!e206.length || !this._editor.hasModel()) return;
    let a10 = this._editor.getModel(), o10 = t10.allEdits.at(t10.activeEditIndex);
    if (!o10) return;
    let s10 = async (a11) => {
      let o11 = this._editor.getModel();
      o11 && (await o11.undo(), this.applyEditAndShowIfNeeded(e206, { activeEditIndex: a11, allEdits: t10.allEdits }, n10, r10, i10));
    }, c10 = (r11, i11) => {
      we(r11) || (this._notificationService.error(i11), n10 && this.show(e206[0], t10, s10));
    }, l10 = new tJ(this._editor, 3, void 0, i10), u10;
    try {
      u10 = await Lte(r10(o10, l10.token), l10.token);
    } catch (e207) {
      return c10(e207, C(937, `Error resolving edit '{0}':
{1}`, o10.title, TY(e207)));
    } finally {
      l10.dispose();
    }
    if (i10.isCancellationRequested) return;
    let d10 = bY(a10.uri, e206, u10), f10 = e206[0], p10 = a10.deltaDecorations([], [{ range: f10, options: { description: `paste-line-suffix`, stickiness: 0 } }]);
    this._editor.focus();
    let m10, h10;
    try {
      m10 = await this._bulkEditService.apply(d10, { editor: this._editor, token: i10 }), h10 = a10.getDecorationRange(p10[0]);
    } catch (e207) {
      return c10(e207, C(938, `Error applying edit '{0}':
{1}`, o10.title, TY(e207)));
    } finally {
      a10.deltaDecorations(p10, []);
    }
    i10.isCancellationRequested || n10 && m10.isApplied && t10.allEdits.length > 1 && this.show(h10 ?? f10, t10, s10);
  }
  show(e206, t10, n10) {
    this.clear(), this._editor.hasModel() && (this._currentWidget.value = this._instantiationService.createInstance(HY, this._id, this._editor, this._visibleContext, this._showCommand, e206, t10, n10, this._getAdditionalActions()));
  }
  clear() {
    this._currentWidget.clear();
  }
  tryShowSelector() {
    this._currentWidget.value?.showSelector();
  }
};
UY = zY([BY(5, V), BY(6, vF), BY(7, dw)], UY);
var mxe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, WY = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, GY, KY = `editor.changePasteType`, hxe = `editor.pasteAs.preferences`, qY = new U(`pasteWidgetVisible`, false, C(917, `Whether the paste widget is showing`)), JY = `application/vnd.code.copymetadata`, YY = (_Qb = class extends D {
  static get(e206) {
    return e206.getContribution(GY.ID);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    super(), this._logService = n10, this._bulkEditService = r10, this._clipboardService = i10, this._commandService = a10, this._configService = o10, this._languageFeaturesService = s10, this._quickInputService = c10, this._progressService = l10, this._editor = e206;
    let u10 = e206.getContainerDomNode();
    this._register(L(u10, `copy`, (e207) => this.handleCopy(e207))), this._register(L(u10, `cut`, (e207) => this.handleCopy(e207))), this._register(L(u10, `paste`, (e207) => this.handlePaste(e207), true)), this._pasteProgressManager = this._register(new YJ(`pasteIntoEditor`, e206, t10)), this._postPasteWidgetManager = this._register(t10.createInstance(UY, `pasteIntoEditor`, e206, qY, { id: KY, label: C(918, `Show paste options...`) }, () => GY._configureDefaultAction ? [GY._configureDefaultAction] : []));
  }
  changePasteType() {
    this._postPasteWidgetManager.tryShowSelector();
  }
  async pasteAs(e206) {
    this._logService.trace(`CopyPasteController.pasteAs`), this._editor.focus();
    try {
      this._logService.trace(`Before calling editor.action.clipboardPasteAction`), this._pasteAsActionContext = { preferred: e206 }, await this._commandService.executeCommand(`editor.action.clipboardPasteAction`);
    } finally {
      this._pasteAsActionContext = void 0;
    }
  }
  clearWidgets() {
    this._postPasteWidgetManager.clear();
  }
  isPasteAsEnabled() {
    return this._editor.getOption(97).enabled;
  }
  async finishedPaste() {
    await this._currentPasteOperation;
  }
  handleCopy(e206) {
    let t10 = null;
    if (e206.clipboardData) {
      let [n11, r11] = Cx.getTextData(e206.clipboardData);
      t10 = (r11 || xx.INSTANCE.get(n11))?.id || null, this._logService.trace(`CopyPasteController#handleCopy for id : `, t10, ` with text.length : `, n11.length);
    } else this._logService.trace(`CopyPasteController#handleCopy`);
    if (!this._editor.hasTextFocus() || (this._clipboardService.clearInternalState?.(), !e206.clipboardData || !this.isPasteAsEnabled())) return;
    let n10 = this._editor.getModel(), r10 = this._editor.getSelections();
    if (!n10 || !r10?.length) return;
    let i10 = this._editor.getOption(45), a10 = r10, o10 = r10.length === 1 && r10[0].isEmpty();
    if (o10) {
      if (!i10) return;
      a10 = [new M(a10[0].startLineNumber, 1, a10[0].startLineNumber, 1 + n10.getLineLength(a10[0].startLineNumber))];
    }
    let s10 = this._editor._getViewModel()?.getPlainTextToCopy(r10, i10, wt), c10 = { multicursorText: Array.isArray(s10) ? s10 : null, pasteOnNewLine: o10, mode: null }, l10 = this._languageFeaturesService.documentPasteEditProvider.ordered(n10).filter((e207) => !!e207.prepareDocumentPaste);
    if (!l10.length) {
      this.setCopyMetadata(e206.clipboardData, { defaultPastePayload: c10 });
      return;
    }
    let u10 = qJ(e206.clipboardData), d10 = l10.flatMap((e207) => e207.copyMimeTypes ?? []), f10 = t10 ?? Tx();
    this.setCopyMetadata(e206.clipboardData, { id: f10, providerCopyMimeTypes: d10, defaultPastePayload: c10 });
    let p10 = l10.map((e207) => ({ providerMimeTypes: e207.copyMimeTypes, operation: es((t11) => e207.prepareDocumentPaste(n10, a10, u10, t11).catch((e208) => {
      console.error(e208);
    })) }));
    GY._currentCopyOperation?.operations.forEach((e207) => e207.operation.cancel()), GY._currentCopyOperation = { handle: f10, operations: p10 };
  }
  async handlePaste(e206) {
    if (e206.clipboardData) {
      let [t11, n11] = Cx.getTextData(e206.clipboardData), r11 = n11 || xx.INSTANCE.get(t11);
      this._logService.trace(`CopyPasteController#handlePaste for id : `, r11?.id);
    } else this._logService.trace(`CopyPasteController#handlePaste`);
    if (!e206.clipboardData || !this._editor.hasTextFocus()) return;
    QJ.get(this._editor)?.closeMessage(), this._currentPasteOperation?.cancel(), this._currentPasteOperation = void 0;
    let t10 = this._editor.getModel(), n10 = this._editor.getSelections();
    if (!n10?.length || !t10 || this._editor.getOption(104) || !this.isPasteAsEnabled() && !this._pasteAsActionContext) return;
    let r10 = this.fetchCopyMetadata(e206);
    this._logService.trace(`CopyPasteController#handlePaste with metadata : `, r10?.id, ` and text.length : `, e206.clipboardData.getData(`text/plain`).length);
    let i10 = JJ(e206.clipboardData);
    i10.delete(JY);
    let a10 = Array.from(e206.clipboardData.files).map((e207) => e207.type), o10 = [...e206.clipboardData.types, ...a10, ...r10?.providerCopyMimeTypes ?? [], $f.uriList], s10 = this._languageFeaturesService.documentPasteEditProvider.ordered(t10).filter((e207) => {
      let t11 = this._pasteAsActionContext?.preferred;
      return t11 && !this.providerMatchesPreference(e207, t11) ? false : e207.pasteMimeTypes?.some((e208) => VJ(e208, o10));
    });
    if (!s10.length) {
      this._pasteAsActionContext?.preferred && (this.showPasteAsNoEditMessage(n10, this._pasteAsActionContext.preferred), e206.preventDefault(), e206.stopImmediatePropagation());
      return;
    }
    e206.preventDefault(), e206.stopImmediatePropagation(), this._pasteAsActionContext ? this.showPasteAsPick(this._pasteAsActionContext.preferred, s10, n10, i10, r10) : this.doPasteInline(s10, n10, i10, r10, e206);
  }
  showPasteAsNoEditMessage(e206, t10) {
    let n10 = `only` in t10 ? t10.only.value : `preferences` in t10 ? t10.preferences.length ? t10.preferences.map((e207) => e207.value).join(`, `) : C(919, `empty`) : t10.providerId;
    QJ.get(this._editor)?.showMessage(C(920, `No paste edits for '{0}' found`, n10), e206[0].getStartPosition());
  }
  doPasteInline(e206, t10, n10, r10, i10) {
    this._logService.trace(`CopyPasteController#doPasteInline`);
    let a10 = this._editor;
    if (!a10.hasModel()) return;
    let o10 = new tJ(a10, 3, void 0), s10 = es(async (a11) => {
      let c10 = this._editor;
      if (!c10.hasModel()) return;
      let l10 = c10.getModel(), u10 = new E(), d10 = u10.add(new pr(a11));
      u10.add(o10.token.onCancellationRequested(() => d10.cancel()));
      let f10 = d10.token;
      try {
        if (await this.mergeInDataFromCopy(e206, n10, r10, f10), f10.isCancellationRequested) return;
        let a12 = e206.filter((e207) => this.isSupportedPasteProvider(e207, n10));
        if (!a12.length || a12.length === 1 && a12[0] instanceof rY) return this.applyDefaultPasteHandler(n10, r10, f10, i10);
        let o11 = { triggerKind: xi.Automatic }, s11 = await this.getPasteEdits(a12, n10, l10, t10, o11, f10);
        if (u10.add(s11), f10.isCancellationRequested) return;
        if (s11.edits.length === 1 && s11.edits[0].provider instanceof rY) return this.applyDefaultPasteHandler(n10, r10, f10, i10);
        if (s11.edits.length) {
          let e207 = c10.getOption(97).showPasteSelector === `afterPaste`;
          return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t10, { activeEditIndex: this.getInitialActiveEditIndex(l10, s11.edits), allEdits: s11.edits }, e207, async (e208, n11) => {
            if (!e208.provider.resolveDocumentPasteEdit) return e208;
            let r11 = e208.provider.resolveDocumentPasteEdit(e208, n11), i11 = new hs(), a13 = await this._pasteProgressManager.showWhile(t10[0].getEndPosition(), C(921, `Resolving paste edit for '{0}'. Click to cancel`, e208.title), ts(Promise.race([i11.p, r11]), n11), { cancel: () => i11.cancel() }, 0);
            return a13 && (e208.insertText = a13.insertText, e208.additionalEdit = a13.additionalEdit), e208;
          }, f10);
        }
        await this.applyDefaultPasteHandler(n10, r10, f10, i10);
      } finally {
        u10.dispose(), this._currentPasteOperation === s10 && (this._currentPasteOperation = void 0);
      }
    });
    this._pasteProgressManager.showWhile(t10[0].getEndPosition(), C(922, `Running paste handlers. Click to cancel and do basic paste`), s10, { cancel: async () => {
      s10.cancel(), !o10.token.isCancellationRequested && await this.applyDefaultPasteHandler(n10, r10, o10.token, i10);
    } }).finally(() => {
      o10.dispose();
    }), this._currentPasteOperation = s10;
  }
  showPasteAsPick(e206, t10, n10, r10, i10) {
    this._logService.trace(`CopyPasteController#showPasteAsPick`);
    let a10 = es(async (o10) => {
      let s10 = this._editor;
      if (!s10.hasModel()) return;
      let c10 = s10.getModel(), l10 = new E(), u10 = l10.add(new tJ(s10, 3, void 0, o10));
      try {
        if (await this.mergeInDataFromCopy(t10, r10, i10, u10.token), u10.token.isCancellationRequested) return;
        let a11 = t10.filter((t11) => this.isSupportedPasteProvider(t11, r10, e206));
        e206 && (a11 = a11.filter((t11) => this.providerMatchesPreference(t11, e206)));
        let o11 = { triggerKind: xi.PasteAs, only: e206 && `only` in e206 ? e206.only : void 0 }, s11 = l10.add(await this.getPasteEdits(a11, r10, c10, n10, o11, u10.token));
        if (u10.token.isCancellationRequested) return;
        if (e206 && (s11 = { edits: s11.edits.filter((t11) => `only` in e206 ? e206.only.contains(t11.kind) : `preferences` in e206 ? e206.preferences.some((e207) => e207.contains(t11.kind)) : e206.providerId === t11.provider.id), dispose: s11.dispose }), !s11.edits.length) {
          e206 && this.showPasteAsNoEditMessage(n10, e206);
          return;
        }
        let d10;
        if (e206) d10 = s11.edits.at(0);
        else {
          let e207 = { id: `editor.pasteAs.default`, label: C(923, `Configure default paste action`), edit: void 0 }, t11 = await this._quickInputService.pick([...s11.edits.map((e208) => ({ label: e208.title, description: e208.kind?.value, edit: e208 })), ...GY._configureDefaultAction ? [$e({ type: `separator` }), { label: GY._configureDefaultAction.label, edit: void 0 }] : []], { placeHolder: C(924, `Select Paste Action`) });
          if (t11 === e207) {
            GY._configureDefaultAction?.run();
            return;
          }
          d10 = t11?.edit;
        }
        if (!d10) return;
        let f10 = bY(c10.uri, n10, d10);
        await this._bulkEditService.apply(f10, { editor: this._editor });
      } finally {
        l10.dispose(), this._currentPasteOperation === a10 && (this._currentPasteOperation = void 0);
      }
    });
    this._progressService.withProgress({ location: 10, title: C(925, `Running paste handlers`) }, () => a10);
  }
  setCopyMetadata(e206, t10) {
    this._logService.trace(`CopyPasteController#setCopyMetadata new id : `, t10.id), e206.setData(JY, JSON.stringify(t10));
  }
  fetchCopyMetadata(e206) {
    if (this._logService.trace(`CopyPasteController#fetchCopyMetadata`), !e206.clipboardData) return;
    let t10 = e206.clipboardData.getData(JY);
    if (t10) try {
      return JSON.parse(t10);
    } catch {
      return;
    }
    let [n10, r10] = Cx.getTextData(e206.clipboardData);
    if (r10) return { defaultPastePayload: { mode: r10.mode, multicursorText: r10.multicursorText ?? null, pasteOnNewLine: !!r10.isFromEmptySelection } };
  }
  async mergeInDataFromCopy(e206, t10, n10, r10) {
    if (this._logService.trace(`CopyPasteController#mergeInDataFromCopy with metadata : `, n10?.id), n10?.id && GY._currentCopyOperation?.handle === n10.id) {
      let n11 = GY._currentCopyOperation.operations.filter((t11) => e206.some((e207) => e207.pasteMimeTypes.some((e208) => VJ(e208, t11.providerMimeTypes)))).map((e207) => e207.operation), i10 = await Promise.all(n11);
      if (r10.isCancellationRequested) return;
      for (let e207 of i10.reverse()) if (e207) for (let [n12, r11] of e207) t10.replace(n12, r11);
    }
    if (!t10.has($f.uriList)) {
      let e207 = await this._clipboardService.readResources();
      if (r10.isCancellationRequested) return;
      e207.length && t10.append($f.uriList, RJ(UJ.create(e207)));
    }
  }
  async getPasteEdits(e206, t10, n10, r10, i10, a10) {
    let o10 = new E();
    return { edits: xY(h(await ts(Promise.all(e206.map(async (e207) => {
      try {
        let s10 = await e207.provideDocumentPasteEdits?.(n10, r10, t10, i10, a10);
        return s10 && o10.add(s10), s10?.edits?.map((t11) => ({ ...t11, provider: e207 }));
      } catch (e208) {
        we(e208) || console.error(e208);
        return;
      }
    })), a10) ?? []).flat().filter((e207) => !i10.only || i10.only.contains(e207.kind))), dispose: () => o10.dispose() };
  }
  async applyDefaultPasteHandler(e206, t10, n10, r10) {
    let i10 = await (e206.get($f.text) ?? e206.get(`text`))?.asString() ?? ``;
    if (n10.isCancellationRequested) return;
    let a10 = { clipboardEvent: r10, text: i10, pasteOnNewLine: t10?.defaultPastePayload.pasteOnNewLine ?? false, multicursorText: t10?.defaultPastePayload.multicursorText ?? null, mode: null };
    this._logService.trace(`CopyPasteController#applyDefaultPasteHandler for id : `, t10?.id), this._editor.trigger(`keyboard`, `paste`, a10);
  }
  isSupportedPasteProvider(e206, t10, n10) {
    return e206.pasteMimeTypes?.some((e207) => t10.matches(e207)) ? !n10 || this.providerMatchesPreference(e206, n10) : false;
  }
  providerMatchesPreference(e206, t10) {
    return `only` in t10 ? e206.providedPasteEditKinds.some((e207) => t10.only.contains(e207)) : `preferences` in t10 ? t10.preferences.some((e207) => t10.preferences.some((t11) => t11.contains(e207))) : e206.id === t10.providerId;
  }
  getInitialActiveEditIndex(e206, t10) {
    let n10 = this._configService.getValue(hxe, { resource: e206.uri });
    for (let e207 of Array.isArray(n10) ? n10 : []) {
      let n11 = new WJ(e207), r10 = t10.findIndex((e208) => n11.contains(e208.kind));
      if (r10 >= 0) return r10;
    }
    return 0;
  }
}, GY = _Qb, _Qb.ID = `editor.contrib.copyPasteActionController`, _Qb);
YY = GY = mxe([WY(1, V), WY(2, Ud), WY(3, vF), WY(4, hW), WY(5, Mu), WY(6, Uf), WY(7, X), WY(8, aF), WY(9, VF)], YY);
var XY = `9_cutcopypaste`, gxe = Dt || document.queryCommandSupported(`cut`), ZY = Dt || document.queryCommandSupported(`copy`), _xe = navigator.clipboard === void 0 || Mo ? document.queryCommandSupported(`paste`) : true;
function QY(e206) {
  return e206.register(), e206;
}
var vxe = gxe ? QY(new Zd({ id: `editor.action.clipboardCutAction`, precondition: void 0, kbOpts: Dt ? { primary: 2102, win: { primary: 2102, secondary: [1044] }, weight: 100 } : void 0, menuOpts: [{ menuId: W.MenubarEditMenu, group: `2_ccp`, title: C(813, `Cu&&t`), order: 1 }, { menuId: W.EditorContext, group: XY, title: C(814, `Cut`), when: $.writable, order: 1 }, { menuId: W.CommandPalette, group: ``, title: C(815, `Cut`), order: 1 }, { menuId: W.SimpleEditorContext, group: XY, title: C(816, `Cut`), when: $.writable, order: 1 }] })) : void 0, yxe = ZY ? QY(new Zd({ id: `editor.action.clipboardCopyAction`, precondition: void 0, kbOpts: Dt ? { primary: 2081, win: { primary: 2081, secondary: [2067] }, weight: 100 } : void 0, menuOpts: [{ menuId: W.MenubarEditMenu, group: `2_ccp`, title: C(817, `&&Copy`), order: 2 }, { menuId: W.EditorContext, group: XY, title: C(818, `Copy`), order: 2 }, { menuId: W.CommandPalette, group: ``, title: C(819, `Copy`), order: 1 }, { menuId: W.SimpleEditorContext, group: XY, title: C(820, `Copy`), order: 2 }] })) : void 0;
hd.appendMenuItem(W.MenubarEditMenu, { submenu: W.MenubarCopy, title: w(825, `Copy As`), group: `2_ccp`, order: 3 }), hd.appendMenuItem(W.EditorContext, { submenu: W.EditorContextCopy, title: w(826, `Copy As`), group: XY, order: 3 }), hd.appendMenuItem(W.EditorContext, { submenu: W.EditorContextShare, title: w(827, `Share`), group: `11_share`, order: -1, when: H.and(H.notEquals(`resourceScheme`, `output`), $.editorTextFocus) }), hd.appendMenuItem(W.ExplorerContext, { submenu: W.ExplorerContextShare, title: w(828, `Share`), group: `11_share`, order: -1 });
var $Y = _xe ? QY(new Zd({ id: `editor.action.clipboardPasteAction`, precondition: void 0, kbOpts: Dt ? { primary: 2100, win: { primary: 2100, secondary: [1043] }, linux: { primary: 2100, secondary: [1043] }, weight: 100 } : void 0, menuOpts: [{ menuId: W.MenubarEditMenu, group: `2_ccp`, title: C(821, `&&Paste`), order: 4 }, { menuId: W.EditorContext, group: XY, title: C(822, `Paste`), when: $.writable, order: 4 }, { menuId: W.CommandPalette, group: ``, title: C(823, `Paste`), order: 1 }, { menuId: W.SimpleEditorContext, group: XY, title: C(824, `Paste`), when: $.writable, order: 4 }] })) : void 0, bxe = class extends G {
  constructor() {
    super({ id: `editor.action.clipboardCopyWithSyntaxHighlightingAction`, label: w(829, `Copy with Syntax Highlighting`), precondition: void 0, kbOpts: { kbExpr: $.textInputFocus, primary: 0, weight: 100 } });
  }
  run(e206, t10) {
    let n10 = e206.get(Ud);
    n10.trace(`ExecCommandCopyWithSyntaxHighlightingAction#run`), t10.hasModel() && (!t10.getOption(45) && t10.getSelection().isEmpty() || (Sx.forceCopyWithSyntaxHighlighting = true, t10.focus(), n10.trace(`ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)`), t10.getContainerDomNode().ownerDocument.execCommand(`copy`), n10.trace(`ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)`), Sx.forceCopyWithSyntaxHighlighting = false));
  }
};
function eX(e206, t10) {
  e206 && (e206.addImplementation(1e4, `code-editor`, (e207, n10) => {
    let r10 = e207.get(Ud);
    r10.trace(`registerExecCommandImpl (addImplementation code-editor for : `, t10, `)`);
    let i10 = e207.get(Su).getFocusedCodeEditor();
    if (i10 && i10.hasTextFocus()) {
      let e208 = i10.getOption(45), n11 = i10.getSelection();
      return n11 && n11.isEmpty() && !e208 || (i10.getOption(170) && t10 === `cut` ? (tX(i10), r10.trace(`registerExecCommandImpl (before execCommand copy)`), i10.getContainerDomNode().ownerDocument.execCommand(`copy`), i10.trigger(void 0, `cut`, void 0), r10.trace(`registerExecCommandImpl (after execCommand copy)`)) : (tX(i10), r10.trace(`registerExecCommandImpl (before execCommand ` + t10 + `)`), i10.getContainerDomNode().ownerDocument.execCommand(t10), r10.trace(`registerExecCommandImpl (after execCommand ` + t10 + `)`))), true;
    }
    return false;
  }), e206.addImplementation(0, `generic-dom`, (e207, n10) => {
    let r10 = e207.get(Ud);
    return r10.trace(`registerExecCommandImpl (addImplementation generic-dom for : `, t10, `)`), r10.trace(`registerExecCommandImpl (before execCommand ` + t10 + `)`), Ml().execCommand(t10), r10.trace(`registerExecCommandImpl (after execCommand ` + t10 + `)`), true;
  }));
}
function tX(e206) {
  if (e206.getOption(170)) {
    let t10 = qw.get(e206.getId());
    t10 && t10.onWillCopy();
  }
}
eX(vxe, `cut`), eX(yxe, `copy`), $Y && ($Y.addImplementation(1e4, `code-editor`, (e206, t10) => {
  let n10 = e206.get(Ud);
  n10.trace(`registerExecCommandImpl (addImplementation code-editor for : paste)`);
  let r10 = e206.get(Su), i10 = e206.get(hW), a10 = e206.get(bd), o10 = e206.get(Ybe), s10 = r10.getFocusedCodeEditor();
  if (s10 && s10.hasModel() && s10.hasTextFocus()) {
    if (s10.getOption(170)) {
      let e208 = qw.get(s10.getId());
      e208 && e208.onWillPaste();
    }
    let e207 = $t.create(true);
    n10.trace(`registerExecCommandImpl (before triggerPaste)`);
    let t11 = i10.triggerPaste(Nl().vscodeWindowId);
    return t11 ? (n10.trace(`registerExecCommandImpl (triggerPaste defined)`), t11.then(async () => {
      if (n10.trace(`registerExecCommandImpl (after triggerPaste)`), o10.quality !== `stable`) {
        let t12 = e207.elapsed();
        a10.publicLog2(`editorAsyncPaste`, { duration: t12 });
      }
      return YY.get(s10)?.finishedPaste() ?? Promise.resolve();
    })) : (n10.trace(`registerExecCommandImpl (triggerPaste undefined)`), Ot ? (n10.trace(`registerExecCommandImpl (Paste handling on web)`), (async () => {
      let e208 = await i10.readText();
      if (e208 !== ``) {
        let t12 = xx.INSTANCE.get(e208), r11 = false, i11 = null, a11 = null;
        t12 && (r11 = s10.getOption(45) && !!t12.isFromEmptySelection, i11 = t12.multicursorText === void 0 ? null : t12.multicursorText, a11 = t12.mode), n10.trace(`registerExecCommandImpl (clipboardText.length : `, e208.length, ` id : `, t12?.id, `)`), s10.trigger(`keyboard`, `paste`, { text: e208, pasteOnNewLine: r11, multicursorText: i11, mode: a11 });
      }
    })()) : true);
  }
  return false;
}), $Y.addImplementation(0, `generic-dom`, (e206, t10) => (e206.get(Ud).trace(`registerExecCommandImpl (addImplementation generic-dom for : paste)`), e206.get(hW).triggerPaste(Nl().vscodeWindowId) ?? false))), ZY && q(bxe);
var nX = new class {
  constructor() {
    this.QuickFix = new WJ(`quickfix`), this.Refactor = new WJ(`refactor`), this.RefactorExtract = this.Refactor.append(`extract`), this.RefactorInline = this.Refactor.append(`inline`), this.RefactorMove = this.Refactor.append(`move`), this.RefactorRewrite = this.Refactor.append(`rewrite`), this.Notebook = new WJ(`notebook`), this.Source = new WJ(`source`), this.SourceOrganizeImports = this.Source.append(`organizeImports`), this.SourceFixAll = this.Source.append(`fixAll`), this.SurroundWith = this.Refactor.append(`surround`);
  }
}(), rX;
(function(e206) {
  e206.Refactor = `refactor`, e206.RefactorPreview = `refactor preview`, e206.Lightbulb = `lightbulb`, e206.Default = `other (default)`, e206.SourceAction = `source action`, e206.QuickFix = `quick fix action`, e206.FixAll = `fix all`, e206.OrganizeImports = `organize imports`, e206.AutoFix = `auto fix`, e206.QuickFixHover = `quick fix hover window`, e206.OnSave = `save participants`, e206.ProblemsView = `problems view`;
})(rX || (rX = {}));
function xxe(e206, t10) {
  return !(e206.include && !e206.include.intersects(t10) || e206.excludes && e206.excludes.some((n10) => iX(t10, n10, e206.include)) || !e206.includeSourceActions && nX.Source.contains(t10));
}
function Sxe(e206, t10) {
  let n10 = t10.kind ? new WJ(t10.kind) : void 0;
  return !(e206.include && (!n10 || !e206.include.contains(n10)) || e206.excludes && n10 && e206.excludes.some((t11) => iX(n10, t11, e206.include)) || !e206.includeSourceActions && n10 && nX.Source.contains(n10) || e206.onlyIncludePreferredActions && !t10.isPreferred);
}
function iX(e206, t10, n10) {
  return !(!t10.contains(e206) || n10 && t10.contains(n10));
}
var aX = class e173 {
  static fromUser(t10, n10) {
    return !t10 || typeof t10 != `object` ? new e173(n10.kind, n10.apply, false) : new e173(e173.getKindFromUser(t10, n10.kind), e173.getApplyFromUser(t10, n10.apply), e173.getPreferredUser(t10));
  }
  static getApplyFromUser(e206, t10) {
    switch (typeof e206.apply == `string` ? e206.apply.toLowerCase() : ``) {
      case `first`:
        return `first`;
      case `never`:
        return `never`;
      case `ifsingle`:
        return `ifSingle`;
      default:
        return t10;
    }
  }
  static getKindFromUser(e206, t10) {
    return typeof e206.kind == `string` ? new WJ(e206.kind) : t10;
  }
  static getPreferredUser(e206) {
    return typeof e206.preferred == `boolean` ? e206.preferred : false;
  }
  constructor(e206, t10, n10) {
    this.kind = e206, this.apply = t10, this.preferred = n10;
  }
}, Cxe = class {
  constructor(e206, t10, n10) {
    this.action = e206, this.provider = t10, this.highlightRange = n10;
  }
  async resolve(e206) {
    if (this.provider?.resolveCodeAction && !this.action.edit) {
      let t10;
      try {
        t10 = await this.provider.resolveCodeAction(this.action, e206);
      } catch (e207) {
        xe(e207);
      }
      t10 && (this.action.edit = t10.edit);
    }
    return this;
  }
}, oX = `editor.action.codeAction`, sX = `editor.action.quickFix`, wxe = `editor.action.autoFix`, cX = `editor.action.refactor`, lX = `editor.action.sourceAction`, uX = `editor.action.organizeImports`, dX = `editor.action.fixAll`, Txe = 1e3, Exe = class e174 extends D {
  static codeActionsPreferredComparator(e206, t10) {
    return e206.isPreferred && !t10.isPreferred ? -1 : !e206.isPreferred && t10.isPreferred ? 1 : 0;
  }
  static codeActionsComparator({ action: t10 }, { action: n10 }) {
    return t10.isAI && !n10.isAI ? 1 : !t10.isAI && n10.isAI ? -1 : v(t10.diagnostics) ? v(n10.diagnostics) ? e174.codeActionsPreferredComparator(t10, n10) : -1 : v(n10.diagnostics) ? 1 : e174.codeActionsPreferredComparator(t10, n10);
  }
  constructor(t10, n10, r10) {
    super(), this.documentation = n10, this._register(r10), this.allActions = [...t10].sort(e174.codeActionsComparator), this.validActions = this.allActions.filter(({ action: e206 }) => !e206.disabled);
  }
  get hasAutoFix() {
    return this.validActions.some(({ action: e206 }) => !!e206.kind && nX.QuickFix.contains(new WJ(e206.kind)) && !!e206.isPreferred);
  }
  get hasAIFix() {
    return this.validActions.some(({ action: e206 }) => !!e206.isAI);
  }
  get allAIFixes() {
    return this.validActions.every(({ action: e206 }) => !!e206.isAI);
  }
}, fX = { actions: [], documentation: void 0 };
async function pX(e206, t10, n10, r10, i10, a10) {
  let s10 = r10.filter || {}, c10 = { ...s10, excludes: [...s10.excludes || [], nX.Notebook] }, l10 = { only: s10.include?.value, trigger: r10.type }, u10 = new nJ(t10, a10), d10 = Dxe(e206, t10, r10.type === 2 ? c10 : s10), f10 = new E(), p10 = d10.map(async (e207) => {
    let r11 = setTimeout(() => i10.report(e207), 1250);
    try {
      let r12 = await e207.provideCodeActions(t10, n10, l10, u10.token);
      if (u10.token.isCancellationRequested) return r12?.dispose(), fX;
      r12 && f10.add(r12);
      let i11 = (r12?.actions || []).filter((e208) => e208 && Sxe(s10, e208)), a11 = kxe(e207, i11, s10.include);
      return { actions: i11.map((t11) => new Cxe(t11, e207)), documentation: a11 };
    } catch (e208) {
      if (we(e208)) throw e208;
      return xe(e208), fX;
    } finally {
      clearTimeout(r11);
    }
  }), m10 = e206.onDidChange(() => {
    o(e206.all(t10), d10) || u10.cancel();
  });
  try {
    let n11 = await Promise.all(p10), i11 = n11.map((e207) => e207.actions).flat(), a11 = new Exe(i11, [...h(n11.map((e207) => e207.documentation)), ...Oxe(e206, t10, r10, i11)], f10);
    return f10.add(a11), a11;
  } catch (e207) {
    throw f10.dispose(), e207;
  } finally {
    m10.dispose(), u10.dispose();
  }
}
function Dxe(e206, t10, n10) {
  return e206.all(t10).filter((e207) => e207.providedCodeActionKinds ? e207.providedCodeActionKinds.some((e208) => xxe(n10, new WJ(e208))) : true);
}
function* Oxe(e206, t10, n10, r10) {
  if (t10 && r10.length) for (let i10 of e206.all(t10)) i10._getAdditionalMenuItems && (yield* i10._getAdditionalMenuItems?.({ trigger: n10.type, only: n10.filter?.include?.value }, r10.map((e207) => e207.action)));
}
function kxe(e206, t10, n10) {
  if (!e206.documentation) return;
  let r10 = e206.documentation.map((e207) => ({ kind: new WJ(e207.kind), command: e207.command }));
  if (n10) {
    let e207;
    for (let t11 of r10) t11.kind.contains(n10) && (e207 ? e207.kind.contains(t11.kind) && (e207 = t11) : e207 = t11);
    if (e207) return e207?.command;
  }
  for (let e207 of t10) if (e207.kind) {
    for (let t11 of r10) if (t11.kind.contains(new WJ(e207.kind))) return t11.command;
  }
}
var mX;
(function(e206) {
  e206.OnSave = `onSave`, e206.FromProblemsView = `fromProblemsView`, e206.FromCodeActions = `fromCodeActions`, e206.FromAILightbulb = `fromAILightbulb`, e206.FromProblemsHover = `fromProblemsHover`;
})(mX || (mX = {}));
async function Axe(e206, t10, n10, r10, i10 = dr.None) {
  let a10 = e206.get(vF), o10 = e206.get(Mu), s10 = e206.get(bd), c10 = e206.get(dw), l10 = e206.get(WW);
  if (s10.publicLog2(`codeAction.applyCodeAction`, { codeActionTitle: t10.action.title, codeActionKind: t10.action.kind, codeActionIsPreferred: !!t10.action.isPreferred, reason: n10 }), l10.playSignal(qW.codeActionTriggered), await t10.resolve(i10), !i10.isCancellationRequested && !(t10.action.edit?.edits.length && !(await a10.apply(t10.action.edit, { editor: r10?.editor, label: t10.action.title, quotableLabel: t10.action.title, code: `undoredo.codeAction`, respectAutoSaveConfig: n10 !== mX.OnSave, showPreview: r10?.preview, reason: mE.codeAction({ kind: t10.action.kind, providerId: yi.fromExtensionId(t10.provider?.extensionId) }) })).isApplied)) {
    if (t10.action.command) try {
      await o10.executeCommand(t10.action.command.id, ...t10.action.command.arguments || []);
    } catch (e207) {
      let t11 = jxe(e207);
      c10.error(typeof t11 == `string` ? t11 : C(830, `An unknown error occurred while applying the code action`));
    }
    setTimeout(() => l10.playSignal(qW.codeActionApplied), Txe);
  }
}
function jxe(e206) {
  if (typeof e206 == `string`) return e206;
  if (e206 instanceof Error && typeof e206.message == `string`) return e206.message;
}
Nu.registerCommand(`_executeCodeActionProvider`, async function(e206, t10, n10, r10, i10) {
  if (!(t10 instanceof $r)) throw De();
  let { codeActionProvider: a10 } = e206.get(X), o10 = e206.get(Cu).getModel(t10);
  if (!o10) throw De();
  let s10 = N.isISelection(n10) ? N.liftSelection(n10) : M.isIRange(n10) ? o10.validateRange(n10) : void 0;
  if (!s10) throw De();
  let c10 = typeof r10 == `string` ? new WJ(r10) : void 0, l10 = await pX(a10, o10, s10, { type: 1, triggerAction: rX.Default, filter: { includeSourceActions: true, include: c10 } }, HF.None, dr.None), u10 = [], d10 = Math.min(l10.validActions.length, typeof i10 == `number` ? i10 : 0);
  for (let e207 = 0; e207 < d10; e207++) u10.push(l10.validActions[e207].resolve(dr.None));
  try {
    return await Promise.all(u10), l10.validActions.map((e207) => e207.action);
  } finally {
    setTimeout(() => l10.dispose(), 100);
  }
});
var Mxe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Nxe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, hX, gX = (_Rb = class {
  constructor(e206) {
    this.keybindingService = e206;
  }
  getResolver() {
    let e206 = new Fa(() => this.keybindingService.getKeybindings().filter((e207) => hX.codeActionCommands.indexOf(e207.command) >= 0).filter((e207) => e207.resolvedKeybinding).map((e207) => {
      let t10 = e207.commandArgs;
      return e207.command === `editor.action.organizeImports` ? t10 = { kind: nX.SourceOrganizeImports.value } : e207.command === `editor.action.fixAll` && (t10 = { kind: nX.SourceFixAll.value }), { resolvedKeybinding: e207.resolvedKeybinding, ...aX.fromUser(t10, { kind: WJ.None, apply: `never` }) };
    }));
    return (t10) => {
      if (t10.kind) return this.bestKeybindingForCodeAction(t10, e206.value)?.resolvedKeybinding;
    };
  }
  bestKeybindingForCodeAction(e206, t10) {
    if (!e206.kind) return;
    let n10 = new WJ(e206.kind);
    return t10.filter((e207) => e207.kind.contains(n10)).filter((t11) => t11.preferred ? e206.isPreferred : true).reduceRight((e207, t11) => e207 ? e207.kind.contains(t11.kind) ? t11 : e207 : t11, void 0);
  }
}, hX = _Rb, _Rb.codeActionCommands = [cX, oX, lX, uX, dX], _Rb);
gX = hX = Mxe([Nxe(0, Dw)], gX), Q(`symbolIcon.arrayForeground`, U_, C(1495, `The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.booleanForeground`, U_, C(1496, `The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.classForeground`, { dark: `#EE9D28`, light: `#D67E00`, hcDark: `#EE9D28`, hcLight: `#D67E00` }, C(1497, `The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.colorForeground`, U_, C(1498, `The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.constantForeground`, U_, C(1499, `The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.constructorForeground`, { dark: `#B180D7`, light: `#652D90`, hcDark: `#B180D7`, hcLight: `#652D90` }, C(1500, `The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.enumeratorForeground`, { dark: `#EE9D28`, light: `#D67E00`, hcDark: `#EE9D28`, hcLight: `#D67E00` }, C(1501, `The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.enumeratorMemberForeground`, { dark: `#75BEFF`, light: `#007ACC`, hcDark: `#75BEFF`, hcLight: `#007ACC` }, C(1502, `The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.eventForeground`, { dark: `#EE9D28`, light: `#D67E00`, hcDark: `#EE9D28`, hcLight: `#D67E00` }, C(1503, `The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.fieldForeground`, { dark: `#75BEFF`, light: `#007ACC`, hcDark: `#75BEFF`, hcLight: `#007ACC` }, C(1504, `The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.fileForeground`, U_, C(1505, `The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.folderForeground`, U_, C(1506, `The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.functionForeground`, { dark: `#B180D7`, light: `#652D90`, hcDark: `#B180D7`, hcLight: `#652D90` }, C(1507, `The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.interfaceForeground`, { dark: `#75BEFF`, light: `#007ACC`, hcDark: `#75BEFF`, hcLight: `#007ACC` }, C(1508, `The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.keyForeground`, U_, C(1509, `The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.keywordForeground`, U_, C(1510, `The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.methodForeground`, { dark: `#B180D7`, light: `#652D90`, hcDark: `#B180D7`, hcLight: `#652D90` }, C(1511, `The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.moduleForeground`, U_, C(1512, `The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.namespaceForeground`, U_, C(1513, `The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.nullForeground`, U_, C(1514, `The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.numberForeground`, U_, C(1515, `The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.objectForeground`, U_, C(1516, `The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.operatorForeground`, U_, C(1517, `The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.packageForeground`, U_, C(1518, `The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.propertyForeground`, U_, C(1519, `The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.referenceForeground`, U_, C(1520, `The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.snippetForeground`, U_, C(1521, `The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.stringForeground`, U_, C(1522, `The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.structForeground`, U_, C(1523, `The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.textForeground`, U_, C(1524, `The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.typeParameterForeground`, U_, C(1525, `The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.unitForeground`, U_, C(1526, `The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)), Q(`symbolIcon.variableForeground`, { dark: `#75BEFF`, light: `#007ACC`, hcDark: `#75BEFF`, hcLight: `#007ACC` }, C(1527, `The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`));
var _X = Object.freeze({ kind: WJ.Empty, title: C(866, `More Actions...`) }), Pxe = Object.freeze([{ kind: nX.QuickFix, title: C(867, `Quick Fix`) }, { kind: nX.RefactorExtract, title: C(868, `Extract`), icon: F.wrench }, { kind: nX.RefactorInline, title: C(869, `Inline`), icon: F.wrench }, { kind: nX.RefactorRewrite, title: C(870, `Rewrite`), icon: F.wrench }, { kind: nX.RefactorMove, title: C(871, `Move`), icon: F.wrench }, { kind: nX.SurroundWith, title: C(872, `Surround With`), icon: F.surroundWith }, { kind: nX.Source, title: C(873, `Source Action`), icon: F.symbolFile }, _X]);
function Fxe(e206, t10, n10) {
  if (!t10) return e206.map((e207) => ({ kind: `action`, item: e207, group: _X, disabled: !!e207.action.disabled, label: e207.action.disabled || e207.action.title, canPreview: !!e207.action.edit?.edits.length }));
  let r10 = Pxe.map((e207) => ({ group: e207, actions: [] }));
  for (let t11 of e206) {
    let e207 = t11.action.kind ? new WJ(t11.action.kind) : WJ.None;
    for (let n11 of r10) if (n11.group.kind.contains(e207)) {
      n11.actions.push(t11);
      break;
    }
  }
  let i10 = [];
  for (let e207 of r10) if (e207.actions.length) {
    i10.push({ kind: `header`, group: e207.group });
    for (let t11 of e207.actions) {
      let r11 = e207.group;
      i10.push({ kind: `action`, item: t11, group: t11.action.isAI ? { title: r11.title, kind: r11.kind, icon: F.sparkle } : r11, label: t11.action.title, disabled: !!t11.action.disabled, keybinding: n10(t11.action) });
    }
  }
  return i10;
}
var vX = new U(`supportedCodeAction`, ``), Ixe = class extends D {
  constructor(e206, t10, n10, r10 = 250) {
    super(), this._editor = e206, this._markerService = t10, this._signalChange = n10, this._delay = r10, this._autoTriggerTimer = this._register(new cs()), this._register(this._markerService.onMarkerChanged((e207) => this._onMarkerChanges(e207))), this._register(this._editor.onDidChangeCursorPosition(() => this._tryAutoTrigger()));
  }
  trigger(e206) {
    let t10 = this._getRangeOfSelectionUnlessWhitespaceEnclosed(e206);
    this._signalChange(t10 ? { trigger: e206, selection: t10 } : void 0);
  }
  _onMarkerChanges(e206) {
    let t10 = this._editor.getModel();
    t10 && e206.some((e207) => Fd(e207, t10.uri)) && this._tryAutoTrigger();
  }
  _tryAutoTrigger() {
    this._autoTriggerTimer.cancelAndSet(() => {
      this.trigger({ type: 2, triggerAction: rX.Default });
    }, this._delay);
  }
  _getRangeOfSelectionUnlessWhitespaceEnclosed(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._editor.getSelection();
    if (e206.type === 1) return t10;
    let n10 = this._editor.getOption(73).enabled;
    if (n10 !== Jn.Off) {
      if (n10 === Jn.On) return t10;
      if (n10 === Jn.OnCode) {
        if (!t10.isEmpty()) return t10;
        let e207 = this._editor.getModel(), { lineNumber: n11, column: r10 } = t10.getPosition(), i10 = e207.getLineContent(n11);
        if (i10.length === 0) return;
        if (r10 === 1) {
          if (/\s/.test(i10[0])) return;
        } else if (r10 === e207.getLineMaxColumn(n11)) {
          if (/\s/.test(i10[i10.length - 1])) return;
        } else if (/\s/.test(i10[r10 - 2]) && /\s/.test(i10[r10 - 1])) return;
      }
      return t10;
    }
  }
}, yX;
(function(e206) {
  e206.Empty = { type: 0 };
  class t10 {
    constructor(e207, t11, n10) {
      this.trigger = e207, this.position = t11, this._cancellablePromise = n10, this.type = 1, this.actions = n10.catch((e208) => {
        if (we(e208)) return bX;
        throw e208;
      });
    }
    cancel() {
      this._cancellablePromise.cancel();
    }
  }
  e206.Triggered = t10;
})(yX || (yX = {}));
var bX = Object.freeze({ allActions: [], validActions: [], dispose: () => {
}, documentation: [], hasAutoFix: false, hasAIFix: false, allAIFixes: false }), Lxe = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._editor = e206, this._registry = t10, this._markerService = n10, this._progressService = i10, this._configurationService = a10, this._codeActionOracle = this._register(new Jt()), this._state = yX.Empty, this._onDidChangeState = this._register(new k()), this.onDidChangeState = this._onDidChangeState.event, this.codeActionsDisposable = this._register(new Jt()), this._disposed = false, this._supportedCodeActions = vX.bindTo(r10), this._register(this._editor.onDidChangeModel(() => this._update())), this._register(this._editor.onDidChangeModelLanguage(() => this._update())), this._register(this._registry.onDidChange(() => this._update())), this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(73) && this._update();
    })), this._update();
  }
  dispose() {
    this._disposed || (this._disposed = true, super.dispose(), this.setState(yX.Empty, true));
  }
  _settingEnabledNearbyQuickfixes() {
    let e206 = this._editor?.getModel();
    return this._configurationService ? this._configurationService.getValue(`editor.codeActionWidget.includeNearbyQuickFixes`, { resource: e206?.uri }) : false;
  }
  _update() {
    if (this._disposed) return;
    this._codeActionOracle.value = void 0, this.setState(yX.Empty);
    let e206 = this._editor.getModel();
    if (e206 && this._registry.has(e206) && !this._editor.getOption(104)) {
      let t10 = this._registry.all(e206).flatMap((e207) => e207.providedCodeActionKinds ?? []);
      this._supportedCodeActions.set(t10.join(` `)), this._codeActionOracle.value = new Ixe(this._editor, this._markerService, (t11) => {
        if (!t11) {
          this.setState(yX.Empty);
          return;
        }
        let n10 = t11.selection.getStartPosition(), r10 = es(async (n11) => {
          if (this._settingEnabledNearbyQuickfixes() && t11.trigger.type === 1 && (t11.trigger.triggerAction === rX.QuickFix || t11.trigger.filter?.include?.contains(nX.QuickFix))) {
            let r12 = await pX(this._registry, e206, t11.selection, t11.trigger, HF.None, n11);
            this.codeActionsDisposable.value = r12;
            let i11 = [...r12.allActions];
            if (n11.isCancellationRequested) return r12.dispose(), bX;
            let a11 = r12.validActions?.some((e207) => e207.action.kind && nX.QuickFix.contains(new WJ(e207.action.kind)) && !e207.action.isAI), o10 = this._markerService.read({ resource: e206.uri });
            if (a11) {
              for (let e207 of r12.validActions) e207.action.command?.arguments?.some((e208) => typeof e208 == `string` && e208.includes(`_typescript.applyFixAllCodeAction`)) && (e207.action.diagnostics = [...o10.filter((e208) => e208.relatedInformation)]);
              return { validActions: r12.validActions, allActions: i11, documentation: r12.documentation, hasAutoFix: r12.hasAutoFix, hasAIFix: r12.hasAIFix, allAIFixes: r12.allAIFixes, dispose: () => {
                this.codeActionsDisposable.value = r12;
              } };
            } else if (!a11 && o10.length > 0) {
              let a12 = t11.selection.getPosition(), s10 = a12, c10 = Number.MAX_VALUE, l10 = [...r12.validActions];
              for (let u11 of o10) {
                let d10 = u11.endColumn, f10 = u11.endLineNumber, p10 = u11.startLineNumber;
                if (f10 === a12.lineNumber || p10 === a12.lineNumber) {
                  s10 = new j(f10, d10);
                  let u12 = { type: t11.trigger.type, triggerAction: t11.trigger.triggerAction, filter: { include: t11.trigger.filter?.include ? t11.trigger.filter?.include : nX.QuickFix }, autoApply: t11.trigger.autoApply, context: { notAvailableMessage: t11.trigger.context?.notAvailableMessage || ``, position: s10 } }, p11 = new N(s10.lineNumber, s10.column, s10.lineNumber, s10.column), m10 = await pX(this._registry, e206, p11, u12, HF.None, n11);
                  if (n11.isCancellationRequested) return m10.dispose(), bX;
                  if (m10.validActions.length !== 0) {
                    for (let e207 of m10.validActions) e207.action.command?.arguments?.some((e208) => typeof e208 == `string` && e208.includes(`_typescript.applyFixAllCodeAction`)) && (e207.action.diagnostics = [...o10.filter((e208) => e208.relatedInformation)]);
                    r12.allActions.length === 0 && i11.push(...m10.allActions), Math.abs(a12.column - d10) < c10 ? l10.unshift(...m10.validActions) : l10.push(...m10.validActions);
                  }
                  c10 = Math.abs(a12.column - d10);
                }
              }
              let u10 = l10.filter((e207, t12, n12) => n12.findIndex((t13) => t13.action.title === e207.action.title) === t12);
              return u10.sort((e207, t12) => e207.action.isPreferred && !t12.action.isPreferred ? -1 : !e207.action.isPreferred && t12.action.isPreferred || e207.action.isAI && !t12.action.isAI ? 1 : !e207.action.isAI && t12.action.isAI ? -1 : 0), { validActions: u10, allActions: i11, documentation: r12.documentation, hasAutoFix: r12.hasAutoFix, hasAIFix: r12.hasAIFix, allAIFixes: r12.allAIFixes, dispose: () => {
                this.codeActionsDisposable.value = r12;
              } };
            }
          }
          if (t11.trigger.type === 1) {
            let r12 = await pX(this._registry, e206, t11.selection, t11.trigger, HF.None, n11);
            return this.codeActionsDisposable.value = r12, r12;
          }
          let r11 = await pX(this._registry, e206, t11.selection, t11.trigger, HF.None, n11);
          return this.codeActionsDisposable.value = r11, r11;
        });
        t11.trigger.type === 1 && this._progressService?.showWhile(r10, 250);
        let i10 = new yX.Triggered(t11.trigger, n10, r10), a10 = false;
        this._state.type === 1 && (a10 = this._state.trigger.type === 1 && i10.type === 1 && i10.trigger.type === 2 && this._state.position !== i10.position), a10 ? setTimeout(() => {
          this.setState(i10);
        }, 500) : this.setState(i10);
      }, void 0), this._codeActionOracle.value.trigger({ type: 2, triggerAction: rX.Default });
    } else this._supportedCodeActions.reset();
  }
  trigger(e206) {
    this._codeActionOracle.value?.trigger(e206), this.codeActionsDisposable.dispose();
  }
  setState(e206, t10) {
    e206 !== this._state && (this._state.type === 1 && this._state.cancel(), this._state = e206, !t10 && !this._disposed && this._onDidChangeState.fire(e206));
  }
}, Rxe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, zxe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, xX, SX = AU(`gutter-lightbulb`, F.lightBulb, C(874, `Icon which spawns code actions menu from the gutter when there is no space in the editor.`)), CX = AU(`gutter-lightbulb-auto-fix`, F.lightbulbAutofix, C(875, `Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.`)), wX = AU(`gutter-lightbulb-sparkle`, F.lightbulbSparkle, C(876, `Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.`)), TX = AU(`gutter-lightbulb-aifix-auto-fix`, F.lightbulbSparkleAutofix, C(877, `Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)), EX = AU(`gutter-lightbulb-sparkle-filled`, F.sparkleFilled, C(878, `Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)), DX;
(function(e206) {
  e206.Hidden = { type: 0 };
  class t10 {
    constructor(e207, t11, n10, r10) {
      this.actions = e207, this.trigger = t11, this.editorPosition = n10, this.widgetPosition = r10, this.type = 1;
    }
  }
  e206.Showing = t10;
})(DX || (DX = {}));
var OX = (_Sb = class extends D {
  constructor(e206, t10) {
    super(), this._editor = e206, this._keybindingService = t10, this._onClick = this._register(new k()), this.onClick = this._onClick.event, this._state = DX.Hidden, this._gutterState = DX.Hidden, this._iconClasses = [], this.lightbulbClasses = [`codicon-` + SX.id, `codicon-` + TX.id, `codicon-` + CX.id, `codicon-` + wX.id, `codicon-` + EX.id], this.gutterDecoration = xX.GUTTER_DECORATION, this._domNode = B(`div.lightBulbWidget`), this._domNode.role = `listbox`, this._register(nx.ignoreTarget(this._domNode)), this._editor.addContentWidget(this), this._register(this._editor.onDidChangeModelContent((e207) => {
      let t11 = this._editor.getModel();
      (this.state.type !== 1 || !t11 || this.state.editorPosition.lineNumber >= t11.getLineCount()) && this.hide(), (this.gutterState.type !== 1 || !t11 || this.gutterState.editorPosition.lineNumber >= t11.getLineCount()) && this.gutterHide();
    })), this._register(tl(this._domNode, (e207) => {
      if (this.state.type !== 1) return;
      this._editor.focus(), e207.preventDefault();
      let { top: t11, height: n10 } = _l2(this._domNode), r10 = this._editor.getOption(75), i10 = Math.floor(r10 / 3);
      this.state.widgetPosition.position !== null && this.state.widgetPosition.position.lineNumber < this.state.editorPosition.lineNumber && (i10 += r10), this._onClick.fire({ x: e207.posx, y: t11 + n10 + i10, actions: this.state.actions, trigger: this.state.trigger });
    })), this._register(L(this._domNode, `mouseenter`, (e207) => {
      (e207.buttons & 1) == 1 && this.hide();
    })), this._register(O.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings, () => {
      this._preferredKbLabel = this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel() ?? void 0, this._quickFixKbLabel = this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel() ?? void 0, this._updateLightBulbTitleAndIcon();
    })), this._register(this._editor.onMouseDown(async (e207) => {
      if (!e207.target.element || !this.lightbulbClasses.some((t12) => e207.target.element && e207.target.element.classList.contains(t12)) || this.gutterState.type !== 1) return;
      this._editor.focus();
      let { top: t11, height: n10 } = _l2(e207.target.element), r10 = this._editor.getOption(75), i10 = Math.floor(r10 / 3);
      this.gutterState.widgetPosition.position !== null && this.gutterState.widgetPosition.position.lineNumber < this.gutterState.editorPosition.lineNumber && (i10 += r10), this._onClick.fire({ x: e207.event.posx, y: t11 + n10 + i10, actions: this.gutterState.actions, trigger: this.gutterState.trigger });
    }));
  }
  dispose() {
    super.dispose(), this._editor.removeContentWidget(this), this._gutterDecorationID && this._removeGutterDecoration(this._gutterDecorationID);
  }
  getId() {
    return `LightBulbWidget`;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._state.type === 1 ? this._state.widgetPosition : null;
  }
  update(e206, t10, n10) {
    if (e206.validActions.length <= 0 || !this._editor.hasTextFocus() || !this._editor.getOptions().get(73).enabled) return this.gutterHide(), this.hide();
    let r10 = this._editor.getModel();
    if (!r10) return this.gutterHide(), this.hide();
    let { lineNumber: i10, column: a10 } = r10.validatePosition(n10), o10 = r10.getOptions().tabSize, s10 = this._editor.getOptions().get(59), c10 = hC(r10.getLineContent(i10), o10), l10 = s10.spaceWidth * c10 > 22, u10 = (e207) => e207 > 2 && this._editor.getTopForLineNumber(e207) === this._editor.getTopForLineNumber(e207 - 1), d10 = this._editor.getLineDecorations(i10), f10 = false;
    if (d10) for (let e207 of d10) {
      let t11 = e207.options.glyphMarginClassName;
      if (t11 && !this.lightbulbClasses.some((e208) => t11.includes(e208))) {
        f10 = true;
        break;
      }
    }
    let p10 = i10, m10 = 1;
    if (!l10) {
      let o11 = (e207) => {
        let t11 = r10.getLineContent(e207);
        return /^\s*$|^\s+/.test(t11) || t11.length <= m10;
      };
      if (i10 > 1 && !u10(i10 - 1)) {
        let a11 = i10 === r10.getLineCount(), s11 = i10 > 1 && o11(i10 - 1), c11 = !a11 && o11(i10 + 1), l11 = o11(i10), u11 = !c11 && !s11;
        if (!c11 && !s11 && !f10) return this.gutterState = new DX.Showing(e206, t10, n10, { position: { lineNumber: p10, column: m10 }, preference: xX._posPref }), this.renderGutterLightbub(), this.hide();
        s11 || a11 || s11 && !l11 ? --p10 : (c11 || u11 && l11) && (p10 += 1);
      } else if (i10 === 1 && (i10 === r10.getLineCount() || !o11(i10 + 1) && !o11(i10))) if (this.gutterState = new DX.Showing(e206, t10, n10, { position: { lineNumber: p10, column: m10 }, preference: xX._posPref }), f10) this.gutterHide();
      else return this.renderGutterLightbub(), this.hide();
      else if (i10 < r10.getLineCount() && !u10(i10 + 1)) p10 += 1;
      else if (a10 * s10.spaceWidth < 22) return this.hide();
      m10 = /^\S\s*$/.test(r10.getLineContent(p10)) ? 2 : 1;
    }
    this.state = new DX.Showing(e206, t10, n10, { position: { lineNumber: p10, column: m10 }, preference: xX._posPref }), this._gutterDecorationID && (this._removeGutterDecoration(this._gutterDecorationID), this.gutterHide());
    let h10 = e206.validActions, g10 = e206.validActions[0].action.kind;
    if (h10.length !== 1 || !g10) {
      this._editor.layoutContentWidget(this);
      return;
    }
    this._editor.layoutContentWidget(this);
  }
  hide() {
    this.state !== DX.Hidden && (this.state = DX.Hidden, this._editor.layoutContentWidget(this));
  }
  gutterHide() {
    this.gutterState !== DX.Hidden && (this._gutterDecorationID && this._removeGutterDecoration(this._gutterDecorationID), this.gutterState = DX.Hidden);
  }
  get state() {
    return this._state;
  }
  set state(e206) {
    this._state = e206, this._updateLightBulbTitleAndIcon();
  }
  get gutterState() {
    return this._gutterState;
  }
  set gutterState(e206) {
    this._gutterState = e206, this._updateGutterLightBulbTitleAndIcon();
  }
  _updateLightBulbTitleAndIcon() {
    if (this._domNode.classList.remove(...this._iconClasses), this._iconClasses = [], this.state.type !== 1) return;
    let e206, t10 = false;
    this.state.actions.allAIFixes ? (e206 = F.sparkleFilled, this.state.actions.validActions.length === 1 && (t10 = true)) : e206 = this.state.actions.hasAutoFix ? this.state.actions.hasAIFix ? F.lightbulbSparkleAutofix : F.lightbulbAutofix : this.state.actions.hasAIFix ? F.lightbulbSparkle : F.lightBulb, this._updateLightbulbTitle(this.state.actions.hasAutoFix, t10), this._iconClasses = ju.asClassNameArray(e206), this._domNode.classList.add(...this._iconClasses);
  }
  _updateGutterLightBulbTitleAndIcon() {
    if (this.gutterState.type !== 1) return;
    let e206, t10 = false;
    this.gutterState.actions.allAIFixes ? (e206 = EX, this.gutterState.actions.validActions.length === 1 && (t10 = true)) : e206 = this.gutterState.actions.hasAutoFix ? this.gutterState.actions.hasAIFix ? TX : CX : this.gutterState.actions.hasAIFix ? wX : SX, this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix, t10), this.gutterDecoration = UO.register({ description: `codicon-gutter-lightbulb-decoration`, glyphMarginClassName: ju.asClassName(e206), glyphMargin: { position: $p.Left }, stickiness: 1 });
  }
  renderGutterLightbub() {
    let e206 = this._editor.getSelection();
    e206 && (this._gutterDecorationID === void 0 ? this._addGutterDecoration(e206.startLineNumber) : this._updateGutterDecoration(this._gutterDecorationID, e206.startLineNumber));
  }
  _addGutterDecoration(e206) {
    this._editor.changeDecorations((t10) => {
      this._gutterDecorationID = t10.addDecoration(new M(e206, 0, e206, 0), this.gutterDecoration);
    });
  }
  _removeGutterDecoration(e206) {
    this._editor.changeDecorations((t10) => {
      t10.removeDecoration(e206), this._gutterDecorationID = void 0;
    });
  }
  _updateGutterDecoration(e206, t10) {
    this._editor.changeDecorations((n10) => {
      n10.changeDecoration(e206, new M(t10, 0, t10, 0)), n10.changeDecorationOptions(e206, this.gutterDecoration);
    });
  }
  _updateLightbulbTitle(e206, t10) {
    this.state.type === 1 && (t10 ? this.title = C(879, `Run: {0}`, this.state.actions.validActions[0].action.title) : e206 && this._preferredKbLabel ? this.title = C(880, `Show Code Actions. Preferred Quick Fix Available ({0})`, this._preferredKbLabel) : !e206 && this._quickFixKbLabel ? this.title = C(881, `Show Code Actions ({0})`, this._quickFixKbLabel) : e206 || (this.title = C(882, `Show Code Actions`)));
  }
  set title(e206) {
    this._domNode.title = e206;
  }
}, xX = _Sb, _Sb.GUTTER_DECORATION = UO.register({ description: `codicon-gutter-lightbulb-decoration`, glyphMarginClassName: ju.asClassName(F.lightBulb), glyphMargin: { position: $p.Left }, stickiness: 1 }), _Sb.ID = `editor.contrib.lightbulbWidget`, _Sb._posPref = [0], _Sb);
OX = xX = Rxe([zxe(1, Dw)], OX);
var Bxe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, kX = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, AX, Vxe = `quickfix-edit-highlight`, jX = (_Tb = class extends D {
  static get(e206) {
    return e206.getContribution(AX.ID);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10) {
    super(), this._commandService = o10, this._configurationService = s10, this._actionWidgetService = c10, this._instantiationService = l10, this._progressService = u10, this._activeCodeActions = this._register(new Jt()), this._showDisabled = false, this._disposed = false, this._editor = e206, this._model = this._register(new Lxe(this._editor, i10.codeActionProvider, t10, n10, a10, s10)), this._register(this._model.onDidChangeState((e207) => this.update(e207))), this._lightBulbWidget = new Fa(() => {
      let e207 = this._editor.getContribution(OX.ID);
      return e207 && this._register(e207.onClick((e208) => this.showCodeActionsFromLightbulb(e208.actions, e208))), e207;
    }), this._resolver = r10.createInstance(gX), this._register(this._editor.onDidLayoutChange(() => this._actionWidgetService.hide()));
  }
  dispose() {
    this._disposed = true, super.dispose();
  }
  async showCodeActionsFromLightbulb(e206, t10) {
    if (e206.allAIFixes && e206.validActions.length === 1) {
      let t11 = e206.validActions[0], n10 = t11.action.command;
      n10 && n10.id === `inlineChat.start` && n10.arguments && n10.arguments.length >= 1 && n10.arguments[0] && (n10.arguments[0] = { ...n10.arguments[0], autoSend: false }), await this.applyCodeAction(t11, false, false, mX.FromAILightbulb);
      return;
    }
    await this.showCodeActionList(e206, t10, { includeDisabledActions: false, fromLightbulb: true });
  }
  showCodeActions(e206, t10, n10) {
    return this.showCodeActionList(t10, n10, { includeDisabledActions: false, fromLightbulb: false });
  }
  manualTriggerAtCurrentPosition(e206, t10, n10, r10) {
    if (!this._editor.hasModel()) return;
    QJ.get(this._editor)?.closeMessage();
    let i10 = this._editor.getPosition();
    this._trigger({ type: 1, triggerAction: t10, filter: n10, autoApply: r10, context: { notAvailableMessage: e206, position: i10 } });
  }
  _trigger(e206) {
    return this._model.trigger(e206);
  }
  async applyCodeAction(e206, t10, n10, r10) {
    let i10 = this._progressService.show(true, 500);
    try {
      await this._instantiationService.invokeFunction(Axe, e206, r10, { preview: n10, editor: this._editor });
    } finally {
      t10 && this._trigger({ type: 2, triggerAction: rX.QuickFix, filter: {} }), i10.done();
    }
  }
  hideLightBulbWidget() {
    this._lightBulbWidget.rawValue?.hide(), this._lightBulbWidget.rawValue?.gutterHide();
  }
  async update(e206) {
    if (e206.type !== 1) {
      this.hideLightBulbWidget();
      return;
    }
    let t10;
    try {
      t10 = await e206.actions;
    } catch (e207) {
      be(e207);
      return;
    }
    if (!this._disposed && this._editor.getSelection()?.startLineNumber === e206.position.lineNumber) if (this._lightBulbWidget.value?.update(t10, e206.trigger, e206.position), e206.trigger.type === 1) {
      if (e206.trigger.filter?.include) {
        let n11 = this.tryGetValidActionToApply(e206.trigger, t10);
        if (n11) {
          try {
            this.hideLightBulbWidget(), await this.applyCodeAction(n11, false, false, mX.FromCodeActions);
          } finally {
            t10.dispose();
          }
          return;
        }
        if (e206.trigger.context) {
          let n12 = this.getInvalidActionThatWouldHaveBeenApplied(e206.trigger, t10);
          if (n12 && n12.action.disabled) {
            QJ.get(this._editor)?.showMessage(n12.action.disabled, e206.trigger.context.position), t10.dispose();
            return;
          }
        }
      }
      let n10 = !!e206.trigger.filter?.include;
      if (e206.trigger.context && (!t10.allActions.length || !n10 && !t10.validActions.length)) {
        QJ.get(this._editor)?.showMessage(e206.trigger.context.notAvailableMessage, e206.trigger.context.position), this._activeCodeActions.value = t10, t10.dispose();
        return;
      }
      this._activeCodeActions.value = t10, this.showCodeActionList(t10, this.toCoords(e206.position), { includeDisabledActions: n10, fromLightbulb: false });
    } else this._actionWidgetService.isVisible ? t10.dispose() : this._activeCodeActions.value = t10;
  }
  getInvalidActionThatWouldHaveBeenApplied(e206, t10) {
    if (t10.allActions.length && (e206.autoApply === `first` && t10.validActions.length === 0 || e206.autoApply === `ifSingle` && t10.allActions.length === 1)) return t10.allActions.find(({ action: e207 }) => e207.disabled);
  }
  tryGetValidActionToApply(e206, t10) {
    if (t10.validActions.length && (e206.autoApply === `first` && t10.validActions.length > 0 || e206.autoApply === `ifSingle` && t10.validActions.length === 1)) return t10.validActions[0];
  }
  async showCodeActionList(e206, t10, n10) {
    let r10 = this._editor.createDecorationsCollection(), i10 = this._editor.getDomNode();
    if (!i10) return;
    let a10 = n10.includeDisabledActions && (this._showDisabled || e206.validActions.length === 0) ? e206.allActions : e206.validActions;
    if (!a10.length) return;
    let o10 = j.isIPosition(t10) ? this.toCoords(t10) : t10;
    this._actionWidgetService.show(`codeActionWidget`, true, Fxe(a10, this._shouldShowHeaders(), this._resolver.getResolver()), { onSelect: async (e207, t11) => {
      this.applyCodeAction(e207, true, !!t11, n10.fromLightbulb ? mX.FromAILightbulb : mX.FromCodeActions), this._actionWidgetService.hide(false), r10.clear();
    }, onHide: (e207) => {
      this._editor?.focus(), r10.clear();
    }, onHover: async (e207, t11) => {
      if (t11.isCancellationRequested) return;
      let n11 = false, r11 = e207.action.kind;
      if (r11) {
        let e208 = new WJ(r11);
        n11 = [nX.RefactorExtract, nX.RefactorInline, nX.RefactorRewrite, nX.RefactorMove, nX.Source].some((t12) => t12.contains(e208));
      }
      return { canPreview: n11 || !!e207.action.edit?.edits.length };
    }, onFocus: (e207) => {
      if (e207 && e207.action) {
        let t11 = e207.action.ranges, n11 = e207.action.diagnostics;
        if (r10.clear(), t11 && t11.length > 0) {
          let e208 = n11 && n11?.length > 1 ? n11.map((e209) => ({ range: e209, options: AX.DECORATION })) : t11.map((e209) => ({ range: e209, options: AX.DECORATION }));
          r10.set(e208);
        } else if (n11 && n11.length > 0) {
          let e208 = n11.map((e209) => ({ range: e209, options: AX.DECORATION }));
          r10.set(e208);
          let t12 = n11[0];
          if (t12.startLineNumber && t12.startColumn) {
            let e209 = this._editor.getModel()?.getWordAtPosition({ lineNumber: t12.startLineNumber, column: t12.startColumn })?.word;
            Gg(C(863, `Context: {0} at line {1} and column {2}.`, e209, t12.startLineNumber, t12.startColumn));
          }
        }
      } else r10.clear();
    } }, o10, i10, this._getActionBarActions(e206, t10, n10));
  }
  toCoords(e206) {
    if (!this._editor.hasModel()) return { x: 0, y: 0 };
    this._editor.revealPosition(e206, 1), this._editor.render();
    let t10 = this._editor.getScrolledVisiblePosition(e206), n10 = _l2(this._editor.getDomNode());
    return { x: n10.left + t10.left, y: n10.top + t10.top + t10.height };
  }
  _shouldShowHeaders() {
    let e206 = this._editor?.getModel();
    return this._configurationService.getValue(`editor.codeActionWidget.showHeaders`, { resource: e206?.uri });
  }
  _getActionBarActions(e206, t10, n10) {
    if (n10.fromLightbulb) return [];
    let r10 = e206.documentation.map((e207) => ({ id: e207.id, label: e207.title, tooltip: e207.tooltip ?? ``, class: void 0, enabled: true, run: () => this._commandService.executeCommand(e207.id, ...e207.arguments ?? []) }));
    return n10.includeDisabledActions && e206.validActions.length > 0 && e206.allActions.length !== e206.validActions.length && r10.push(this._showDisabled ? { id: `hideMoreActions`, label: C(864, `Hide Disabled`), enabled: true, tooltip: ``, class: void 0, run: () => (this._showDisabled = false, this.showCodeActionList(e206, t10, n10)) } : { id: `showMoreActions`, label: C(865, `Show Disabled`), enabled: true, tooltip: ``, class: void 0, run: () => (this._showDisabled = true, this.showCodeActionList(e206, t10, n10)) }), r10;
  }
}, AX = _Tb, _Tb.ID = `editor.contrib.codeActionController`, _Tb.DECORATION = UO.register({ description: `quickfix-highlight`, className: Vxe }), _Tb);
jX = AX = Bxe([kX(1, GL), kX(2, nd), kX(3, V), kX(4, X), kX(5, UF), kX(6, Mu), kX(7, Uf), kX(8, IY), kX(9, V), kX(10, UF)], jX), JS((e206, t10) => {
  ((e207, n11) => {
    n11 && t10.addRule(`.monaco-editor ${e207} { background-color: ${n11}; }`);
  })(`.quickfix-edit-highlight`, e206.getColor(Sv));
  let n10 = e206.getColor(wv);
  n10 && t10.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Fb(e206.type) ? `dotted` : `solid`} ${n10}; box-sizing: border-box; }`);
});
function MX(e206) {
  return H.regex(vX.keys()[0], RegExp(`(\\s|^)` + za(e206.value) + `\\b`));
}
var NX = { type: `object`, defaultSnippets: [{ body: { kind: `` } }], properties: { kind: { type: `string`, description: C(831, `Kind of the code action to run.`) }, apply: { type: `string`, description: C(832, `Controls when the returned actions are applied.`), default: `ifSingle`, enum: [`first`, `ifSingle`, `never`], enumDescriptions: [C(833, `Always apply the first returned code action.`), C(834, `Apply the first returned code action if it is the only one.`), C(835, `Do not apply the returned code actions.`)] }, preferred: { type: `boolean`, default: false, description: C(836, `Controls if only preferred code actions should be returned.`) } } };
function PX(e206, t10, n10, r10, i10 = rX.Default) {
  e206.hasModel() && jX.get(e206)?.manualTriggerAtCurrentPosition(t10, i10, n10, r10);
}
var Hxe = class extends G {
  constructor() {
    super({ id: sX, label: w(853, `Quick Fix...`), precondition: H.and($.writable, $.hasCodeActionsProvider), kbOpts: { kbExpr: $.textInputFocus, primary: 2137, weight: 100 } });
  }
  run(e206, t10) {
    return PX(t10, C(837, `No code actions available`), void 0, void 0, rX.QuickFix);
  }
}, Uxe = class extends $d {
  constructor() {
    super({ id: oX, precondition: H.and($.writable, $.hasCodeActionsProvider), metadata: { description: `Trigger a code action`, args: [{ name: `args`, schema: NX }] } });
  }
  runEditorCommand(e206, t10, n10) {
    let r10 = aX.fromUser(n10, { kind: WJ.Empty, apply: `ifSingle` });
    return PX(t10, typeof n10?.kind == `string` ? r10.preferred ? C(838, `No preferred code actions for '{0}' available`, n10.kind) : C(839, `No code actions for '{0}' available`, n10.kind) : r10.preferred ? C(840, `No preferred code actions available`) : C(841, `No code actions available`), { include: r10.kind, includeSourceActions: true, onlyIncludePreferredActions: r10.preferred }, r10.apply);
  }
}, Wxe = class extends G {
  constructor() {
    super({ id: cX, label: w(854, `Refactor...`), precondition: H.and($.writable, $.hasCodeActionsProvider), kbOpts: { kbExpr: $.textInputFocus, primary: 3120, mac: { primary: 1328 }, weight: 100 }, contextMenuOpts: { group: `1_modification`, order: 2, when: H.and($.writable, MX(nX.Refactor)) }, metadata: { description: `Refactor...`, args: [{ name: `args`, schema: NX }] } });
  }
  run(e206, t10, n10) {
    let r10 = aX.fromUser(n10, { kind: nX.Refactor, apply: `never` });
    return PX(t10, typeof n10?.kind == `string` ? r10.preferred ? C(842, `No preferred refactorings for '{0}' available`, n10.kind) : C(843, `No refactorings for '{0}' available`, n10.kind) : r10.preferred ? C(844, `No preferred refactorings available`) : C(845, `No refactorings available`), { include: nX.Refactor.contains(r10.kind) ? r10.kind : WJ.None, onlyIncludePreferredActions: r10.preferred }, r10.apply, rX.Refactor);
  }
}, Gxe = class extends G {
  constructor() {
    super({ id: lX, label: w(855, `Source Action...`), precondition: H.and($.writable, $.hasCodeActionsProvider), contextMenuOpts: { group: `1_modification`, order: 2.1, when: H.and($.writable, MX(nX.Source)) }, metadata: { description: `Source Action...`, args: [{ name: `args`, schema: NX }] } });
  }
  run(e206, t10, n10) {
    let r10 = aX.fromUser(n10, { kind: nX.Source, apply: `never` });
    return PX(t10, typeof n10?.kind == `string` ? r10.preferred ? C(846, `No preferred source actions for '{0}' available`, n10.kind) : C(847, `No source actions for '{0}' available`, n10.kind) : r10.preferred ? C(848, `No preferred source actions available`) : C(849, `No source actions available`), { include: nX.Source.contains(r10.kind) ? r10.kind : WJ.None, includeSourceActions: true, onlyIncludePreferredActions: r10.preferred }, r10.apply, rX.SourceAction);
  }
}, Kxe = class extends G {
  constructor() {
    super({ id: uX, label: w(856, `Organize Imports`), precondition: H.and($.writable, MX(nX.SourceOrganizeImports)), kbOpts: { kbExpr: $.textInputFocus, primary: 1581, weight: 100 }, metadata: { description: w(857, `Organize imports in the current file. Also called 'Optimize Imports' by some tools`) } });
  }
  run(e206, t10) {
    return PX(t10, C(850, `No organize imports action available`), { include: nX.SourceOrganizeImports, includeSourceActions: true }, `ifSingle`, rX.OrganizeImports);
  }
}, qxe = class extends G {
  constructor() {
    super({ id: dX, label: w(858, `Fix All`), precondition: H.and($.writable, MX(nX.SourceFixAll)) });
  }
  run(e206, t10) {
    return PX(t10, C(851, `No fix all action available`), { include: nX.SourceFixAll, includeSourceActions: true }, `ifSingle`, rX.FixAll);
  }
}, Jxe = class extends G {
  constructor() {
    super({ id: wxe, label: w(859, `Auto Fix...`), precondition: H.and($.writable, MX(nX.QuickFix)), kbOpts: { kbExpr: $.textInputFocus, primary: 1625, mac: { primary: 2649 }, weight: 100 } });
  }
  run(e206, t10) {
    return PX(t10, C(852, `No auto fixes available`), { include: nX.QuickFix, onlyIncludePreferredActions: true }, `ifSingle`, rX.AutoFix);
  }
};
af(jX.ID, jX, 3), af(OX.ID, OX, 4), q(Hxe), q(Wxe), q(Gxe), q(Kxe), q(Jxe), q(qxe), K(new Uxe()), cd.as(op.Configuration).registerConfiguration({ ...CF, properties: { "editor.codeActionWidget.showHeaders": { type: `boolean`, scope: 6, description: C(860, `Enable/disable showing group headers in the Code Action menu.`), default: true } } }), cd.as(op.Configuration).registerConfiguration({ ...CF, properties: { "editor.codeActionWidget.includeNearbyQuickFixes": { type: `boolean`, scope: 6, description: C(861, `Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.`), default: true } } }), cd.as(op.Configuration).registerConfiguration({ ...CF, properties: { "editor.codeActions.triggerOnFocusChange": { type: `boolean`, scope: 6, markdownDescription: C(862, `Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.`, "`#editor.codeActionsOnSave#`", "`#files.autoSave#`", "`afterDelay`", "`always`"), default: false } } });
var FX = (_Ub = class {
  constructor() {
    this.lenses = [];
  }
  dispose() {
    this._store?.dispose();
  }
  get isDisposed() {
    return this._store?.isDisposed ?? false;
  }
  add(e206, t10) {
    Gt(e206) && (this._store ?? (this._store = new E()), this._store.add(e206));
    for (let n10 of e206.lenses) this.lenses.push({ symbol: n10, provider: t10 });
  }
}, _Ub.Empty = new _Ub(), _Ub);
async function IX(e206, t10, n10) {
  let r10 = e206.ordered(t10), i10 = /* @__PURE__ */ new Map(), a10 = new FX(), o10 = r10.map(async (e207, r11) => {
    i10.set(e207, r11);
    try {
      let r12 = await Promise.resolve(e207.provideCodeLenses(t10, n10));
      r12 && a10.add(r12, e207);
    } catch (e208) {
      xe(e208);
    }
  });
  return await Promise.all(o10), n10.isCancellationRequested ? (a10.dispose(), FX.Empty) : (a10.lenses = a10.lenses.sort((e207, t11) => e207.symbol.range.startLineNumber < t11.symbol.range.startLineNumber ? -1 : e207.symbol.range.startLineNumber > t11.symbol.range.startLineNumber ? 1 : i10.get(e207.provider) < i10.get(t11.provider) ? -1 : i10.get(e207.provider) > i10.get(t11.provider) ? 1 : e207.symbol.range.startColumn < t11.symbol.range.startColumn ? -1 : +(e207.symbol.range.startColumn > t11.symbol.range.startColumn)), a10);
}
Nu.registerCommand(`_executeCodeLensProvider`, function(e206, ...t10) {
  let [n10, r10] = t10;
  Je($r.isUri(n10)), Je(typeof r10 == `number` || !r10);
  let { codeLensProvider: i10 } = e206.get(X), a10 = e206.get(Cu).getModel(n10);
  if (!a10) throw De();
  let o10 = [], s10 = new E();
  return IX(i10, a10, dr.None).then((e207) => {
    s10.add(e207);
    let t11 = [];
    for (let n11 of e207.lenses) r10 == null || n11.symbol.command ? o10.push(n11.symbol) : r10-- > 0 && n11.provider.resolveCodeLens && t11.push(Promise.resolve(n11.provider.resolveCodeLens(a10, n11.symbol, dr.None)).then((e208) => o10.push(e208 || n11.symbol)));
    return Promise.all(t11);
  }).then(() => o10).finally(() => {
    setTimeout(() => s10.dispose(), 100);
  });
});
var Yxe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Xxe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, LX = xu(`ICodeLensCache`), RX = class {
  constructor(e206, t10) {
    this.lineCount = e206, this.data = t10;
  }
}, zX = class {
  constructor(e206) {
    this._fakeProvider = new class {
      provideCodeLenses() {
        throw Error(`not supported`);
      }
    }(), this._cache = new Td(20, 0.75), al(Aa, () => e206.remove(`codelens/cache`, 1));
    let t10 = `codelens/cache2`, n10 = e206.get(t10, 1, `{}`);
    this._deserialize(n10);
    let r10 = O.filter(e206.onWillSaveState, (e207) => e207.reason === fF.SHUTDOWN);
    O.once(r10)((n11) => {
      e206.store(t10, this._serialize(), 1, 1);
    });
  }
  put(e206, t10) {
    let n10 = t10.lenses.map((e207) => ({ range: e207.symbol.range, command: e207.symbol.command && { id: ``, title: e207.symbol.command?.title } })), r10 = new FX();
    r10.add({ lenses: n10 }, this._fakeProvider);
    let i10 = new RX(e206.getLineCount(), r10);
    this._cache.set(e206.uri.toString(), i10);
  }
  get(e206) {
    let t10 = this._cache.get(e206.uri.toString());
    return t10 && t10.lineCount === e206.getLineCount() ? t10.data : void 0;
  }
  delete(e206) {
    this._cache.delete(e206.uri.toString());
  }
  _serialize() {
    let e206 = /* @__PURE__ */ Object.create(null);
    for (let [t10, n10] of this._cache) {
      let r10 = /* @__PURE__ */ new Set();
      for (let e207 of n10.data.lenses) r10.add(e207.symbol.range.startLineNumber);
      e206[t10] = { lineCount: n10.lineCount, lines: [...r10.values()] };
    }
    return JSON.stringify(e206);
  }
  _deserialize(e206) {
    try {
      let t10 = JSON.parse(e206);
      for (let e207 in t10) {
        let n10 = t10[e207], r10 = [];
        for (let e208 of n10.lines) r10.push({ range: new M(e208, 1, e208, 11) });
        let i10 = new FX();
        i10.add({ lenses: r10 }, this._fakeProvider), this._cache.set(e207, new RX(n10.lineCount, i10));
      }
    } catch {
    }
  }
};
zX = Yxe([Xxe(0, dF)], zX), Zf(LX, zX, 1);
var Zxe = class {
  constructor(e206, t10, n10) {
    this.afterColumn = 1073741824, this.afterLineNumber = e206, this.heightInPx = t10, this._onHeight = n10, this.suppressMouseDown = true, this.domNode = document.createElement(`div`);
  }
  onComputedHeight(e206) {
    this._lastHeight === void 0 ? this._lastHeight = e206 : this._lastHeight !== e206 && (this._lastHeight = e206, this._onHeight());
  }
  isVisible() {
    return this._lastHeight !== 0 && this.domNode.hasAttribute(`monaco-visible-view-zone`);
  }
}, Qxe = (_Vb = class {
  constructor(t10, n10) {
    this.allowEditorOverflow = false, this.suppressMouseDown = true, this._commands = /* @__PURE__ */ new Map(), this._isEmpty = true, this._editor = t10, this._id = `codelens.widget-${_Vb._idPool++}`, this.updatePosition(n10), this._domNode = document.createElement(`span`), this._domNode.className = `codelens-decoration`;
  }
  withCommands(t10, n10) {
    this._commands.clear();
    let r10 = [], i10 = false;
    for (let n11 = 0; n11 < t10.length; n11++) {
      let a10 = t10[n11];
      if (a10 && (i10 = true, a10.command)) {
        let i11 = CP(a10.command.title.trim());
        if (a10.command.id) {
          let t11 = `c${_Vb._idPool++}`;
          r10.push(B(`a`, { id: t11, title: a10.command.tooltip, role: `button` }, ...i11)), this._commands.set(t11, a10.command);
        } else r10.push(B(`span`, { title: a10.command.tooltip }, ...i11));
        n11 + 1 < t10.length && r10.push(B(`span`, void 0, `\xA0|\xA0`));
      }
    }
    i10 ? (Jl(this._domNode, ...r10), this._isEmpty && n10 && this._domNode.classList.add(`fadein`), this._isEmpty = false) : Jl(this._domNode, B(`span`, void 0, `no commands`));
  }
  getCommand(e206) {
    return e206.parentElement === this._domNode ? this._commands.get(e206.id) : void 0;
  }
  getId() {
    return this._id;
  }
  getDomNode() {
    return this._domNode;
  }
  updatePosition(e206) {
    this._widgetPosition = { position: { lineNumber: e206, column: this._editor.getModel().getLineFirstNonWhitespaceColumn(e206) }, preference: [1] };
  }
  getPosition() {
    return this._widgetPosition || null;
  }
}, _Vb._idPool = 0, _Vb), BX = class {
  constructor() {
    this._removeDecorations = [], this._addDecorations = [], this._addDecorationsCallbacks = [];
  }
  addDecoration(e206, t10) {
    this._addDecorations.push(e206), this._addDecorationsCallbacks.push(t10);
  }
  removeDecoration(e206) {
    this._removeDecorations.push(e206);
  }
  commit(e206) {
    let t10 = e206.deltaDecorations(this._removeDecorations, this._addDecorations);
    for (let e207 = 0, n10 = t10.length; e207 < n10; e207++) this._addDecorationsCallbacks[e207](t10[e207]);
  }
}, VX = UO.register({ collapseOnReplaceEdit: true, description: `codelens` }), HX = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._isDisposed = false, this._editor = t10, this._data = e206, this._decorationIds = [];
    let o10, s10 = [];
    this._data.forEach((e207, t11) => {
      e207.symbol.command && s10.push(e207.symbol), n10.addDecoration({ range: e207.symbol.range, options: VX }, (e208) => this._decorationIds[t11] = e208), o10 = o10 ? M.plusRange(o10, e207.symbol.range) : M.lift(e207.symbol.range);
    }), this._viewZone = new Zxe(o10.startLineNumber - 1, i10, a10), this._viewZoneId = r10.addZone(this._viewZone), s10.length > 0 && (this._createContentWidgetIfNecessary(), this._contentWidget.withCommands(s10, false));
  }
  _createContentWidgetIfNecessary() {
    this._contentWidget ? this._editor.layoutContentWidget(this._contentWidget) : (this._contentWidget = new Qxe(this._editor, this._viewZone.afterLineNumber + 1), this._editor.addContentWidget(this._contentWidget));
  }
  dispose(e206, t10) {
    this._decorationIds.forEach(e206.removeDecoration, e206), this._decorationIds = [], t10?.removeZone(this._viewZoneId), this._contentWidget && (this._contentWidget = (this._editor.removeContentWidget(this._contentWidget), void 0)), this._isDisposed = true;
  }
  isDisposed() {
    return this._isDisposed;
  }
  isValid() {
    return this._decorationIds.some((e206, t10) => {
      let n10 = this._editor.getModel().getDecorationRange(e206), r10 = this._data[t10].symbol;
      return !!(n10 && M.isEmpty(r10.range) === n10.isEmpty());
    });
  }
  updateCodeLensSymbols(e206, t10) {
    this._decorationIds.forEach(t10.removeDecoration, t10), this._decorationIds = [], this._data = e206, this._data.forEach((e207, n10) => {
      t10.addDecoration({ range: e207.symbol.range, options: VX }, (e208) => this._decorationIds[n10] = e208);
    });
  }
  updateHeight(e206, t10) {
    this._viewZone.heightInPx = e206, t10.layoutZone(this._viewZoneId), this._contentWidget && this._editor.layoutContentWidget(this._contentWidget);
  }
  computeIfNecessary(e206) {
    if (!this._viewZone.isVisible()) return null;
    for (let t10 = 0; t10 < this._decorationIds.length; t10++) {
      let n10 = e206.getDecorationRange(this._decorationIds[t10]);
      n10 && (this._data[t10].symbol.range = n10);
    }
    return this._data;
  }
  updateCommands(e206) {
    this._createContentWidgetIfNecessary(), this._contentWidget.withCommands(e206, true);
    for (let t10 = 0; t10 < this._data.length; t10++) {
      let n10 = e206[t10];
      if (n10) {
        let { symbol: e207 } = this._data[t10];
        e207.command = n10.command || e207.command;
      }
    }
  }
  getCommand(e206) {
    return this._contentWidget?.getCommand(e206);
  }
  getLineNumber() {
    let e206 = this._editor.getModel().getDecorationRange(this._decorationIds[0]);
    return e206 ? e206.startLineNumber : -1;
  }
  update(e206) {
    if (this.isValid()) {
      let t10 = this._editor.getModel().getDecorationRange(this._decorationIds[0]);
      t10 && (this._viewZone.afterLineNumber = t10.startLineNumber - 1, e206.layoutZone(this._viewZoneId), this._contentWidget && (this._contentWidget.updatePosition(t10.startLineNumber), this._editor.layoutContentWidget(this._contentWidget)));
    }
  }
}, $xe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, UX = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, WX = (_Wb = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._editor = e206, this._languageFeaturesService = t10, this._commandService = r10, this._notificationService = i10, this._codeLensCache = a10, this._disposables = new E(), this._localToDispose = new E(), this._lenses = [], this._oldCodeLensModels = new E(), this._provideCodeLensDebounce = n10.for(t10.codeLensProvider, `CodeLensProvide`, { min: 250 }), this._resolveCodeLensesDebounce = n10.for(t10.codeLensProvider, `CodeLensResolve`, { min: 250, salt: `resolve` }), this._resolveCodeLensesScheduler = new us(() => this._resolveCodeLensesInViewport(), this._resolveCodeLensesDebounce.default()), this._disposables.add(this._editor.onDidChangeModel(() => this._onModelChange())), this._disposables.add(this._editor.onDidChangeModelLanguage(() => this._onModelChange())), this._disposables.add(this._editor.onDidChangeConfiguration((e207) => {
      (e207.hasChanged(59) || e207.hasChanged(25) || e207.hasChanged(24)) && this._updateLensStyle(), e207.hasChanged(23) && this._onModelChange();
    })), this._disposables.add(t10.codeLensProvider.onDidChange(this._onModelChange, this)), this._onModelChange(), this._updateLensStyle();
  }
  dispose() {
    this._localDispose(), this._localToDispose.dispose(), this._disposables.dispose(), this._oldCodeLensModels.dispose(), this._currentCodeLensModel?.dispose();
  }
  _getLayoutInfo() {
    let e206 = Math.max(1.3, this._editor.getOption(75) / this._editor.getOption(61)), t10 = this._editor.getOption(25);
    return (!t10 || t10 < 5) && (t10 = this._editor.getOption(61) * 0.9 | 0), { fontSize: t10, codeLensHeight: t10 * e206 | 0 };
  }
  _updateLensStyle() {
    let { codeLensHeight: e206, fontSize: t10 } = this._getLayoutInfo(), n10 = this._editor.getOption(24), r10 = this._editor.getOption(59), { style: i10 } = this._editor.getContainerDomNode();
    i10.setProperty(`--vscode-editorCodeLens-lineHeight`, `${e206}px`), i10.setProperty(`--vscode-editorCodeLens-fontSize`, `${t10}px`), i10.setProperty(`--vscode-editorCodeLens-fontFeatureSettings`, r10.fontFeatureSettings), n10 && (i10.setProperty(`--vscode-editorCodeLens-fontFamily`, n10), i10.setProperty(`--vscode-editorCodeLens-fontFamilyDefault`, _n.fontFamily)), this._editor.changeViewZones((t11) => {
      for (let n11 of this._lenses) n11.updateHeight(e206, t11);
    });
  }
  _localDispose() {
    this._getCodeLensModelPromise?.cancel(), this._getCodeLensModelPromise = void 0, this._resolveCodeLensesPromise?.cancel(), this._resolveCodeLensesPromise = void 0, this._localToDispose.clear(), this._oldCodeLensModels.clear(), this._currentCodeLensModel?.dispose();
  }
  _onModelChange() {
    this._localDispose();
    let e206 = this._editor.getModel();
    if (!e206 || !this._editor.getOption(23) || e206.isTooLargeForTokenization()) return;
    let t10 = this._codeLensCache.get(e206);
    if (t10 && this._renderCodeLensSymbols(t10), !this._languageFeaturesService.codeLensProvider.has(e206)) {
      t10 && as(() => {
        t10 === this._codeLensCache.get(e206) && (this._codeLensCache.delete(e206), this._onModelChange());
      }, 30 * 1e3, this._localToDispose);
      return;
    }
    for (let t11 of this._languageFeaturesService.codeLensProvider.all(e206)) if (typeof t11.onDidChange == `function`) {
      let e207 = t11.onDidChange(() => n10.schedule());
      this._localToDispose.add(e207);
    }
    let n10 = new us(() => {
      let t11 = Date.now();
      this._getCodeLensModelPromise?.cancel(), this._getCodeLensModelPromise = es((t12) => IX(this._languageFeaturesService.codeLensProvider, e206, t12)), this._getCodeLensModelPromise.then((r10) => {
        this._currentCodeLensModel && this._oldCodeLensModels.add(this._currentCodeLensModel), this._currentCodeLensModel = r10, this._codeLensCache.put(e206, r10), n10.delay = this._provideCodeLensDebounce.update(e206, Date.now() - t11), this._renderCodeLensSymbols(r10), this._resolveCodeLensesInViewportSoon();
      }, be);
    }, this._provideCodeLensDebounce.get(e206));
    this._localToDispose.add(n10), this._localToDispose.add(T(() => this._resolveCodeLensesScheduler.cancel())), this._localToDispose.add(this._editor.onDidChangeModelContent(() => {
      this._editor.changeDecorations((e207) => {
        this._editor.changeViewZones((t11) => {
          let n11 = [], r10 = -1;
          this._lenses.forEach((e208) => {
            !e208.isValid() || r10 === e208.getLineNumber() ? n11.push(e208) : (e208.update(t11), r10 = e208.getLineNumber());
          });
          let i10 = new BX();
          n11.forEach((e208) => {
            e208.dispose(i10, t11), this._lenses.splice(this._lenses.indexOf(e208), 1);
          }), i10.commit(e207);
        });
      }), n10.schedule(), this._resolveCodeLensesScheduler.cancel(), this._resolveCodeLensesPromise?.cancel(), this._resolveCodeLensesPromise = void 0;
    })), this._localToDispose.add(this._editor.onDidFocusEditorText(() => {
      n10.schedule();
    })), this._localToDispose.add(this._editor.onDidBlurEditorText(() => {
      n10.cancel();
    })), this._localToDispose.add(this._editor.onDidScrollChange((e207) => {
      e207.scrollTopChanged && this._lenses.length > 0 && this._resolveCodeLensesInViewportSoon();
    })), this._localToDispose.add(this._editor.onDidLayoutChange(() => {
      this._resolveCodeLensesInViewportSoon();
    })), this._localToDispose.add(T(() => {
      if (this._editor.getModel()) {
        let e207 = FG.capture(this._editor);
        this._editor.changeDecorations((e208) => {
          this._editor.changeViewZones((t11) => {
            this._disposeAllLenses(e208, t11);
          });
        }), e207.restore(this._editor);
      } else this._disposeAllLenses(void 0, void 0);
    })), this._localToDispose.add(this._editor.onMouseDown((e207) => {
      if (e207.target.type !== 9) return;
      let t11 = e207.target.element;
      if (t11?.tagName === `SPAN` && (t11 = t11.parentElement), t11?.tagName === `A`) for (let e208 of this._lenses) {
        let n11 = e208.getCommand(t11);
        if (n11) {
          this._commandService.executeCommand(n11.id, ...n11.arguments || []).catch((e209) => this._notificationService.error(e209));
          break;
        }
      }
    })), n10.schedule();
  }
  _disposeAllLenses(e206, t10) {
    let n10 = new BX();
    for (let e207 of this._lenses) e207.dispose(n10, t10);
    e206 && n10.commit(e206), this._lenses.length = 0;
  }
  _renderCodeLensSymbols(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._editor.getModel().getLineCount(), n10 = [], r10;
    for (let i11 of e206.lenses) {
      let e207 = i11.symbol.range.startLineNumber;
      e207 < 1 || e207 > t10 || (r10 && r10[r10.length - 1].symbol.range.startLineNumber === e207 ? r10.push(i11) : (r10 = [i11], n10.push(r10)));
    }
    if (!n10.length && !this._lenses.length) return;
    let i10 = FG.capture(this._editor), a10 = this._getLayoutInfo();
    this._editor.changeDecorations((e207) => {
      this._editor.changeViewZones((t11) => {
        let r11 = new BX(), i11 = 0, o10 = 0;
        for (; o10 < n10.length && i11 < this._lenses.length; ) {
          let e208 = n10[o10][0].symbol.range.startLineNumber, s10 = this._lenses[i11].getLineNumber();
          s10 < e208 ? (this._lenses[i11].dispose(r11, t11), this._lenses.splice(i11, 1)) : s10 === e208 ? (this._lenses[i11].updateCodeLensSymbols(n10[o10], r11), o10++, i11++) : (this._lenses.splice(i11, 0, new HX(n10[o10], this._editor, r11, t11, a10.codeLensHeight, () => this._resolveCodeLensesInViewportSoon())), i11++, o10++);
        }
        for (; i11 < this._lenses.length; ) this._lenses[i11].dispose(r11, t11), this._lenses.splice(i11, 1);
        for (; o10 < n10.length; ) this._lenses.push(new HX(n10[o10], this._editor, r11, t11, a10.codeLensHeight, () => this._resolveCodeLensesInViewportSoon())), o10++;
        r11.commit(e207);
      });
    }), i10.restore(this._editor);
  }
  _resolveCodeLensesInViewportSoon() {
    this._editor.getModel() && this._resolveCodeLensesScheduler.schedule();
  }
  _resolveCodeLensesInViewport() {
    this._resolveCodeLensesPromise?.cancel(), this._resolveCodeLensesPromise = void 0;
    let e206 = this._editor.getModel();
    if (!e206) return;
    let t10 = [], n10 = [];
    if (this._lenses.forEach((r11) => {
      let i11 = r11.computeIfNecessary(e206);
      i11 && (t10.push(i11), n10.push(r11));
    }), t10.length === 0) {
      this._oldCodeLensModels.clear();
      return;
    }
    let r10 = Date.now(), i10 = es((r11) => {
      let i11 = t10.map((t11, i12) => {
        let a10 = Array(t11.length), o10 = t11.map((t12, n11) => !t12.symbol.command && typeof t12.provider.resolveCodeLens == `function` ? Promise.resolve(t12.provider.resolveCodeLens(e206, t12.symbol, r11)).then((e207) => {
          a10[n11] = e207;
        }, xe) : (a10[n11] = t12.symbol, Promise.resolve(void 0)));
        return Promise.all(o10).then(() => {
          !r11.isCancellationRequested && !n10[i12].isDisposed() && n10[i12].updateCommands(a10);
        });
      });
      return Promise.all(i11);
    });
    this._resolveCodeLensesPromise = i10, this._resolveCodeLensesPromise.then(() => {
      let t11 = this._resolveCodeLensesDebounce.update(e206, Date.now() - r10);
      this._resolveCodeLensesScheduler.delay = t11, this._currentCodeLensModel && this._codeLensCache.put(e206, this._currentCodeLensModel), this._oldCodeLensModels.clear(), i10 === this._resolveCodeLensesPromise && (this._resolveCodeLensesPromise = void 0);
    }, (e207) => {
      be(e207), i10 === this._resolveCodeLensesPromise && (this._resolveCodeLensesPromise = void 0);
    });
  }
  async getModel() {
    return await this._getCodeLensModelPromise, await this._resolveCodeLensesPromise, this._currentCodeLensModel?.isDisposed ? void 0 : this._currentCodeLensModel;
  }
}, _Wb.ID = `css.editor.codeLens`, _Wb);
WX = $xe([UX(1, X), UX(2, lA), UX(3, Mu), UX(4, dw), UX(5, LX)], WX), af(WX.ID, WX, 1), q(class extends G {
  constructor() {
    super({ id: `codelens.showLensesInCurrentLine`, precondition: $.hasCodeLensProvider, label: w(884, `Show CodeLens Commands for Current Line`) });
  }
  async run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = e206.get(aF), r10 = e206.get(Mu), i10 = e206.get(dw), a10 = t10.getSelection().positionLineNumber, o10 = t10.getContribution(WX.ID);
    if (!o10) return;
    let s10 = await o10.getModel();
    if (!s10) return;
    let c10 = [];
    for (let e207 of s10.lenses) e207.symbol.command && e207.symbol.range.startLineNumber === a10 && c10.push({ label: e207.symbol.command.title, command: e207.symbol.command });
    if (c10.length === 0) return;
    let l10 = await n10.pick(c10, { canPickMany: false, placeHolder: C(883, `Select a command`) });
    if (!l10) return;
    let u10 = l10.command;
    if (s10.isDisposed) {
      let e207 = (await o10.getModel())?.lenses.find((e208) => e208.symbol.range.startLineNumber === a10 && e208.symbol.command?.title === u10.title);
      if (!e207 || !e207.symbol.command) return;
      u10 = e207.symbol.command;
    }
    try {
      await r10.executeCommand(u10.id, ...u10.arguments || []);
    } catch (e207) {
      i10.error(e207);
    }
  }
});
var GX = class {
  constructor(e206, t10, n10, r10) {
    this.priority = e206, this.range = t10, this.initialMousePosX = n10, this.initialMousePosY = r10, this.type = 1;
  }
  equals(e206) {
    return e206.type === 1 && this.range.equalsRange(e206.range);
  }
  canAdoptVisibleHover(e206, t10) {
    return e206.type === 1 && t10.lineNumber === this.range.startLineNumber;
  }
}, KX = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this.priority = e206, this.owner = t10, this.range = n10, this.initialMousePosX = r10, this.initialMousePosY = i10, this.supportsMarkerHover = a10, this.type = 2;
  }
  equals(e206) {
    return e206.type === 2 && this.owner === e206.owner;
  }
  canAdoptVisibleHover(e206, t10) {
    return e206.type === 2 && this.owner === e206.owner;
  }
}, qX = class {
  constructor(e206, t10) {
    this.renderedHoverParts = e206, this.disposables = t10;
  }
  dispose() {
    for (let e206 of this.renderedHoverParts) e206.dispose();
    this.disposables?.dispose();
  }
}, JX = new class {
  constructor() {
    this._participants = [];
  }
  register(e206) {
    this._participants.push(e206);
  }
  getAll() {
    return this._participants;
  }
}(), YX = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, XX = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, ZX = class {
  constructor(e206) {
    this._editorWorkerService = e206;
  }
  async provideDocumentColors(e206, t10) {
    return this._editorWorkerService.computeDefaultDocumentColors(e206.uri);
  }
  provideColorPresentations(e206, t10, n10) {
    let r10 = t10.range, i10 = t10.color, a10 = i10.alpha, o10 = new Y(new J(Math.round(255 * i10.red), Math.round(255 * i10.green), Math.round(255 * i10.blue), a10)), s10 = a10 ? Y.Format.CSS.formatRGBA(o10) : Y.Format.CSS.formatRGB(o10), c10 = a10 ? Y.Format.CSS.formatHSLA(o10) : Y.Format.CSS.formatHSL(o10), l10 = a10 ? Y.Format.CSS.formatHexA(o10) : Y.Format.CSS.formatHex(o10), u10 = [];
    return u10.push({ label: s10, textEdit: { range: r10, text: s10 } }), u10.push({ label: c10, textEdit: { range: r10, text: c10 } }), u10.push({ label: l10, textEdit: { range: r10, text: l10 } }), u10;
  }
};
ZX = YX([XX(0, HL)], ZX);
var QX = class extends D {
  constructor(e206, t10) {
    super(), this._register(e206.colorProvider.register(`*`, new ZX(t10)));
  }
};
QX = YX([XX(0, X), XX(1, HL)], QX);
async function $X(e206, t10, n10, r10 = `auto`) {
  return tZ(new eSe(), e206, t10, n10, r10);
}
function eZ(e206, t10, n10, r10) {
  return Promise.resolve(n10.provideColorPresentations(e206, t10, r10));
}
var eSe = class {
  constructor() {
  }
  async compute(e206, t10, n10, r10) {
    let i10 = await e206.provideDocumentColors(t10, n10);
    if (Array.isArray(i10)) for (let t11 of i10) r10.push({ colorInfo: t11, provider: e206 });
    return Array.isArray(i10);
  }
}, tSe = class {
  constructor() {
  }
  async compute(e206, t10, n10, r10) {
    let i10 = await e206.provideDocumentColors(t10, n10);
    if (Array.isArray(i10)) for (let e207 of i10) r10.push({ range: e207.range, color: [e207.color.red, e207.color.green, e207.color.blue, e207.color.alpha] });
    return Array.isArray(i10);
  }
}, nSe = class {
  constructor(e206) {
    this.colorInfo = e206;
  }
  async compute(e206, t10, n10, r10) {
    let i10 = await e206.provideColorPresentations(t10, this.colorInfo, dr.None);
    return Array.isArray(i10) && r10.push(...i10), Array.isArray(i10);
  }
};
async function tZ(e206, t10, n10, r10, i10) {
  let a10 = false, o10, s10 = [], c10 = t10.ordered(n10);
  for (let t11 = c10.length - 1; t11 >= 0; t11--) {
    let l10 = c10[t11];
    if (i10 !== `always` && l10 instanceof ZX) o10 = l10;
    else try {
      await e206.compute(l10, n10, r10, s10) && (a10 = true);
    } catch (e207) {
      xe(e207);
    }
  }
  return a10 ? s10 : o10 && i10 !== `never` ? (await e206.compute(o10, n10, r10, s10), s10) : [];
}
function nZ(e206, t10) {
  let { colorProvider: n10 } = e206.get(X), r10 = e206.get(Cu).getModel(t10);
  if (!r10) throw De();
  return { model: r10, colorProviderRegistry: n10, defaultColorDecoratorsEnablement: e206.get(Uf).getValue(`editor.defaultColorDecorators`, { resource: t10 }) };
}
var rSe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, rZ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, iZ, aZ = /* @__PURE__ */ Object.create({}), oZ = (_Xb = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._configurationService = t10, this._languageFeaturesService = n10, this._localToDispose = this._register(new E()), this._decorationsIds = [], this._colorDatas = /* @__PURE__ */ new Map(), this._decoratorLimitReporter = this._register(new iSe()), this._colorDecorationClassRefs = this._register(new E()), this._colorDecoratorIds = this._editor.createDecorationsCollection(), this._ruleFactory = this._register(new Cb(this._editor)), this._debounceInformation = r10.for(n10.colorProvider, `Document Colors`, { min: iZ.RECOMPUTE_TIME }), this._register(e206.onDidChangeModel(() => {
      this._isColorDecoratorsEnabled = this.isEnabled(), this.updateColors();
    })), this._register(e206.onDidChangeModelLanguage(() => this.updateColors())), this._register(n10.colorProvider.onDidChange(() => this.updateColors())), this._register(e206.onDidChangeConfiguration((e207) => {
      let t11 = this._isColorDecoratorsEnabled;
      this._isColorDecoratorsEnabled = this.isEnabled(), this._defaultColorDecoratorsEnablement = this._editor.getOption(167);
      let n11 = t11 !== this._isColorDecoratorsEnabled || e207.hasChanged(27), r11 = e207.hasChanged(167);
      (n11 || r11) && (this._isColorDecoratorsEnabled ? this.updateColors() : this.removeAllDecorations());
    })), this._timeoutTimer = null, this._computePromise = null, this._isColorDecoratorsEnabled = this.isEnabled(), this._defaultColorDecoratorsEnablement = this._editor.getOption(167), this.updateColors();
  }
  isEnabled() {
    let e206 = this._editor.getModel();
    if (!e206) return false;
    let t10 = e206.getLanguageId(), n10 = this._configurationService.getValue(t10);
    if (n10 && typeof n10 == `object`) {
      let e207 = n10.colorDecorators;
      if (e207 && e207.enable !== void 0 && !e207.enable) return e207.enable;
    }
    return this._editor.getOption(26);
  }
  static get(e206) {
    return e206.getContribution(this.ID);
  }
  dispose() {
    this.stop(), this.removeAllDecorations(), super.dispose();
  }
  updateColors() {
    if (this.stop(), !this._isColorDecoratorsEnabled) return;
    let e206 = this._editor.getModel();
    !e206 || !this._languageFeaturesService.colorProvider.has(e206) || (this._localToDispose.add(this._editor.onDidChangeModelContent(() => {
      this._timeoutTimer || (this._timeoutTimer = new cs(), this._timeoutTimer.cancelAndSet(() => {
        this._timeoutTimer = null, this.beginCompute();
      }, this._debounceInformation.get(e206)));
    })), this.beginCompute());
  }
  async beginCompute() {
    this._computePromise = es(async (e206) => {
      let t10 = this._editor.getModel();
      if (!t10) return [];
      let n10 = new $t(false), r10 = await $X(this._languageFeaturesService.colorProvider, t10, e206, this._defaultColorDecoratorsEnablement);
      return this._debounceInformation.update(t10, n10.elapsed()), r10;
    });
    try {
      let e206 = await this._computePromise;
      this.updateDecorations(e206), this.updateColorDecorators(e206), this._computePromise = null;
    } catch (e206) {
      be(e206);
    }
  }
  stop() {
    this._timeoutTimer && (this._timeoutTimer = (this._timeoutTimer.cancel(), null)), this._computePromise && (this._computePromise = (this._computePromise.cancel(), null)), this._localToDispose.clear();
  }
  updateDecorations(e206) {
    let t10 = e206.map((e207) => ({ range: { startLineNumber: e207.colorInfo.range.startLineNumber, startColumn: e207.colorInfo.range.startColumn, endLineNumber: e207.colorInfo.range.endLineNumber, endColumn: e207.colorInfo.range.endColumn }, options: UO.EMPTY }));
    this._editor.changeDecorations((n10) => {
      this._decorationsIds = n10.deltaDecorations(this._decorationsIds, t10), this._colorDatas = /* @__PURE__ */ new Map(), this._decorationsIds.forEach((t11, n11) => this._colorDatas.set(t11, e206[n11]));
    });
  }
  updateColorDecorators(e206) {
    this._colorDecorationClassRefs.clear();
    let t10 = [], n10 = this._editor.getOption(27);
    for (let r11 = 0; r11 < e206.length && t10.length < n10; r11++) {
      let { red: n11, green: i10, blue: a10, alpha: o10 } = e206[r11].colorInfo.color, s10 = new J(Math.round(n11 * 255), Math.round(i10 * 255), Math.round(a10 * 255), o10), c10 = `rgba(${s10.r}, ${s10.g}, ${s10.b}, ${s10.a})`, l10 = this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({ backgroundColor: c10 }));
      t10.push({ range: { startLineNumber: e206[r11].colorInfo.range.startLineNumber, startColumn: e206[r11].colorInfo.range.startColumn, endLineNumber: e206[r11].colorInfo.range.endLineNumber, endColumn: e206[r11].colorInfo.range.endColumn }, options: { description: `colorDetector`, before: { content: `\xA0`, inlineClassName: `${l10.className} colorpicker-color-decoration`, inlineClassNameAffectsLetterSpacing: true, attachedData: aZ } } });
    }
    let r10 = n10 < e206.length ? n10 : false;
    this._decoratorLimitReporter.update(e206.length, r10), this._colorDecoratorIds.set(t10);
  }
  removeAllDecorations() {
    this._editor.removeDecorations(this._decorationsIds), this._decorationsIds = [], this._colorDecoratorIds.clear(), this._colorDecorationClassRefs.clear();
  }
  getColorData(e206) {
    let t10 = this._editor.getModel();
    if (!t10) return null;
    let n10 = t10.getDecorationsInRange(M.fromPositions(e206, e206)).filter((e207) => this._colorDatas.has(e207.id));
    return n10.length === 0 ? null : this._colorDatas.get(n10[0].id);
  }
  isColorDecoration(e206) {
    return this._colorDecoratorIds.has(e206);
  }
}, iZ = _Xb, _Xb.ID = `editor.contrib.colorDetector`, _Xb.RECOMPUTE_TIME = 1e3, _Xb);
oZ = iZ = rSe([rZ(1, Uf), rZ(2, X), rZ(3, lA)], oZ);
var iSe = class extends D {
  constructor() {
    super(...arguments), this._onDidChange = this._register(new k()), this._computed = 0, this._limited = false;
  }
  update(e206, t10) {
    (e206 !== this._computed || t10 !== this._limited) && (this._computed = e206, this._limited = t10, this._onDidChange.fire());
  }
}, aSe = `editor.action.showHover`, oSe = `editor.action.showDefinitionPreviewHover`, sSe = `editor.action.hideHover`, cSe = `editor.action.scrollUpHover`, lSe = `editor.action.scrollDownHover`, uSe = `editor.action.scrollLeftHover`, dSe = `editor.action.scrollRightHover`, fSe = `editor.action.pageUpHover`, pSe = `editor.action.pageDownHover`, mSe = `editor.action.goToTopHover`, hSe = `editor.action.goToBottomHover`, sZ = `editor.action.increaseHoverVerbosityLevel`, gSe = C(1102, `Increase Hover Verbosity Level`), cZ = `editor.action.decreaseHoverVerbosityLevel`, _Se = C(1103, `Decrease Hover Verbosity Level`), lZ = `editor.action.inlineSuggest.commit`, uZ = `editor.action.inlineSuggest.showPrevious`, dZ = `editor.action.inlineSuggest.showNext`, vSe = `editor.action.inlineSuggest.jump`, fZ = `editor.action.inlineSuggest.hide`, pZ = `editor.action.inlineSuggest.toggleShowCollapsed`, mZ = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, hZ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, gZ, _Z2 = class extends D {
  constructor(e206, t10, n10) {
    super(), this.editor = e206, this.model = t10, this.instantiationService = n10, this.alwaysShowToolbar = Tc(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(71).showToolbar === `always`), this.sessionPosition = void 0, this.position = I(this, (e207) => {
      let t11 = this.model.read(e207)?.primaryGhostText.read(e207);
      if (!this.alwaysShowToolbar.read(e207) || !t11 || t11.parts.length === 0) return this.sessionPosition = void 0, null;
      let n11 = t11.parts[0].column;
      this.sessionPosition && this.sessionPosition.lineNumber !== t11.lineNumber && (this.sessionPosition = void 0);
      let r10 = new j(t11.lineNumber, Math.min(n11, this.sessionPosition?.column ?? 2 ** 53 - 1));
      return this.sessionPosition = r10, r10;
    }), this._register(vc((t11, n11) => {
      let r10 = this.model.read(t11);
      if (!r10 || !this.alwaysShowToolbar.read(t11)) return;
      let i10 = I((t12) => {
        let n12 = t12.store.add(this.instantiationService.createInstance(vZ.hot.read(t12), this.editor, true, this.position, r10.selectedInlineCompletionIndex, r10.inlineCompletionsCount, r10.activeCommands, r10.warning, () => {
        }));
        return e206.addContentWidget(n12), t12.store.add(T(() => e206.removeContentWidget(n12))), t12.store.add(hc((e207) => {
          this.position.read(e207) && r10.lastTriggerKind.read(e207) !== gi.Explicit && r10.triggerExplicitly();
        })), n12;
      }), a10 = Ac(this, (e207, t12) => !!this.position.read(e207) || !!t12);
      n11.add(hc((e207) => {
        a10.read(e207) && i10.read(e207);
      }));
    }));
  }
};
_Z2 = mZ([hZ(2, V)], _Z2);
var ySe = AU(`inline-suggestion-hints-next`, F.chevronRight, C(1207, `Icon for show next parameter hint.`)), bSe = AU(`inline-suggestion-hints-previous`, F.chevronLeft, C(1208, `Icon for show previous parameter hint.`)), vZ = (_Yb = class extends D {
  static get dropDownVisible() {
    return this._dropDownVisible;
  }
  createCommandAction(e206, t10, n10) {
    let r10 = new Tu(e206, t10, n10, true, () => this._commandService.executeCommand(e206)), i10 = this.keybindingService.lookupKeybinding(e206, this._contextKeyService), a10 = t10;
    return i10 && (a10 = C(1209, `{0} ({1})`, t10, i10.getLabel())), r10.tooltip = a10, r10;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10) {
    super(), this.editor = e206, this.withBorder = t10, this._position = n10, this._currentSuggestionIdx = r10, this._suggestionCount = i10, this._extraCommands = a10, this._warning = o10, this._relayout = s10, this._commandService = c10, this.keybindingService = u10, this._contextKeyService = d10, this._menuService = f10, this.id = `InlineSuggestionHintsContentWidget${gZ.id++}`, this.allowEditorOverflow = true, this.suppressMouseDown = false, this._warningMessageContentNode = I((e207) => {
      let t11 = this._warning.read(e207);
      if (t11) return typeof t11.message == `string` ? t11.message : e207.store.add(EP(t11.message)).element;
    }), this._warningMessageNode = au.div({ class: `warningMessage`, style: { maxWidth: 400, margin: 4, marginBottom: 4, display: I((e207) => this._warning.read(e207) ? `block` : `none`) } }, [this._warningMessageContentNode]).keepUpdated(this._store), this.nodes = nu(`div.inlineSuggestionsHints`, { className: this.withBorder ? `monaco-hover monaco-hover-content` : `` }, [this._warningMessageNode.element, nu(`div@toolBar`)]), this.previousAction = this._register(this.createCommandAction(uZ, C(1210, `Previous`), ju.asClassName(bSe))), this.availableSuggestionCountAction = this._register(new Tu(`inlineSuggestionHints.availableSuggestionCount`, ``, void 0, false)), this.nextAction = this._register(this.createCommandAction(dZ, C(1211, `Next`), ju.asClassName(ySe))), this.inlineCompletionsActionsMenus = this._register(this._menuService.createMenu(W.InlineCompletionsActions, this._contextKeyService)), this.clearAvailableSuggestionCountLabelDebounced = this._register(new us(() => {
      this.availableSuggestionCountAction.label = ``;
    }, 100)), this.disableButtonsDebounced = this._register(new us(() => {
      this.previousAction.enabled = this.nextAction.enabled = false;
    }, 100)), this._register(hc((e207) => {
      this._warningMessageContentNode.read(e207), this._warningMessageNode.readEffect(e207), this._relayout();
    })), this.toolBar = this._register(l10.createInstance(yZ, this.nodes.toolBar, W.InlineSuggestionToolbar, { menuOptions: { renderShortTitle: true }, toolbarOptions: { primaryGroup: (e207) => e207.startsWith(`primary`) }, actionViewItemProvider: (e207, t11) => {
      if (e207 instanceof _d2) return l10.createInstance(SSe, e207, void 0);
      if (e207 === this.availableSuggestionCountAction) {
        let t12 = new xSe(void 0, e207, { label: true, icon: false });
        return t12.setClass(`availableSuggestionCount`), t12;
      }
    }, telemetrySource: `InlineSuggestionToolbar` })), this.toolBar.setPrependedPrimaryActions([this.previousAction, this.availableSuggestionCountAction, this.nextAction]), this._register(this.toolBar.onDidChangeDropdownVisibility((e207) => {
      gZ._dropDownVisible = e207;
    })), this._register(hc((e207) => {
      this._position.read(e207), this.editor.layoutContentWidget(this);
    })), this._register(hc((e207) => {
      let t11 = this._suggestionCount.read(e207), n11 = this._currentSuggestionIdx.read(e207);
      t11 === void 0 ? this.clearAvailableSuggestionCountLabelDebounced.schedule() : (this.clearAvailableSuggestionCountLabelDebounced.cancel(), this.availableSuggestionCountAction.label = `${n11 + 1}/${t11}`), t11 !== void 0 && t11 > 1 ? (this.disableButtonsDebounced.cancel(), this.previousAction.enabled = this.nextAction.enabled = true) : this.disableButtonsDebounced.schedule();
    })), this._register(hc((e207) => {
      let t11 = this._extraCommands.read(e207).map((e208) => ({ class: void 0, id: e208.command.id, enabled: true, tooltip: e208.command.tooltip || ``, label: e208.command.title, run: (t12) => this._commandService.executeCommand(e208.command.id) }));
      for (let [e208, n11] of this.inlineCompletionsActionsMenus.getActions()) for (let e209 of n11) e209 instanceof _d2 && t11.push(e209);
      t11.length > 0 && t11.unshift(new Du()), this.toolBar.setAdditionalSecondaryActions(t11);
    }));
  }
  getId() {
    return this.id;
  }
  getDomNode() {
    return this.nodes.root;
  }
  getPosition() {
    return { position: this._position.get(), preference: [1, 2], positionAffinity: 3 };
  }
}, gZ = _Yb, _Yb.hot = MG(_Yb), _Yb._dropDownVisible = false, _Yb.id = 0, _Yb);
vZ = gZ = mZ([hZ(8, Mu), hZ(9, V), hZ(10, Dw), hZ(11, nd), hZ(12, pd)], vZ);
var xSe = class extends rL {
  constructor() {
    super(...arguments), this._className = void 0;
  }
  setClass(e206) {
    this._className = e206;
  }
  render(e206) {
    super.render(e206), this._className && e206.classList.add(this._className);
  }
  updateTooltip() {
  }
}, SSe = class extends vL {
  updateLabel() {
    let e206 = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService, true);
    if (!e206) return super.updateLabel();
    if (this.label) {
      let t10 = nu(`div.keybinding`).root;
      this._register(new QR(t10, Pt, { disableTitle: true, ...ZR })).set(e206), this.label.textContent = this._action.label, this.label.appendChild(t10), this.label.classList.add(`inlineSuggestionStatusBarItemLabel`);
    }
  }
  updateTooltip() {
  }
}, yZ = class extends rq {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(e206, { resetMenu: t10, ...n10 }, r10, i10, a10, o10, s10, c10), this.menuId = t10, this.options2 = n10, this.menuService = r10, this.contextKeyService = i10, this.menu = this._store.add(this.menuService.createMenu(this.menuId, this.contextKeyService, { emitEventsForSubmenuChanges: true })), this.additionalActions = [], this.prependedPrimaryActions = [], this.additionalPrimaryActions = [], this._store.add(this.menu.onDidChange(() => this.updateToolbar())), this.updateToolbar();
  }
  updateToolbar() {
    let { primary: e206, secondary: t10 } = hL(this.menu.getActions(this.options2?.menuOptions), this.options2?.toolbarOptions?.primaryGroup, this.options2?.toolbarOptions?.shouldInlineSubmenu, this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);
    t10.push(...this.additionalActions), e206.unshift(...this.prependedPrimaryActions), e206.push(...this.additionalPrimaryActions), this.setActions(e206, t10);
  }
  setPrependedPrimaryActions(e206) {
    o(this.prependedPrimaryActions, e206, (e207, t10) => e207 === t10) || (this.prependedPrimaryActions = e206, this.updateToolbar());
  }
  setAdditionalSecondaryActions(e206) {
    o(this.additionalActions, e206, (e207, t10) => e207 === t10) || (this.additionalActions = e206, this.updateToolbar());
  }
};
yZ = mZ([hZ(3, pd), hZ(4, nd), hZ(5, mj), hZ(6, Dw), hZ(7, Mu), hZ(8, bd)], yZ);
function bZ(e206, t10, n10) {
  let r10 = _l2(e206);
  return !(t10 < r10.left || t10 > r10.left + r10.width || n10 < r10.top || n10 > r10.top + r10.height);
}
var CSe = class {
  constructor(e206, t10, n10, r10) {
    this.value = e206, this.isComplete = t10, this.hasLoadingMessage = n10, this.options = r10;
  }
}, xZ = class extends D {
  constructor(e206, t10) {
    super(), this._editor = e206, this._computer = t10, this._onResult = this._register(new k()), this.onResult = this._onResult.event, this._asyncComputationScheduler = this._register(new SZ((e207) => this._triggerAsyncComputation(e207), 0)), this._syncComputationScheduler = this._register(new SZ((e207) => this._triggerSyncComputation(e207), 0)), this._loadingMessageScheduler = this._register(new SZ((e207) => this._triggerLoadingMessage(e207), 0)), this._state = 0, this._asyncIterable = null, this._asyncIterableDone = false, this._result = [];
  }
  dispose() {
    this._asyncIterable && (this._asyncIterable = (this._asyncIterable.cancel(), null)), this._options = void 0, super.dispose();
  }
  get _hoverTime() {
    return this._editor.getOption(69).delay;
  }
  get _firstWaitTime() {
    return this._hoverTime / 2;
  }
  get _secondWaitTime() {
    return this._hoverTime - this._firstWaitTime;
  }
  get _loadingMessageTime() {
    return 3 * this._hoverTime;
  }
  _setState(e206, t10) {
    this._options = t10, this._state = e206, this._fireResult(t10);
  }
  _triggerAsyncComputation(e206) {
    this._setState(2, e206), this._syncComputationScheduler.schedule(e206, this._secondWaitTime), this._computer.computeAsync ? (this._asyncIterableDone = false, this._asyncIterable = _s((t10) => this._computer.computeAsync(e206, t10)), (async () => {
      try {
        for await (let t10 of this._asyncIterable) t10 && (this._result.push(t10), this._fireResult(e206));
        this._asyncIterableDone = true, (this._state === 3 || this._state === 4) && this._setState(0, e206);
      } catch (e207) {
        be(e207);
      }
    })()) : this._asyncIterableDone = true;
  }
  _triggerSyncComputation(e206) {
    this._computer.computeSync && (this._result = this._result.concat(this._computer.computeSync(e206))), this._setState(this._asyncIterableDone ? 0 : 3, e206);
  }
  _triggerLoadingMessage(e206) {
    this._state === 3 && this._setState(4, e206);
  }
  _fireResult(e206) {
    if (this._state === 1 || this._state === 2) return;
    let t10 = this._state === 0, n10 = this._state === 4;
    this._onResult.fire(new CSe(this._result.slice(0), t10, n10, e206));
  }
  start(e206, t10) {
    if (e206 === 0) this._state === 0 && (this._setState(1, t10), this._asyncComputationScheduler.schedule(t10, this._firstWaitTime), this._loadingMessageScheduler.schedule(t10, this._loadingMessageTime));
    else switch (this._state) {
      case 0:
        this._triggerAsyncComputation(t10), this._syncComputationScheduler.cancel(), this._triggerSyncComputation(t10);
        break;
      case 2:
        this._syncComputationScheduler.cancel(), this._triggerSyncComputation(t10);
        break;
    }
  }
  cancel() {
    this._asyncComputationScheduler.cancel(), this._syncComputationScheduler.cancel(), this._loadingMessageScheduler.cancel(), this._asyncIterable && (this._asyncIterable = (this._asyncIterable.cancel(), null)), this._result = [], this._options = void 0, this._state = 0;
  }
  get options() {
    return this._options;
  }
}, SZ = class extends D {
  constructor(e206, t10) {
    super(), this._scheduler = this._register(new us(() => e206(this._options), t10));
  }
  schedule(e206, t10) {
    this._options = e206, this._scheduler.schedule(t10);
  }
  cancel() {
    this._scheduler.cancel();
  }
}, CZ = class {
  get onDidWillResize() {
    return this._onDidWillResize.event;
  }
  get onDidResize() {
    return this._onDidResize.event;
  }
  constructor() {
    this._onDidWillResize = new k(), this._onDidResize = new k(), this._sashListener = new E(), this._size = new ml(0, 0), this._minSize = new ml(0, 0), this._maxSize = new ml(2 ** 53 - 1, 2 ** 53 - 1), this.domNode = document.createElement(`div`), this._eastSash = new nB(this.domNode, { getVerticalSashLeft: () => this._size.width }, { orientation: 0 }), this._westSash = new nB(this.domNode, { getVerticalSashLeft: () => 0 }, { orientation: 0 }), this._northSash = new nB(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: 1, orthogonalEdge: qz.North }), this._southSash = new nB(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: 1, orthogonalEdge: qz.South }), this._northSash.orthogonalStartSash = this._westSash, this._northSash.orthogonalEndSash = this._eastSash, this._southSash.orthogonalStartSash = this._westSash, this._southSash.orthogonalEndSash = this._eastSash;
    let e206, t10 = 0, n10 = 0;
    this._sashListener.add(O.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => {
      e206 === void 0 && (this._onDidWillResize.fire(), e206 = this._size, t10 = 0, n10 = 0);
    })), this._sashListener.add(O.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => {
      e206 !== void 0 && (e206 = void 0, t10 = 0, n10 = 0, this._onDidResize.fire({ dimension: this._size, done: true }));
    })), this._sashListener.add(this._eastSash.onDidChange((r10) => {
      e206 && (n10 = r10.currentX - r10.startX, this.layout(e206.height + t10, e206.width + n10), this._onDidResize.fire({ dimension: this._size, done: false, east: true }));
    })), this._sashListener.add(this._westSash.onDidChange((r10) => {
      e206 && (n10 = -(r10.currentX - r10.startX), this.layout(e206.height + t10, e206.width + n10), this._onDidResize.fire({ dimension: this._size, done: false, west: true }));
    })), this._sashListener.add(this._northSash.onDidChange((r10) => {
      e206 && (t10 = -(r10.currentY - r10.startY), this.layout(e206.height + t10, e206.width + n10), this._onDidResize.fire({ dimension: this._size, done: false, north: true }));
    })), this._sashListener.add(this._southSash.onDidChange((r10) => {
      e206 && (t10 = r10.currentY - r10.startY, this.layout(e206.height + t10, e206.width + n10), this._onDidResize.fire({ dimension: this._size, done: false, south: true }));
    })), this._sashListener.add(O.any(this._eastSash.onDidReset, this._westSash.onDidReset)((e207) => {
      this._preferredSize && (this.layout(this._size.height, this._preferredSize.width), this._onDidResize.fire({ dimension: this._size, done: true }));
    })), this._sashListener.add(O.any(this._northSash.onDidReset, this._southSash.onDidReset)((e207) => {
      this._preferredSize && (this.layout(this._preferredSize.height, this._size.width), this._onDidResize.fire({ dimension: this._size, done: true }));
    }));
  }
  dispose() {
    this._northSash.dispose(), this._southSash.dispose(), this._eastSash.dispose(), this._westSash.dispose(), this._sashListener.dispose(), this._onDidResize.dispose(), this._onDidWillResize.dispose(), this.domNode.remove();
  }
  enableSashes(e206, t10, n10, r10) {
    this._northSash.state = e206 ? 3 : 0, this._eastSash.state = t10 ? 3 : 0, this._southSash.state = n10 ? 3 : 0, this._westSash.state = r10 ? 3 : 0;
  }
  layout(e206 = this.size.height, t10 = this.size.width) {
    let { height: n10, width: r10 } = this._minSize, { height: i10, width: a10 } = this._maxSize;
    e206 = Math.max(n10, Math.min(i10, e206)), t10 = Math.max(r10, Math.min(a10, t10));
    let o10 = new ml(t10, e206);
    ml.equals(o10, this._size) || (this.domNode.style.height = e206 + `px`, this.domNode.style.width = t10 + `px`, this._size = o10, this._northSash.layout(), this._eastSash.layout(), this._southSash.layout(), this._westSash.layout());
  }
  clearSashHoverState() {
    this._eastSash.clearSashHoverState(), this._westSash.clearSashHoverState(), this._northSash.clearSashHoverState(), this._southSash.clearSashHoverState();
  }
  get size() {
    return this._size;
  }
  set maxSize(e206) {
    this._maxSize = e206;
  }
  get maxSize() {
    return this._maxSize;
  }
  set minSize(e206) {
    this._minSize = e206;
  }
  get minSize() {
    return this._minSize;
  }
  set preferredSize(e206) {
    this._preferredSize = e206;
  }
  get preferredSize() {
    return this._preferredSize;
  }
}, wSe = 30, TSe = 24, ESe = class extends D {
  constructor(e206, t10 = new ml(10, 10)) {
    super(), this._editor = e206, this.allowEditorOverflow = true, this.suppressMouseDown = false, this._resizableNode = this._register(new CZ()), this._contentPosition = null, this._isResizing = false, this._resizableNode.domNode.style.position = `absolute`, this._resizableNode.minSize = ml.lift(t10), this._resizableNode.layout(t10.height, t10.width), this._resizableNode.enableSashes(true, true, true, true), this._register(this._resizableNode.onDidResize((e207) => {
      this._resize(new ml(e207.dimension.width, e207.dimension.height)), e207.done && (this._isResizing = false);
    })), this._register(this._resizableNode.onDidWillResize(() => {
      this._isResizing = true;
    }));
  }
  get isResizing() {
    return this._isResizing;
  }
  getDomNode() {
    return this._resizableNode.domNode;
  }
  getPosition() {
    return this._contentPosition;
  }
  get position() {
    return this._contentPosition?.position ? j.lift(this._contentPosition.position) : void 0;
  }
  _availableVerticalSpaceAbove(e206) {
    let t10 = this._editor.getDomNode(), n10 = this._editor.getScrolledVisiblePosition(e206);
    if (!(!t10 || !n10)) return _l2(t10).top + n10.top - wSe;
  }
  _availableVerticalSpaceBelow(e206) {
    let t10 = this._editor.getDomNode(), n10 = this._editor.getScrolledVisiblePosition(e206);
    if (!t10 || !n10) return;
    let r10 = _l2(t10), i10 = fl(t10.ownerDocument.body), a10 = r10.top + n10.top + n10.height;
    return i10.height - a10 - TSe;
  }
  _findPositionPreference(e206, t10) {
    let n10 = Math.min(this._availableVerticalSpaceBelow(t10) ?? 1 / 0, e206), r10 = Math.min(this._availableVerticalSpaceAbove(t10) ?? 1 / 0, e206), i10 = Math.min(e206, Math.min(Math.max(r10, n10), e206)), a10;
    return a10 = this._editor.getOption(69).above ? i10 <= r10 ? 1 : 2 : i10 <= n10 ? 2 : 1, a10 === 1 ? this._resizableNode.enableSashes(true, true, false, false) : this._resizableNode.enableSashes(false, true, true, false), a10;
  }
  _resize(e206) {
    this._resizableNode.layout(e206.height, e206.width);
  }
}, DSe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, wZ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, TZ, EZ = 30, DZ = (_Zb = class extends ESe {
  get isVisibleFromKeyboard() {
    return this._renderedHover?.source === 2;
  }
  get isVisible() {
    return this._hoverVisibleKey.get() ?? false;
  }
  get isFocused() {
    return this._hoverFocusedKey.get() ?? false;
  }
  constructor(e206, t10, n10, r10, i10) {
    let a10 = new ml(150, e206.getOption(75) + 8);
    super(e206, a10), this._configurationService = n10, this._accessibilityService = r10, this._keybindingService = i10, this._hover = this._register(new gj(true)), this._onDidResize = this._register(new k()), this.onDidResize = this._onDidResize.event, this._onDidScroll = this._register(new k()), this.onDidScroll = this._onDidScroll.event, this._onContentsChanged = this._register(new k()), this.onContentsChanged = this._onContentsChanged.event, this._minimumSize = a10, this._hoverVisibleKey = $.hoverVisible.bindTo(t10), this._hoverFocusedKey = $.hoverFocused.bindTo(t10), z(this._resizableNode.domNode, this._hover.containerDomNode), this._resizableNode.domNode.style.zIndex = `50`, this._resizableNode.domNode.className = `monaco-resizable-hover`, this._register(this._editor.onDidLayoutChange(() => {
      this.isVisible && this._updateMaxDimensions();
    })), this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(59) && this._updateFont();
    }));
    let o10 = this._register(Gl(this._resizableNode.domNode));
    this._register(o10.onDidFocus(() => {
      this._hoverFocusedKey.set(true);
    })), this._register(o10.onDidBlur(() => {
      this._hoverFocusedKey.set(false);
    })), this._register(this._hover.scrollbar.onScroll((e207) => {
      this._onDidScroll.fire(e207);
    })), this._setRenderedHover(void 0), this._editor.addContentWidget(this);
  }
  dispose() {
    super.dispose(), this._renderedHover?.dispose(), this._editor.removeContentWidget(this);
  }
  getId() {
    return TZ.ID;
  }
  static _applyDimensions(e206, t10, n10) {
    let r10 = typeof t10 == `number` ? `${t10}px` : t10, i10 = typeof n10 == `number` ? `${n10}px` : n10;
    e206.style.width = r10, e206.style.height = i10;
  }
  _setContentsDomNodeDimensions(e206, t10) {
    let n10 = this._hover.contentsDomNode;
    return TZ._applyDimensions(n10, e206, t10);
  }
  _setContainerDomNodeDimensions(e206, t10) {
    let n10 = this._hover.containerDomNode;
    return TZ._applyDimensions(n10, e206, t10);
  }
  _setScrollableElementDimensions(e206, t10) {
    let n10 = this._hover.scrollbar.getDomNode();
    return TZ._applyDimensions(n10, e206, t10);
  }
  _setHoverWidgetDimensions(e206, t10) {
    this._setContainerDomNodeDimensions(e206, t10), this._setScrollableElementDimensions(e206, t10), this._setContentsDomNodeDimensions(e206, t10), this._layoutContentWidget();
  }
  static _applyMaxDimensions(e206, t10, n10) {
    let r10 = typeof t10 == `number` ? `${t10}px` : t10, i10 = typeof n10 == `number` ? `${n10}px` : n10;
    e206.style.maxWidth = r10, e206.style.maxHeight = i10;
  }
  _setHoverWidgetMaxDimensions(e206, t10) {
    TZ._applyMaxDimensions(this._hover.contentsDomNode, e206, t10), TZ._applyMaxDimensions(this._hover.scrollbar.getDomNode(), e206, t10), TZ._applyMaxDimensions(this._hover.containerDomNode, e206, t10), this._hover.containerDomNode.style.setProperty(`--vscode-hover-maxWidth`, typeof e206 == `number` ? `${e206}px` : e206), this._layoutContentWidget();
  }
  _setAdjustedHoverWidgetDimensions(e206) {
    this._setHoverWidgetMaxDimensions(`none`, `none`), this._setHoverWidgetDimensions(e206.width, e206.height);
  }
  _updateResizableNodeMaxDimensions() {
    let e206 = this._findMaximumRenderingWidth() ?? 1 / 0, t10 = this._findMaximumRenderingHeight() ?? 1 / 0;
    this._resizableNode.maxSize = new ml(e206, t10), this._setHoverWidgetMaxDimensions(e206, t10);
  }
  _resize(e206) {
    TZ._lastDimensions = new ml(e206.width, e206.height), this._setAdjustedHoverWidgetDimensions(e206), this._resizableNode.layout(e206.height, e206.width), this._updateResizableNodeMaxDimensions(), this._hover.scrollbar.scanDomNode(), this._editor.layoutContentWidget(this), this._onDidResize.fire();
  }
  _findAvailableSpaceVertically() {
    let e206 = this._renderedHover?.showAtPosition;
    if (e206) return this._positionPreference === 1 ? this._availableVerticalSpaceAbove(e206) : this._availableVerticalSpaceBelow(e206);
  }
  _findMaximumRenderingHeight() {
    let e206 = this._findAvailableSpaceVertically();
    if (!e206) return;
    let t10 = this._hover.contentsDomNode.children.length - 1;
    return Array.from(this._hover.contentsDomNode.children).forEach((e207) => {
      t10 += e207.clientHeight;
    }), Math.min(e206, t10);
  }
  _isHoverTextOverflowing() {
    this._hover.containerDomNode.style.setProperty(`--vscode-hover-whiteSpace`, `nowrap`), this._hover.containerDomNode.style.setProperty(`--vscode-hover-sourceWhiteSpace`, `nowrap`);
    let e206 = Array.from(this._hover.contentsDomNode.children).some((e207) => e207.scrollWidth > e207.clientWidth);
    return this._hover.containerDomNode.style.removeProperty(`--vscode-hover-whiteSpace`), this._hover.containerDomNode.style.removeProperty(`--vscode-hover-sourceWhiteSpace`), e206;
  }
  _findMaximumRenderingWidth() {
    if (!this._editor || !this._editor.hasModel()) return;
    let e206 = this._isHoverTextOverflowing(), t10 = this._contentWidth === void 0 ? 0 : this._contentWidth;
    return e206 || this._hover.containerDomNode.clientWidth < t10 ? fl(this._hover.containerDomNode.ownerDocument.body).width - 14 : this._hover.containerDomNode.clientWidth;
  }
  isMouseGettingCloser(e206, t10) {
    if (!this._renderedHover) return false;
    if (this._renderedHover.initialMousePosX === void 0 || this._renderedHover.initialMousePosY === void 0) return this._renderedHover.initialMousePosX = e206, this._renderedHover.initialMousePosY = t10, false;
    let n10 = _l2(this.getDomNode());
    this._renderedHover.closestMouseDistance === void 0 && (this._renderedHover.closestMouseDistance = OZ(this._renderedHover.initialMousePosX, this._renderedHover.initialMousePosY, n10.left, n10.top, n10.width, n10.height));
    let r10 = OZ(e206, t10, n10.left, n10.top, n10.width, n10.height);
    return r10 > this._renderedHover.closestMouseDistance + 4 ? false : (this._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, r10), true);
  }
  _setRenderedHover(e206) {
    this._renderedHover?.dispose(), this._renderedHover = e206, this._hoverVisibleKey.set(!!e206), this._hover.containerDomNode.classList.toggle(`hidden`, !e206);
  }
  _updateFont() {
    let { fontSize: e206, lineHeight: t10 } = this._editor.getOption(59), n10 = this._hover.contentsDomNode;
    n10.style.fontSize = `${e206}px`, n10.style.lineHeight = `${t10 / e206}`, Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName(`code`)).forEach((e207) => this._editor.applyFontInfo(e207));
  }
  _updateContent(e206) {
    let t10 = this._hover.contentsDomNode;
    t10.style.paddingBottom = ``, t10.textContent = ``, t10.appendChild(e206);
  }
  _layoutContentWidget() {
    this._editor.layoutContentWidget(this), this._hover.onContentsChanged();
  }
  _updateMaxDimensions() {
    let e206 = Math.max(this._editor.getLayoutInfo().height / 4, 250, TZ._lastDimensions.height), t10 = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, TZ._lastDimensions.width);
    this._resizableNode.maxSize = new ml(t10, e206), this._setHoverWidgetMaxDimensions(t10, e206);
  }
  _render(e206) {
    this._setRenderedHover(e206), this._updateFont(), this._updateContent(e206.domNode), this.handleContentsChanged(), this._editor.render();
  }
  getPosition() {
    return this._renderedHover ? { position: this._renderedHover.showAtPosition, secondaryPosition: this._renderedHover.showAtSecondaryPosition, positionAffinity: this._renderedHover.shouldAppearBeforeContent ? 3 : void 0, preference: [this._positionPreference ?? 1] } : null;
  }
  show(e206) {
    if (!this._editor || !this._editor.hasModel()) return;
    this._render(e206);
    let t10 = Sl(this._hover.containerDomNode), n10 = e206.showAtPosition;
    this._positionPreference = this._findPositionPreference(t10, n10) ?? 1, this.handleContentsChanged(), e206.shouldFocus && this._hover.containerDomNode.focus(), this._onDidResize.fire();
    let r10 = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode && vj(this._configurationService.getValue(`accessibility.verbosity.hover`) === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding(`editor.action.accessibleView`)?.getAriaLabel() ?? ``);
    r10 && (this._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + `, ` + r10);
  }
  hide() {
    if (!this._renderedHover) return;
    let e206 = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();
    this._setRenderedHover(void 0), this._resizableNode.maxSize = new ml(1 / 0, 1 / 0), this._resizableNode.clearSashHoverState(), this._hoverFocusedKey.set(false), this._editor.layoutContentWidget(this), e206 && this._editor.focus();
  }
  _removeConstraintsRenderNormally() {
    let e206 = this._editor.getLayoutInfo();
    this._resizableNode.layout(e206.height, e206.width), this._setHoverWidgetDimensions(`auto`, `auto`), this._updateMaxDimensions();
  }
  setMinimumDimensions(e206) {
    this._minimumSize = new ml(Math.max(this._minimumSize.width, e206.width), Math.max(this._minimumSize.height, e206.height)), this._updateMinimumWidth();
  }
  _updateMinimumWidth() {
    let e206 = this._contentWidth === void 0 ? this._minimumSize.width : Math.min(this._contentWidth, this._minimumSize.width);
    this._resizableNode.minSize = new ml(e206, this._minimumSize.height);
  }
  handleContentsChanged() {
    this._removeConstraintsRenderNormally();
    let e206 = this._hover.contentsDomNode, t10 = Sl(e206), n10 = yl(e206) + 2;
    if (this._resizableNode.layout(t10, n10), this._setHoverWidgetDimensions(n10, t10), t10 = Sl(e206), n10 = yl(e206), this._contentWidth = n10, this._updateMinimumWidth(), this._resizableNode.layout(t10, n10), this._renderedHover?.showAtPosition) {
      let e207 = Sl(this._hover.containerDomNode);
      this._positionPreference = this._findPositionPreference(e207, this._renderedHover.showAtPosition);
    }
    this._layoutContentWidget(), this._onContentsChanged.fire();
  }
  focus() {
    this._hover.containerDomNode.focus();
  }
  scrollUp() {
    let e206 = this._hover.scrollbar.getScrollPosition().scrollTop, t10 = this._editor.getOption(59);
    this._hover.scrollbar.setScrollPosition({ scrollTop: e206 - t10.lineHeight });
  }
  scrollDown() {
    let e206 = this._hover.scrollbar.getScrollPosition().scrollTop, t10 = this._editor.getOption(59);
    this._hover.scrollbar.setScrollPosition({ scrollTop: e206 + t10.lineHeight });
  }
  scrollLeft() {
    let e206 = this._hover.scrollbar.getScrollPosition().scrollLeft;
    this._hover.scrollbar.setScrollPosition({ scrollLeft: e206 - EZ });
  }
  scrollRight() {
    let e206 = this._hover.scrollbar.getScrollPosition().scrollLeft;
    this._hover.scrollbar.setScrollPosition({ scrollLeft: e206 + EZ });
  }
  pageUp() {
    let e206 = this._hover.scrollbar.getScrollPosition().scrollTop, t10 = this._hover.scrollbar.getScrollDimensions().height;
    this._hover.scrollbar.setScrollPosition({ scrollTop: e206 - t10 });
  }
  pageDown() {
    let e206 = this._hover.scrollbar.getScrollPosition().scrollTop, t10 = this._hover.scrollbar.getScrollDimensions().height;
    this._hover.scrollbar.setScrollPosition({ scrollTop: e206 + t10 });
  }
  goToTop() {
    this._hover.scrollbar.setScrollPosition({ scrollTop: 0 });
  }
  goToBottom() {
    this._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight });
  }
}, TZ = _Zb, _Zb.ID = `editor.contrib.resizableContentHoverWidget`, _Zb._lastDimensions = new ml(0, 0), _Zb);
DZ = TZ = DSe([wZ(1, nd), wZ(2, Uf), wZ(3, e_), wZ(4, Dw)], DZ);
function OZ(e206, t10, n10, r10, i10, a10) {
  let o10 = n10 + i10 / 2, s10 = r10 + a10 / 2, c10 = Math.max(Math.abs(e206 - o10) - i10 / 2, 0), l10 = Math.max(Math.abs(t10 - s10) - a10 / 2, 0);
  return Math.sqrt(c10 * c10 + l10 * l10);
}
var OSe = class e175 {
  constructor(e206, t10) {
    this._editor = e206, this._participants = t10;
  }
  static _getLineDecorations(e206, t10) {
    if (t10.type !== 1 && !t10.supportsMarkerHover) return [];
    let n10 = e206.getModel(), r10 = t10.range.startLineNumber;
    if (r10 > n10.getLineCount()) return [];
    let i10 = n10.getLineMaxColumn(r10);
    return e206.getLineDecorations(r10).filter((e207) => {
      if (e207.options.isWholeLine) return true;
      let n11 = e207.range.startLineNumber === r10 ? e207.range.startColumn : 1, a10 = e207.range.endLineNumber === r10 ? e207.range.endColumn : i10;
      if (e207.options.showIfCollapsed) {
        if (n11 > t10.range.startColumn + 1 || t10.range.endColumn - 1 > a10) return false;
      } else if (n11 > t10.range.startColumn || t10.range.endColumn > a10) return false;
      return true;
    });
  }
  computeAsync(t10, n10) {
    let r10 = t10.anchor;
    if (!this._editor.hasModel() || !r10) return ys.EMPTY;
    let i10 = e175._getLineDecorations(this._editor, r10);
    return ys.merge(this._participants.map((e206) => e206.computeAsync ? e206.computeAsync(r10, i10, t10.source, n10) : ys.EMPTY));
  }
  computeSync(t10) {
    if (!this._editor.hasModel()) return [];
    let n10 = t10.anchor, r10 = e175._getLineDecorations(this._editor, n10), i10 = [];
    for (let e206 of this._participants) i10 = i10.concat(e206.computeSync(n10, r10, t10.source));
    return h(i10);
  }
}, kZ = class {
  constructor(e206, t10, n10) {
    this.hoverParts = e206, this.isComplete = t10, this.options = n10;
  }
  filter(e206) {
    let t10 = this.hoverParts.filter((t11) => t11.isValidForHoverAnchor(e206));
    return t10.length === this.hoverParts.length ? this : new kSe(this, t10, this.isComplete, this.options);
  }
}, kSe = class extends kZ {
  constructor(e206, t10, n10, r10) {
    super(t10, n10, r10), this.original = e206;
  }
  filter(e206) {
    return this.original.filter(e206);
  }
}, ASe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, AZ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, jZ = B, MZ = class extends D {
  get hasContent() {
    return this._hasContent;
  }
  constructor(e206, t10) {
    super(), this._keybindingService = e206, this._hoverService = t10, this.actions = [], this._hasContent = false, this.hoverElement = jZ(`div.hover-row.status-bar`), this.hoverElement.tabIndex = 0, this.actionsElement = z(this.hoverElement, jZ(`div.actions`));
  }
  addAction(e206) {
    let t10 = this._keybindingService.lookupKeybinding(e206.commandId), n10 = t10 ? t10.getLabel() : null;
    this._hasContent = true;
    let r10 = this._register(_j2.render(this.actionsElement, e206, n10));
    return this._register(this._hoverService.setupManagedHover(CI(`element`), r10.actionContainer, r10.actionRenderedLabel)), this.actions.push(r10), r10;
  }
  append(e206) {
    let t10 = z(this.actionsElement, e206);
    return this._hasContent = true, t10;
  }
};
MZ = ASe([AZ(0, Dw), AZ(1, uj)], MZ);
var jSe = (__b = class {
  constructor(e206) {
    this._editor = e206, this._decorations = [], this._overviewRulerApproximateDecorations = [], this._findScopeDecorationIds = [], this._rangeHighlightDecorationId = null, this._highlightedDecorationId = null, this._startPosition = this._editor.getPosition();
  }
  dispose() {
    this._editor.removeDecorations(this._allDecorations()), this._decorations = [], this._overviewRulerApproximateDecorations = [], this._findScopeDecorationIds = [], this._rangeHighlightDecorationId = null, this._highlightedDecorationId = null;
  }
  reset() {
    this._decorations = [], this._overviewRulerApproximateDecorations = [], this._findScopeDecorationIds = [], this._rangeHighlightDecorationId = null, this._highlightedDecorationId = null;
  }
  getCount() {
    return this._decorations.length;
  }
  getFindScope() {
    return this._findScopeDecorationIds[0] ? this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]) : null;
  }
  getFindScopes() {
    if (this._findScopeDecorationIds.length) {
      let e206 = this._findScopeDecorationIds.map((e207) => this._editor.getModel().getDecorationRange(e207)).filter((e207) => !!e207);
      if (e206.length) return e206;
    }
    return null;
  }
  getStartPosition() {
    return this._startPosition;
  }
  setStartPosition(e206) {
    this._startPosition = e206, this.setCurrentFindMatch(null);
  }
  _getDecorationIndex(e206) {
    let t10 = this._decorations.indexOf(e206);
    return t10 >= 0 ? t10 + 1 : 1;
  }
  getDecorationRangeAt(e206) {
    let t10 = e206 < this._decorations.length ? this._decorations[e206] : null;
    return t10 ? this._editor.getModel().getDecorationRange(t10) : null;
  }
  getCurrentMatchesPosition(t10) {
    let n10 = this._editor.getModel().getDecorationsInRange(t10);
    for (let t11 of n10) {
      let n11 = t11.options;
      if (n11 === __b._FIND_MATCH_DECORATION || n11 === __b._CURRENT_FIND_MATCH_DECORATION) return this._getDecorationIndex(t11.id);
    }
    return 0;
  }
  setCurrentFindMatch(t10) {
    let n10 = null, r10 = 0;
    if (t10) for (let e206 = 0, i10 = this._decorations.length; e206 < i10; e206++) {
      let i11 = this._editor.getModel().getDecorationRange(this._decorations[e206]);
      if (t10.equalsRange(i11)) {
        n10 = this._decorations[e206], r10 = e206 + 1;
        break;
      }
    }
    return (this._highlightedDecorationId !== null || n10 !== null) && this._editor.changeDecorations((t11) => {
      if (this._highlightedDecorationId !== null && (t11.changeDecorationOptions(this._highlightedDecorationId, __b._FIND_MATCH_DECORATION), this._highlightedDecorationId = null), n10 !== null && (this._highlightedDecorationId = n10, t11.changeDecorationOptions(this._highlightedDecorationId, __b._CURRENT_FIND_MATCH_DECORATION)), this._rangeHighlightDecorationId !== null && (t11.removeDecoration(this._rangeHighlightDecorationId), this._rangeHighlightDecorationId = null), n10 !== null) {
        let r11 = this._editor.getModel().getDecorationRange(n10);
        if (r11.startLineNumber !== r11.endLineNumber && r11.endColumn === 1) {
          let e206 = r11.endLineNumber - 1, t12 = this._editor.getModel().getLineMaxColumn(e206);
          r11 = new M(r11.startLineNumber, r11.startColumn, e206, t12);
        }
        this._rangeHighlightDecorationId = t11.addDecoration(r11, __b._RANGE_HIGHLIGHT_DECORATION);
      }
    }), r10;
  }
  set(t10, n10) {
    this._editor.changeDecorations((r10) => {
      let i10 = __b._FIND_MATCH_DECORATION, a10 = [];
      if (t10.length > 1e3) {
        i10 = __b._FIND_MATCH_NO_OVERVIEW_DECORATION;
        let n11 = this._editor.getModel().getLineCount(), r11 = this._editor.getLayoutInfo().height / n11, o11 = Math.max(2, Math.ceil(3 / r11)), s10 = t10[0].range.startLineNumber, c10 = t10[0].range.endLineNumber;
        for (let n12 = 1, r12 = t10.length; n12 < r12; n12++) {
          let r13 = t10[n12].range;
          c10 + o11 >= r13.startLineNumber ? r13.endLineNumber > c10 && (c10 = r13.endLineNumber) : (a10.push({ range: new M(s10, 1, c10, 1), options: __b._FIND_MATCH_ONLY_OVERVIEW_DECORATION }), s10 = r13.startLineNumber, c10 = r13.endLineNumber);
        }
        a10.push({ range: new M(s10, 1, c10, 1), options: __b._FIND_MATCH_ONLY_OVERVIEW_DECORATION });
      }
      let o10 = Array(t10.length);
      for (let e206 = 0, n11 = t10.length; e206 < n11; e206++) o10[e206] = { range: t10[e206].range, options: i10 };
      this._decorations = r10.deltaDecorations(this._decorations, o10), this._overviewRulerApproximateDecorations = r10.deltaDecorations(this._overviewRulerApproximateDecorations, a10), this._rangeHighlightDecorationId && (this._rangeHighlightDecorationId = (r10.removeDecoration(this._rangeHighlightDecorationId), null)), this._findScopeDecorationIds.length && (this._findScopeDecorationIds.forEach((e206) => r10.removeDecoration(e206)), this._findScopeDecorationIds = []), n10?.length && (this._findScopeDecorationIds = n10.map((t11) => r10.addDecoration(t11, __b._FIND_SCOPE_DECORATION)));
    });
  }
  matchBeforePosition(e206) {
    if (this._decorations.length === 0) return null;
    for (let t10 = this._decorations.length - 1; t10 >= 0; t10--) {
      let n10 = this._decorations[t10], r10 = this._editor.getModel().getDecorationRange(n10);
      if (!(!r10 || r10.endLineNumber > e206.lineNumber) && (r10.endLineNumber < e206.lineNumber || !(r10.endColumn > e206.column))) return r10;
    }
    return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length - 1]);
  }
  matchAfterPosition(e206) {
    if (this._decorations.length === 0) return null;
    for (let t10 = 0, n10 = this._decorations.length; t10 < n10; t10++) {
      let n11 = this._decorations[t10], r10 = this._editor.getModel().getDecorationRange(n11);
      if (!(!r10 || r10.startLineNumber < e206.lineNumber) && (r10.startLineNumber > e206.lineNumber || !(r10.startColumn < e206.column))) return r10;
    }
    return this._editor.getModel().getDecorationRange(this._decorations[0]);
  }
  _allDecorations() {
    let e206 = [];
    return e206 = e206.concat(this._decorations), e206 = e206.concat(this._overviewRulerApproximateDecorations), this._findScopeDecorationIds.length && e206.push(...this._findScopeDecorationIds), this._rangeHighlightDecorationId && e206.push(this._rangeHighlightDecorationId), e206;
  }
}, __b._CURRENT_FIND_MATCH_DECORATION = UO.register({ description: `current-find-match`, stickiness: 1, zIndex: 13, className: `currentFindMatch`, inlineClassName: `currentFindMatchInline`, showIfCollapsed: true, overviewRuler: { color: WS(oy), position: Qp.Center }, minimap: { color: WS(dy), position: 1 } }), __b._FIND_MATCH_DECORATION = UO.register({ description: `find-match`, stickiness: 1, zIndex: 10, className: `findMatch`, inlineClassName: `findMatchInline`, showIfCollapsed: true, overviewRuler: { color: WS(oy), position: Qp.Center }, minimap: { color: WS(dy), position: 1 } }), __b._FIND_MATCH_NO_OVERVIEW_DECORATION = UO.register({ description: `find-match-no-overview`, stickiness: 1, className: `findMatch`, showIfCollapsed: true }), __b._FIND_MATCH_ONLY_OVERVIEW_DECORATION = UO.register({ description: `find-match-only-overview`, stickiness: 1, overviewRuler: { color: WS(oy), position: Qp.Center } }), __b._RANGE_HIGHLIGHT_DECORATION = UO.register({ description: `find-range-highlight`, stickiness: 1, className: `rangeHighlight`, isWholeLine: true }), __b._FIND_SCOPE_DECORATION = UO.register({ description: `find-scope`, className: `findScope`, isWholeLine: true }), __b), MSe = class {
  constructor(e206, t10, n10) {
    this._editorSelection = e206, this._ranges = t10, this._replaceStrings = n10, this._trackedEditorSelectionId = null;
  }
  getEditOperations(e206, t10) {
    if (this._ranges.length > 0) {
      let e207 = [];
      for (let t11 = 0; t11 < this._ranges.length; t11++) e207.push({ range: this._ranges[t11], text: this._replaceStrings[t11] });
      e207.sort((e208, t11) => M.compareRangesUsingStarts(e208.range, t11.range));
      let n10 = [], r10 = e207[0];
      for (let t11 = 1; t11 < e207.length; t11++) r10.range.endLineNumber === e207[t11].range.startLineNumber && r10.range.endColumn === e207[t11].range.startColumn ? (r10.range = r10.range.plusRange(e207[t11].range), r10.text += e207[t11].text) : (n10.push(r10), r10 = e207[t11]);
      n10.push(r10);
      for (let e208 of n10) t10.addEditOperation(e208.range, e208.text);
    }
    this._trackedEditorSelectionId = t10.trackSelection(this._editorSelection);
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this._trackedEditorSelectionId);
  }
};
function NZ(e206, t10) {
  if (e206 && e206[0] !== ``) {
    let n10 = PZ(e206, t10, `-`), r10 = PZ(e206, t10, `_`);
    return n10 && !r10 ? FZ(e206, t10, `-`) : !n10 && r10 ? FZ(e206, t10, `_`) : e206[0].toUpperCase() === e206[0] ? t10.toUpperCase() : e206[0].toLowerCase() === e206[0] ? t10.toLowerCase() : Dte(e206[0][0]) && t10.length > 0 ? t10[0].toUpperCase() + t10.substr(1) : e206[0][0].toUpperCase() !== e206[0][0] && t10.length > 0 ? t10[0].toLowerCase() + t10.substr(1) : t10;
  } else return t10;
}
function PZ(e206, t10, n10) {
  return e206[0].indexOf(n10) !== -1 && t10.indexOf(n10) !== -1 && e206[0].split(n10).length === t10.split(n10).length;
}
function FZ(e206, t10, n10) {
  let r10 = t10.split(n10), i10 = e206[0].split(n10), a10 = ``;
  return r10.forEach((e207, t11) => {
    a10 += NZ([i10[t11]], e207) + n10;
  }), a10.slice(0, -1);
}
var IZ = class {
  constructor(e206) {
    this.staticValue = e206, this.kind = 0;
  }
}, NSe = class {
  constructor(e206) {
    this.pieces = e206, this.kind = 1;
  }
}, LZ = class e176 {
  static fromStaticValue(t10) {
    return new e176([RZ.staticValue(t10)]);
  }
  get hasReplacementPatterns() {
    return this._state.kind === 1;
  }
  constructor(e206) {
    !e206 || e206.length === 0 ? this._state = new IZ(``) : e206.length === 1 && e206[0].staticValue !== null ? this._state = new IZ(e206[0].staticValue) : this._state = new NSe(e206);
  }
  buildReplaceString(t10, n10) {
    if (this._state.kind === 0) return n10 ? NZ(t10, this._state.staticValue) : this._state.staticValue;
    let r10 = ``;
    for (let n11 = 0, i10 = this._state.pieces.length; n11 < i10; n11++) {
      let i11 = this._state.pieces[n11];
      if (i11.staticValue !== null) {
        r10 += i11.staticValue;
        continue;
      }
      let a10 = e176._substitute(i11.matchIndex, t10);
      if (i11.caseOps !== null && i11.caseOps.length > 0) {
        let e206 = [], t11 = i11.caseOps.length, n12 = 0;
        for (let r11 = 0, o10 = a10.length; r11 < o10; r11++) {
          if (n12 >= t11) {
            e206.push(a10.slice(r11));
            break;
          }
          switch (i11.caseOps[n12]) {
            case `U`:
              e206.push(a10[r11].toUpperCase());
              break;
            case `u`:
              e206.push(a10[r11].toUpperCase()), n12++;
              break;
            case `L`:
              e206.push(a10[r11].toLowerCase());
              break;
            case `l`:
              e206.push(a10[r11].toLowerCase()), n12++;
              break;
            default:
              e206.push(a10[r11]);
          }
        }
        a10 = e206.join(``);
      }
      r10 += a10;
    }
    return r10;
  }
  static _substitute(e206, t10) {
    if (t10 === null) return ``;
    if (e206 === 0) return t10[0];
    let n10 = ``;
    for (; e206 > 0; ) {
      if (e206 < t10.length) return (t10[e206] || ``) + n10;
      n10 = String(e206 % 10) + n10, e206 = Math.floor(e206 / 10);
    }
    return `$` + n10;
  }
}, RZ = class e177 {
  static staticValue(t10) {
    return new e177(t10, -1, null);
  }
  static caseOps(t10, n10) {
    return new e177(null, t10, n10);
  }
  constructor(e206, t10, n10) {
    this.staticValue = e206, this.matchIndex = t10, !n10 || n10.length === 0 ? this.caseOps = null : this.caseOps = n10.slice(0);
  }
}, PSe = class {
  constructor(e206) {
    this._source = e206, this._lastCharIndex = 0, this._result = [], this._resultLen = 0, this._currentStaticPiece = ``;
  }
  emitUnchanged(e206) {
    this._emitStatic(this._source.substring(this._lastCharIndex, e206)), this._lastCharIndex = e206;
  }
  emitStatic(e206, t10) {
    this._emitStatic(e206), this._lastCharIndex = t10;
  }
  _emitStatic(e206) {
    e206.length !== 0 && (this._currentStaticPiece += e206);
  }
  emitMatchIndex(e206, t10, n10) {
    this._currentStaticPiece.length !== 0 && (this._result[this._resultLen++] = RZ.staticValue(this._currentStaticPiece), this._currentStaticPiece = ``), this._result[this._resultLen++] = RZ.caseOps(e206, n10), this._lastCharIndex = t10;
  }
  finalize() {
    return this.emitUnchanged(this._source.length), this._currentStaticPiece.length !== 0 && (this._result[this._resultLen++] = RZ.staticValue(this._currentStaticPiece), this._currentStaticPiece = ``), new LZ(this._result);
  }
};
function FSe(e206) {
  if (!e206 || e206.length === 0) return new LZ(null);
  let t10 = [], n10 = new PSe(e206);
  for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
    let a10 = e206.charCodeAt(r10);
    if (a10 === 92) {
      if (r10++, r10 >= i10) break;
      let a11 = e206.charCodeAt(r10);
      switch (a11) {
        case 92:
          n10.emitUnchanged(r10 - 1), n10.emitStatic(`\\`, r10 + 1);
          break;
        case 110:
          n10.emitUnchanged(r10 - 1), n10.emitStatic(`
`, r10 + 1);
          break;
        case 116:
          n10.emitUnchanged(r10 - 1), n10.emitStatic(`	`, r10 + 1);
          break;
        case 117:
        case 85:
        case 108:
        case 76:
          n10.emitUnchanged(r10 - 1), n10.emitStatic(``, r10 + 1), t10.push(String.fromCharCode(a11));
          break;
      }
      continue;
    }
    if (a10 === 36) {
      if (r10++, r10 >= i10) break;
      let a11 = e206.charCodeAt(r10);
      if (a11 === 36) {
        n10.emitUnchanged(r10 - 1), n10.emitStatic(`$`, r10 + 1);
        continue;
      }
      if (a11 === 48 || a11 === 38) {
        n10.emitUnchanged(r10 - 1), n10.emitMatchIndex(0, r10 + 1, t10), t10.length = 0;
        continue;
      }
      if (49 <= a11 && a11 <= 57) {
        let o10 = a11 - 48;
        if (r10 + 1 < i10) {
          let i11 = e206.charCodeAt(r10 + 1);
          if (48 <= i11 && i11 <= 57) {
            r10++, o10 = o10 * 10 + (i11 - 48), n10.emitUnchanged(r10 - 2), n10.emitMatchIndex(o10, r10 + 1, t10), t10.length = 0;
            continue;
          }
        }
        n10.emitUnchanged(r10 - 1), n10.emitMatchIndex(o10, r10 + 1, t10), t10.length = 0;
        continue;
      }
    }
  }
  return n10.finalize();
}
var zZ = new U(`findWidgetVisible`, false);
zZ.toNegated();
var BZ = new U(`findInputFocussed`, false), VZ = new U(`replaceInputFocussed`, false), HZ = { primary: 545, mac: { primary: 2593 } }, UZ = { primary: 565, mac: { primary: 2613 } }, WZ = { primary: 560, mac: { primary: 2608 } }, GZ = { primary: 554, mac: { primary: 2602 } }, KZ = { primary: 558, mac: { primary: 2606 } }, qZ = { StartFindAction: `actions.find`, StartFindWithSelection: `actions.findWithSelection`, StartFindWithArgs: `editor.actions.findWithArgs`, NextMatchFindAction: `editor.action.nextMatchFindAction`, PreviousMatchFindAction: `editor.action.previousMatchFindAction`, GoToMatchFindAction: `editor.action.goToMatchFindAction`, NextSelectionMatchFindAction: `editor.action.nextSelectionMatchFindAction`, PreviousSelectionMatchFindAction: `editor.action.previousSelectionMatchFindAction`, StartFindReplaceAction: `editor.action.startFindReplaceAction`, CloseFindWidgetCommand: `closeFindWidget`, ToggleCaseSensitiveCommand: `toggleFindCaseSensitive`, ToggleWholeWordCommand: `toggleFindWholeWord`, ToggleRegexCommand: `toggleFindRegex`, ToggleSearchScopeCommand: `toggleFindInSelection`, TogglePreserveCaseCommand: `togglePreserveCase`, ReplaceOneAction: `editor.action.replaceOne`, ReplaceAllAction: `editor.action.replaceAll`, SelectAllMatchesAction: `editor.action.selectAllMatches` }, JZ = 19999, ISe = 240, LSe = class e178 {
  constructor(e206, t10) {
    this._toDispose = new E(), this._editor = e206, this._state = t10, this._isDisposed = false, this._startSearchingTimer = new cs(), this._decorations = new jSe(e206), this._toDispose.add(this._decorations), this._updateDecorationsScheduler = new us(() => {
      if (this._editor.hasModel()) return this.research(false);
    }, 100), this._toDispose.add(this._updateDecorationsScheduler), this._toDispose.add(this._editor.onDidChangeCursorPosition((e207) => {
      (e207.reason === 3 || e207.reason === 5 || e207.reason === 6) && this._decorations.setStartPosition(this._editor.getPosition());
    })), this._ignoreModelContentChanged = false, this._toDispose.add(this._editor.onDidChangeModelContent((e207) => {
      this._ignoreModelContentChanged || (e207.isFlush && this._decorations.reset(), this._decorations.setStartPosition(this._editor.getPosition()), this._updateDecorationsScheduler.schedule());
    })), this._toDispose.add(this._state.onFindReplaceStateChange((e207) => this._onStateChanged(e207))), this.research(false, this._state.searchScope);
  }
  dispose() {
    this._isDisposed = true, Kt(this._startSearchingTimer), this._toDispose.dispose();
  }
  _onStateChanged(e206) {
    this._isDisposed || this._editor.hasModel() && (e206.searchString || e206.isReplaceRevealed || e206.isRegex || e206.wholeWord || e206.matchCase || e206.searchScope) && (this._editor.getModel().isTooLargeForSyncing() ? (this._startSearchingTimer.cancel(), this._startSearchingTimer.setIfNotSet(() => {
      e206.searchScope ? this.research(e206.moveCursor, this._state.searchScope) : this.research(e206.moveCursor);
    }, ISe)) : e206.searchScope ? this.research(e206.moveCursor, this._state.searchScope) : this.research(e206.moveCursor));
  }
  static _getSearchRange(e206, t10) {
    return t10 || e206.getFullModelRange();
  }
  research(e206, t10) {
    let n10 = null;
    t10 === void 0 ? n10 = this._decorations.getFindScopes() : t10 !== null && (n10 = Array.isArray(t10) ? t10 : [t10]), n10 !== null && (n10 = n10.map((e207) => {
      if (e207.startLineNumber !== e207.endLineNumber) {
        let t11 = e207.endLineNumber;
        return e207.endColumn === 1 && --t11, new M(e207.startLineNumber, 1, t11, this._editor.getModel().getLineMaxColumn(t11));
      }
      return e207;
    }));
    let r10 = this._findMatches(n10, false, JZ);
    this._decorations.set(r10, n10);
    let i10 = this._editor.getSelection(), a10 = this._decorations.getCurrentMatchesPosition(i10);
    if (a10 === 0 && r10.length > 0) {
      let e207 = Mm(r10.map((e208) => e208.range), (e208) => M.compareRangesUsingStarts(e208, i10) >= 0);
      a10 = e207 > 0 ? e207 - 1 + 1 : a10;
    }
    this._state.changeMatchInfo(a10, this._decorations.getCount(), void 0), e206 && this._editor.getOption(50).cursorMoveOnType && this._moveToNextMatch(this._decorations.getStartPosition());
  }
  _hasMatches() {
    return this._state.matchesCount > 0;
  }
  _cannotFind() {
    if (!this._hasMatches()) {
      let e206 = this._decorations.getFindScope();
      return e206 && this._editor.revealRangeInCenterIfOutsideViewport(e206, 0), true;
    }
    return false;
  }
  _setCurrentFindMatch(e206) {
    let t10 = this._decorations.setCurrentFindMatch(e206);
    this._state.changeMatchInfo(t10, this._decorations.getCount(), e206), this._editor.setSelection(e206), this._editor.revealRangeInCenterIfOutsideViewport(e206, 0);
  }
  _prevSearchPosition(e206) {
    let t10 = this._state.isRegex && (this._state.searchString.indexOf(`^`) >= 0 || this._state.searchString.indexOf(`$`) >= 0), { lineNumber: n10, column: r10 } = e206, i10 = this._editor.getModel();
    return t10 || r10 === 1 ? (n10 === 1 ? n10 = i10.getLineCount() : n10--, r10 = i10.getLineMaxColumn(n10)) : r10--, new j(n10, r10);
  }
  _moveToPrevMatch(t10, n10 = false) {
    if (!this._state.canNavigateBack()) {
      let e206 = this._decorations.matchAfterPosition(t10);
      e206 && this._setCurrentFindMatch(e206);
      return;
    }
    if (this._decorations.getCount() < 19999) {
      let e206 = this._decorations.matchBeforePosition(t10);
      e206 && e206.isEmpty() && e206.getStartPosition().equals(t10) && (t10 = this._prevSearchPosition(t10), e206 = this._decorations.matchBeforePosition(t10)), e206 && this._setCurrentFindMatch(e206);
      return;
    }
    if (this._cannotFind()) return;
    let r10 = this._decorations.getFindScope(), i10 = e178._getSearchRange(this._editor.getModel(), r10);
    i10.getEndPosition().isBefore(t10) && (t10 = i10.getEndPosition()), t10.isBefore(i10.getStartPosition()) && (t10 = i10.getEndPosition());
    let { lineNumber: a10, column: o10 } = t10, s10 = this._editor.getModel(), c10 = new j(a10, o10), l10 = s10.findPreviousMatch(this._state.searchString, c10, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(148) : null, false);
    if (l10 && l10.range.isEmpty() && l10.range.getStartPosition().equals(c10) && (c10 = this._prevSearchPosition(c10), l10 = s10.findPreviousMatch(this._state.searchString, c10, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(148) : null, false)), l10) {
      if (!n10 && !i10.containsRange(l10.range)) return this._moveToPrevMatch(l10.range.getStartPosition(), true);
      this._setCurrentFindMatch(l10.range);
    }
  }
  moveToPrevMatch() {
    this._moveToPrevMatch(this._editor.getSelection().getStartPosition());
  }
  _nextSearchPosition(e206) {
    let t10 = this._state.isRegex && (this._state.searchString.indexOf(`^`) >= 0 || this._state.searchString.indexOf(`$`) >= 0), { lineNumber: n10, column: r10 } = e206, i10 = this._editor.getModel();
    return t10 || r10 === i10.getLineMaxColumn(n10) ? (n10 === i10.getLineCount() ? n10 = 1 : n10++, r10 = 1) : r10++, new j(n10, r10);
  }
  _moveToNextMatch(e206) {
    if (!this._state.canNavigateForward()) {
      let t11 = this._decorations.matchBeforePosition(e206);
      t11 && this._setCurrentFindMatch(t11);
      return;
    }
    if (this._decorations.getCount() < 19999) {
      let t11 = this._decorations.matchAfterPosition(e206);
      t11 && t11.isEmpty() && t11.getStartPosition().equals(e206) && (e206 = this._nextSearchPosition(e206), t11 = this._decorations.matchAfterPosition(e206)), t11 && this._setCurrentFindMatch(t11);
      return;
    }
    let t10 = this._getNextMatch(e206, false, true);
    t10 && this._setCurrentFindMatch(t10.range);
  }
  _getNextMatch(t10, n10, r10, i10 = false) {
    if (this._cannotFind()) return null;
    let a10 = this._decorations.getFindScope(), o10 = e178._getSearchRange(this._editor.getModel(), a10);
    o10.getEndPosition().isBefore(t10) && (t10 = o10.getStartPosition()), t10.isBefore(o10.getStartPosition()) && (t10 = o10.getStartPosition());
    let { lineNumber: s10, column: c10 } = t10, l10 = this._editor.getModel(), u10 = new j(s10, c10), d10 = l10.findNextMatch(this._state.searchString, u10, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(148) : null, n10);
    return r10 && d10 && d10.range.isEmpty() && d10.range.getStartPosition().equals(u10) && (u10 = this._nextSearchPosition(u10), d10 = l10.findNextMatch(this._state.searchString, u10, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(148) : null, n10)), d10 ? !i10 && !o10.containsRange(d10.range) ? this._getNextMatch(d10.range.getEndPosition(), n10, r10, true) : d10 : null;
  }
  moveToNextMatch() {
    this._moveToNextMatch(this._editor.getSelection().getEndPosition());
  }
  _moveToMatch(e206) {
    let t10 = this._decorations.getDecorationRangeAt(e206);
    t10 && this._setCurrentFindMatch(t10);
  }
  moveToMatch(e206) {
    this._moveToMatch(e206);
  }
  _getReplacePattern() {
    return this._state.isRegex ? FSe(this._state.replaceString) : LZ.fromStaticValue(this._state.replaceString);
  }
  replace() {
    if (!this._hasMatches()) return;
    let e206 = this._getReplacePattern(), t10 = this._editor.getSelection(), n10 = this._getNextMatch(t10.getStartPosition(), true, false);
    if (n10) if (t10.equalsRange(n10.range)) {
      let r10 = e206.buildReplaceString(n10.matches, this._state.preserveCase), i10 = new Lx(t10, r10);
      this._executeEditorCommand(`replace`, i10), this._decorations.setStartPosition(new j(t10.startLineNumber, t10.startColumn + r10.length)), this.research(true);
    } else this._decorations.setStartPosition(this._editor.getPosition()), this._setCurrentFindMatch(n10.range);
  }
  _findMatches(t10, n10, r10) {
    let i10 = (t10 || [null]).map((t11) => e178._getSearchRange(this._editor.getModel(), t11));
    return this._editor.getModel().findMatches(this._state.searchString, i10, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(148) : null, n10, r10);
  }
  replaceAll() {
    if (!this._hasMatches()) return;
    let e206 = this._decorations.getFindScopes();
    e206 === null && this._state.matchesCount >= 19999 ? this._largeReplaceAll() : this._regularReplaceAll(e206), this.research(false);
  }
  _largeReplaceAll() {
    let e206 = new um(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(148) : null).parseSearchRequest();
    if (!e206) return;
    let t10 = e206.regex;
    if (!t10.multiline) {
      let e207 = `mu`;
      t10.ignoreCase && (e207 += `i`), t10.global && (e207 += `g`), t10 = new RegExp(t10.source, e207);
    }
    let n10 = this._editor.getModel(), r10 = n10.getValue(1), i10 = n10.getFullModelRange(), a10 = this._getReplacePattern(), o10, s10 = this._state.preserveCase;
    o10 = a10.hasReplacementPatterns || s10 ? r10.replace(t10, function() {
      return a10.buildReplaceString(arguments, s10);
    }) : r10.replace(t10, a10.buildReplaceString(null, s10));
    let c10 = new Vx(i10, o10, this._editor.getSelection());
    this._executeEditorCommand(`replaceAll`, c10);
  }
  _regularReplaceAll(e206) {
    let t10 = this._getReplacePattern(), n10 = this._findMatches(e206, t10.hasReplacementPatterns || this._state.preserveCase, 1073741824), r10 = [];
    for (let e207 = 0, i11 = n10.length; e207 < i11; e207++) r10[e207] = t10.buildReplaceString(n10[e207].matches, this._state.preserveCase);
    let i10 = new MSe(this._editor.getSelection(), n10.map((e207) => e207.range), r10);
    this._executeEditorCommand(`replaceAll`, i10);
  }
  selectAllMatches() {
    if (!this._hasMatches()) return;
    let e206 = this._decorations.getFindScopes(), t10 = this._findMatches(e206, false, 1073741824).map((e207) => new N(e207.range.startLineNumber, e207.range.startColumn, e207.range.endLineNumber, e207.range.endColumn)), n10 = this._editor.getSelection();
    for (let e207 = 0, r10 = t10.length; e207 < r10; e207++) if (t10[e207].equalsRange(n10)) {
      t10 = [n10].concat(t10.slice(0, e207), t10.slice(e207 + 1));
      break;
    }
    this._editor.setSelections(t10);
  }
  _executeEditorCommand(e206, t10) {
    try {
      this._ignoreModelContentChanged = true, this._editor.pushUndoStop(), this._editor.executeCommand(e206, t10), this._editor.pushUndoStop();
    } finally {
      this._ignoreModelContentChanged = false;
    }
  }
}, RSe = C(5, `input`), zSe = C(6, `Preserve Case`), BSe = class extends rR {
  constructor(e206) {
    super({ icon: F.preserveCase, title: zSe + e206.appendTitle, isChecked: e206.isChecked, hoverLifecycleOptions: e206.hoverLifecycleOptions, inputActiveOptionBorder: e206.inputActiveOptionBorder, inputActiveOptionForeground: e206.inputActiveOptionForeground, inputActiveOptionBackground: e206.inputActiveOptionBackground });
  }
}, VSe = class extends rx {
  get onDidOptionChange() {
    return this._onDidOptionChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  get onPreserveCaseKeyDown() {
    return this._onPreserveCaseKeyDown.event;
  }
  constructor(e206, t10, n10, r10) {
    super(), this._showOptionButtons = n10, this.fixFocusOnOptionClickEnabled = true, this.cachedOptionsWidth = 0, this._onDidOptionChange = this._register(new k()), this._onKeyDown = this._register(new k()), this._onMouseDown = this._register(new k()), this._onInput = this._register(new k()), this._onKeyUp = this._register(new k()), this._onPreserveCaseKeyDown = this._register(new k()), this.contextViewProvider = t10, this.placeholder = r10.placeholder || ``, this.validation = r10.validation, this.label = r10.label || RSe;
    let i10 = r10.appendPreserveCaseLabel || ``, a10 = r10.history || /* @__PURE__ */ new Set([]), o10 = !!r10.flexibleHeight, s10 = !!r10.flexibleWidth, c10 = r10.flexibleMaxHeight;
    this.domNode = document.createElement(`div`), this.domNode.classList.add(`monaco-findInput`), this.inputBox = this._register(new zR(this.domNode, this.contextViewProvider, { ariaLabel: this.label || ``, placeholder: this.placeholder || ``, validationOptions: { validation: this.validation }, history: a10, showHistoryHint: r10.showHistoryHint, flexibleHeight: o10, flexibleWidth: s10, flexibleMaxHeight: c10, inputBoxStyles: r10.inputBoxStyles })), this.preserveCase = this._register(new BSe({ appendTitle: i10, isChecked: false, hoverLifecycleOptions: r10.hoverLifecycleOptions, ...r10.toggleStyles })), this._register(this.preserveCase.onChange((e207) => {
      this._onDidOptionChange.fire(e207), !e207 && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
    })), this._register(this.preserveCase.onKeyDown((e207) => {
      this._onPreserveCaseKeyDown.fire(e207);
    })), this._showOptionButtons ? this.cachedOptionsWidth = this.preserveCase.width() : this.cachedOptionsWidth = 0;
    let l10 = [this.preserveCase.domNode];
    this.onkeydown(this.domNode, (e207) => {
      if (e207.equals(15) || e207.equals(17) || e207.equals(9)) {
        let t11 = l10.indexOf(this.domNode.ownerDocument.activeElement);
        if (t11 >= 0) {
          let n11 = -1;
          e207.equals(17) ? n11 = (t11 + 1) % l10.length : e207.equals(15) && (n11 = t11 === 0 ? l10.length - 1 : t11 - 1), e207.equals(9) ? (l10[t11].blur(), this.inputBox.focus()) : n11 >= 0 && l10[n11].focus(), Vl.stop(e207, true);
        }
      }
    });
    let u10 = document.createElement(`div`);
    u10.className = `controls`, u10.style.display = this._showOptionButtons ? `block` : `none`, u10.appendChild(this.preserveCase.domNode), this.domNode.appendChild(u10), e206?.appendChild(this.domNode), this.onkeydown(this.inputBox.inputElement, (e207) => this._onKeyDown.fire(e207)), this.onkeyup(this.inputBox.inputElement, (e207) => this._onKeyUp.fire(e207)), this.oninput(this.inputBox.inputElement, (e207) => this._onInput.fire()), this.onmousedown(this.inputBox.inputElement, (e207) => this._onMouseDown.fire(e207));
  }
  enable() {
    this.domNode.classList.remove(`disabled`), this.inputBox.enable(), this.preserveCase.enable();
  }
  disable() {
    this.domNode.classList.add(`disabled`), this.inputBox.disable(), this.preserveCase.disable();
  }
  setEnabled(e206) {
    e206 ? this.enable() : this.disable();
  }
  select() {
    this.inputBox.select();
  }
  focus() {
    this.inputBox.focus();
  }
  getPreserveCase() {
    return this.preserveCase.checked;
  }
  setPreserveCase(e206) {
    this.preserveCase.checked = e206;
  }
  focusOnPreserve() {
    this.preserveCase.focus();
  }
  validate() {
    this.inputBox?.validate();
  }
  set width(e206) {
    this.inputBox.paddingRight = this.cachedOptionsWidth, this.domNode.style.width = e206 + `px`;
  }
  dispose() {
    super.dispose();
  }
}, YZ = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, XZ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, ZZ = new U(`suggestWidgetVisible`, false, C(1698, `Whether suggestion are visible`)), QZ = `historyNavigationWidgetFocus`, $Z = `historyNavigationForwardsEnabled`, eQ = `historyNavigationBackwardsEnabled`, tQ = void 0, nQ = [];
function rQ(e206, t10) {
  if (nQ.includes(t10)) throw Error(`Cannot register the same widget multiple times`);
  nQ.push(t10);
  let n10 = new E(), r10 = new U(QZ, false).bindTo(e206), i10 = new U($Z, true).bindTo(e206), a10 = new U(eQ, true).bindTo(e206), o10 = () => {
    r10.set(true), tQ = t10;
  }, s10 = () => {
    r10.set(false), tQ === t10 && (tQ = void 0);
  };
  return Al(t10.element) && o10(), n10.add(t10.onDidFocus(() => o10())), n10.add(t10.onDidBlur(() => s10())), n10.add(T(() => {
    nQ.splice(nQ.indexOf(t10), 1), s10();
  })), { historyNavigationForwardsEnablement: i10, historyNavigationBackwardsEnablement: a10, dispose() {
    n10.dispose();
  } };
}
var iQ = class extends VR {
  constructor(e206, t10, n10, r10) {
    super(e206, t10, n10);
    let i10 = this._register(r10.createScoped(this.inputBox.element));
    this._register(rQ(i10, this.inputBox));
  }
};
iQ = YZ([XZ(3, nd)], iQ);
var aQ = class extends VSe {
  constructor(e206, t10, n10, r10, i10 = false) {
    super(e206, t10, i10, n10);
    let a10 = this._register(r10.createScoped(this.inputBox.element));
    this._register(rQ(a10, this.inputBox));
  }
};
aQ = YZ([XZ(3, nd)], aQ), ld.registerCommandAndKeybindingRule({ id: `history.showPrevious`, weight: 200, when: H.and(H.has(QZ), H.equals(eQ, true), H.not(`isComposing`), ZZ.isEqualTo(false)), primary: 16, secondary: [528], handler: (e206) => {
  tQ?.showPreviousValue();
} }), ld.registerCommandAndKeybindingRule({ id: `history.showNext`, weight: 200, when: H.and(H.has(QZ), H.equals($Z, true), H.not(`isComposing`), ZZ.isEqualTo(false)), primary: 18, secondary: [530], handler: (e206) => {
  tQ?.showNextValue();
} });
function oQ(e206) {
  return e206.lookupKeybinding(`history.showPrevious`)?.getElectronAccelerator() === `Up` && e206.lookupKeybinding(`history.showNext`)?.getElectronAccelerator() === `Down`;
}
var sQ = AU(`find-collapsed`, F.chevronRight, C(956, `Icon to indicate that the editor find widget is collapsed.`)), cQ = AU(`find-expanded`, F.chevronDown, C(957, `Icon to indicate that the editor find widget is expanded.`)), HSe = AU(`find-selection`, F.selection, C(958, `Icon for 'Find in Selection' in the editor find widget.`)), USe = AU(`find-replace`, F.replace, C(959, `Icon for 'Replace' in the editor find widget.`)), WSe = AU(`find-replace-all`, F.replaceAll, C(960, `Icon for 'Replace All' in the editor find widget.`)), GSe = AU(`find-previous-match`, F.arrowUp, C(961, `Icon for 'Find Previous' in the editor find widget.`)), KSe = AU(`find-next-match`, F.arrowDown, C(962, `Icon for 'Find Next' in the editor find widget.`)), qSe = C(963, `Find / Replace`), JSe = C(964, `Find`), YSe = C(965, `Find`), XSe = C(966, `Previous Match`), ZSe = C(967, `Next Match`), QSe = C(968, `Find in Selection`), $Se = C(969, `Close`), eCe = C(970, `Replace`), tCe = C(971, `Replace`), nCe = C(972, `Replace`), rCe = C(973, `Replace All`), iCe = C(974, `Toggle Replace`), aCe = C(975, `Only the first {0} results are highlighted, but all find operations work on the entire text.`, JZ), oCe = C(976, `{0} of {1}`), lQ = C(977, `No results`), uQ = 419, sCe = 221, dQ = 69, cCe = 33, fQ = Tt ? 256 : 2048, pQ = class {
  constructor(e206) {
    this.afterLineNumber = e206, this.heightInPx = cCe, this.suppressMouseDown = false, this.domNode = document.createElement(`div`), this.domNode.className = `dock-find-viewzone`;
  }
};
function mQ(e206, t10, n10) {
  let r10 = !!t10.match(/\n/);
  if (n10 && r10 && n10.selectionStart > 0) {
    e206.stopPropagation();
    return;
  }
}
function hQ(e206, t10, n10) {
  let r10 = !!t10.match(/\n/);
  if (n10 && r10 && n10.selectionEnd < n10.value.length) {
    e206.stopPropagation();
    return;
  }
}
var lCe = (_$b = class extends rx {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(), this._hoverService = o10, this._findWidgetSearchHistory = s10, this._replaceWidgetHistory = c10, this._cachedHeight = null, this._revealTimeouts = [], this._codeEditor = e206, this._controller = t10, this._state = n10, this._contextViewProvider = r10, this._keybindingService = i10, this._contextKeyService = a10, this._isVisible = false, this._isReplaceVisible = false, this._ignoreChangeEvent = false, this._updateHistoryDelayer = new ns(500), this._register(T(() => this._updateHistoryDelayer.cancel())), this._register(this._state.onFindReplaceStateChange((e207) => this._onStateChanged(e207))), this._buildDomNode(), this._updateButtons(), this._tryUpdateWidgetWidth(), this._findInput.inputBox.layout(), this._register(this._codeEditor.onDidChangeConfiguration((e207) => {
      if (e207.hasChanged(104) && (this._codeEditor.getOption(104) && this._state.change({ isReplaceRevealed: false }, false), this._updateButtons()), e207.hasChanged(165) && this._tryUpdateWidgetWidth(), e207.hasChanged(2) && this.updateAccessibilitySupport(), e207.hasChanged(50)) {
        let e208 = this._codeEditor.getOption(50).loop;
        this._state.change({ loop: e208 }, false);
        let t11 = this._codeEditor.getOption(50).addExtraSpaceOnTop;
        t11 && !this._viewZone && (this._viewZone = new pQ(0), this._showViewZone()), !t11 && this._viewZone && this._removeViewZone();
      }
    })), this.updateAccessibilitySupport(), this._register(this._codeEditor.onDidChangeCursorSelection(() => {
      this._isVisible && this._updateToggleSelectionFindButton();
    })), this._register(this._codeEditor.onDidFocusEditorWidget(async () => {
      if (this._isVisible) {
        let e207 = await this._controller.getGlobalBufferTerm();
        e207 && e207 !== this._state.searchString && (this._state.change({ searchString: e207 }, false), this._findInput.select());
      }
    })), this._findInputFocused = BZ.bindTo(a10), this._findFocusTracker = this._register(Gl(this._findInput.inputBox.inputElement)), this._register(this._findFocusTracker.onDidFocus(() => {
      this._findInputFocused.set(true), this._updateSearchScope();
    })), this._register(this._findFocusTracker.onDidBlur(() => {
      this._findInputFocused.set(false);
    })), this._replaceInputFocused = VZ.bindTo(a10), this._replaceFocusTracker = this._register(Gl(this._replaceInput.inputBox.inputElement)), this._register(this._replaceFocusTracker.onDidFocus(() => {
      this._replaceInputFocused.set(true), this._updateSearchScope();
    })), this._register(this._replaceFocusTracker.onDidBlur(() => {
      this._replaceInputFocused.set(false);
    })), this._codeEditor.addOverlayWidget(this), this._codeEditor.getOption(50).addExtraSpaceOnTop && (this._viewZone = new pQ(0)), this._register(this._codeEditor.onDidChangeModel(() => {
      this._isVisible && (this._viewZoneId = void 0);
    })), this._register(this._codeEditor.onDidScrollChange((e207) => {
      if (e207.scrollTopChanged) {
        this._layoutViewZone();
        return;
      }
      setTimeout(() => {
        this._layoutViewZone();
      }, 0);
    }));
  }
  getId() {
    return _$b.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._isVisible ? { preference: 0 } : null;
  }
  _onStateChanged(e206) {
    if (e206.searchString) {
      try {
        this._ignoreChangeEvent = true, this._findInput.setValue(this._state.searchString);
      } finally {
        this._ignoreChangeEvent = false;
      }
      this._updateButtons();
    }
    if (e206.replaceString && (this._replaceInput.inputBox.value = this._state.replaceString), e206.isRevealed && (this._state.isRevealed ? this._reveal() : this._hide(true)), e206.isReplaceRevealed && (this._state.isReplaceRevealed ? !this._codeEditor.getOption(104) && !this._isReplaceVisible && (this._isReplaceVisible = true, this._replaceInput.width = yl(this._findInput.domNode), this._updateButtons(), this._replaceInput.inputBox.layout()) : this._isReplaceVisible && (this._isReplaceVisible = false, this._updateButtons())), (e206.isRevealed || e206.isReplaceRevealed) && (this._state.isRevealed || this._state.isReplaceRevealed) && this._tryUpdateHeight() && this._showViewZone(), e206.isRegex && this._findInput.setRegex(this._state.isRegex), e206.wholeWord && this._findInput.setWholeWords(this._state.wholeWord), e206.matchCase && this._findInput.setCaseSensitive(this._state.matchCase), e206.preserveCase && this._replaceInput.setPreserveCase(this._state.preserveCase), e206.searchScope && (this._state.searchScope ? this._toggleSelectionFind.checked = true : this._toggleSelectionFind.checked = false, this._updateToggleSelectionFindButton()), e206.searchString || e206.matchesCount || e206.matchesPosition) {
      let e207 = this._state.searchString.length > 0 && this._state.matchesCount === 0;
      this._domNode.classList.toggle(`no-results`, e207), this._updateMatchesCount(), this._updateButtons();
    }
    (e206.searchString || e206.currentMatch) && this._layoutViewZone(), e206.updateHistory && this._delayedUpdateHistory(), e206.loop && this._updateButtons();
  }
  _delayedUpdateHistory() {
    this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0, be);
  }
  _updateHistory() {
    this._state.searchString && this._findInput.inputBox.addToHistory(), this._state.replaceString && this._replaceInput.inputBox.addToHistory();
  }
  _updateMatchesCount() {
    this._matchesCount.style.minWidth = dQ + `px`, this._state.matchesCount >= 19999 ? this._matchesCount.title = aCe : this._matchesCount.title = ``, this._matchesCount.firstChild?.remove();
    let e206;
    if (this._state.matchesCount > 0) {
      let t10 = String(this._state.matchesCount);
      this._state.matchesCount >= 19999 && (t10 += `+`);
      let n10 = String(this._state.matchesPosition);
      n10 === `0` && (n10 = `?`), e206 = La(oCe, n10, t10);
    } else e206 = lQ;
    this._matchesCount.appendChild(document.createTextNode(e206)), Wg(this._getAriaLabel(e206, this._state.currentMatch, this._state.searchString)), dQ = Math.max(dQ, this._matchesCount.clientWidth);
  }
  _getAriaLabel(e206, t10, n10) {
    if (e206 === lQ) return n10 === `` ? C(978, `{0} found`, e206) : C(979, `{0} found for '{1}'`, e206, n10);
    if (t10) {
      let r10 = C(980, `{0} found for '{1}', at {2}`, e206, n10, t10.startLineNumber + `:` + t10.startColumn), i10 = this._codeEditor.getModel();
      return i10 && t10.startLineNumber <= i10.getLineCount() && t10.startLineNumber >= 1 ? `${i10.getLineContent(t10.startLineNumber)}, ${r10}` : r10;
    }
    return C(981, `{0} found for '{1}'`, e206, n10);
  }
  _updateToggleSelectionFindButton() {
    let e206 = this._codeEditor.getSelection(), t10 = e206 ? e206.startLineNumber !== e206.endLineNumber || e206.startColumn !== e206.endColumn : false, n10 = this._toggleSelectionFind.checked;
    this._isVisible && (n10 || t10) ? this._toggleSelectionFind.enable() : this._toggleSelectionFind.disable();
  }
  _updateButtons() {
    this._findInput.setEnabled(this._isVisible), this._replaceInput.setEnabled(this._isVisible && this._isReplaceVisible), this._updateToggleSelectionFindButton(), this._closeBtn.setEnabled(this._isVisible);
    let e206 = this._state.searchString.length > 0, t10 = !!this._state.matchesCount;
    this._prevBtn.setEnabled(this._isVisible && e206 && t10 && this._state.canNavigateBack()), this._nextBtn.setEnabled(this._isVisible && e206 && t10 && this._state.canNavigateForward()), this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && e206), this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && e206), this._domNode.classList.toggle(`replaceToggled`, this._isReplaceVisible), this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
    let n10 = !this._codeEditor.getOption(104);
    this._toggleReplaceBtn.setEnabled(this._isVisible && n10);
  }
  _reveal() {
    if (this._revealTimeouts.forEach((e206) => {
      clearTimeout(e206);
    }), this._revealTimeouts = [], !this._isVisible) {
      this._isVisible = true;
      let e206 = this._codeEditor.getSelection();
      switch (this._codeEditor.getOption(50).autoFindInSelection) {
        case `always`:
          this._toggleSelectionFind.checked = true;
          break;
        case `never`:
          this._toggleSelectionFind.checked = false;
          break;
        case `multiline`: {
          let t11 = !!e206 && e206.startLineNumber !== e206.endLineNumber;
          this._toggleSelectionFind.checked = t11;
          break;
        }
      }
      this._tryUpdateWidgetWidth(), this._updateButtons(), this._revealTimeouts.push(setTimeout(() => {
        this._domNode.classList.add(`visible`), this._domNode.setAttribute(`aria-hidden`, `false`);
      }, 0)), this._revealTimeouts.push(setTimeout(() => {
        this._findInput.validate();
      }, 200)), this._codeEditor.layoutOverlayWidget(this);
      let t10 = true;
      if (this._codeEditor.getOption(50).seedSearchStringFromSelection && e206) {
        let n10 = this._codeEditor.getDomNode();
        if (n10) {
          let r10 = _l2(n10), i10 = this._codeEditor.getScrolledVisiblePosition(e206.getStartPosition()), a10 = r10.left + (i10 ? i10.left : 0), o10 = i10 ? i10.top : 0;
          if (this._viewZone && o10 < this._viewZone.heightInPx) {
            e206.endLineNumber > e206.startLineNumber && (t10 = false);
            let n11 = hl(this._domNode).left;
            a10 > n11 && (t10 = false);
            let i11 = this._codeEditor.getScrolledVisiblePosition(e206.getEndPosition());
            r10.left + (i11 ? i11.left : 0) > n11 && (t10 = false);
          }
        }
      }
      this._showViewZone(t10);
    }
  }
  _hide(e206) {
    this._revealTimeouts.forEach((e207) => {
      clearTimeout(e207);
    }), this._revealTimeouts = [], this._isVisible && (this._isVisible = false, this._updateButtons(), this._domNode.classList.remove(`visible`), this._domNode.setAttribute(`aria-hidden`, `true`), this._findInput.clearMessage(), e206 && this._codeEditor.focus(), this._codeEditor.layoutOverlayWidget(this), this._removeViewZone());
  }
  _layoutViewZone(e206) {
    if (!this._codeEditor.getOption(50).addExtraSpaceOnTop) {
      this._removeViewZone();
      return;
    }
    if (!this._isVisible) return;
    let t10 = this._viewZone;
    this._viewZoneId !== void 0 || !t10 || this._codeEditor.changeViewZones((n10) => {
      t10.heightInPx = this._getHeight(), this._viewZoneId = n10.addZone(t10), this._codeEditor.setScrollTop(e206 || this._codeEditor.getScrollTop() + t10.heightInPx);
    });
  }
  _showViewZone(e206 = true) {
    if (!this._isVisible || !this._codeEditor.getOption(50).addExtraSpaceOnTop) return;
    this._viewZone === void 0 && (this._viewZone = new pQ(0));
    let t10 = this._viewZone;
    this._codeEditor.changeViewZones((n10) => {
      if (this._viewZoneId !== void 0) {
        let r10 = this._getHeight();
        if (r10 === t10.heightInPx) return;
        let i10 = r10 - t10.heightInPx;
        t10.heightInPx = r10, n10.layoutZone(this._viewZoneId), e206 && this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + i10);
        return;
      } else {
        let r10 = this._getHeight();
        if (r10 -= this._codeEditor.getOption(96).top, r10 <= 0) return;
        t10.heightInPx = r10, this._viewZoneId = n10.addZone(t10), e206 && this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + r10);
      }
    });
  }
  _removeViewZone() {
    this._codeEditor.changeViewZones((e206) => {
      this._viewZoneId !== void 0 && (e206.removeZone(this._viewZoneId), this._viewZoneId = void 0, this._viewZone && (this._viewZone = (this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() - this._viewZone.heightInPx), void 0)));
    });
  }
  _tryUpdateWidgetWidth() {
    if (!this._isVisible || !this._domNode.isConnected) return;
    let e206 = this._codeEditor.getLayoutInfo();
    if (e206.contentWidth <= 0) {
      this._domNode.classList.add(`hiddenEditor`);
      return;
    } else this._domNode.classList.contains(`hiddenEditor`) && this._domNode.classList.remove(`hiddenEditor`);
    let t10 = e206.width, n10 = e206.minimap.minimapWidth, r10 = false, i10 = false, a10 = false;
    if (this._resized && yl(this._domNode) > uQ) {
      this._domNode.style.maxWidth = `${t10 - 28 - n10 - 15}px`, this._replaceInput.width = yl(this._findInput.domNode);
      return;
    }
    if (uQ + 28 + n10 >= t10 && (i10 = true), uQ + 28 + n10 - dQ >= t10 && (a10 = true), uQ + 28 + n10 - dQ >= t10 + 50 && (r10 = true), this._domNode.classList.toggle(`collapsed-find-widget`, r10), this._domNode.classList.toggle(`narrow-find-widget`, a10), this._domNode.classList.toggle(`reduced-find-widget`, i10), !a10 && !r10 && (this._domNode.style.maxWidth = `${t10 - 28 - n10 - 15}px`), this._findInput.layout({ collapsedFindWidget: r10, narrowFindWidget: a10, reducedFindWidget: i10 }), this._resized) {
      let e207 = this._findInput.inputBox.element.clientWidth;
      e207 > 0 && (this._replaceInput.width = e207);
    } else this._isReplaceVisible && (this._replaceInput.width = yl(this._findInput.domNode));
  }
  _getHeight() {
    let e206 = 0;
    return e206 += 4, e206 += this._findInput.inputBox.height + 2, this._isReplaceVisible && (e206 += 4, e206 += this._replaceInput.inputBox.height + 2), e206 += 4, e206;
  }
  _tryUpdateHeight() {
    let e206 = this._getHeight();
    return this._cachedHeight !== null && this._cachedHeight === e206 ? false : (this._cachedHeight = e206, this._domNode.style.height = `${e206}px`, true);
  }
  focusFindInput() {
    this._findInput.select(), this._findInput.focus();
  }
  focusReplaceInput() {
    this._replaceInput.select(), this._replaceInput.focus();
  }
  highlightFindOptions() {
    this._findInput.highlightFindOptions();
  }
  _updateSearchScope() {
    if (this._codeEditor.hasModel() && this._toggleSelectionFind.checked) {
      let e206 = this._codeEditor.getSelections();
      e206.map((e207) => {
        e207.endColumn === 1 && e207.endLineNumber > e207.startLineNumber && (e207 = e207.setEndPosition(e207.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(e207.endLineNumber - 1)));
        let t10 = this._state.currentMatch;
        return e207.startLineNumber !== e207.endLineNumber && !M.equalsRange(e207, t10) ? e207 : null;
      }).filter((e207) => !!e207), e206.length && this._state.change({ searchScope: e206 }, true);
    }
  }
  _onFindInputMouseDown(e206) {
    e206.middleButton && e206.stopPropagation();
  }
  _onFindInputKeyDown(e206) {
    if (e206.equals(fQ | 3)) if (this._keybindingService.dispatchEvent(e206, e206.target)) {
      e206.preventDefault();
      return;
    } else {
      this._findInput.inputBox.insertAtCursor(`
`), e206.preventDefault();
      return;
    }
    if (e206.equals(2)) {
      this._isReplaceVisible ? this._replaceInput.focus() : this._findInput.focusOnCaseSensitive(), e206.preventDefault();
      return;
    }
    if (e206.equals(2066)) {
      this._codeEditor.focus(), e206.preventDefault();
      return;
    }
    if (e206.equals(16)) return mQ(e206, this._findInput.getValue(), this._findInput.domNode.querySelector(`textarea`));
    if (e206.equals(18)) return hQ(e206, this._findInput.getValue(), this._findInput.domNode.querySelector(`textarea`));
  }
  _onReplaceInputKeyDown(e206) {
    if (e206.equals(fQ | 3)) if (this._keybindingService.dispatchEvent(e206, e206.target)) {
      e206.preventDefault();
      return;
    } else {
      this._replaceInput.inputBox.insertAtCursor(`
`), e206.preventDefault();
      return;
    }
    if (e206.equals(2)) {
      this._findInput.focusOnCaseSensitive(), e206.preventDefault();
      return;
    }
    if (e206.equals(1026)) {
      this._findInput.focus(), e206.preventDefault();
      return;
    }
    if (e206.equals(2066)) {
      this._codeEditor.focus(), e206.preventDefault();
      return;
    }
    if (e206.equals(16)) return mQ(e206, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector(`textarea`));
    if (e206.equals(18)) return hQ(e206, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector(`textarea`));
  }
  getVerticalSashLeft(e206) {
    return 0;
  }
  _keybindingLabelFor(e206) {
    let t10 = this._keybindingService.lookupKeybinding(e206);
    return t10 ? ` (${t10.getLabel()})` : ``;
  }
  _buildDomNode() {
    let e206 = this._codeEditor.getOption(50).history, t10 = this._codeEditor.getOption(50).replaceHistory;
    this._findInput = this._register(new iQ(null, this._contextViewProvider, { width: sCe, label: JSe, placeholder: YSe, appendCaseSensitiveLabel: this._keybindingLabelFor(qZ.ToggleCaseSensitiveCommand), appendWholeWordsLabel: this._keybindingLabelFor(qZ.ToggleWholeWordCommand), appendRegexLabel: this._keybindingLabelFor(qZ.ToggleRegexCommand), validation: (e207) => {
      if (e207.length === 0 || !this._findInput.getRegex()) return null;
      try {
        return new RegExp(e207, `gu`), null;
      } catch (e208) {
        return { content: e208.message };
      }
    }, flexibleHeight: true, flexibleWidth: true, flexibleMaxHeight: 118, showCommonFindToggles: true, showHistoryHint: () => oQ(this._keybindingService), inputBoxStyles: cL, toggleStyles: oL, history: e206 === `workspace` ? this._findWidgetSearchHistory : /* @__PURE__ */ new Set([]) }, this._contextKeyService)), this._findInput.setRegex(!!this._state.isRegex), this._findInput.setCaseSensitive(!!this._state.matchCase), this._findInput.setWholeWords(!!this._state.wholeWord), this._register(this._findInput.onKeyDown((e207) => {
      e207.equals(3) && !this._codeEditor.getOption(50).findOnType && this._state.change({ searchString: this._findInput.getValue() }, true), this._onFindInputKeyDown(e207);
    })), this._register(this._findInput.inputBox.onDidChange(() => {
      this._ignoreChangeEvent || !this._codeEditor.getOption(50).findOnType || this._state.change({ searchString: this._findInput.getValue() }, true);
    })), this._register(this._findInput.onDidOptionChange(() => {
      this._state.change({ isRegex: this._findInput.getRegex(), wholeWord: this._findInput.getWholeWords(), matchCase: this._findInput.getCaseSensitive() }, true);
    })), this._register(this._findInput.onCaseSensitiveKeyDown((e207) => {
      e207.equals(1026) && this._isReplaceVisible && (this._replaceInput.focus(), e207.preventDefault());
    })), this._register(this._findInput.onRegexKeyDown((e207) => {
      e207.equals(2) && this._isReplaceVisible && (this._replaceInput.focusOnPreserve(), e207.preventDefault());
    })), this._register(this._findInput.inputBox.onDidHeightChange((e207) => {
      this._tryUpdateHeight() && this._showViewZone();
    })), Et && this._register(this._findInput.onMouseDown((e207) => this._onFindInputMouseDown(e207))), this._matchesCount = document.createElement(`div`), this._matchesCount.className = `matchesCount`, this._updateMatchesCount();
    let n10 = { groupId: `find-widget` };
    this._prevBtn = this._register(new gQ({ label: XSe + this._keybindingLabelFor(qZ.PreviousMatchFindAction), icon: GSe, hoverLifecycleOptions: n10, onTrigger: () => {
      Ye(this._codeEditor.getAction(qZ.PreviousMatchFindAction)).run().then(void 0, be);
    } }, this._hoverService)), this._nextBtn = this._register(new gQ({ label: ZSe + this._keybindingLabelFor(qZ.NextMatchFindAction), icon: KSe, hoverLifecycleOptions: n10, onTrigger: () => {
      Ye(this._codeEditor.getAction(qZ.NextMatchFindAction)).run().then(void 0, be);
    } }, this._hoverService));
    let r10 = document.createElement(`div`);
    r10.className = `find-part`, r10.appendChild(this._findInput.domNode);
    let i10 = document.createElement(`div`);
    i10.className = `find-actions`, r10.appendChild(i10), i10.appendChild(this._matchesCount), i10.appendChild(this._prevBtn.domNode), i10.appendChild(this._nextBtn.domNode), this._toggleSelectionFind = this._register(new rR({ icon: HSe, title: QSe + this._keybindingLabelFor(qZ.ToggleSearchScopeCommand), isChecked: false, hoverLifecycleOptions: n10, inputActiveOptionBackground: Z(wy), inputActiveOptionBorder: Z(Sy), inputActiveOptionForeground: Z(Ty) })), this._register(this._toggleSelectionFind.onChange(() => {
      if (this._toggleSelectionFind.checked) {
        if (this._codeEditor.hasModel()) {
          let e207 = this._codeEditor.getSelections();
          e207 = e207.map((e208) => (e208.endColumn === 1 && e208.endLineNumber > e208.startLineNumber && (e208 = e208.setEndPosition(e208.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(e208.endLineNumber - 1))), e208.isEmpty() ? null : e208)).filter((e208) => !!e208), e207.length && this._state.change({ searchScope: e207 }, true);
        }
      } else this._state.change({ searchScope: null }, true);
    })), i10.appendChild(this._toggleSelectionFind.domNode), this._closeBtn = this._register(new gQ({ label: $Se + this._keybindingLabelFor(qZ.CloseFindWidgetCommand), icon: IU, hoverLifecycleOptions: n10, onTrigger: () => {
      this._state.change({ isRevealed: false, searchScope: null }, false);
    }, onKeyDown: (e207) => {
      e207.equals(2) && this._isReplaceVisible && (this._replaceBtn.isEnabled() ? this._replaceBtn.focus() : this._codeEditor.focus(), e207.preventDefault());
    } }, this._hoverService)), this._replaceInput = this._register(new aQ(null, void 0, { label: eCe, placeholder: tCe, appendPreserveCaseLabel: this._keybindingLabelFor(qZ.TogglePreserveCaseCommand), history: t10 === `workspace` ? this._replaceWidgetHistory : /* @__PURE__ */ new Set([]), flexibleHeight: true, flexibleWidth: true, flexibleMaxHeight: 118, showHistoryHint: () => oQ(this._keybindingService), inputBoxStyles: cL, toggleStyles: oL, hoverLifecycleOptions: n10 }, this._contextKeyService, true)), this._replaceInput.setPreserveCase(!!this._state.preserveCase), this._register(this._replaceInput.onKeyDown((e207) => this._onReplaceInputKeyDown(e207))), this._register(this._replaceInput.inputBox.onDidChange(() => {
      this._state.change({ replaceString: this._replaceInput.inputBox.value }, false);
    })), this._register(this._replaceInput.inputBox.onDidHeightChange((e207) => {
      this._isReplaceVisible && this._tryUpdateHeight() && this._showViewZone();
    })), this._register(this._replaceInput.onDidOptionChange(() => {
      this._state.change({ preserveCase: this._replaceInput.getPreserveCase() }, true);
    })), this._register(this._replaceInput.onPreserveCaseKeyDown((e207) => {
      e207.equals(2) && (this._prevBtn.isEnabled() ? this._prevBtn.focus() : this._nextBtn.isEnabled() ? this._nextBtn.focus() : this._toggleSelectionFind.enabled ? this._toggleSelectionFind.focus() : this._closeBtn.isEnabled() && this._closeBtn.focus(), e207.preventDefault());
    })), this._replaceBtn = this._register(new gQ({ label: nCe + this._keybindingLabelFor(qZ.ReplaceOneAction), icon: USe, hoverLifecycleOptions: n10, onTrigger: () => {
      this._controller.replace();
    }, onKeyDown: (e207) => {
      e207.equals(1026) && (this._closeBtn.focus(), e207.preventDefault());
    } }, this._hoverService)), this._replaceAllBtn = this._register(new gQ({ label: rCe + this._keybindingLabelFor(qZ.ReplaceAllAction), icon: WSe, hoverLifecycleOptions: n10, onTrigger: () => {
      this._controller.replaceAll();
    } }, this._hoverService));
    let a10 = document.createElement(`div`);
    a10.className = `replace-part`, a10.appendChild(this._replaceInput.domNode);
    let o10 = document.createElement(`div`);
    o10.className = `replace-actions`, a10.appendChild(o10), o10.appendChild(this._replaceBtn.domNode), o10.appendChild(this._replaceAllBtn.domNode), this._toggleReplaceBtn = this._register(new gQ({ label: iCe, className: `codicon toggle left`, onTrigger: () => {
      this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, false), this._isReplaceVisible && (this._replaceInput.width = yl(this._findInput.domNode), this._replaceInput.inputBox.layout()), this._showViewZone();
    } }, this._hoverService)), this._toggleReplaceBtn.setExpanded(this._isReplaceVisible), this._domNode = document.createElement(`div`), this._domNode.className = `editor-widget find-widget`, this._domNode.setAttribute(`aria-hidden`, `true`), this._domNode.ariaLabel = qSe, this._domNode.role = `dialog`, this._domNode.style.width = `${uQ}px`, this._domNode.appendChild(this._toggleReplaceBtn.domNode), this._domNode.appendChild(r10), this._domNode.appendChild(this._closeBtn.domNode), this._domNode.appendChild(a10), this._resizeSash = this._register(new nB(this._domNode, this, { orientation: 0, size: 2 })), this._resized = false;
    let s10 = uQ;
    this._register(this._resizeSash.onDidStart(() => {
      s10 = yl(this._domNode);
    })), this._register(this._resizeSash.onDidChange((e207) => {
      this._resized = true;
      let t11 = s10 + e207.startX - e207.currentX;
      t11 < uQ || t11 > (parseFloat(dl(this._domNode).maxWidth) || 0) || (this._domNode.style.width = `${t11}px`, this._isReplaceVisible && (this._replaceInput.width = yl(this._findInput.domNode)), this._findInput.inputBox.layout(), this._tryUpdateHeight());
    })), this._register(this._resizeSash.onDidReset(() => {
      let e207 = yl(this._domNode);
      if (e207 < uQ) return;
      let t11 = uQ;
      if (!this._resized || e207 === uQ) {
        let e208 = this._codeEditor.getLayoutInfo();
        t11 = e208.width - 28 - e208.minimap.minimapWidth - 15, this._resized = true;
      }
      this._domNode.style.width = `${t11}px`, this._isReplaceVisible && (this._replaceInput.width = yl(this._findInput.domNode)), this._findInput.inputBox.layout();
    }));
  }
  updateAccessibilitySupport() {
    let e206 = this._codeEditor.getOption(2);
    this._findInput.setFocusInputOnOptionClick(e206 !== 2);
  }
  getViewState() {
    let e206 = false;
    return this._viewZone && this._viewZoneId && (e206 = this._viewZone.heightInPx > this._codeEditor.getScrollTop()), { widgetViewZoneVisible: e206, scrollTop: this._codeEditor.getScrollTop() };
  }
  setViewState(e206) {
    e206 && e206.widgetViewZoneVisible && this._layoutViewZone(e206.scrollTop);
  }
}, _$b.ID = `editor.contrib.findWidget`, _$b), gQ = class extends rx {
  constructor(e206, t10) {
    super(), this._opts = e206;
    let n10 = `button`;
    this._opts.className && (n10 = n10 + ` ` + this._opts.className), this._opts.icon && (n10 = n10 + ` ` + ju.asClassName(this._opts.icon)), this._domNode = document.createElement(`div`), this._domNode.tabIndex = 0, this._domNode.className = n10, this._domNode.setAttribute(`role`, `button`), this._domNode.setAttribute(`aria-label`, this._opts.label), this._register(t10.setupDelayedHover(this._domNode, { content: this._opts.label, style: 1 }, e206.hoverLifecycleOptions)), this.onclick(this._domNode, (e207) => {
      this._opts.onTrigger(), e207.preventDefault();
    }), this.onkeydown(this._domNode, (e207) => {
      if (e207.equals(10) || e207.equals(3)) {
        this._opts.onTrigger(), e207.preventDefault();
        return;
      }
      this._opts.onKeyDown?.(e207);
    });
  }
  get domNode() {
    return this._domNode;
  }
  isEnabled() {
    return this._domNode.tabIndex >= 0;
  }
  focus() {
    this._domNode.focus();
  }
  setEnabled(e206) {
    this._domNode.classList.toggle(`disabled`, !e206), this._domNode.setAttribute(`aria-disabled`, String(!e206)), this._domNode.tabIndex = e206 ? 0 : -1;
  }
  setExpanded(e206) {
    this._domNode.setAttribute(`aria-expanded`, String(!!e206)), e206 ? (this._domNode.classList.remove(...ju.asClassNameArray(sQ)), this._domNode.classList.add(...ju.asClassNameArray(cQ))) : (this._domNode.classList.remove(...ju.asClassNameArray(cQ)), this._domNode.classList.add(...ju.asClassNameArray(sQ)));
  }
};
JS((e206, t10) => {
  let n10 = e206.getColor(wv);
  n10 && t10.addRule(`.monaco-editor .findMatch { border: 1px ${Fb(e206.type) ? `dotted` : `solid`} ${n10}; box-sizing: border-box; }`);
  let r10 = e206.getColor(Tv);
  r10 && t10.addRule(`.monaco-editor .findScope { border: 1px ${Fb(e206.type) ? `dashed` : `solid`} ${r10}; }`);
  let i10 = e206.getColor(q_);
  i10 && t10.addRule(`.monaco-editor .find-widget { border: 1px solid ${i10}; }`);
  let a10 = e206.getColor(xv);
  a10 && t10.addRule(`.monaco-editor .findMatchInline { color: ${a10}; }`);
  let o10 = e206.getColor(Cv);
  o10 && t10.addRule(`.monaco-editor .currentFindMatchInline { color: ${o10}; }`);
});
var uCe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, _Q2 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, vQ = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._container = e206, this._getContent = t10, this._clipboardService = n10, this._hoverService = r10, this._container.classList.add(`hover-row-with-copy`), this._button = this._register(new gQ({ label: C(1128, `Copy`), icon: F.copy, onTrigger: () => this._copyContent(), className: `hover-copy-button` }, this._hoverService)), this._container.appendChild(this._button.domNode);
  }
  async _copyContent() {
    let e206 = this._getContent();
    e206 && (await this._clipboardService.writeText(e206), Gg(C(1129, `Copied to clipboard`)));
  }
};
vQ = uCe([_Q2(2, hW), _Q2(3, uj)], vQ);
var dCe = class {
  constructor(e206, t10, n10) {
    this.provider = e206, this.hover = t10, this.ordinal = n10;
  }
};
async function fCe(e206, t10, n10, r10, i10) {
  let a10 = await Promise.resolve(e206.provideHover(n10, r10, i10)).catch(xe);
  if (!(!a10 || !pCe(a10))) return new dCe(e206, a10, t10);
}
function yQ(e206, t10, n10, r10, i10 = false) {
  let a10 = e206.ordered(t10, i10).map((e207, i11) => fCe(e207, i11, t10, n10, r10));
  return ys.fromPromisesResolveOrder(a10).coalesce();
}
async function bQ(e206, t10, n10, r10, i10 = false) {
  let a10 = [];
  for await (let o10 of yQ(e206, t10, n10, r10, i10)) a10.push(o10.hover);
  return a10;
}
nf(`_executeHoverProvider`, (e206, t10, n10) => bQ(e206.get(X).hoverProvider, t10, n10, dr.None)), nf(`_executeHoverProvider_recursive`, (e206, t10, n10) => bQ(e206.get(X).hoverProvider, t10, n10, dr.None, true));
function pCe(e206) {
  let t10 = e206.range !== void 0, n10 = e206.contents !== void 0 && e206.contents && e206.contents.length > 0;
  return t10 && n10;
}
var mCe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, xQ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, SQ = B, hCe = AU(`hover-increase-verbosity`, F.add, C(1130, `Icon for increaseing hover verbosity.`)), gCe = AU(`hover-decrease-verbosity`, F.remove, C(1131, `Icon for decreasing hover verbosity.`)), CQ = class {
  constructor(e206, t10, n10, r10, i10, a10 = void 0) {
    this.owner = e206, this.range = t10, this.contents = n10, this.isBeforeContent = r10, this.ordinal = i10, this.source = a10;
  }
  isValidForHoverAnchor(e206) {
    return e206.type === 1 && this.range.startColumn <= e206.range.startColumn && this.range.endColumn >= e206.range.endColumn;
  }
}, wQ = class {
  constructor(e206, t10, n10) {
    this.hover = e206, this.hoverProvider = t10, this.hoverPosition = n10;
  }
  supportsVerbosityAction(e206) {
    switch (e206) {
      case mi.Increase:
        return this.hover.canIncreaseVerbosity ?? false;
      case mi.Decrease:
        return this.hover.canDecreaseVerbosity ?? false;
    }
  }
}, TQ = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this._editor = e206, this._markdownRendererService = t10, this._configurationService = n10, this._languageFeaturesService = r10, this._keybindingService = i10, this._hoverService = a10, this._commandService = o10, this.hoverOrdinal = 3;
  }
  createLoadingMessage(e206) {
    return new CQ(this, e206.range, [new PM().appendText(C(1132, `Loading...`))], false, 2e3);
  }
  computeSync(e206, t10) {
    if (!this._editor.hasModel() || e206.type !== 1) return [];
    let n10 = this._editor.getModel(), r10 = e206.range.startLineNumber, i10 = n10.getLineMaxColumn(r10), a10 = [], o10 = 1e3, s10 = n10.getLineLength(r10), c10 = n10.getLanguageIdAtPosition(e206.range.startLineNumber, e206.range.startColumn), l10 = this._editor.getOption(133), u10 = this._configurationService.getValue(`editor.maxTokenizationLineLength`, { overrideIdentifier: c10 }), d10 = false;
    l10 >= 0 && s10 > l10 && e206.range.startColumn >= l10 && (d10 = true, a10.push(new CQ(this, e206.range, [{ value: C(1133, "Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.") }], false, o10++))), !d10 && typeof u10 == `number` && s10 >= u10 && a10.push(new CQ(this, e206.range, [{ value: C(1134, "Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.") }], false, o10++));
    let f10 = false;
    for (let n11 of t10) {
      let t11 = n11.range.startLineNumber === r10 ? n11.range.startColumn : 1, s11 = n11.range.endLineNumber === r10 ? n11.range.endColumn : i10, c11 = n11.options.hoverMessage;
      if (!c11 || FM(c11)) continue;
      n11.options.beforeContentClassName && (f10 = true);
      let l11 = new M(e206.range.startLineNumber, t11, e206.range.startLineNumber, s11);
      a10.push(new CQ(this, l11, re(c11), f10, o10++));
    }
    return a10;
  }
  computeAsync(e206, t10, n10, r10) {
    if (!this._editor.hasModel() || e206.type !== 1) return ys.EMPTY;
    let i10 = this._editor.getModel(), a10 = this._languageFeaturesService.hoverProvider;
    return a10.has(i10) ? this._getMarkdownHovers(a10, i10, e206, r10) : ys.EMPTY;
  }
  async *_getMarkdownHovers(e206, t10, n10, r10) {
    let i10 = n10.range.getStartPosition(), a10 = yQ(e206, t10, i10, r10);
    for await (let e207 of a10) if (!FM(e207.hover.contents)) {
      let t11 = e207.hover.range ? M.lift(e207.hover.range) : n10.range, r11 = new wQ(e207.hover, e207.provider, i10);
      yield new CQ(this, t11, e207.hover.contents, false, e207.ordinal, r11);
    }
  }
  renderHoverParts(e206, t10) {
    return this._renderedHoverParts = new _Ce(t10, e206.fragment, this, this._editor, this._commandService, this._keybindingService, this._hoverService, this._configurationService, this._markdownRendererService, e206.onContentsChanged), this._renderedHoverParts;
  }
  handleScroll(e206) {
    this._renderedHoverParts?.handleScroll(e206);
  }
  getAccessibleContent(e206) {
    return this._renderedHoverParts?.getAccessibleContent(e206) ?? ``;
  }
  updateMarkdownHoverVerbosityLevel(e206, t10) {
    return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e206, t10));
  }
};
TQ = mCe([xQ(1, LP), xQ(2, Uf), xQ(3, X), xQ(4, Dw), xQ(5, uj), xQ(6, Mu)], TQ);
var EQ = class {
  constructor(e206, t10, n10, r10) {
    this.hoverPart = e206, this.hoverElement = t10, this.disposables = n10, this.actionsContainer = r10;
  }
  dispose() {
    this.disposables.dispose();
  }
}, _Ce = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    this._hoverParticipant = n10, this._editor = r10, this._commandService = i10, this._keybindingService = a10, this._hoverService = o10, this._configurationService = s10, this._markdownRendererService = c10, this._onFinishedRendering = l10, this._ongoingHoverOperations = /* @__PURE__ */ new Map(), this._disposables = new E(), this.renderedHoverParts = this._renderHoverParts(e206, t10, this._onFinishedRendering), this._disposables.add(T(() => {
      this.renderedHoverParts.forEach((e207) => {
        e207.dispose();
      }), this._ongoingHoverOperations.forEach((e207) => {
        e207.tokenSource.dispose(true);
      });
    }));
  }
  _renderHoverParts(e206, t10, n10) {
    return e206.sort(ce((e207) => e207.ordinal, ue)), e206.map((e207) => {
      let r10 = this._renderHoverPart(e207, n10);
      return t10.appendChild(r10.hoverElement), r10;
    });
  }
  _renderHoverPart(e206, t10) {
    let n10 = this._renderMarkdownHover(e206, t10), r10 = n10.hoverElement, i10 = e206.source, a10 = new E();
    if (a10.add(n10), !i10) return new EQ(e206, r10, a10);
    let o10 = i10.supportsVerbosityAction(mi.Increase), s10 = i10.supportsVerbosityAction(mi.Decrease);
    if (!o10 && !s10) return new EQ(e206, r10, a10);
    let c10 = SQ(`div.verbosity-actions`);
    r10.prepend(c10);
    let l10 = SQ(`div.verbosity-actions-inner`);
    return c10.append(l10), a10.add(this._renderHoverExpansionAction(l10, mi.Increase, o10)), a10.add(this._renderHoverExpansionAction(l10, mi.Decrease, s10)), new EQ(e206, r10, a10, l10);
  }
  _renderMarkdownHover(e206, t10) {
    return DQ(this._editor, e206, this._markdownRendererService, t10);
  }
  _renderHoverExpansionAction(e206, t10, n10) {
    let r10 = new E(), i10 = t10 === mi.Increase, a10 = z(e206, SQ(ju.asCSSSelector(i10 ? hCe : gCe)));
    a10.tabIndex = 0;
    let o10 = new dj(`mouse`, void 0, { target: e206, position: { hoverPosition: 0 } }, this._configurationService, this._hoverService);
    if (r10.add(this._hoverService.setupManagedHover(o10, a10, yCe(this._keybindingService, t10))), !n10) return a10.classList.add(`disabled`), r10;
    a10.classList.add(`enabled`);
    let s10 = () => this._commandService.executeCommand(t10 === mi.Increase ? sZ : cZ, { focus: true });
    return r10.add(new yj(a10, s10)), r10.add(new bj(a10, s10, [3, 10])), r10;
  }
  handleScroll(e206) {
    this.renderedHoverParts.forEach((t10) => {
      let n10 = t10.actionsContainer;
      if (!n10) return;
      let r10 = t10.hoverElement, i10 = e206.scrollTop + e206.height, a10 = r10.offsetTop, o10 = r10.clientHeight, s10 = a10 + o10, c10;
      c10 = s10 <= i10 || a10 >= i10 ? o10 - 22 : i10 - a10 - 22, n10.style.top = `${c10}px`;
    });
  }
  async updateMarkdownHoverPartVerbosityLevel(e206, t10) {
    let n10 = this._editor.getModel();
    if (!n10) return;
    let r10 = this._getRenderedHoverPartAtIndex(t10), i10 = r10?.hoverPart.source;
    if (!r10 || !i10?.supportsVerbosityAction(e206)) return;
    let a10 = await this._fetchHover(i10, n10, e206);
    if (!a10) return;
    let o10 = new wQ(a10, i10.hoverProvider, i10.hoverPosition), s10 = r10.hoverPart, c10 = new CQ(this._hoverParticipant, s10.range, a10.contents, s10.isBeforeContent, s10.ordinal, o10), l10 = this._updateRenderedHoverPart(t10, c10);
    if (l10) return { hoverPart: c10, hoverElement: l10.hoverElement };
  }
  getAccessibleContent(e206) {
    let t10 = this.renderedHoverParts.findIndex((t11) => t11.hoverPart === e206);
    if (t10 === -1) return;
    let n10 = this._getRenderedHoverPartAtIndex(t10);
    if (n10) return n10.hoverElement.innerText.replace(/[^\S\n\r]+/gu, ` `);
  }
  async _fetchHover(e206, t10, n10) {
    let r10 = n10 === mi.Increase ? 1 : -1, i10 = e206.hoverProvider, a10 = this._ongoingHoverOperations.get(i10);
    a10 && (a10.tokenSource.cancel(), r10 += a10.verbosityDelta);
    let o10 = new pr();
    this._ongoingHoverOperations.set(i10, { verbosityDelta: r10, tokenSource: o10 });
    let s10 = { verbosityRequest: { verbosityDelta: r10, previousHover: e206.hover } }, c10;
    try {
      c10 = await Promise.resolve(i10.provideHover(t10, e206.hoverPosition, o10.token, s10));
    } catch (e207) {
      xe(e207);
    }
    return o10.dispose(), this._ongoingHoverOperations.delete(i10), c10;
  }
  _updateRenderedHoverPart(e206, t10) {
    if (e206 >= this.renderedHoverParts.length || e206 < 0) return;
    let n10 = this._renderHoverPart(t10, this._onFinishedRendering), r10 = this.renderedHoverParts[e206], i10 = r10.hoverElement, a10 = n10.hoverElement, o10 = Array.from(a10.children);
    i10.replaceChildren(...o10);
    let s10 = new EQ(t10, i10, n10.disposables, n10.actionsContainer);
    return r10.dispose(), this.renderedHoverParts[e206] = s10, s10;
  }
  _getRenderedHoverPartAtIndex(e206) {
    return this.renderedHoverParts[e206];
  }
  dispose() {
    this._disposables.dispose();
  }
};
function vCe(e206, t10, n10, r10) {
  t10.sort(ce((e207) => e207.ordinal, ue));
  let i10 = [];
  for (let a10 of t10) {
    let t11 = DQ(n10, a10, r10, e206.onContentsChanged);
    e206.fragment.appendChild(t11.hoverElement), i10.push(t11);
  }
  return new qX(i10);
}
function DQ(e206, t10, n10, r10) {
  let i10 = new E(), a10 = SQ(`div.hover-row`), o10 = SQ(`div.hover-row-contents`);
  a10.appendChild(o10);
  let s10 = t10.contents;
  for (let t11 of s10) {
    if (FM(t11)) continue;
    let a11 = SQ(`div.markdown-hover`), s11 = z(a11, SQ(`div.hover-contents`)), c10 = i10.add(n10.render(t11, { context: e206, asyncRenderCallback: () => {
      s11.className = `hover-contents code-hover-contents`, r10();
    } }));
    s11.appendChild(c10.element), o10.appendChild(a11);
  }
  return { hoverPart: t10, hoverElement: a10, dispose() {
    i10.dispose();
  } };
}
function yCe(e206, t10) {
  switch (t10) {
    case mi.Increase: {
      let t11 = e206.lookupKeybinding(sZ);
      return t11 ? C(1135, `Increase Hover Verbosity ({0})`, t11.getLabel()) : C(1136, `Increase Hover Verbosity`);
    }
    case mi.Decrease: {
      let t11 = e206.lookupKeybinding(cZ);
      return t11 ? C(1137, `Decrease Hover Verbosity ({0})`, t11.getLabel()) : C(1138, `Decrease Hover Verbosity`);
    }
  }
}
var OQ = B, bCe = class extends D {
  constructor(e206, t10, n10) {
    super(), this.model = t10, this.pixelRatio = n10, this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._onColorFlushed = new k(), this.onColorFlushed = this._onColorFlushed.event, this._domNode = OQ(`.saturation-wrap`), z(e206, this._domNode), this._canvas = document.createElement(`canvas`), this._canvas.className = `saturation-box`, z(this._domNode, this._canvas), this.selection = OQ(`.saturation-selection`), z(this._domNode, this.selection), this.layout(), this._register(L(this._domNode, R.POINTER_DOWN, (e207) => this.onPointerDown(e207))), this._register(this.model.onDidChangeColor(this.onDidChangeColor, this)), this.monitor = null;
  }
  get domNode() {
    return this._domNode;
  }
  onPointerDown(e206) {
    if (!e206.target || !(e206.target instanceof Element)) return;
    this.monitor = this._register(new T_());
    let t10 = _l2(this._domNode);
    e206.target !== this.selection && this.onDidChangePosition(e206.offsetX, e206.offsetY), this.monitor.startMonitoring(e206.target, e206.pointerId, e206.buttons, (e207) => this.onDidChangePosition(e207.pageX - t10.left, e207.pageY - t10.top), () => null);
    let n10 = L(e206.target.ownerDocument, R.POINTER_UP, () => {
      this._onColorFlushed.fire(), n10.dispose(), this.monitor && (this.monitor = (this.monitor.stopMonitoring(true), null));
    }, true);
  }
  onDidChangePosition(e206, t10) {
    let n10 = Math.max(0, Math.min(1, e206 / this.width)), r10 = Math.max(0, Math.min(1, 1 - t10 / this.height));
    this.paintSelection(n10, r10), this._onDidChange.fire({ s: n10, v: r10 });
  }
  layout() {
    this.width = this._domNode.offsetWidth, this.height = this._domNode.offsetHeight, this._canvas.width = this.width * this.pixelRatio, this._canvas.height = this.height * this.pixelRatio, this.paint();
    let e206 = this.model.color.hsva;
    this.paintSelection(e206.s, e206.v);
  }
  paint() {
    let e206 = this.model.color.hsva, t10 = new Y(new Ph(e206.h, 1, 1, 1)), n10 = this._canvas.getContext(`2d`), r10 = n10.createLinearGradient(0, 0, this._canvas.width, 0);
    r10.addColorStop(0, `rgba(255, 255, 255, 1)`), r10.addColorStop(0.5, `rgba(255, 255, 255, 0.5)`), r10.addColorStop(1, `rgba(255, 255, 255, 0)`);
    let i10 = n10.createLinearGradient(0, 0, 0, this._canvas.height);
    i10.addColorStop(0, `rgba(0, 0, 0, 0)`), i10.addColorStop(1, `rgba(0, 0, 0, 1)`), n10.rect(0, 0, this._canvas.width, this._canvas.height), n10.fillStyle = Y.Format.CSS.format(t10), n10.fill(), n10.fillStyle = r10, n10.fill(), n10.fillStyle = i10, n10.fill();
  }
  paintSelection(e206, t10) {
    this.selection.style.left = `${e206 * this.width}px`, this.selection.style.top = `${this.height - t10 * this.height}px`;
  }
  onDidChangeColor(e206) {
    if (this.monitor && this.monitor.isMonitoring()) return;
    this.paint();
    let t10 = e206.hsva;
    this.paintSelection(t10.s, t10.v);
  }
}, xCe = class extends D {
  constructor(e206) {
    super(), this._onClicked = this._register(new k()), this.onClicked = this._onClicked.event, this._button = z(e206, document.createElement(`button`)), this._button.classList.add(`insert-button`), this._button.textContent = `Insert`, this._register(L(this._button, R.CLICK, () => {
      this._onClicked.fire();
    }));
  }
  get button() {
    return this._button;
  }
}, kQ = B, AQ = class extends D {
  constructor(e206, t10, n10) {
    super(), this.model = t10, this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._onColorFlushed = new k(), this.onColorFlushed = this._onColorFlushed.event, n10 === `standalone` ? (this.domNode = z(e206, kQ(`.standalone-strip`)), this.overlay = z(this.domNode, kQ(`.standalone-overlay`))) : (this.domNode = z(e206, kQ(`.strip`)), this.overlay = z(this.domNode, kQ(`.overlay`))), this.slider = z(this.domNode, kQ(`.slider`)), this.slider.style.top = `0px`, this._register(L(this.domNode, R.POINTER_DOWN, (e207) => this.onPointerDown(e207))), this._register(t10.onDidChangeColor(this.onDidChangeColor, this)), this.layout();
  }
  layout() {
    this.height = this.domNode.offsetHeight - this.slider.offsetHeight;
    let e206 = this.getValue(this.model.color);
    this.updateSliderPosition(e206);
  }
  onDidChangeColor(e206) {
    let t10 = this.getValue(e206);
    this.updateSliderPosition(t10);
  }
  onPointerDown(e206) {
    if (!e206.target || !(e206.target instanceof Element)) return;
    let t10 = this._register(new T_()), n10 = _l2(this.domNode);
    this.domNode.classList.add(`grabbing`), e206.target !== this.slider && this.onDidChangeTop(e206.offsetY), t10.startMonitoring(e206.target, e206.pointerId, e206.buttons, (e207) => this.onDidChangeTop(e207.pageY - n10.top), () => null);
    let r10 = L(e206.target.ownerDocument, R.POINTER_UP, () => {
      this._onColorFlushed.fire(), r10.dispose(), t10.stopMonitoring(true), this.domNode.classList.remove(`grabbing`);
    }, true);
  }
  onDidChangeTop(e206) {
    let t10 = Math.max(0, Math.min(1, 1 - e206 / this.height));
    this.updateSliderPosition(t10), this._onDidChange.fire(t10);
  }
  updateSliderPosition(e206) {
    this.slider.style.top = `${(1 - e206) * this.height}px`;
  }
}, SCe = class extends AQ {
  constructor(e206, t10, n10) {
    super(e206, t10, n10), this.domNode.classList.add(`opacity-strip`), this.onDidChangeColor(this.model.color);
  }
  onDidChangeColor(e206) {
    super.onDidChangeColor(e206);
    let { r: t10, g: n10, b: r10 } = e206.rgba, i10 = new Y(new J(t10, n10, r10, 1)), a10 = new Y(new J(t10, n10, r10, 0));
    this.overlay.style.background = `linear-gradient(to bottom, ${i10} 0%, ${a10} 100%)`;
  }
  getValue(e206) {
    return e206.hsva.a;
  }
}, CCe = class extends AQ {
  constructor(e206, t10, n10) {
    super(e206, t10, n10), this.domNode.classList.add(`hue-strip`);
  }
  getValue(e206) {
    return 1 - e206.hsva.h / 360;
  }
}, wCe = B, TCe = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this.model = t10, this.pixelRatio = n10, this._insertButton = null, this._domNode = wCe(`.colorpicker-body`), z(e206, this._domNode), this._saturationBox = new bCe(this._domNode, this.model, this.pixelRatio), this._register(this._saturationBox), this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange, this)), this._register(this._saturationBox.onColorFlushed(this.flushColor, this)), this._opacityStrip = new SCe(this._domNode, this.model, r10), this._register(this._opacityStrip), this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange, this)), this._register(this._opacityStrip.onColorFlushed(this.flushColor, this)), this._hueStrip = new CCe(this._domNode, this.model, r10), this._register(this._hueStrip), this._register(this._hueStrip.onDidChange(this.onDidHueChange, this)), this._register(this._hueStrip.onColorFlushed(this.flushColor, this)), r10 === `standalone` && (this._insertButton = this._register(new xCe(this._domNode)), this._domNode.classList.add(`standalone-colorpicker`));
  }
  flushColor() {
    this.model.flushColor();
  }
  onDidSaturationValueChange({ s: e206, v: t10 }) {
    let n10 = this.model.color.hsva;
    this.model.color = new Y(new Ph(n10.h, e206, t10, n10.a));
  }
  onDidOpacityChange(e206) {
    let t10 = this.model.color.hsva;
    this.model.color = new Y(new Ph(t10.h, t10.s, t10.v, e206));
  }
  onDidHueChange(e206) {
    let t10 = this.model.color.hsva, n10 = (1 - e206) * 360;
    this.model.color = new Y(new Ph(n10 === 360 ? 0 : n10, t10.s, t10.v, t10.a));
  }
  get domNode() {
    return this._domNode;
  }
  get saturationBox() {
    return this._saturationBox;
  }
  get enterButton() {
    return this._insertButton;
  }
  layout() {
    this._saturationBox.layout(), this._opacityStrip.layout(), this._hueStrip.layout();
  }
}, ECe = B, DCe = class extends D {
  constructor(e206) {
    super(), this._onClicked = this._register(new k()), this.onClicked = this._onClicked.event, this._button = document.createElement(`div`), this._button.classList.add(`close-button`), z(e206, this._button);
    let t10 = document.createElement(`div`);
    t10.classList.add(`close-button-inner-div`), z(this._button, t10), z(t10, ECe(`.button` + ju.asCSSSelector(AU(`color-picker-close`, F.close, C(885, `Icon to close the color picker`))))).classList.add(`close-icon`), this._register(L(this._button, R.CLICK, () => {
      this._onClicked.fire();
    }));
  }
}, jQ = B, OCe = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this.model = t10, this.type = r10, this._closeButton = null, this._domNode = jQ(`.colorpicker-header`), z(e206, this._domNode), this._pickedColorNode = z(this._domNode, jQ(`.picked-color`)), z(this._pickedColorNode, jQ(`span.codicon.codicon-color-mode`)), this._pickedColorPresentation = z(this._pickedColorNode, document.createElement(`span`)), this._pickedColorPresentation.classList.add(`picked-color-presentation`);
    let i10 = C(886, `Click to toggle color options (rgb/hsl/hex)`);
    this._pickedColorNode.setAttribute(`title`, i10), this._originalColorNode = z(this._domNode, jQ(`.original-color`)), this._originalColorNode.style.backgroundColor = Y.Format.CSS.format(this.model.originalColor) || ``, this.backgroundColor = n10.getColorTheme().getColor(Ev) || Y.white, this._register(n10.onDidColorThemeChange((e207) => {
      this.backgroundColor = e207.getColor(Ev) || Y.white;
    })), this._register(L(this._pickedColorNode, R.CLICK, () => this.model.selectNextColorPresentation())), this._register(L(this._originalColorNode, R.CLICK, () => {
      this.model.color = this.model.originalColor, this.model.flushColor();
    })), this._register(t10.onDidChangeColor(this.onDidChangeColor, this)), this._register(t10.onDidChangePresentation(this.onDidChangePresentation, this)), this._pickedColorNode.style.backgroundColor = Y.Format.CSS.format(t10.color) || ``, this._pickedColorNode.classList.toggle(`light`, t10.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : t10.color.isLighter()), this.onDidChangeColor(this.model.color), this.type === `standalone` && (this._domNode.classList.add(`standalone-colorpicker`), this._closeButton = this._register(new DCe(this._domNode)));
  }
  get closeButton() {
    return this._closeButton;
  }
  get pickedColorNode() {
    return this._pickedColorNode;
  }
  get originalColorNode() {
    return this._originalColorNode;
  }
  onDidChangeColor(e206) {
    this._pickedColorNode.style.backgroundColor = Y.Format.CSS.format(e206) || ``, this._pickedColorNode.classList.toggle(`light`, e206.rgba.a < 0.5 ? this.backgroundColor.isLighter() : e206.isLighter()), this.onDidChangePresentation();
  }
  onDidChangePresentation() {
    this._pickedColorPresentation.textContent = this.model.presentation ? this.model.presentation.label : ``;
  }
}, kCe = B, MQ = class extends rx {
  constructor(e206, t10, n10, r10, i10) {
    super(), this.model = t10, this.pixelRatio = n10, this._register(mu.getInstance(Vc(e206)).onDidChange(() => this.layout())), this._domNode = kCe(`.colorpicker-widget`), e206.appendChild(this._domNode), this.header = this._register(new OCe(this._domNode, this.model, r10, i10)), this.body = this._register(new TCe(this._domNode, this.model, this.pixelRatio, i10));
  }
  layout() {
    this.body.layout();
  }
  get domNode() {
    return this._domNode;
  }
}, ACe = class {
  get color() {
    return this._color;
  }
  set color(e206) {
    this._color.equals(e206) || (this._color = e206, this._onDidChangeColor.fire(e206));
  }
  get presentation() {
    return this.colorPresentations[this.presentationIndex];
  }
  get colorPresentations() {
    return this._colorPresentations;
  }
  set colorPresentations(e206) {
    this._colorPresentations = e206, this.presentationIndex > e206.length - 1 && (this.presentationIndex = 0), this._onDidChangePresentation.fire(this.presentation);
  }
  constructor(e206, t10, n10) {
    this.presentationIndex = n10, this._onColorFlushed = new k(), this.onColorFlushed = this._onColorFlushed.event, this._onDidChangeColor = new k(), this.onDidChangeColor = this._onDidChangeColor.event, this._onDidChangePresentation = new k(), this.onDidChangePresentation = this._onDidChangePresentation.event, this.originalColor = e206, this._color = e206, this._colorPresentations = t10;
  }
  selectNextColorPresentation() {
    this.presentationIndex = (this.presentationIndex + 1) % this.colorPresentations.length, this.flushColor(), this._onDidChangePresentation.fire(this.presentation);
  }
  guessColorPresentation(e206, t10) {
    let n10 = -1;
    for (let e207 = 0; e207 < this.colorPresentations.length; e207++) if (t10.toLowerCase() === this.colorPresentations[e207].label) {
      n10 = e207;
      break;
    }
    if (n10 === -1) {
      let e207 = t10.split(`(`)[0].toLowerCase();
      for (let t11 = 0; t11 < this.colorPresentations.length; t11++) if (this.colorPresentations[t11].label.toLowerCase().startsWith(e207)) {
        n10 = t11;
        break;
      }
    }
    n10 !== -1 && n10 !== this.presentationIndex && (this.presentationIndex = n10, this._onDidChangePresentation.fire(this.presentation));
  }
  flushColor() {
    this._onColorFlushed.fire(this._color);
  }
};
async function NQ(e206, t10, n10) {
  let r10 = e206.getValueInRange(t10.range), { red: i10, green: a10, blue: o10, alpha: s10 } = t10.color, c10 = new Y(new J(Math.round(i10 * 255), Math.round(a10 * 255), Math.round(o10 * 255), s10)), l10 = await eZ(e206, t10, n10, dr.None), u10 = new ACe(c10, [], 0);
  return u10.colorPresentations = l10 || [], u10.guessColorPresentation(c10, r10), { range: M.lift(t10.range), model: u10, provider: n10 };
}
function PQ(e206, t10, n10) {
  let r10 = [], i10 = n10.presentation.textEdit ?? { range: t10, text: n10.presentation.label, forceMoveMarkers: false };
  r10.push(i10), n10.presentation.additionalTextEdits && r10.push(...n10.presentation.additionalTextEdits);
  let a10 = M.lift(i10.range), o10 = e206.getModel()._setTrackedRange(null, a10, 3);
  return e206.executeEdits(`colorpicker`, r10), e206.pushUndoStop(), e206.getModel()._getTrackedRange(o10) ?? a10;
}
async function FQ(e206, t10, n10, r10, i10) {
  t10.colorPresentations = await eZ(e206, { range: r10, color: { red: n10.rgba.r / 255, green: n10.rgba.g / 255, blue: n10.rgba.b / 255, alpha: n10.rgba.a } }, i10.provider, dr.None) || [];
}
var jCe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, MCe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, IQ = class e179 {
  constructor(e206, t10, n10, r10) {
    this.owner = e206, this.range = t10, this.model = n10, this.provider = r10, this.forceShowAtRange = true;
  }
  isValidForHoverAnchor(e206) {
    return e206.type === 1 && this.range.startColumn <= e206.range.startColumn && this.range.endColumn >= e206.range.endColumn;
  }
  static fromBaseColor(t10, n10) {
    return new e179(t10, n10.range, n10.model, n10.provider);
  }
}, LQ = class {
  constructor(e206, t10) {
    this._editor = e206, this._themeService = t10, this.hoverOrdinal = 2;
  }
  computeSync(e206, t10, n10) {
    return [];
  }
  computeAsync(e206, t10, n10, r10) {
    return ys.fromPromise(this._computeAsync(e206, t10, n10));
  }
  async _computeAsync(e206, t10, n10) {
    if (!this._editor.hasModel() || !this._isValidRequest(n10)) return [];
    let r10 = oZ.get(this._editor);
    if (!r10) return [];
    for (let e207 of t10) {
      if (!r10.isColorDecoration(e207)) continue;
      let t11 = r10.getColorData(e207.range.getStartPosition());
      if (t11) return [IQ.fromBaseColor(this, await NQ(this._editor.getModel(), t11.colorInfo, t11.provider))];
    }
    return [];
  }
  _isValidRequest(e206) {
    let t10 = this._editor.getOption(168);
    switch (e206) {
      case 0:
        return t10 === `hover` || t10 === `clickAndHover`;
      case 1:
        return t10 === `click` || t10 === `clickAndHover`;
      case 2:
        return true;
    }
  }
  renderHoverParts(e206, t10) {
    let n10 = this._editor;
    if (t10.length === 0 || !n10.hasModel()) return new qX([]);
    let r10 = n10.getOption(75) + 8;
    e206.setMinimumDimensions(new ml(302, r10));
    let i10 = new E(), a10 = t10[0], o10 = n10.getModel(), s10 = a10.model;
    this._colorPicker = i10.add(new MQ(e206.fragment, s10, n10.getOption(163), this._themeService, `hover`));
    let c10 = false, l10 = new M(a10.range.startLineNumber, a10.range.startColumn, a10.range.endLineNumber, a10.range.endColumn);
    return i10.add(s10.onColorFlushed(async (e207) => {
      await FQ(o10, s10, e207, l10, a10), c10 = true, l10 = PQ(n10, l10, s10);
    })), i10.add(s10.onDidChangeColor((e207) => {
      FQ(o10, s10, e207, l10, a10);
    })), i10.add(n10.onDidChangeModelContent((t11) => {
      c10 ? c10 = false : (e206.hide(), n10.focus());
    })), new qX([{ hoverPart: IQ.fromBaseColor(this, a10), hoverElement: this._colorPicker.domNode, dispose() {
      i10.dispose();
    } }]);
  }
  getAccessibleContent(e206) {
    return C(887, `There is a color picker here.`);
  }
  handleResize() {
    this._colorPicker?.layout();
  }
  handleContentsChanged() {
    this._colorPicker?.layout();
  }
  handleHide() {
    this._colorPicker?.dispose(), this._colorPicker = void 0;
  }
  isColorPickerVisible() {
    return !!this._colorPicker;
  }
};
LQ = jCe([MCe(1, US)], LQ);
function RQ(e206, t10) {
  return !!e206[t10];
}
var zQ = class {
  constructor(e206, t10) {
    this.target = e206.target, this.isLeftClick = e206.event.leftButton, this.isMiddleClick = e206.event.middleButton, this.isRightClick = e206.event.rightButton, this.mouseMiddleClickAction = t10.mouseMiddleClickAction, this.hasTriggerModifier = RQ(e206.event, t10.triggerModifier), this.isMiddleClick && t10.mouseMiddleClickAction === `ctrlLeftClick` && (this.isMiddleClick = false, this.isLeftClick = true, this.hasTriggerModifier = true), this.hasSideBySideModifier = RQ(e206.event, t10.triggerSideBySideModifier), this.isNoneOrSingleMouseDown = e206.event.detail <= 1;
  }
}, BQ = class {
  constructor(e206, t10) {
    this.keyCodeIsTriggerKey = e206.keyCode === t10.triggerKey, this.keyCodeIsSideBySideKey = e206.keyCode === t10.triggerSideBySideKey, this.hasTriggerModifier = RQ(e206, t10.triggerModifier);
  }
}, VQ = class {
  constructor(e206, t10, n10, r10, i10) {
    this.mouseMiddleClickAction = i10, this.triggerKey = e206, this.triggerModifier = t10, this.triggerSideBySideKey = n10, this.triggerSideBySideModifier = r10;
  }
  equals(e206) {
    return this.triggerKey === e206.triggerKey && this.triggerModifier === e206.triggerModifier && this.triggerSideBySideKey === e206.triggerSideBySideKey && this.triggerSideBySideModifier === e206.triggerSideBySideModifier && this.mouseMiddleClickAction === e206.mouseMiddleClickAction;
  }
};
function HQ(e206, t10) {
  return e206 === `altKey` ? Tt ? new VQ(57, `metaKey`, 6, `altKey`, t10) : new VQ(5, `ctrlKey`, 6, `altKey`, t10) : Tt ? new VQ(6, `altKey`, 57, `metaKey`, t10) : new VQ(6, `altKey`, 5, `ctrlKey`, t10);
}
var UQ = class extends D {
  constructor(e206, t10) {
    super(), this._onMouseMoveOrRelevantKeyDown = this._register(new k()), this.onMouseMoveOrRelevantKeyDown = this._onMouseMoveOrRelevantKeyDown.event, this._onExecute = this._register(new k()), this.onExecute = this._onExecute.event, this._onCancel = this._register(new k()), this.onCancel = this._onCancel.event, this._editor = e206, this._extractLineNumberFromMouseEvent = t10?.extractLineNumberFromMouseEvent ?? ((e207) => e207.target.position ? e207.target.position.lineNumber : 0), this._opts = HQ(this._editor.getOption(86), this._editor.getOption(87)), this._lastMouseMoveEvent = null, this._hasTriggerKeyOnMouseDown = false, this._lineNumberOnMouseDown = 0, this._register(this._editor.onDidChangeConfiguration((e207) => {
      if (e207.hasChanged(86) || e207.hasChanged(87)) {
        let e208 = HQ(this._editor.getOption(86), this._editor.getOption(87));
        if (this._opts.equals(e208)) return;
        this._opts = e208, this._lastMouseMoveEvent = null, this._hasTriggerKeyOnMouseDown = false, this._lineNumberOnMouseDown = 0, this._onCancel.fire();
      }
    })), this._register(this._editor.onMouseMove((e207) => this._onEditorMouseMove(new zQ(e207, this._opts)))), this._register(this._editor.onMouseDown((e207) => this._onEditorMouseDown(new zQ(e207, this._opts)))), this._register(this._editor.onMouseUp((e207) => this._onEditorMouseUp(new zQ(e207, this._opts)))), this._register(this._editor.onKeyDown((e207) => this._onEditorKeyDown(new BQ(e207, this._opts)))), this._register(this._editor.onKeyUp((e207) => this._onEditorKeyUp(new BQ(e207, this._opts)))), this._register(this._editor.onMouseDrag(() => this._resetHandler())), this._register(this._editor.onDidChangeCursorSelection((e207) => this._onDidChangeCursorSelection(e207))), this._register(this._editor.onDidChangeModel((e207) => this._resetHandler())), this._register(this._editor.onDidChangeModelContent(() => this._resetHandler())), this._register(this._editor.onDidScrollChange((e207) => {
      (e207.scrollTopChanged || e207.scrollLeftChanged) && this._resetHandler();
    }));
  }
  _onDidChangeCursorSelection(e206) {
    e206.selection && e206.selection.startColumn !== e206.selection.endColumn && this._resetHandler();
  }
  _onEditorMouseMove(e206) {
    this._lastMouseMoveEvent = e206, this._onMouseMoveOrRelevantKeyDown.fire([e206, null]);
  }
  _onEditorMouseDown(e206) {
    this._hasTriggerKeyOnMouseDown = e206.hasTriggerModifier, this._lineNumberOnMouseDown = this._extractLineNumberFromMouseEvent(e206);
  }
  _onEditorMouseUp(e206) {
    let t10 = this._extractLineNumberFromMouseEvent(e206);
    this._lineNumberOnMouseDown && this._lineNumberOnMouseDown === t10 && (this._hasTriggerKeyOnMouseDown || e206.isMiddleClick && e206.mouseMiddleClickAction === `openLink`) && this._onExecute.fire(e206);
  }
  _onEditorKeyDown(e206) {
    this._lastMouseMoveEvent && (e206.keyCodeIsTriggerKey || e206.keyCodeIsSideBySideKey && e206.hasTriggerModifier) ? this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent, e206]) : e206.hasTriggerModifier && this._onCancel.fire();
  }
  _onEditorKeyUp(e206) {
    e206.keyCodeIsTriggerKey && this._onCancel.fire();
  }
  _resetHandler() {
    this._lastMouseMoveEvent = null, this._hasTriggerKeyOnMouseDown = false, this._onCancel.fire();
  }
}, WQ = class {
  constructor(e206, t10) {
    this.range = e206, this.direction = t10;
  }
}, NCe = class e180 {
  constructor(e206, t10, n10) {
    this.hint = e206, this.anchor = t10, this.provider = n10, this._isResolved = false;
  }
  with(t10) {
    let n10 = new e180(this.hint, t10.anchor, this.provider);
    return n10._isResolved = this._isResolved, n10._currentResolve = this._currentResolve, n10;
  }
  async resolve(e206) {
    if (typeof this.provider.resolveInlayHint == `function`) {
      if (this._currentResolve) return await this._currentResolve, e206.isCancellationRequested ? void 0 : this.resolve(e206);
      this._isResolved || (this._currentResolve = this._doResolve(e206).finally(() => this._currentResolve = void 0)), await this._currentResolve;
    }
  }
  async _doResolve(e206) {
    try {
      let t10 = await Promise.resolve(this.provider.resolveInlayHint(this.hint, e206));
      this.hint.tooltip = t10?.tooltip ?? this.hint.tooltip, this.hint.label = t10?.label ?? this.hint.label, this.hint.textEdits = t10?.textEdits ?? this.hint.textEdits, this._isResolved = true;
    } catch (e207) {
      xe(e207), this._isResolved = false;
    }
  }
}, GQ = (_ac = class {
  static async create(t10, n10, r10, i10) {
    let a10 = [], o10 = t10.ordered(n10).reverse().map((t11) => r10.map(async (r11) => {
      try {
        let o11 = await t11.provideInlayHints(n10, r11, i10);
        (o11?.hints.length || t11.onDidChangeInlayHints) && a10.push([o11 ?? _ac._emptyInlayHintList, t11]);
      } catch (e206) {
        xe(e206);
      }
    }));
    if (await Promise.all(o10.flat()), i10.isCancellationRequested || n10.isDisposed()) throw new Te();
    return new _ac(r10, a10, n10);
  }
  constructor(t10, n10, r10) {
    this._disposables = new E(), this.ranges = t10, this.provider = /* @__PURE__ */ new Set();
    let i10 = [];
    for (let [t11, a10] of n10) {
      this._disposables.add(t11), this.provider.add(a10);
      for (let n11 of t11.hints) {
        let t12 = r10.validatePosition(n11.position), o10 = `before`, s10 = _ac._getRangeAtPosition(r10, t12), c10;
        s10.getStartPosition().isBefore(t12) ? (c10 = M.fromPositions(s10.getStartPosition(), t12), o10 = `after`) : (c10 = M.fromPositions(t12, s10.getEndPosition()), o10 = `before`), i10.push(new NCe(n11, new WQ(c10, o10), a10));
      }
    }
    this.items = i10.sort((e206, t11) => j.compare(e206.hint.position, t11.hint.position));
  }
  dispose() {
    this._disposables.dispose();
  }
  static _getRangeAtPosition(e206, t10) {
    let n10 = t10.lineNumber, r10 = e206.getWordAtPosition(t10);
    if (r10) return new M(n10, r10.startColumn, n10, r10.endColumn);
    e206.tokenization.tokenizeIfCheap(n10);
    let i10 = e206.tokenization.getLineTokens(n10), a10 = t10.column - 1, o10 = i10.findTokenIndexAtOffset(a10), s10 = i10.getStartOffset(o10), c10 = i10.getEndOffset(o10);
    return c10 - s10 === 1 && (s10 === a10 && o10 > 1 ? (s10 = i10.getStartOffset(o10 - 1), c10 = i10.getEndOffset(o10 - 1)) : c10 === a10 && o10 < i10.getCount() - 1 && (s10 = i10.getStartOffset(o10 + 1), c10 = i10.getEndOffset(o10 + 1))), new M(n10, s10 + 1, n10, c10 + 1);
  }
}, _ac._emptyInlayHintList = Object.freeze({ dispose() {
}, hints: [] }), _ac);
function PCe(e206) {
  return zM(e206.id, ...e206.arguments ?? []).toString();
}
var FCe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, KQ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, qQ = class extends Mk {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10) {
    super(e206, { ...r10.getRawOptions(), overflowWidgetsDomNode: r10.getOverflowWidgetsDomNode() }, n10, i10, a10, o10, s10, c10, l10, u10, d10, f10), this._parentEditor = r10, this._overwriteOptions = t10, super.updateOptions(this._overwriteOptions), this._register(r10.onDidChangeConfiguration((e207) => this._onParentConfigurationChanged(e207)));
  }
  getParentEditor() {
    return this._parentEditor;
  }
  _onParentConfigurationChanged(e206) {
    super.updateOptions(this._parentEditor.getRawOptions()), super.updateOptions(this._overwriteOptions);
  }
  updateOptions(e206) {
    at(this._overwriteOptions, e206, true), super.updateOptions(this._overwriteOptions);
  }
};
qQ = FCe([KQ(4, V), KQ(5, Su), KQ(6, Mu), KQ(7, nd), KQ(8, US), KQ(9, dw), KQ(10, e_), KQ(11, bp), KQ(12, X)], qQ);
function JQ(e206) {
  let t10 = e206.get(Su).getFocusedCodeEditor();
  return t10 instanceof qQ ? t10.getParentEditor() : t10;
}
var YQ = new Y(new J(0, 122, 204)), ICe = { showArrow: true, showFrame: true, className: ``, frameColor: YQ, arrowColor: YQ, keepEditorSelection: false }, LCe = `vs.editor.contrib.zoneWidget`, RCe = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this.id = ``, this.domNode = e206, this.afterLineNumber = t10, this.afterColumn = n10, this.heightInLines = r10, this.showInHiddenAreas = o10, this.ordinal = s10, this._onDomNodeTop = i10, this._onComputedHeight = a10;
  }
  onDomNodeTop(e206) {
    this._onDomNodeTop(e206);
  }
  onComputedHeight(e206) {
    this._onComputedHeight(e206);
  }
}, zCe = class {
  constructor(e206, t10) {
    this._id = e206, this._domNode = t10;
  }
  getId() {
    return this._id;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return null;
  }
}, BCe = (_bc = class {
  constructor(t10) {
    this._editor = t10, this._ruleName = _bc._IdGenerator.nextId(), this._color = null, this._height = -1, this._decorations = this._editor.createDecorationsCollection();
  }
  dispose() {
    this.hide(), S_(this._ruleName);
  }
  set color(e206) {
    this._color !== e206 && (this._color = e206, this._updateStyle());
  }
  set height(e206) {
    this._height !== e206 && (this._height = e206, this._updateStyle());
  }
  _updateStyle() {
    S_(this._ruleName), x_(`.monaco-editor ${this._ruleName}`, `border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `);
  }
  show(e206) {
    e206.column === 1 && (e206 = { lineNumber: e206.lineNumber, column: 2 }), this._decorations.set([{ range: M.fromPositions(e206), options: { description: `zone-widget-arrow`, className: this._ruleName, stickiness: 1 } }]);
  }
  hide() {
    this._decorations.clear();
  }
}, _bc._IdGenerator = new BM(`.arrow-decoration-`), _bc), VCe = class {
  constructor(e206, t10 = {}) {
    this._arrow = null, this._overlayWidget = null, this._resizeSash = null, this._isSashResizeHeight = false, this._viewZone = null, this._disposables = new E(), this.container = null, this._isShowing = false, this.editor = e206, this._positionMarkerId = this.editor.createDecorationsCollection(), this.options = et(t10), at(this.options, ICe, false), this.domNode = document.createElement(`div`), this.options.isAccessible || (this.domNode.setAttribute(`aria-hidden`, `true`), this.domNode.setAttribute(`role`, `presentation`)), this._disposables.add(this.editor.onDidLayoutChange((e207) => {
      let t11 = this._getWidth(e207);
      this.domNode.style.width = t11 + `px`, this.domNode.style.left = this._getLeft(e207) + `px`, this._onWidth(t11);
    }));
  }
  dispose() {
    this._overlayWidget && (this._overlayWidget = (this.editor.removeOverlayWidget(this._overlayWidget), null)), this._viewZone && this.editor.changeViewZones((e206) => {
      this._viewZone && e206.removeZone(this._viewZone.id), this._viewZone = null;
    }), this._positionMarkerId.clear(), this._disposables.dispose();
  }
  create() {
    this.domNode.classList.add(`zone-widget`), this.options.className && this.domNode.classList.add(this.options.className), this.container = document.createElement(`div`), this.container.classList.add(`zone-widget-container`), this.domNode.appendChild(this.container), this.options.showArrow && (this._arrow = new BCe(this.editor), this._disposables.add(this._arrow)), this._fillContainer(this.container), this._initSash(), this._applyStyles();
  }
  style(e206) {
    e206.frameColor && (this.options.frameColor = e206.frameColor), e206.arrowColor && (this.options.arrowColor = e206.arrowColor), this._applyStyles();
  }
  _applyStyles() {
    if (this.container && this.options.frameColor) {
      let e206 = this.options.frameColor.toString();
      this.container.style.borderTopColor = e206, this.container.style.borderBottomColor = e206;
    }
    if (this._arrow && this.options.arrowColor) {
      let e206 = this.options.arrowColor.toString();
      this._arrow.color = e206;
    }
  }
  _getWidth(e206) {
    return e206.width - e206.minimap.minimapWidth - e206.verticalScrollbarWidth;
  }
  _getLeft(e206) {
    return e206.minimap.minimapWidth > 0 && e206.minimap.minimapLeft === 0 ? e206.minimap.minimapWidth : 0;
  }
  _onViewZoneTop(e206) {
    this.domNode.style.top = e206 + `px`;
  }
  _onViewZoneHeight(e206) {
    if (this.domNode.style.height = `${e206}px`, this.container) {
      let t10 = e206 - this._decoratingElementsHeight();
      this.container.style.height = `${t10}px`;
      let n10 = this.editor.getLayoutInfo();
      this._doLayout(t10, this._getWidth(n10));
    }
    this._resizeSash?.layout();
  }
  get position() {
    let e206 = this._positionMarkerId.getRange(0);
    if (e206) return e206.getStartPosition();
  }
  show(e206, t10) {
    let n10 = M.isIRange(e206) ? M.lift(e206) : M.fromPositions(e206);
    this._isShowing = true, this._showImpl(n10, t10), this._isShowing = false, this._positionMarkerId.set([{ range: n10, options: UO.EMPTY }]);
  }
  hide() {
    this._viewZone && (this._viewZone = (this.editor.changeViewZones((e206) => {
      this._viewZone && e206.removeZone(this._viewZone.id);
    }), null)), this._overlayWidget && (this._overlayWidget = (this.editor.removeOverlayWidget(this._overlayWidget), null)), this._arrow?.hide(), this._positionMarkerId.clear(), this._isSashResizeHeight = false;
  }
  _decoratingElementsHeight() {
    let e206 = this.editor.getOption(75), t10 = 0;
    if (this.options.showArrow) {
      let n10 = Math.round(e206 / 3);
      t10 += 2 * n10;
    }
    if (this.options.showFrame) {
      let n10 = this.options.frameWidth ?? Math.round(e206 / 9);
      t10 += 2 * n10;
    }
    return t10;
  }
  _getMaximumHeightInLines() {
    return Math.max(12, this.editor.getLayoutInfo().height / this.editor.getOption(75) * 0.8);
  }
  _showImpl(e206, t10) {
    let n10 = e206.getStartPosition(), r10 = this.editor.getLayoutInfo(), i10 = this._getWidth(r10);
    this.domNode.style.width = `${i10}px`, this.domNode.style.left = this._getLeft(r10) + `px`;
    let a10 = document.createElement(`div`);
    a10.style.overflow = `hidden`;
    let o10 = this.editor.getOption(75), s10 = this._getMaximumHeightInLines();
    s10 !== void 0 && (t10 = Math.min(t10, s10));
    let c10 = 0, l10 = 0;
    if (this._arrow && this.options.showArrow && (c10 = Math.round(o10 / 3), this._arrow.height = c10, this._arrow.show(n10)), this.options.showFrame && (l10 = Math.round(o10 / 9)), this.editor.changeViewZones((e207) => {
      this._viewZone && e207.removeZone(this._viewZone.id), this._overlayWidget && (this._overlayWidget = (this.editor.removeOverlayWidget(this._overlayWidget), null)), this.domNode.style.top = `-1000px`, this._viewZone = new RCe(a10, n10.lineNumber, n10.column, t10, (e208) => this._onViewZoneTop(e208), (e208) => this._onViewZoneHeight(e208), this.options.showInHiddenAreas, this.options.ordinal), this._viewZone.id = e207.addZone(this._viewZone), this._overlayWidget = new zCe(LCe + this._viewZone.id, this.domNode), this.editor.addOverlayWidget(this._overlayWidget);
    }), this._updateSashEnablement(), this.container && this.options.showFrame) {
      let e207 = this.options.frameWidth ? this.options.frameWidth : l10;
      this.container.style.borderTopWidth = e207 + `px`, this.container.style.borderBottomWidth = e207 + `px`;
    }
    let u10 = t10 * o10 - this._decoratingElementsHeight();
    this.container && (this.container.style.top = c10 + `px`, this.container.style.height = u10 + `px`, this.container.style.overflow = `hidden`), this._doLayout(u10, i10), this.options.keepEditorSelection || this.editor.setSelection(e206);
    let d10 = this.editor.getModel();
    if (d10) {
      let t11 = d10.validateRange(new M(e206.startLineNumber, 1, e206.endLineNumber + 1, 1));
      this.revealRange(t11, t11.startLineNumber === d10.getLineCount());
    }
  }
  revealRange(e206, t10) {
    t10 ? this.editor.revealLineNearTop(e206.endLineNumber, 0) : this.editor.revealRange(e206, 0);
  }
  setCssClass(e206, t10) {
    this.container && (t10 && this.container.classList.remove(t10), this.container.classList.add(e206));
  }
  _onWidth(e206) {
  }
  _doLayout(e206, t10) {
  }
  _relayout(e206, t10) {
    let n10 = this._getMaximumHeightInLines(), r10 = t10 && n10 !== void 0 ? Math.min(n10, e206) : e206;
    this._viewZone && this._viewZone.heightInLines !== r10 && (this.editor.changeViewZones((e207) => {
      this._viewZone && (this._viewZone.heightInLines = r10, e207.layoutZone(this._viewZone.id));
    }), this._updateSashEnablement());
  }
  _initSash() {
    if (this._resizeSash) return;
    this._resizeSash = this._disposables.add(new nB(this.domNode, this, { orientation: 1 })), this.options.isResizeable || (this._resizeSash.state = 0);
    let e206;
    this._disposables.add(this._resizeSash.onDidStart((t10) => {
      this._viewZone && (e206 = { startY: t10.startY, heightInLines: this._viewZone.heightInLines, ...this._getResizeBounds() });
    })), this._disposables.add(this._resizeSash.onDidEnd(() => {
      e206 = void 0;
    })), this._disposables.add(this._resizeSash.onDidChange((t10) => {
      if (e206) {
        let n10 = (t10.currentY - e206.startY) / this.editor.getOption(75), r10 = n10 < 0 ? Math.ceil(n10) : Math.floor(n10), i10 = e206.heightInLines + r10;
        i10 > e206.minLines && i10 < e206.maxLines && (this._isSashResizeHeight = true, this._relayout(i10));
      }
    }));
  }
  _updateSashEnablement() {
    if (this._resizeSash) {
      let { minLines: e206, maxLines: t10 } = this._getResizeBounds();
      this._resizeSash.state = e206 === t10 ? 0 : 3;
    }
  }
  _getResizeBounds() {
    return { minLines: 5, maxLines: 35 };
  }
  getHorizontalSashLeft() {
    return 0;
  }
  getHorizontalSashTop() {
    return (this.domNode.style.height === null ? 0 : parseInt(this.domNode.style.height)) - this._decoratingElementsHeight() / 2;
  }
  getHorizontalSashWidth() {
    let e206 = this.editor.getLayoutInfo();
    return e206.width - e206.minimap.minimapWidth;
  }
}, XQ = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, ZQ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, QQ = xu(`IPeekViewService`);
Zf(QQ, class {
  constructor() {
    this._widgets = /* @__PURE__ */ new Map();
  }
  addExclusiveWidget(e206, t10) {
    let n10 = this._widgets.get(e206);
    n10 && (n10.listener.dispose(), n10.widget.dispose()), this._widgets.set(e206, { widget: t10, listener: t10.onDidClose(() => {
      let n11 = this._widgets.get(e206);
      n11 && n11.widget === t10 && (n11.listener.dispose(), this._widgets.delete(e206));
    }) });
  }
}, 1);
var $Q;
(function(e206) {
  e206.inPeekEditor = new U(`inReferenceSearchEditor`, true, C(1316, `Whether the current code editor is embedded inside peek`)), e206.notInPeekEditor = e206.inPeekEditor.toNegated();
})($Q || ($Q = {}));
var e$ = (_cc = class {
  constructor(e206, t10) {
    e206 instanceof qQ && $Q.inPeekEditor.bindTo(t10);
  }
  dispose() {
  }
}, _cc.ID = `editor.contrib.referenceController`, _cc);
e$ = XQ([ZQ(1, nd)], e$), af(e$.ID, e$, 0);
var HCe = { headerBackgroundColor: Y.white, primaryHeadingColor: Y.fromHex(`#333333`), secondaryHeadingColor: Y.fromHex(`#6c6c6cb3`) }, t$ = class extends VCe {
  constructor(e206, t10, n10) {
    super(e206, t10), this.instantiationService = n10, this._onDidClose = new k(), this.onDidClose = this._onDidClose.event, at(this.options, HCe, false);
    let r10 = WK(this.editor);
    r10.openedPeekWidgets.set(r10.openedPeekWidgets.get() + 1, void 0);
  }
  dispose() {
    if (!this.disposed) {
      this.disposed = true, super.dispose(), this._onDidClose.fire(this);
      let e206 = WK(this.editor);
      e206.openedPeekWidgets.set(e206.openedPeekWidgets.get() - 1, void 0);
    }
  }
  style(e206) {
    let t10 = this.options;
    e206.headerBackgroundColor && (t10.headerBackgroundColor = e206.headerBackgroundColor), e206.primaryHeadingColor && (t10.primaryHeadingColor = e206.primaryHeadingColor), e206.secondaryHeadingColor && (t10.secondaryHeadingColor = e206.secondaryHeadingColor), super.style(e206);
  }
  _applyStyles() {
    super._applyStyles();
    let e206 = this.options;
    this._headElement && e206.headerBackgroundColor && (this._headElement.style.backgroundColor = e206.headerBackgroundColor.toString()), this._primaryHeading && e206.primaryHeadingColor && (this._primaryHeading.style.color = e206.primaryHeadingColor.toString()), this._secondaryHeading && e206.secondaryHeadingColor && (this._secondaryHeading.style.color = e206.secondaryHeadingColor.toString()), this._bodyElement && e206.frameColor && (this._bodyElement.style.borderColor = e206.frameColor.toString());
  }
  _fillContainer(e206) {
    this.setCssClass(`peekview-widget`), this._headElement = B(`.head`), this._bodyElement = B(`.body`), this._fillHead(this._headElement), this._fillBody(this._bodyElement), e206.appendChild(this._headElement), e206.appendChild(this._bodyElement);
  }
  _fillHead(e206, t10) {
    this._titleElement = B(`.peekview-title`), this.options.supportOnTitleClick && (this._titleElement.classList.add(`clickable`), el(this._titleElement, `click`, (e207) => this._onTitleClick(e207))), z(this._headElement, this._titleElement), this._fillTitleIcon(this._titleElement), this._primaryHeading = B(`span.filename`), this._secondaryHeading = B(`span.dirname`), this._metaHeading = B(`span.meta`), z(this._titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading);
    let n10 = B(`.peekview-actions`);
    z(this._headElement, n10), this._actionbarWidget = new CL(n10, this._getActionBarOptions()), this._disposables.add(this._actionbarWidget), t10 || this._actionbarWidget.push(this._disposables.add(new Tu(`peekview.close`, C(1317, `Close`), ju.asClassName(F.close), true, () => (this.dispose(), Promise.resolve()))), { label: false, icon: true });
  }
  _fillTitleIcon(e206) {
  }
  _getActionBarOptions() {
    return { actionViewItemProvider: SL.bind(void 0, this.instantiationService), orientation: 0 };
  }
  _onTitleClick(e206) {
  }
  setTitle(e206, t10) {
    this._primaryHeading && this._secondaryHeading && (this._primaryHeading.innerText = e206, this._primaryHeading.setAttribute(`title`, e206), t10 ? this._secondaryHeading.innerText = t10 : Xc(this._secondaryHeading));
  }
  setMetaTitle(e206) {
    this._metaHeading && (e206 ? (this._metaHeading.innerText = e206, Zl(this._metaHeading)) : Ql(this._metaHeading));
  }
  _doLayout(e206, t10) {
    if (!this._isShowing && e206 < 0) {
      this.dispose();
      return;
    }
    let n10 = Math.ceil(this.editor.getOption(75) * 1.2), r10 = Math.round(e206 - (n10 + 1));
    this._doLayoutHead(n10, t10), this._doLayoutBody(r10, t10);
  }
  _doLayoutHead(e206, t10) {
    this._headElement && (this._headElement.style.height = `${e206}px`, this._headElement.style.lineHeight = this._headElement.style.height);
  }
  _doLayoutBody(e206, t10) {
    this._bodyElement && (this._bodyElement.style.height = `${e206}px`);
  }
};
t$ = XQ([ZQ(2, V)], t$);
var UCe = Q(`peekViewTitle.background`, { dark: `#252526`, light: `#F3F3F3`, hcDark: Y.black, hcLight: Y.white }, C(1318, `Background color of the peek view title area.`)), n$ = Q(`peekViewTitleLabel.foreground`, { dark: Y.white, light: Y.black, hcDark: Y.white, hcLight: iv }, C(1319, `Color of the peek view title.`)), r$ = Q(`peekViewTitleDescription.foreground`, { dark: `#ccccccb3`, light: `#616161`, hcDark: `#FFFFFF99`, hcLight: `#292929` }, C(1320, `Color of the peek view title info.`)), WCe = Q(`peekView.border`, { dark: pv, light: pv, hcDark: q_, hcLight: q_ }, C(1321, `Color of the peek view borders and arrow.`)), GCe = Q(`peekViewResult.background`, { dark: `#252526`, light: `#F3F3F3`, hcDark: Y.black, hcLight: Y.white }, C(1322, `Background color of the peek view result list.`));
Q(`peekViewResult.lineForeground`, { dark: `#bbbbbb`, light: `#646465`, hcDark: Y.white, hcLight: iv }, C(1323, `Foreground color for line nodes in the peek view result list.`)), Q(`peekViewResult.fileForeground`, { dark: Y.white, light: `#1E1E1E`, hcDark: Y.white, hcLight: iv }, C(1324, `Foreground color for file nodes in the peek view result list.`)), Q(`peekViewResult.selectionBackground`, { dark: `#3399ff33`, light: `#3399ff33`, hcDark: null, hcLight: null }, C(1325, `Background color of the selected entry in the peek view result list.`)), Q(`peekViewResult.selectionForeground`, { dark: Y.white, light: `#6C6C6C`, hcDark: Y.white, hcLight: iv }, C(1326, `Foreground color of the selected entry in the peek view result list.`));
var i$ = Q(`peekViewEditor.background`, { dark: `#001F33`, light: `#F2F8FC`, hcDark: Y.black, hcLight: Y.white }, C(1327, `Background color of the peek view editor.`));
Q(`peekViewEditorGutter.background`, i$, C(1328, `Background color of the gutter in the peek view editor.`)), Q(`peekViewEditorStickyScroll.background`, i$, C(1329, `Background color of sticky scroll in the peek view editor.`)), Q(`peekViewEditorStickyScrollGutter.background`, i$, C(1330, `Background color of the gutter part of sticky scroll in the peek view editor.`)), Q(`peekViewResult.matchHighlightBackground`, { dark: `#ea5c004d`, light: `#ea5c004d`, hcDark: null, hcLight: null }, C(1331, `Match highlight color in the peek view result list.`)), Q(`peekViewEditor.matchHighlightBackground`, { dark: `#ff8f0099`, light: `#f5d802de`, hcDark: null, hcLight: null }, C(1332, `Match highlight color in the peek view editor.`)), Q(`peekViewEditor.matchHighlightBorder`, { dark: null, light: null, hcDark: J_, hcLight: J_ }, C(1333, `Match highlight border in the peek view editor.`));
var a$ = class {
  constructor(e206, t10, n10, r10) {
    this.isProviderFirst = e206, this.parent = t10, this.link = n10, this._rangeCallback = r10, this.id = VM.nextId();
  }
  get uri() {
    return this.link.uri;
  }
  get range() {
    return this._range ?? this.link.targetSelectionRange ?? this.link.range;
  }
  set range(e206) {
    this._range = e206, this._rangeCallback(this);
  }
  get ariaMessage() {
    let e206 = this.parent.getPreview(this)?.preview(this.range);
    return e206 ? C(1088, `{0} in {1} on line {2} at column {3}`, e206.value, Id(this.uri), this.range.startLineNumber, this.range.startColumn) : C(1087, `in {0} on line {1} at column {2}`, Id(this.uri), this.range.startLineNumber, this.range.startColumn);
  }
}, KCe = class {
  constructor(e206) {
    this._modelReference = e206;
  }
  dispose() {
    this._modelReference.dispose();
  }
  preview(e206, t10 = 8) {
    let n10 = this._modelReference.object.textEditorModel;
    if (!n10) return;
    let { startLineNumber: r10, startColumn: i10, endLineNumber: a10, endColumn: o10 } = e206, s10 = new M(r10, n10.getWordUntilPosition({ lineNumber: r10, column: i10 - t10 }).startColumn, r10, i10), c10 = new M(a10, o10, a10, 1073741824), l10 = n10.getValueInRange(s10).replace(/^\s+/, ``), u10 = n10.getValueInRange(e206), d10 = n10.getValueInRange(c10).replace(/\s+$/, ``);
    return { value: l10 + u10 + d10, highlight: { start: l10.length, end: l10.length + u10.length } };
  }
}, o$ = class {
  constructor(e206, t10) {
    this.parent = e206, this.uri = t10, this.children = [], this._previews = new wd();
  }
  dispose() {
    Kt(this._previews.values()), this._previews.clear();
  }
  getPreview(e206) {
    return this._previews.get(e206.uri);
  }
  get ariaMessage() {
    let e206 = this.children.length;
    return e206 === 1 ? C(1089, `1 symbol in {0}, full path {1}`, Id(this.uri), this.uri.fsPath) : C(1090, `{0} symbols in {1}, full path {2}`, e206, Id(this.uri), this.uri.fsPath);
  }
  async resolve(e206) {
    if (this._previews.size !== 0) return this;
    for (let t10 of this.children) if (!this._previews.has(t10.uri)) try {
      let n10 = await e206.createModelReference(t10.uri);
      this._previews.set(t10.uri, new KCe(n10));
    } catch (e207) {
      be(e207);
    }
    return this;
  }
}, s$ = class e181 {
  constructor(t10, n10) {
    this.groups = [], this.references = [], this._onDidChangeReferenceRange = new k(), this.onDidChangeReferenceRange = this._onDidChangeReferenceRange.event, this._links = t10, this._title = n10;
    let [r10] = t10;
    t10.sort(e181._compareReferences);
    let i10;
    for (let n11 of t10) if ((!i10 || !Pd.isEqual(i10.uri, n11.uri, true)) && (i10 = new o$(this, n11.uri), this.groups.push(i10)), i10.children.length === 0 || e181._compareReferences(n11, i10.children[i10.children.length - 1]) !== 0) {
      let e206 = new a$(r10 === n11, i10, n11, (e207) => this._onDidChangeReferenceRange.fire(e207));
      this.references.push(e206), i10.children.push(e206);
    }
  }
  dispose() {
    Kt(this.groups), this._onDidChangeReferenceRange.dispose(), this.groups.length = 0;
  }
  clone() {
    return new e181(this._links, this._title);
  }
  get title() {
    return this._title;
  }
  get isEmpty() {
    return this.groups.length === 0;
  }
  get ariaMessage() {
    return this.isEmpty ? C(1091, `No results found`) : this.references.length === 1 ? C(1092, `Found 1 symbol in {0}`, this.references[0].uri.fsPath) : this.groups.length === 1 ? C(1093, `Found {0} symbols in {1}`, this.references.length, this.groups[0].uri.fsPath) : C(1094, `Found {0} symbols in {1} files`, this.references.length, this.groups.length);
  }
  nextOrPreviousReference(e206, t10) {
    let { parent: n10 } = e206, r10 = n10.children.indexOf(e206), i10 = n10.children.length, a10 = n10.parent.groups.length;
    return a10 === 1 || t10 && r10 + 1 < i10 || !t10 && r10 > 0 ? (r10 = t10 ? (r10 + 1) % i10 : (r10 + i10 - 1) % i10, n10.children[r10]) : (r10 = n10.parent.groups.indexOf(n10), t10 ? (r10 = (r10 + 1) % a10, n10.parent.groups[r10].children[0]) : (r10 = (r10 + a10 - 1) % a10, n10.parent.groups[r10].children[n10.parent.groups[r10].children.length - 1]));
  }
  nearestReference(e206, t10) {
    let n10 = this.references.map((n11, r10) => ({ idx: r10, prefixLen: ro(n11.uri.toString(), e206.toString()), offsetDist: Math.abs(n11.range.startLineNumber - t10.lineNumber) * 100 + Math.abs(n11.range.startColumn - t10.column) })).sort((e207, t11) => e207.prefixLen > t11.prefixLen ? -1 : e207.prefixLen < t11.prefixLen ? 1 : e207.offsetDist < t11.offsetDist ? -1 : +(e207.offsetDist > t11.offsetDist))[0];
    if (n10) return this.references[n10.idx];
  }
  referenceAt(e206, t10) {
    for (let n10 of this.references) if (n10.uri.toString() === e206.toString() && M.containsPosition(n10.range, t10)) return n10;
  }
  firstReference() {
    for (let e206 of this.references) if (e206.isProviderFirst) return e206;
    return this.references[0];
  }
  static _compareReferences(e206, t10) {
    return Pd.compare(e206.uri, t10.uri) || M.compareRangesUsingStarts(e206.range, t10.range);
  }
}, c$ = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, l$ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, u$, d$ = class {
  constructor(e206) {
    this._resolverService = e206;
  }
  hasChildren(e206) {
    return e206 instanceof s$ || e206 instanceof o$;
  }
  getChildren(e206) {
    if (e206 instanceof s$) return e206.groups;
    if (e206 instanceof o$) return e206.resolve(this._resolverService).then((e207) => e207.children);
    throw Error(`bad tree`);
  }
};
d$ = c$([l$(0, wu)], d$);
var qCe = class {
  getHeight() {
    return 23;
  }
  getTemplateId(e206) {
    return e206 instanceof o$ ? m$.id : h$.id;
  }
}, f$ = class {
  constructor(e206) {
    this._keybindingService = e206;
  }
  getKeyboardNavigationLabel(e206) {
    if (e206 instanceof a$) {
      let t10 = e206.parent.getPreview(e206)?.preview(e206.range);
      if (t10) return t10.value;
    }
    return Id(e206.uri);
  }
};
f$ = c$([l$(0, Dw)], f$);
var JCe = class {
  getId(e206) {
    return e206 instanceof a$ ? e206.id : e206.uri;
  }
}, p$ = class extends D {
  constructor(e206, t10) {
    super(), this._labelService = t10;
    let n10 = document.createElement(`div`);
    n10.classList.add(`reference-file`), this.file = this._register(new KR(n10, { supportHighlights: true })), this.badge = this._register(new bR(z(n10, B(`.count`)), {}, lL)), e206.appendChild(n10);
  }
  set(e206, t10) {
    let n10 = Ld(e206.uri);
    this.file.setLabel(this._labelService.getUriBasenameLabel(e206.uri), this._labelService.getUriLabel(n10, { relative: true }), { title: this._labelService.getUriLabel(e206.uri), matches: t10 });
    let r10 = e206.children.length;
    this.badge.setCount(r10), r10 > 1 ? this.badge.setTitleFormat(C(1081, `{0} references`, r10)) : this.badge.setTitleFormat(C(1082, `{0} reference`, r10));
  }
};
p$ = c$([l$(1, BF)], p$);
var m$ = (_dc = class {
  constructor(e206) {
    this._instantiationService = e206, this.templateId = u$.id;
  }
  renderTemplate(e206) {
    return this._instantiationService.createInstance(p$, e206);
  }
  renderElement(e206, t10, n10) {
    n10.set(e206.element, uM(e206.filterData));
  }
  disposeTemplate(e206) {
    e206.dispose();
  }
}, u$ = _dc, _dc.id = `FileReferencesRenderer`, _dc);
m$ = u$ = c$([l$(0, V)], m$);
var YCe = class extends D {
  constructor(e206) {
    super(), this.label = this._register(new WR(e206));
  }
  set(e206, t10) {
    let n10 = e206.parent.getPreview(e206)?.preview(e206.range);
    if (!n10 || !n10.value) this.label.set(`${Id(e206.uri)}:${e206.range.startLineNumber + 1}:${e206.range.startColumn + 1}`);
    else {
      let { value: e207, highlight: r10 } = n10;
      t10 && !CM.isDefault(t10) ? (this.label.element.classList.toggle(`referenceMatch`, false), this.label.set(e207, uM(t10))) : (this.label.element.classList.toggle(`referenceMatch`, true), this.label.set(e207, [r10]));
    }
  }
}, h$ = (_ec = class {
  constructor() {
    this.templateId = _ec.id;
  }
  renderTemplate(e206) {
    return new YCe(e206);
  }
  renderElement(e206, t10, n10) {
    n10.set(e206.element, e206.filterData);
  }
  disposeTemplate(e206) {
    e206.dispose();
  }
}, _ec.id = `OneReferenceRenderer`, _ec), XCe = class {
  getWidgetAriaLabel() {
    return C(1083, `References`);
  }
  getAriaLabel(e206) {
    return e206.ariaMessage;
  }
}, g$ = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, _$2 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, ZCe = (_fc = class {
  constructor(e206, t10) {
    this._editor = e206, this._model = t10, this._decorations = /* @__PURE__ */ new Map(), this._decorationIgnoreSet = /* @__PURE__ */ new Set(), this._callOnDispose = new E(), this._callOnModelChange = new E(), this._callOnDispose.add(this._editor.onDidChangeModel(() => this._onModelChanged())), this._onModelChanged();
  }
  dispose() {
    this._callOnModelChange.dispose(), this._callOnDispose.dispose(), this.removeDecorations();
  }
  _onModelChanged() {
    this._callOnModelChange.clear();
    let e206 = this._editor.getModel();
    if (e206) {
      for (let t10 of this._model.references) if (t10.uri.toString() === e206.uri.toString()) {
        this._addDecorations(t10.parent);
        return;
      }
    }
  }
  _addDecorations(t10) {
    if (!this._editor.hasModel()) return;
    this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(() => this._onDecorationChanged()));
    let n10 = [], r10 = [];
    for (let i10 = 0, a10 = t10.children.length; i10 < a10; i10++) {
      let a11 = t10.children[i10];
      this._decorationIgnoreSet.has(a11.id) || a11.uri.toString() === this._editor.getModel().uri.toString() && (n10.push({ range: a11.range, options: _fc.DecorationOptions }), r10.push(i10));
    }
    this._editor.changeDecorations((e206) => {
      let i10 = e206.deltaDecorations([], n10);
      for (let e207 = 0; e207 < i10.length; e207++) this._decorations.set(i10[e207], t10.children[r10[e207]]);
    });
  }
  _onDecorationChanged() {
    let e206 = [], t10 = this._editor.getModel();
    if (t10) {
      for (let [n10, r10] of this._decorations) {
        let i10 = t10.getDecorationRange(n10);
        if (!i10) continue;
        let a10 = false;
        M.equalsRange(i10, r10.range) || ((M.spansMultipleLines(i10) || r10.range.endColumn - r10.range.startColumn !== i10.endColumn - i10.startColumn) && (a10 = true), a10 ? (this._decorationIgnoreSet.add(r10.id), e206.push(n10)) : r10.range = i10);
      }
      for (let t11 = 0, n10 = e206.length; t11 < n10; t11++) this._decorations.delete(e206[t11]);
      this._editor.removeDecorations(e206);
    }
  }
  removeDecorations() {
    this._editor.removeDecorations([...this._decorations.keys()]), this._decorations.clear();
  }
}, _fc.DecorationOptions = UO.register({ description: `reference-decoration`, stickiness: 1, className: `reference-decoration` }), _fc), QCe = class {
  constructor() {
    this.ratio = 0.7, this.heightInLines = 18;
  }
  static fromJSON(e206) {
    let t10, n10;
    try {
      let r10 = JSON.parse(e206);
      t10 = r10.ratio, n10 = r10.heightInLines;
    } catch {
    }
    return { ratio: t10 || 0.7, heightInLines: n10 || 18 };
  }
}, $Ce = class extends nH {
}, v$ = class {
  constructor(e206) {
    this.labelService = e206, this.disposables = new E();
  }
  getDragURI(e206) {
    return e206 instanceof o$ ? e206.uri.toString() : e206 instanceof a$ ? che(e206.uri, e206.range).toString() : null;
  }
  getDragLabel(e206) {
    if (e206.length !== 0) return e206.map((e207) => this.labelService.getUriBasenameLabel(e207.uri)).join(`, `);
  }
  onDragStart(e206, t10) {
    if (!t10.dataTransfer) return;
    let n10 = e206.elements.map((e207) => this.getDragURI(e207)).filter(Boolean);
    n10.length && (t10.dataTransfer.setData(xI.RESOURCES, JSON.stringify(n10)), t10.dataTransfer.setData(xI.TEXT, n10.join(`
`)));
  }
  onDragOver() {
    return false;
  }
  drop() {
  }
  dispose() {
    this.disposables.dispose();
  }
};
v$ = g$([_$2(0, BF)], v$);
var y$ = class extends t$ {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(e206, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true, supportOnTitleClick: true }, a10), this._defaultTreeKeyboardSupport = t10, this.layoutData = n10, this._textModelResolverService = i10, this._instantiationService = a10, this._peekViewService = o10, this._uriLabel = s10, this._keybindingService = c10, this._disposeOnNewModel = new E(), this._callOnDispose = new E(), this._onDidSelectReference = new k(), this.onDidSelectReference = this._onDidSelectReference.event, this._dim = new ml(0, 0), this._isClosing = false, this._applyTheme(r10.getColorTheme()), this._callOnDispose.add(r10.onDidColorThemeChange(this._applyTheme.bind(this))), this._peekViewService.addExclusiveWidget(e206, this), this.create();
  }
  get isClosing() {
    return this._isClosing;
  }
  dispose() {
    this._isClosing = true, this.setModel(void 0), this._callOnDispose.dispose(), this._disposeOnNewModel.dispose(), Kt(this._preview), Kt(this._previewNotAvailableMessage), Kt(this._tree), Kt(this._previewModelReference), this._splitView.dispose(), super.dispose();
  }
  _applyTheme(e206) {
    let t10 = e206.getColor(WCe) || Y.transparent;
    this.style({ arrowColor: t10, frameColor: t10, headerBackgroundColor: e206.getColor(UCe) || Y.transparent, primaryHeadingColor: e206.getColor(n$), secondaryHeadingColor: e206.getColor(r$) });
  }
  show(e206) {
    super.show(e206, this.layoutData.heightInLines || 18);
  }
  focusOnReferenceTree() {
    this._tree.domFocus();
  }
  focusOnPreviewEditor() {
    this._preview.focus();
  }
  isPreviewEditorFocused() {
    return this._preview.hasTextFocus();
  }
  _onTitleClick(e206) {
    this._preview && this._preview.getModel() && this._onDidSelectReference.fire({ element: this._getFocusedReference(), kind: e206.ctrlKey || e206.metaKey || e206.altKey ? `side` : `open`, source: `title` });
  }
  _fillBody(e206) {
    this.setCssClass(`reference-zone-widget`), this._messageContainer = z(e206, B(`div.messages`)), Ql(this._messageContainer), this._splitView = new lB(e206, { orientation: 1 }), this._previewContainer = z(e206, B(`div.preview.inline`)), this._preview = this._instantiationService.createInstance(qQ, this._previewContainer, { scrollBeyondLastLine: false, scrollbar: { verticalScrollbarSize: 14, horizontal: `auto`, useShadows: true, verticalHasArrows: false, horizontalHasArrows: false, alwaysConsumeMouseWheel: true }, overviewRulerLanes: 2, fixedOverflowWidgets: true, minimap: { enabled: false } }, {}, this.editor), Ql(this._previewContainer), this._previewNotAvailableMessage = this._instantiationService.createInstance(FO, C(1084, `no preview available`), hp, FO.DEFAULT_CREATION_OPTIONS, null), this._treeContainer = z(e206, B(`div.ref-tree.inline`));
    let t10 = { keyboardSupport: this._defaultTreeKeyboardSupport, accessibilityProvider: new XCe(), keyboardNavigationLabelProvider: this._instantiationService.createInstance(f$), identityProvider: new JCe(), openOnSingleClick: true, selectionNavigation: true, overrideStyles: { listBackground: GCe }, dnd: this._instantiationService.createInstance(v$) };
    this._defaultTreeKeyboardSupport && this._callOnDispose.add(el(this._treeContainer, `keydown`, (e207) => {
      e207.equals(9) && (this._keybindingService.dispatchEvent(e207, e207.target), e207.stopPropagation());
    }, true)), this._tree = this._instantiationService.createInstance($Ce, `ReferencesWidget`, this._treeContainer, new qCe(), [this._instantiationService.createInstance(m$), this._instantiationService.createInstance(h$)], this._instantiationService.createInstance(d$), t10), this._splitView.addView({ onDidChange: O.None, element: this._previewContainer, minimumSize: 200, maximumSize: Number.MAX_VALUE, layout: (e207) => {
      this._preview.layout({ height: this._dim.height, width: e207 });
    } }, cB.Distribute), this._splitView.addView({ onDidChange: O.None, element: this._treeContainer, minimumSize: 100, maximumSize: Number.MAX_VALUE, layout: (e207) => {
      this._treeContainer.style.height = `${this._dim.height}px`, this._treeContainer.style.width = `${e207}px`, this._tree.layout(this._dim.height, e207);
    } }, cB.Distribute), this._disposables.add(this._splitView.onDidSashChange(() => {
      this._dim.width && (this.layoutData.ratio = this._splitView.getViewSize(0) / this._dim.width);
    }, void 0));
    let n10 = (e207, t11) => {
      e207 instanceof a$ && (t11 === `show` && this._revealReference(e207, false), this._onDidSelectReference.fire({ element: e207, kind: t11, source: `tree` }));
    };
    this._disposables.add(this._tree.onDidOpen((e207) => {
      e207.sideBySide ? n10(e207.element, `side`) : e207.editorOptions.pinned ? n10(e207.element, `goto`) : n10(e207.element, `show`);
    })), Ql(this._treeContainer);
  }
  _onWidth(e206) {
    this._dim && this._doLayoutBody(this._dim.height, e206);
  }
  _doLayoutBody(e206, t10) {
    super._doLayoutBody(e206, t10), this._dim = new ml(t10, e206), this.layoutData.heightInLines = this._viewZone ? this._viewZone.heightInLines : this.layoutData.heightInLines, this._splitView.layout(t10), this._splitView.resizeView(0, t10 * this.layoutData.ratio);
  }
  setSelection(e206) {
    return this._revealReference(e206, true).then(() => {
      this._model && (this._tree.setSelection([e206]), this._tree.setFocus([e206]));
    });
  }
  setModel(e206) {
    return this._disposeOnNewModel.clear(), this._model = e206, this._model ? this._onNewModel() : Promise.resolve();
  }
  _onNewModel() {
    return this._model ? this._model.isEmpty ? (this.setTitle(``), this._messageContainer.innerText = C(1085, `No results`), Zl(this._messageContainer), Promise.resolve(void 0)) : (Ql(this._messageContainer), this._decorationsManager = new ZCe(this._preview, this._model), this._disposeOnNewModel.add(this._decorationsManager), this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((e206) => this._tree.rerender(e206))), this._disposeOnNewModel.add(this._preview.onMouseDown((e206) => {
      let { event: t10, target: n10 } = e206;
      if (t10.detail !== 2) return;
      let r10 = this._getFocusedReference();
      r10 && this._onDidSelectReference.fire({ element: { uri: r10.uri, range: n10.range }, kind: t10.ctrlKey || t10.metaKey || t10.altKey ? `side` : `open`, source: `editor` });
    })), this.container.classList.add(`results-loaded`), Zl(this._treeContainer), Zl(this._previewContainer), this._splitView.layout(this._dim.width), this.focusOnReferenceTree(), this._tree.setInput(this._model.groups.length === 1 ? this._model.groups[0] : this._model)) : Promise.resolve(void 0);
  }
  _getFocusedReference() {
    let [e206] = this._tree.getFocus();
    if (e206 instanceof a$) return e206;
    if (e206 instanceof o$ && e206.children.length > 0) return e206.children[0];
  }
  async revealReference(e206) {
    await this._revealReference(e206, false), this._onDidSelectReference.fire({ element: e206, kind: `goto`, source: `tree` });
  }
  async _revealReference(e206, t10) {
    if (this._revealedReference === e206) return;
    this._revealedReference = e206, e206.uri.scheme === xs.inMemory ? this.setTitle(C(1086, `References`)) : this.setTitle(rre(e206.uri), this._uriLabel.getUriLabel(Ld(e206.uri)));
    let n10 = this._textModelResolverService.createModelReference(e206.uri);
    this._tree.getInput() === e206.parent ? this._tree.reveal(e206) : (t10 && this._tree.reveal(e206.parent), await this._tree.expand(e206.parent), this._tree.reveal(e206));
    let r10 = await n10;
    if (!this._model) {
      r10.dispose();
      return;
    }
    Kt(this._previewModelReference);
    let i10 = r10.object;
    if (i10) {
      let t11 = this._preview.getModel() === i10.textEditorModel ? 0 : 1, n11 = M.lift(e206.range).collapseToStart();
      this._previewModelReference = r10, this._preview.setModel(i10.textEditorModel), this._preview.setSelection(n11), this._preview.revealRangeInCenter(n11, t11);
    } else this._preview.setModel(this._previewNotAvailableMessage), r10.dispose();
  }
};
y$ = g$([_$2(3, US), _$2(4, wu), _$2(5, V), _$2(6, QQ), _$2(7, BF), _$2(8, Dw)], y$);
var ewe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, b$ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, x$, S$ = new U(`referenceSearchVisible`, false, C(1078, `Whether reference peek is visible, like 'Peek References' or 'Peek Definition'`)), C$ = (_gc = class {
  static get(e206) {
    return e206.getContribution(x$.ID);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this._defaultTreeKeyboardSupport = e206, this._editor = t10, this._editorService = r10, this._notificationService = i10, this._instantiationService = a10, this._storageService = o10, this._configurationService = s10, this._disposables = new E(), this._requestIdPool = 0, this._ignoreModelChangeEvent = false, this._referenceSearchVisible = S$.bindTo(n10);
  }
  dispose() {
    this._referenceSearchVisible.reset(), this._disposables.dispose(), this._widget?.dispose(), this._model?.dispose(), this._widget = void 0, this._model = void 0;
  }
  toggleWidget(e206, t10, n10) {
    let r10;
    if (this._widget && (r10 = this._widget.position), this.closeWidget(), r10 && e206.containsPosition(r10)) return;
    this._peekMode = n10, this._referenceSearchVisible.set(true), this._disposables.add(this._editor.onDidChangeModelLanguage(() => {
      this.closeWidget();
    })), this._disposables.add(this._editor.onDidChangeModel(() => {
      this._ignoreModelChangeEvent || this.closeWidget();
    }));
    let i10 = `peekViewLayout`, a10 = QCe.fromJSON(this._storageService.get(i10, 0, `{}`));
    this._widget = this._instantiationService.createInstance(y$, this._editor, this._defaultTreeKeyboardSupport, a10), this._widget.setTitle(C(1079, `Loading...`)), this._widget.show(e206), this._disposables.add(this._widget.onDidClose(() => {
      t10.cancel(), this._widget ? (this._storageService.store(i10, JSON.stringify(this._widget.layoutData), 0, 1), this._widget.isClosing || this.closeWidget(), this._widget = void 0) : this.closeWidget();
    })), this._disposables.add(this._widget.onDidSelectReference((e207) => {
      let { element: t11, kind: r11 } = e207;
      if (t11) switch (r11) {
        case `open`:
          (e207.source !== `editor` || !this._configurationService.getValue(`editor.stablePeek`)) && this.openReference(t11, false, false);
          break;
        case `side`:
          this.openReference(t11, true, false);
          break;
        case `goto`:
          n10 ? this._gotoReference(t11, true) : this.openReference(t11, false, true);
          break;
      }
    }));
    let o10 = ++this._requestIdPool;
    t10.then((t11) => {
      if (o10 !== this._requestIdPool || !this._widget) {
        t11.dispose();
        return;
      }
      return this._model?.dispose(), this._model = t11, this._widget.setModel(this._model).then(() => {
        if (this._widget && this._model && this._editor.hasModel()) {
          this._model.isEmpty ? this._widget.setMetaTitle(``) : this._widget.setMetaTitle(C(1080, `{0} ({1})`, this._model.title, this._model.references.length));
          let t12 = this._editor.getModel().uri, n11 = new j(e206.startLineNumber, e206.startColumn), r11 = this._model.nearestReference(t12, n11);
          if (r11) return this._widget.setSelection(r11).then(() => {
            this._widget && this._editor.getOption(99) === `editor` && this._widget.focusOnPreviewEditor();
          });
        }
      });
    }, (e207) => {
      this._notificationService.error(e207);
    });
  }
  changeFocusBetweenPreviewAndReferences() {
    this._widget && (this._widget.isPreviewEditorFocused() ? this._widget.focusOnReferenceTree() : this._widget.focusOnPreviewEditor());
  }
  async goToNextOrPreviousReference(e206) {
    if (!this._editor.hasModel() || !this._model || !this._widget) return;
    let t10 = this._widget.position;
    if (!t10) return;
    let n10 = this._model.nearestReference(this._editor.getModel().uri, t10);
    if (!n10) return;
    let r10 = this._model.nextOrPreviousReference(n10, e206), i10 = this._editor.hasTextFocus(), a10 = this._widget.isPreviewEditorFocused();
    await this._widget.setSelection(r10), await this._gotoReference(r10, false), i10 ? this._editor.focus() : this._widget && a10 && this._widget.focusOnPreviewEditor();
  }
  async revealReference(e206) {
    !this._editor.hasModel() || !this._model || !this._widget || await this._widget.revealReference(e206);
  }
  closeWidget(e206 = true) {
    this._widget?.dispose(), this._model?.dispose(), this._referenceSearchVisible.reset(), this._disposables.clear(), this._widget = void 0, this._model = void 0, e206 && this._editor.focus(), this._requestIdPool += 1;
  }
  _gotoReference(e206, t10) {
    this._widget?.hide(), this._ignoreModelChangeEvent = true;
    let n10 = M.lift(e206.range).collapseToStart();
    return this._editorService.openCodeEditor({ resource: e206.uri, options: { selection: n10, selectionSource: `code.jump`, pinned: t10 } }, this._editor).then((e207) => {
      if (this._ignoreModelChangeEvent = false, !e207 || !this._widget) {
        this.closeWidget();
        return;
      }
      if (this._editor === e207) this._widget.show(n10), this._widget.focusOnReferenceTree();
      else {
        let t11 = x$.get(e207), r10 = this._model.clone();
        this.closeWidget(), e207.focus(), t11?.toggleWidget(n10, es((e208) => Promise.resolve(r10)), this._peekMode ?? false);
      }
    }, (e207) => {
      this._ignoreModelChangeEvent = false, be(e207);
    });
  }
  openReference(e206, t10, n10) {
    t10 || this.closeWidget();
    let { uri: r10, range: i10 } = e206;
    this._editorService.openCodeEditor({ resource: r10, options: { selection: i10, selectionSource: `code.jump`, pinned: n10 } }, this._editor, t10);
  }
}, x$ = _gc, _gc.ID = `editor.contrib.referencesController`, _gc);
C$ = x$ = ewe([b$(2, nd), b$(3, Su), b$(4, dw), b$(5, V), b$(6, dF), b$(7, Uf)], C$);
function w$(e206, t10) {
  let n10 = JQ(e206);
  if (!n10) return;
  let r10 = C$.get(n10);
  r10 && t10(r10);
}
ld.registerCommandAndKeybindingRule({ id: `togglePeekWidgetFocus`, weight: 100, primary: Sr(2089, 60), when: H.or(S$, $Q.inPeekEditor), handler(e206) {
  w$(e206, (e207) => {
    e207.changeFocusBetweenPreviewAndReferences();
  });
} }), ld.registerCommandAndKeybindingRule({ id: `goToNextReference`, weight: 90, primary: 62, secondary: [70], when: H.or(S$, $Q.inPeekEditor), handler(e206) {
  w$(e206, (e207) => {
    e207.goToNextOrPreviousReference(true);
  });
} }), ld.registerCommandAndKeybindingRule({ id: `goToPreviousReference`, weight: 90, primary: 1086, secondary: [1094], when: H.or(S$, $Q.inPeekEditor), handler(e206) {
  w$(e206, (e207) => {
    e207.goToNextOrPreviousReference(false);
  });
} }), Nu.registerCommandAlias(`goToNextReferenceFromEmbeddedEditor`, `goToNextReference`), Nu.registerCommandAlias(`goToPreviousReferenceFromEmbeddedEditor`, `goToPreviousReference`), Nu.registerCommandAlias(`closeReferenceSearchEditor`, `closeReferenceSearch`), Nu.registerCommand(`closeReferenceSearch`, (e206) => w$(e206, (e207) => e207.closeWidget())), ld.registerKeybindingRule({ id: `closeReferenceSearch`, weight: -1, primary: 9, secondary: [1033], when: H.and($Q.inPeekEditor, H.not(`config.editor.stablePeek`)) }), ld.registerKeybindingRule({ id: `closeReferenceSearch`, weight: 250, primary: 9, secondary: [1033], when: H.and(S$, H.not(`config.editor.stablePeek`), H.or($.editorTextFocus, nV.negate())) }), ld.registerCommandAndKeybindingRule({ id: `revealReference`, weight: 200, primary: 3, mac: { primary: 3, secondary: [2066] }, when: H.and(S$, dV, _V2.negate(), yV.negate()), handler(e206) {
  let t10 = e206.get(aV).lastFocusedList?.getFocus();
  Array.isArray(t10) && t10[0] instanceof a$ && w$(e206, (e207) => e207.revealReference(t10[0]));
} }), ld.registerCommandAndKeybindingRule({ id: `openReferenceToSide`, weight: 100, primary: 2051, mac: { primary: 259 }, when: H.and(S$, dV, _V2.negate(), yV.negate()), handler(e206) {
  let t10 = e206.get(aV).lastFocusedList?.getFocus();
  Array.isArray(t10) && t10[0] instanceof a$ && w$(e206, (e207) => e207.openReference(t10[0], true, true));
} }), Nu.registerCommand(`openReference`, (e206) => {
  let t10 = e206.get(aV).lastFocusedList?.getFocus();
  Array.isArray(t10) && t10[0] instanceof a$ && w$(e206, (e207) => e207.openReference(t10[0], false, true));
});
var T$ = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, E$ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, D$ = new U(`hasSymbols`, false, C(1095, `Whether there are symbol locations that can be navigated via keyboard-only.`)), O$ = xu(`ISymbolNavigationService`), k$ = class {
  constructor(e206, t10, n10, r10) {
    this._editorService = t10, this._notificationService = n10, this._keybindingService = r10, this._currentModel = void 0, this._currentIdx = -1, this._ignoreEditorChange = false, this._ctxHasSymbols = D$.bindTo(e206);
  }
  reset() {
    this._ctxHasSymbols.reset(), this._currentState?.dispose(), this._currentMessage?.close(), this._currentModel = void 0, this._currentIdx = -1;
  }
  put(e206) {
    let t10 = e206.parent.parent;
    if (t10.references.length <= 1) {
      this.reset();
      return;
    }
    this._currentModel = t10, this._currentIdx = t10.references.indexOf(e206), this._ctxHasSymbols.set(true), this._showMessage();
    let n10 = new A$(this._editorService);
    this._currentState = qt(n10, n10.onDidChange((e207) => {
      if (this._ignoreEditorChange) return;
      let n11 = this._editorService.getActiveCodeEditor();
      if (!n11) return;
      let r10 = n11.getModel(), i10 = n11.getPosition();
      if (!r10 || !i10) return;
      let a10 = false, o10 = false;
      for (let e208 of t10.references) if (Fd(e208.uri, r10.uri)) a10 = true, o10 || (o10 = M.containsPosition(e208.range, i10));
      else if (a10) break;
      (!a10 || !o10) && this.reset();
    }));
  }
  revealNext(e206) {
    if (!this._currentModel) return Promise.resolve();
    this._currentIdx += 1, this._currentIdx %= this._currentModel.references.length;
    let t10 = this._currentModel.references[this._currentIdx];
    return this._showMessage(), this._ignoreEditorChange = true, this._editorService.openCodeEditor({ resource: t10.uri, options: { selection: M.collapseToStart(t10.range), selectionRevealType: 3 } }, e206).finally(() => {
      this._ignoreEditorChange = false;
    });
  }
  _showMessage() {
    this._currentMessage?.close();
    let e206 = this._keybindingService.lookupKeybinding(`editor.gotoNextSymbolFromResult`), t10 = e206 ? C(1096, `Symbol {0} of {1}, {2} for next`, this._currentIdx + 1, this._currentModel.references.length, e206.getLabel()) : C(1097, `Symbol {0} of {1}`, this._currentIdx + 1, this._currentModel.references.length);
    this._currentMessage = this._notificationService.status(t10);
  }
};
k$ = T$([E$(0, nd), E$(1, Su), E$(2, dw), E$(3, Dw)], k$), Zf(O$, k$, 1), K(new class extends $d {
  constructor() {
    super({ id: `editor.gotoNextSymbolFromResult`, precondition: D$, kbOpts: { weight: 100, primary: 70 } });
  }
  runEditorCommand(e206, t10) {
    return e206.get(O$).revealNext(t10);
  }
}()), ld.registerCommandAndKeybindingRule({ id: `editor.gotoNextSymbolFromResult.cancel`, weight: 100, when: D$, primary: 9, handler(e206) {
  e206.get(O$).reset();
} });
var A$ = class {
  constructor(e206) {
    this._listener = /* @__PURE__ */ new Map(), this._disposables = new E(), this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._disposables.add(e206.onCodeEditorRemove(this._onDidRemoveEditor, this)), this._disposables.add(e206.onCodeEditorAdd(this._onDidAddEditor, this)), e206.listCodeEditors().forEach(this._onDidAddEditor, this);
  }
  dispose() {
    this._disposables.dispose(), this._onDidChange.dispose(), Kt(this._listener.values());
  }
  _onDidAddEditor(e206) {
    this._listener.set(e206, qt(e206.onDidChangeCursorPosition((t10) => this._onDidChange.fire({ editor: e206 })), e206.onDidChangeModelContent((t10) => this._onDidChange.fire({ editor: e206 }))));
  }
  _onDidRemoveEditor(e206) {
    this._listener.get(e206)?.dispose(), this._listener.delete(e206);
  }
};
A$ = T$([E$(0, Su)], A$);
function j$(e206, t10) {
  return t10.uri.scheme === e206.uri.scheme ? true : !Cs(t10.uri, xs.walkThroughSnippet, xs.vscodeChatCodeBlock, xs.vscodeChatCodeCompareBlock);
}
async function M$(e206, t10, n10, r10, i10) {
  let a10 = n10.ordered(e206, r10).map((n11) => Promise.resolve(i10(n11, e206, t10)).then(void 0, (e207) => {
    xe(e207);
  }));
  return h((await Promise.all(a10)).flat()).filter((t11) => j$(e206, t11));
}
function N$(e206, t10, n10, r10, i10) {
  return M$(t10, n10, e206, r10, (e207, t11, n11) => e207.provideDefinition(t11, n11, i10));
}
function P$(e206, t10, n10, r10, i10) {
  return M$(t10, n10, e206, r10, (e207, t11, n11) => e207.provideDeclaration(t11, n11, i10));
}
function F$(e206, t10, n10, r10, i10) {
  return M$(t10, n10, e206, r10, (e207, t11, n11) => e207.provideImplementation(t11, n11, i10));
}
function I$(e206, t10, n10, r10, i10) {
  return M$(t10, n10, e206, r10, (e207, t11, n11) => e207.provideTypeDefinition(t11, n11, i10));
}
function L$(e206, t10, n10, r10, i10, a10) {
  return M$(t10, n10, e206, i10, async (e207, t11, n11) => {
    let i11 = (await e207.provideReferences(t11, n11, { includeDeclaration: true }, a10))?.filter((e208) => j$(t11, e208));
    if (!r10 || !i11 || i11.length !== 2) return i11;
    let o10 = (await e207.provideReferences(t11, n11, { includeDeclaration: false }, a10))?.filter((e208) => j$(t11, e208));
    return o10 && o10.length === 1 ? o10 : i11;
  });
}
async function R$(e206) {
  let t10 = new s$(await e206(), ``), n10 = t10.references.map((e207) => e207.link);
  return t10.dispose(), n10;
}
nf(`_executeDefinitionProvider`, (e206, t10, n10) => {
  let r10 = N$(e206.get(X).definitionProvider, t10, n10, false, dr.None);
  return R$(() => r10);
}), nf(`_executeDefinitionProvider_recursive`, (e206, t10, n10) => {
  let r10 = N$(e206.get(X).definitionProvider, t10, n10, true, dr.None);
  return R$(() => r10);
}), nf(`_executeTypeDefinitionProvider`, (e206, t10, n10) => {
  let r10 = I$(e206.get(X).typeDefinitionProvider, t10, n10, false, dr.None);
  return R$(() => r10);
}), nf(`_executeTypeDefinitionProvider_recursive`, (e206, t10, n10) => {
  let r10 = I$(e206.get(X).typeDefinitionProvider, t10, n10, true, dr.None);
  return R$(() => r10);
}), nf(`_executeDeclarationProvider`, (e206, t10, n10) => {
  let r10 = P$(e206.get(X).declarationProvider, t10, n10, false, dr.None);
  return R$(() => r10);
}), nf(`_executeDeclarationProvider_recursive`, (e206, t10, n10) => {
  let r10 = P$(e206.get(X).declarationProvider, t10, n10, true, dr.None);
  return R$(() => r10);
}), nf(`_executeReferenceProvider`, (e206, t10, n10) => {
  let r10 = L$(e206.get(X).referenceProvider, t10, n10, false, false, dr.None);
  return R$(() => r10);
}), nf(`_executeReferenceProvider_recursive`, (e206, t10, n10) => {
  let r10 = L$(e206.get(X).referenceProvider, t10, n10, false, true, dr.None);
  return R$(() => r10);
}), nf(`_executeImplementationProvider`, (e206, t10, n10) => {
  let r10 = F$(e206.get(X).implementationProvider, t10, n10, false, dr.None);
  return R$(() => r10);
}), nf(`_executeImplementationProvider_recursive`, (e206, t10, n10) => {
  let r10 = F$(e206.get(X).implementationProvider, t10, n10, true, dr.None);
  return R$(() => r10);
}), hd.appendMenuItem(W.EditorContext, { submenu: W.EditorContextPeek, title: C(1038, `Peek`), group: `navigation`, order: 100 });
var z$ = class e182 {
  static is(t10) {
    return !t10 || typeof t10 != `object` ? false : !!(t10 instanceof e182 || j.isIPosition(t10.position) && t10.model);
  }
  constructor(e206, t10) {
    this.model = e206, this.position = t10;
  }
}, B$ = (_hc = class extends tf {
  static all() {
    return _hc._allSymbolNavigationCommands.values();
  }
  static _patchConfig(e206) {
    let t10 = { ...e206, f1: true };
    if (t10.menu) for (let n10 of Ut.wrap(t10.menu)) (n10.id === W.EditorContext || n10.id === W.EditorContextPeek) && (n10.when = H.and(e206.precondition, n10.when));
    return t10;
  }
  constructor(t10, n10) {
    super(_hc._patchConfig(n10)), this.configuration = t10, _hc._allSymbolNavigationCommands.set(n10.id, this);
  }
  runEditorCommand(t10, n10, r10, i10) {
    if (!n10.hasModel()) return Promise.resolve(void 0);
    let a10 = t10.get(dw), o10 = t10.get(Su), s10 = t10.get(UF), c10 = t10.get(O$), l10 = t10.get(X), u10 = t10.get(V), d10 = n10.getModel(), f10 = n10.getPosition(), p10 = z$.is(r10) ? r10 : new z$(d10, f10), m10 = new tJ(n10, 5), h10 = ts(this._getLocationModel(l10, p10.model, p10.position, m10.token), m10.token).then(async (t11) => {
      if (!t11 || m10.token.isCancellationRequested) return;
      Wg(t11.ariaMessage);
      let a11;
      if (t11.referenceAt(d10.uri, f10)) {
        let t12 = this._getAlternativeCommand(n10);
        t12 !== void 0 && !_hc._activeAlternativeCommands.has(t12) && _hc._allSymbolNavigationCommands.has(t12) && (a11 = _hc._allSymbolNavigationCommands.get(t12));
      }
      let s11 = t11.references.length;
      if (s11 === 0) {
        if (!this.configuration.muteMessage) {
          let e206 = d10.getWordAtPosition(f10);
          QJ.get(n10)?.showMessage(this._getNoResultFoundMessage(e206), f10);
        }
      } else if (s11 === 1 && a11) _hc._activeAlternativeCommands.add(this.desc.id), u10.invokeFunction((t12) => a11.runEditorCommand(t12, n10, r10, i10).finally(() => {
        _hc._activeAlternativeCommands.delete(this.desc.id);
      }));
      else return this._onResult(o10, c10, n10, t11, i10);
    }, (e206) => {
      a10.error(e206);
    }).finally(() => {
      m10.dispose();
    });
    return s10.showWhile(h10, 250), h10;
  }
  async _onResult(e206, t10, n10, r10, i10) {
    let a10 = this._getGoToPreference(n10);
    if (!(n10 instanceof qQ) && (this.configuration.openInPeek || a10 === `peek` && r10.references.length > 1)) this._openInPeek(n10, r10, i10);
    else {
      let o10 = r10.firstReference(), s10 = r10.references.length > 1 && a10 === `gotoAndPeek`, c10 = await this._openReference(n10, e206, o10, this.configuration.openToSide, !s10);
      s10 && c10 ? this._openInPeek(c10, r10, i10) : r10.dispose(), a10 === `goto` && t10.put(o10);
    }
  }
  async _openReference(e206, t10, n10, r10, i10) {
    let a10;
    if (wi(n10) && (a10 = n10.targetSelectionRange), a10 || (a10 = n10.range), !a10) return;
    let o10 = await t10.openCodeEditor({ resource: n10.uri, options: { selection: M.collapseToStart(a10), selectionRevealType: 3, selectionSource: `code.jump` } }, e206, r10);
    if (o10) {
      if (i10) {
        let e207 = o10.getModel(), t11 = o10.createDecorationsCollection([{ range: a10, options: { description: `symbol-navigate-action-highlight`, className: `symbolHighlight` } }]);
        setTimeout(() => {
          o10.getModel() === e207 && t11.clear();
        }, 350);
      }
      return o10;
    }
  }
  _openInPeek(e206, t10, n10) {
    let r10 = C$.get(e206);
    r10 && e206.hasModel() ? r10.toggleWidget(n10 ?? e206.getSelection(), es((e207) => Promise.resolve(t10)), this.configuration.openInPeek) : t10.dispose();
  }
}, _hc._allSymbolNavigationCommands = /* @__PURE__ */ new Map(), _hc._activeAlternativeCommands = /* @__PURE__ */ new Set(), _hc), V$ = class extends B$ {
  async _getLocationModel(e206, t10, n10, r10) {
    return new s$(await N$(e206.definitionProvider, t10, n10, false, r10), C(1039, `Definitions`));
  }
  _getNoResultFoundMessage(e206) {
    return e206 && e206.word ? C(1040, `No definition found for '{0}'`, e206.word) : C(1041, `No definition found`);
  }
  _getAlternativeCommand(e206) {
    return e206.getOption(67).alternativeDefinitionCommand;
  }
  _getGoToPreference(e206) {
    return e206.getOption(67).multipleDefinitions;
  }
};
yd((_ic = class extends V$ {
  constructor() {
    super({ openToSide: false, openInPeek: false, muteMessage: false }, { id: _ic.id, title: { ...w(1065, `Go to Definition`), mnemonicTitle: C(1042, `Go to &&Definition`) }, precondition: $.hasDefinitionProvider, keybinding: [{ when: $.editorTextFocus, primary: 70, weight: 100 }, { when: H.and($.editorTextFocus, eV), primary: 2118, weight: 100 }], menu: [{ id: W.EditorContext, group: `navigation`, order: 1.1 }, { id: W.MenubarGoMenu, precondition: null, group: `4_symbol_nav`, order: 2 }] }), Nu.registerCommandAlias(`editor.action.goToDeclaration`, _ic.id);
  }
}, _ic.id = `editor.action.revealDefinition`, _ic)), yd((_jc = class extends V$ {
  constructor() {
    super({ openToSide: true, openInPeek: false, muteMessage: false }, { id: _jc.id, title: w(1066, `Open Definition to the Side`), precondition: H.and($.hasDefinitionProvider, $.isInEmbeddedEditor.toNegated()), keybinding: [{ when: $.editorTextFocus, primary: Sr(2089, 70), weight: 100 }, { when: H.and($.editorTextFocus, eV), primary: Sr(2089, 2118), weight: 100 }] }), Nu.registerCommandAlias(`editor.action.openDeclarationToTheSide`, _jc.id);
  }
}, _jc.id = `editor.action.revealDefinitionAside`, _jc)), yd((_kc = class extends V$ {
  constructor() {
    super({ openToSide: false, openInPeek: true, muteMessage: false }, { id: _kc.id, title: w(1067, `Peek Definition`), precondition: H.and($.hasDefinitionProvider, $Q.notInPeekEditor, $.isInEmbeddedEditor.toNegated()), keybinding: { when: $.editorTextFocus, primary: 582, linux: { primary: 3140 }, weight: 100 }, menu: { id: W.EditorContextPeek, group: `peek`, order: 2 } }), Nu.registerCommandAlias(`editor.action.previewDeclaration`, _kc.id);
  }
}, _kc.id = `editor.action.peekDefinition`, _kc));
var H$ = class extends B$ {
  async _getLocationModel(e206, t10, n10, r10) {
    return new s$(await P$(e206.declarationProvider, t10, n10, false, r10), C(1043, `Declarations`));
  }
  _getNoResultFoundMessage(e206) {
    return e206 && e206.word ? C(1044, `No declaration found for '{0}'`, e206.word) : C(1045, `No declaration found`);
  }
  _getAlternativeCommand(e206) {
    return e206.getOption(67).alternativeDeclarationCommand;
  }
  _getGoToPreference(e206) {
    return e206.getOption(67).multipleDeclarations;
  }
};
yd((_lc = class extends H$ {
  constructor() {
    super({ openToSide: false, openInPeek: false, muteMessage: false }, { id: _lc.id, title: { ...w(1068, `Go to Declaration`), mnemonicTitle: C(1046, `Go to &&Declaration`) }, precondition: H.and($.hasDeclarationProvider, $.isInEmbeddedEditor.toNegated()), menu: [{ id: W.EditorContext, group: `navigation`, order: 1.3 }, { id: W.MenubarGoMenu, precondition: null, group: `4_symbol_nav`, order: 3 }] });
  }
  _getNoResultFoundMessage(e206) {
    return e206 && e206.word ? C(1047, `No declaration found for '{0}'`, e206.word) : C(1048, `No declaration found`);
  }
}, _lc.id = `editor.action.revealDeclaration`, _lc)), yd(class extends H$ {
  constructor() {
    super({ openToSide: false, openInPeek: true, muteMessage: false }, { id: `editor.action.peekDeclaration`, title: w(1069, `Peek Declaration`), precondition: H.and($.hasDeclarationProvider, $Q.notInPeekEditor, $.isInEmbeddedEditor.toNegated()), menu: { id: W.EditorContextPeek, group: `peek`, order: 3 } });
  }
});
var U$ = class extends B$ {
  async _getLocationModel(e206, t10, n10, r10) {
    return new s$(await I$(e206.typeDefinitionProvider, t10, n10, false, r10), C(1049, `Type Definitions`));
  }
  _getNoResultFoundMessage(e206) {
    return e206 && e206.word ? C(1050, `No type definition found for '{0}'`, e206.word) : C(1051, `No type definition found`);
  }
  _getAlternativeCommand(e206) {
    return e206.getOption(67).alternativeTypeDefinitionCommand;
  }
  _getGoToPreference(e206) {
    return e206.getOption(67).multipleTypeDefinitions;
  }
};
yd((_mc = class extends U$ {
  constructor() {
    super({ openToSide: false, openInPeek: false, muteMessage: false }, { id: _mc.ID, title: { ...w(1070, `Go to Type Definition`), mnemonicTitle: C(1052, `Go to &&Type Definition`) }, precondition: $.hasTypeDefinitionProvider, keybinding: { when: $.editorTextFocus, primary: 0, weight: 100 }, menu: [{ id: W.EditorContext, group: `navigation`, order: 1.4 }, { id: W.MenubarGoMenu, precondition: null, group: `4_symbol_nav`, order: 3 }] });
  }
}, _mc.ID = `editor.action.goToTypeDefinition`, _mc)), yd((_nc = class extends U$ {
  constructor() {
    super({ openToSide: false, openInPeek: true, muteMessage: false }, { id: _nc.ID, title: w(1071, `Peek Type Definition`), precondition: H.and($.hasTypeDefinitionProvider, $Q.notInPeekEditor, $.isInEmbeddedEditor.toNegated()), menu: { id: W.EditorContextPeek, group: `peek`, order: 4 } });
  }
}, _nc.ID = `editor.action.peekTypeDefinition`, _nc));
var W$ = class extends B$ {
  async _getLocationModel(e206, t10, n10, r10) {
    return new s$(await F$(e206.implementationProvider, t10, n10, false, r10), C(1053, `Implementations`));
  }
  _getNoResultFoundMessage(e206) {
    return e206 && e206.word ? C(1054, `No implementation found for '{0}'`, e206.word) : C(1055, `No implementation found`);
  }
  _getAlternativeCommand(e206) {
    return e206.getOption(67).alternativeImplementationCommand;
  }
  _getGoToPreference(e206) {
    return e206.getOption(67).multipleImplementations;
  }
};
yd((_oc = class extends W$ {
  constructor() {
    super({ openToSide: false, openInPeek: false, muteMessage: false }, { id: _oc.ID, title: { ...w(1072, `Go to Implementations`), mnemonicTitle: C(1056, `Go to &&Implementations`) }, precondition: $.hasImplementationProvider, keybinding: { when: $.editorTextFocus, primary: 2118, weight: 100 }, menu: [{ id: W.EditorContext, group: `navigation`, order: 1.45 }, { id: W.MenubarGoMenu, precondition: null, group: `4_symbol_nav`, order: 4 }] });
  }
}, _oc.ID = `editor.action.goToImplementation`, _oc)), yd((_pc = class extends W$ {
  constructor() {
    super({ openToSide: false, openInPeek: true, muteMessage: false }, { id: _pc.ID, title: w(1073, `Peek Implementations`), precondition: H.and($.hasImplementationProvider, $Q.notInPeekEditor, $.isInEmbeddedEditor.toNegated()), keybinding: { when: $.editorTextFocus, primary: 3142, weight: 100 }, menu: { id: W.EditorContextPeek, group: `peek`, order: 5 } });
  }
}, _pc.ID = `editor.action.peekImplementation`, _pc));
var G$ = class extends B$ {
  _getNoResultFoundMessage(e206) {
    return e206 ? C(1057, `No references found for '{0}'`, e206.word) : C(1058, `No references found`);
  }
  _getAlternativeCommand(e206) {
    return e206.getOption(67).alternativeReferenceCommand;
  }
  _getGoToPreference(e206) {
    return e206.getOption(67).multipleReferences;
  }
};
yd(class extends G$ {
  constructor() {
    super({ openToSide: false, openInPeek: false, muteMessage: false }, { id: `editor.action.goToReferences`, title: { ...w(1074, `Go to References`), mnemonicTitle: C(1059, `Go to &&References`) }, precondition: H.and($.hasReferenceProvider, $Q.notInPeekEditor, $.isInEmbeddedEditor.toNegated()), keybinding: { when: $.editorTextFocus, primary: 1094, weight: 100 }, menu: [{ id: W.EditorContext, group: `navigation`, order: 1.45 }, { id: W.MenubarGoMenu, precondition: null, group: `4_symbol_nav`, order: 5 }] });
  }
  async _getLocationModel(e206, t10, n10, r10) {
    return new s$(await L$(e206.referenceProvider, t10, n10, true, false, r10), C(1060, `References`));
  }
}), yd(class extends G$ {
  constructor() {
    super({ openToSide: false, openInPeek: true, muteMessage: false }, { id: `editor.action.referenceSearch.trigger`, title: w(1075, `Peek References`), precondition: H.and($.hasReferenceProvider, $Q.notInPeekEditor, $.isInEmbeddedEditor.toNegated()), menu: { id: W.EditorContextPeek, group: `peek`, order: 6 } });
  }
  async _getLocationModel(e206, t10, n10, r10) {
    return new s$(await L$(e206.referenceProvider, t10, n10, false, false, r10), C(1061, `References`));
  }
});
var twe = class extends B$ {
  constructor(e206, t10, n10) {
    super(e206, { id: `editor.action.goToLocation`, title: w(1076, `Go to Any Symbol`), precondition: H.and($Q.notInPeekEditor, $.isInEmbeddedEditor.toNegated()) }), this._references = t10, this._gotoMultipleBehaviour = n10;
  }
  async _getLocationModel(e206, t10, n10, r10) {
    return new s$(this._references, C(1062, `Locations`));
  }
  _getNoResultFoundMessage(e206) {
    return e206 && C(1063, `No results for '{0}'`, e206.word) || ``;
  }
  _getGoToPreference(e206) {
    return this._gotoMultipleBehaviour ?? e206.getOption(67).multipleReferences;
  }
  _getAlternativeCommand() {
  }
};
Nu.registerCommand({ id: `editor.action.goToLocations`, metadata: { description: `Go to locations from a position in a file`, args: [{ name: `uri`, description: `The text document in which to start`, constraint: $r }, { name: `position`, description: `The position at which to start`, constraint: j.isIPosition }, { name: `locations`, description: `An array of locations.`, constraint: Array }, { name: `multiple`, description: "Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`" }, { name: `noResultsMessage`, description: `Human readable message that shows when locations is empty.` }] }, handler: async (e206, t10, n10, r10, i10, a10, o10) => {
  Je($r.isUri(t10)), Je(j.isIPosition(n10)), Je(Array.isArray(r10)), Je(i10 === void 0 || typeof i10 == `string`), Je(o10 === void 0 || typeof o10 == `boolean`);
  let s10 = e206.get(Su), c10 = await s10.openCodeEditor({ resource: t10 }, s10.getFocusedCodeEditor());
  if (Sq(c10)) return c10.setPosition(n10), c10.revealPositionInCenterIfOutsideViewport(n10, 0), c10.invokeWithinContext((e207) => {
    let t11 = new class extends twe {
      _getNoResultFoundMessage(e208) {
        return a10 || super._getNoResultFoundMessage(e208);
      }
    }({ muteMessage: !a10, openInPeek: !!o10, openToSide: false }, r10, i10);
    e207.get(V).invokeFunction(t11.run.bind(t11), c10);
  });
} }), Nu.registerCommand({ id: `editor.action.peekLocations`, metadata: { description: `Peek locations from a position in a file`, args: [{ name: `uri`, description: `The text document in which to start`, constraint: $r }, { name: `position`, description: `The position at which to start`, constraint: j.isIPosition }, { name: `locations`, description: `An array of locations.`, constraint: Array }, { name: `multiple`, description: "Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`" }] }, handler: async (e206, t10, n10, r10, i10) => {
  e206.get(Mu).executeCommand(`editor.action.goToLocations`, t10, n10, r10, i10, void 0, true);
} }), Nu.registerCommand({ id: `editor.action.findReferences`, handler: (e206, t10, n10) => {
  Je($r.isUri(t10)), Je(j.isIPosition(n10));
  let r10 = e206.get(X), i10 = e206.get(Su);
  return i10.openCodeEditor({ resource: t10 }, i10.getFocusedCodeEditor()).then((e207) => {
    if (!Sq(e207) || !e207.hasModel()) return;
    let t11 = C$.get(e207);
    if (!t11) return;
    let i11 = es((t12) => L$(r10.referenceProvider, e207.getModel(), j.lift(n10), false, false, t12).then((e208) => new s$(e208, C(1064, `References`)))), a10 = new M(n10.lineNumber, n10.column, n10.lineNumber, n10.column);
    return Promise.resolve(t11.toggleWidget(a10, i11, false));
  });
} }), Nu.registerCommandAlias(`editor.action.showReferences`, `editor.action.peekLocations`);
async function nwe(e206, t10, n10, r10) {
  let i10 = e206.get(wu), a10 = e206.get(mj), o10 = e206.get(Mu), s10 = e206.get(V), c10 = e206.get(dw);
  if (await r10.item.resolve(dr.None), !r10.part.location) return;
  let l10 = r10.part.location, u10 = [], d10 = new Set(hd.getMenuItems(W.EditorContext).map((e207) => fd(e207) ? e207.command.id : Tx()));
  for (let e207 of B$.all()) d10.has(e207.desc.id) && u10.push(new Tu(e207.desc.id, _d2.label(e207.desc, { renderShortTitle: true }), void 0, true, async () => {
    let n11 = await i10.createModelReference(l10.uri);
    try {
      let i11 = new z$(n11.object.textEditorModel, M.getStartPosition(l10.range)), a11 = r10.item.anchor.range;
      await s10.invokeFunction(e207.runEditorCommand.bind(e207), t10, i11, a11);
    } finally {
      n11.dispose();
    }
  }));
  if (r10.part.command) {
    let { command: e207 } = r10.part;
    u10.push(new Du()), u10.push(new Tu(e207.id, e207.title, void 0, true, async () => {
      try {
        await o10.executeCommand(e207.id, ...e207.arguments ?? []);
      } catch (e208) {
        c10.notify({ severity: uw.Error, source: r10.item.provider.displayName, message: e208 });
      }
    }));
  }
  let f10 = t10.getOption(144);
  a10.showContextMenu({ domForShadowRoot: f10 ? t10.getDomNode() ?? void 0 : void 0, getAnchor: () => {
    let e207 = _l2(n10);
    return { x: e207.left, y: e207.top + e207.height + 8 };
  }, getActions: () => u10, onHide: () => {
    t10.focus();
  }, autoSelectFirstItem: true });
}
async function K$(e206, t10, n10, r10) {
  let i10 = await e206.get(wu).createModelReference(r10.uri);
  await n10.invokeWithinContext(async (e207) => {
    let a10 = t10.hasSideBySideModifier, o10 = e207.get(nd), s10 = $Q.inPeekEditor.getValue(o10);
    return new V$({ openToSide: a10, openInPeek: !a10 && n10.getOption(101) && !s10, muteMessage: true }, { title: { value: ``, original: `` }, id: ``, precondition: void 0 }).run(e207, new z$(i10.object.textEditorModel, M.getStartPosition(r10.range)), M.lift(r10.range));
  }), i10.dispose();
}
var rwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, q$ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, J$, iwe = class e183 {
  constructor() {
    this._entries = new Td(50);
  }
  get(t10) {
    let n10 = e183._key(t10);
    return this._entries.get(n10);
  }
  set(t10, n10) {
    let r10 = e183._key(t10);
    this._entries.set(r10, n10);
  }
  static _key(e206) {
    return `${e206.uri.toString()}/${e206.getVersionId()}`;
  }
}, Y$ = xu(`IInlayHintsCache`);
Zf(Y$, iwe, 1);
var X$ = class {
  constructor(e206, t10) {
    this.item = e206, this.index = t10;
  }
  get part() {
    let e206 = this.item.hint.label;
    return typeof e206 == `string` ? { label: e206 } : e206[this.index];
  }
}, awe = class {
  constructor(e206, t10) {
    this.part = e206, this.hasTriggerModifier = t10;
  }
}, owe = class {
  constructor() {
    this._store = new Jt(), this._tokenSource = new pr();
  }
  dispose() {
    this._store.dispose(), this._tokenSource.dispose(true);
  }
  reset() {
    return this._tokenSource.dispose(true), this._tokenSource = new pr(), this._store.value = new E(), { store: this._store.value, token: this._tokenSource.token };
  }
}, Z$ = (_qc = class {
  static get(e206) {
    return e206.getContribution(J$.ID) ?? void 0;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this._editor = e206, this._languageFeaturesService = t10, this._inlayHintsCache = r10, this._commandService = i10, this._notificationService = a10, this._instaService = o10, this._disposables = new E(), this._sessionDisposables = new E(), this._decorationsMetadata = /* @__PURE__ */ new Map(), this._activeRenderMode = 0, this._ruleFactory = this._disposables.add(new Cb(this._editor)), this._debounceInfo = n10.for(t10.inlayHintsProvider, `InlayHint`, { min: 25 }), this._disposables.add(t10.inlayHintsProvider.onDidChange(() => this._update())), this._disposables.add(e206.onDidChangeModel(() => this._update())), this._disposables.add(e206.onDidChangeModelLanguage(() => this._update())), this._disposables.add(e206.onDidChangeConfiguration((e207) => {
      e207.hasChanged(159) && this._update();
    })), this._update();
  }
  dispose() {
    this._sessionDisposables.dispose(), this._removeAllDecorations(), this._disposables.dispose();
  }
  _update() {
    this._sessionDisposables.clear(), this._removeAllDecorations();
    let e206 = this._editor.getOption(159);
    if (e206.enabled === `off`) return;
    let t10 = this._editor.getModel();
    if (!t10 || !this._languageFeaturesService.inlayHintsProvider.has(t10)) return;
    if (e206.enabled === `on`) this._activeRenderMode = 0;
    else {
      let t11, n11;
      e206.enabled === `onUnlessPressed` ? (t11 = 0, n11 = 1) : (t11 = 1, n11 = 0), this._activeRenderMode = t11, this._sessionDisposables.add(tu.getInstance().event((e207) => {
        if (!this._editor.hasModel()) return;
        let r11 = e207.altKey && e207.ctrlKey && !(e207.shiftKey || e207.metaKey) ? n11 : t11;
        if (r11 !== this._activeRenderMode) {
          this._activeRenderMode = r11;
          let e208 = this._editor.getModel(), t12 = this._copyInlayHintsWithCurrentAnchor(e208);
          this._updateHintsDecorators([e208.getFullModelRange()], t12), a10.schedule(0);
        }
      }));
    }
    let n10 = this._inlayHintsCache.get(t10);
    n10 && this._updateHintsDecorators([t10.getFullModelRange()], n10), this._sessionDisposables.add(T(() => {
      t10.isDisposed() || this._cacheHintsForFastRestore(t10);
    }));
    let r10 = /* @__PURE__ */ new Set();
    this._sessionDisposables.add(t10.onWillDispose(() => void 0));
    let i10 = this._sessionDisposables.add(new owe()), a10 = new us(async () => {
      let e207 = Date.now(), { store: n11, token: o11 } = i10.reset();
      try {
        let i11 = await GQ.create(this._languageFeaturesService.inlayHintsProvider, t10, this._getHintsRanges(), o11);
        if (a10.delay = this._debounceInfo.update(t10, Date.now() - e207), o11.isCancellationRequested) {
          i11.dispose();
          return;
        }
        for (let e208 of i11.provider) typeof e208.onDidChangeInlayHints == `function` && !r10.has(e208) && (r10.add(e208), n11.add(e208.onDidChangeInlayHints(() => {
          a10.isScheduled() || a10.schedule();
        })));
        n11.add(i11), this._updateHintsDecorators(i11.ranges, i11.items), this._cacheHintsForFastRestore(t10);
      } catch (e208) {
        be(e208);
      }
    }, this._debounceInfo.get(t10));
    this._sessionDisposables.add(a10), a10.schedule(0), this._sessionDisposables.add(this._editor.onDidScrollChange((e207) => {
      (e207.scrollTopChanged || !a10.isScheduled()) && a10.schedule();
    }));
    let o10 = this._sessionDisposables.add(new Jt());
    this._sessionDisposables.add(this._editor.onDidChangeModelContent((e207) => {
      let t11 = Math.max(a10.delay, 800);
      this._cursorInfo = { position: this._editor.getPosition(), notEarlierThan: Date.now() + t11 }, o10.value = as(() => a10.schedule(0), t11), a10.schedule();
    })), this._sessionDisposables.add(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(159) && a10.schedule();
    })), this._sessionDisposables.add(this._installDblClickGesture(() => a10.schedule(0))), this._sessionDisposables.add(this._installLinkGesture()), this._sessionDisposables.add(this._installContextMenu());
  }
  _installLinkGesture() {
    let e206 = new E(), t10 = e206.add(new UQ(this._editor)), n10 = new E();
    return e206.add(n10), e206.add(t10.onMouseMoveOrRelevantKeyDown((e207) => {
      let [t11] = e207, r10 = this._getInlayHintLabelPart(t11), i10 = this._editor.getModel();
      if (!r10 || !i10) {
        n10.clear();
        return;
      }
      let a10 = new pr();
      n10.add(T(() => a10.dispose(true))), r10.item.resolve(a10.token), this._activeInlayHintPart = r10.part.command || r10.part.location ? new awe(r10, t11.hasTriggerModifier) : void 0;
      let o10 = i10.validatePosition(r10.item.hint.position).lineNumber, s10 = new M(o10, 1, o10, i10.getLineMaxColumn(o10)), c10 = this._getInlineHintsForRange(s10);
      this._updateHintsDecorators([s10], c10), n10.add(T(() => {
        this._activeInlayHintPart = void 0, this._updateHintsDecorators([s10], c10);
      }));
    })), e206.add(t10.onCancel(() => n10.clear())), e206.add(t10.onExecute(async (e207) => {
      let t11 = this._getInlayHintLabelPart(e207);
      if (t11) {
        let n11 = t11.part;
        n11.location ? this._instaService.invokeFunction(K$, e207, this._editor, n11.location) : ji.is(n11.command) && await this._invokeCommand(n11.command, t11.item);
      }
    })), e206;
  }
  _getInlineHintsForRange(e206) {
    let t10 = /* @__PURE__ */ new Set();
    for (let n10 of this._decorationsMetadata.values()) e206.containsRange(n10.item.anchor.range) && t10.add(n10.item);
    return Array.from(t10);
  }
  _installDblClickGesture(e206) {
    return this._editor.onMouseUp(async (t10) => {
      if (t10.event.detail !== 2) return;
      let n10 = this._getInlayHintLabelPart(t10);
      if (n10 && (t10.event.preventDefault(), await n10.item.resolve(dr.None), v(n10.item.hint.textEdits))) {
        let t11 = n10.item.hint.textEdits.map((e207) => DF.replace(M.lift(e207.range), e207.text));
        this._editor.executeEdits(`inlayHint.default`, t11), e206();
      }
    });
  }
  _installContextMenu() {
    return this._editor.onContextMenu(async (e206) => {
      if (!Fl(e206.event.target)) return;
      let t10 = this._getInlayHintLabelPart(e206);
      t10 && await this._instaService.invokeFunction(nwe, this._editor, e206.event.target, t10);
    });
  }
  _getInlayHintLabelPart(e206) {
    if (e206.target.type !== 6) return;
    let t10 = e206.target.detail.injectedText?.options;
    if (t10 instanceof HO && t10?.attachedData instanceof X$) return t10.attachedData;
  }
  async _invokeCommand(e206, t10) {
    try {
      await this._commandService.executeCommand(e206.id, ...e206.arguments ?? []);
    } catch (e207) {
      this._notificationService.notify({ severity: uw.Error, source: t10.provider.displayName, message: e207 });
    }
  }
  _cacheHintsForFastRestore(e206) {
    let t10 = this._copyInlayHintsWithCurrentAnchor(e206);
    this._inlayHintsCache.set(e206, t10);
  }
  _copyInlayHintsWithCurrentAnchor(e206) {
    let t10 = /* @__PURE__ */ new Map();
    for (let [n10, r10] of this._decorationsMetadata) {
      if (t10.has(r10.item)) continue;
      let i10 = e206.getDecorationRange(n10);
      if (i10) {
        let e207 = new WQ(i10, r10.item.anchor.direction), n11 = r10.item.with({ anchor: e207 });
        t10.set(r10.item, n11);
      }
    }
    return Array.from(t10.values());
  }
  _getHintsRanges() {
    let e206 = this._editor.getModel(), t10 = this._editor.getVisibleRangesPlusViewportAboveBelow(), n10 = [];
    for (let r10 of t10.sort(M.compareRangesUsingStarts)) {
      let t11 = e206.validateRange(new M(r10.startLineNumber - 30, r10.startColumn, r10.endLineNumber + 30, r10.endColumn));
      n10.length === 0 || !M.areIntersectingOrTouching(n10[n10.length - 1], t11) ? n10.push(t11) : n10[n10.length - 1] = M.plusRange(n10[n10.length - 1], t11);
    }
    return n10;
  }
  _updateHintsDecorators(e206, t10) {
    let n10 = /* @__PURE__ */ new Map();
    if (this._cursorInfo && this._cursorInfo.notEarlierThan > Date.now() && e206.some((e207) => e207.containsPosition(this._cursorInfo.position))) {
      let { position: e207 } = this._cursorInfo;
      this._cursorInfo = void 0;
      let r11 = /* @__PURE__ */ new Map();
      for (let t11 of this._editor.getLineDecorations(e207.lineNumber) ?? []) {
        let n11 = this._decorationsMetadata.get(t11.id);
        if (t11.range.startColumn > e207.column) continue;
        let i12 = n11?.decoration.options[n11.item.anchor.direction];
        if (i12 && i12.attachedData !== J$._whitespaceData) {
          let e208 = r11.get(n11.item) ?? 0;
          r11.set(n11.item, e208 + i12.content.length);
        }
      }
      let i11 = t10.filter((t11) => t11.anchor.range.startLineNumber === e207.lineNumber && t11.anchor.range.endColumn <= e207.column), a11 = Array.from(r11.values()), o11;
      for (; ; ) {
        let e208 = i11.shift(), t11 = a11.shift();
        if (!t11 && !e208) break;
        if (e208) n10.set(e208, t11 ?? 0), o11 = e208;
        else if (o11 && t11) {
          let e209 = n10.get(o11);
          e209 += t11, e209 += a11.reduce((e211, t12) => e211 + t12, 0), a11.length = 0;
          break;
        }
      }
    }
    let r10 = [], i10 = (e207, t11, n11, i11, a11) => {
      let o11 = { content: n11, inlineClassNameAffectsLetterSpacing: true, inlineClassName: t11.className, cursorStops: i11, attachedData: a11 };
      r10.push({ item: e207, classNameRef: t11, decoration: { range: e207.anchor.range, options: { description: `InlayHint`, showIfCollapsed: e207.anchor.range.isEmpty(), collapseOnReplaceEdit: !e207.anchor.range.isEmpty(), stickiness: 0, [e207.anchor.direction]: this._activeRenderMode === 0 ? o11 : void 0 } } });
    }, a10 = (e207, t11) => {
      i10(e207, this._ruleFactory.createClassNameRef({ width: `${o10 / 3 | 0}px`, display: `inline-block` }), `\u200A`, t11 ? tm.Right : tm.None, J$._whitespaceData);
    }, { fontSize: o10, fontFamily: s10, padding: c10, isUniform: l10 } = this._getLayoutInfo(), u10 = this._editor.getOption(159).maximumLength, d10 = `--code-editorInlayHintsFontFamily`;
    this._editor.getContainerDomNode().style.setProperty(d10, s10);
    let f10 = { line: 0, totalLen: 0 };
    for (let e207 = 0; e207 < t10.length; e207++) {
      let s11 = t10[e207];
      if (f10.line !== s11.anchor.range.startLineNumber && (f10 = { line: s11.anchor.range.startLineNumber, totalLen: 0 }), u10 && f10.totalLen > u10) continue;
      s11.hint.paddingLeft && a10(s11, false);
      let p11 = typeof s11.hint.label == `string` ? [{ label: s11.hint.label }] : s11.hint.label, m11 = n10.get(s11), h10 = 0;
      for (let e208 = 0; e208 < p11.length; e208++) {
        let t11 = p11[e208], n11 = e208 === 0, r11 = e208 === p11.length - 1, a11 = { fontSize: `${o10}px`, fontFamily: `var(${d10}), ${_n.fontFamily}`, verticalAlign: l10 ? `baseline` : `middle`, unicodeBidi: `isolate` };
        v(s11.hint.textEdits) && (a11.cursor = `default`), this._fillInColors(a11, s11.hint), (t11.command || t11.location) && this._activeInlayHintPart?.part.item === s11 && this._activeInlayHintPart.part.index === e208 && (a11.textDecoration = `underline`, this._activeInlayHintPart.hasTriggerModifier && (a11.color = WS(gv), a11.cursor = `pointer`));
        let g10 = t11.label;
        f10.totalLen += g10.length;
        let _10 = false, y10 = u10 === 0 ? 0 : f10.totalLen - u10;
        if (y10 > 0 && (g10 = g10.slice(0, -y10) + `\u2026`, _10 = true), h10 += g10.length, m11 !== void 0) {
          let e209 = h10 - m11;
          e209 >= 0 && (h10 -= e209, g10 = g10.slice(0, -(1 + e209)) + `\u2026`, _10 = true);
        }
        if (c10 && (n11 && (r11 || _10) ? (a11.padding = `1px ${Math.max(1, o10 / 4) | 0}px`, a11.borderRadius = `${o10 / 4 | 0}px`) : n11 ? (a11.padding = `1px 0 1px ${Math.max(1, o10 / 4) | 0}px`, a11.borderRadius = `${o10 / 4 | 0}px 0 0 ${o10 / 4 | 0}px`) : r11 || _10 ? (a11.padding = `1px ${Math.max(1, o10 / 4) | 0}px 1px 0`, a11.borderRadius = `0 ${o10 / 4 | 0}px ${o10 / 4 | 0}px 0`) : a11.padding = `1px 0 1px 0`), i10(s11, this._ruleFactory.createClassNameRef(a11), swe(g10), r11 && !s11.hint.paddingRight ? tm.Right : tm.None, new X$(s11, e208)), _10) break;
      }
      if (m11 !== void 0 && h10 < m11) {
        let e208 = m11 - h10;
        i10(s11, this._ruleFactory.createClassNameRef({}), `\u200A`.repeat(e208), tm.None);
      }
      if (s11.hint.paddingRight && a10(s11, true), r10.length > J$._MAX_DECORATORS) break;
    }
    let p10 = [];
    for (let [t11, n11] of this._decorationsMetadata) {
      let r11 = this._editor.getModel()?.getDecorationRange(t11);
      r11 && e206.some((e207) => e207.containsRange(r11)) && (p10.push(t11), n11.classNameRef.dispose(), this._decorationsMetadata.delete(t11));
    }
    let m10 = FG.capture(this._editor);
    this._editor.changeDecorations((e207) => {
      let t11 = e207.deltaDecorations(p10, r10.map((e208) => e208.decoration));
      for (let e208 = 0; e208 < t11.length; e208++) {
        let n11 = r10[e208];
        this._decorationsMetadata.set(t11[e208], n11);
      }
    }), m10.restore(this._editor);
  }
  _fillInColors(e206, t10) {
    t10.kind === Mi.Parameter ? (e206.backgroundColor = WS(Pv), e206.color = WS(Nv)) : t10.kind === Mi.Type ? (e206.backgroundColor = WS(Mv), e206.color = WS(jv)) : (e206.backgroundColor = WS(Av), e206.color = WS(kv));
  }
  _getLayoutInfo() {
    let e206 = this._editor.getOption(159), t10 = e206.padding, n10 = this._editor.getOption(61), r10 = this._editor.getOption(58), i10 = e206.fontSize;
    (!i10 || i10 < 5 || i10 > n10) && (i10 = n10);
    let a10 = e206.fontFamily || r10;
    return { fontSize: i10, fontFamily: a10, padding: t10, isUniform: !t10 && a10 === r10 && i10 === n10 };
  }
  _removeAllDecorations() {
    this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));
    for (let e206 of this._decorationsMetadata.values()) e206.classNameRef.dispose();
    this._decorationsMetadata.clear();
  }
}, J$ = _qc, _qc.ID = `editor.contrib.InlayHints`, _qc._MAX_DECORATORS = 1500, _qc._whitespaceData = {}, _qc);
Z$ = J$ = rwe([q$(1, X), q$(2, lA), q$(3, Y$), q$(4, Mu), q$(5, dw), q$(6, V)], Z$);
function swe(e206) {
  return e206.replace(/[ \t]/g, `\xA0`);
}
Nu.registerCommand(`_executeInlayHintProvider`, async (e206, ...t10) => {
  let [n10, r10] = t10;
  Je($r.isUri(n10)), Je(M.isIRange(r10));
  let { inlayHintsProvider: i10 } = e206.get(X), a10 = await e206.get(wu).createModelReference(n10);
  try {
    let e207 = await GQ.create(i10, a10.object.textEditorModel, [M.lift(r10)], dr.None), t11 = e207.items.map((e208) => e208.hint);
    return setTimeout(() => e207.dispose(), 0), t11;
  } finally {
    a10.dispose();
  }
});
var cwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Q$ = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, $$ = class extends KX {
  constructor(e206, t10, n10, r10) {
    super(10, t10, e206.item.anchor.range, n10, r10, true), this.part = e206;
  }
}, e1 = class extends TQ {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(e206, t10, i10, o10, n10, r10, s10), this._resolverService = a10, this.hoverOrdinal = 6;
  }
  suggestHoverAnchor(e206) {
    if (!Z$.get(this._editor) || e206.target.type !== 6) return null;
    let t10 = e206.target.detail.injectedText?.options;
    return t10 instanceof HO && t10.attachedData instanceof X$ ? new $$(t10.attachedData, this, e206.event.posx, e206.event.posy) : null;
  }
  computeSync() {
    return [];
  }
  computeAsync(e206, t10, n10, r10) {
    return e206 instanceof $$ ? new ys(async (t11) => {
      let { part: n11 } = e206;
      if (await n11.item.resolve(r10), r10.isCancellationRequested) return;
      let i10;
      typeof n11.item.hint.tooltip == `string` ? i10 = new PM().appendText(n11.item.hint.tooltip) : n11.item.hint.tooltip && (i10 = n11.item.hint.tooltip), i10 && t11.emitOne(new CQ(this, e206.range, [i10], false, 0)), v(n11.item.hint.textEdits) && t11.emitOne(new CQ(this, e206.range, [new PM().appendText(C(1164, `Double-click to insert`))], false, 10001));
      let a10;
      if (typeof n11.part.tooltip == `string` ? a10 = new PM().appendText(n11.part.tooltip) : n11.part.tooltip && (a10 = n11.part.tooltip), a10 && t11.emitOne(new CQ(this, e206.range, [a10], false, 1)), n11.part.location || n11.part.command) {
        let r11, i11 = this._editor.getOption(86) === `altKey` ? Tt ? C(1165, `cmd + click`) : C(1166, `ctrl + click`) : Tt ? C(1167, `option + click`) : C(1168, `alt + click`);
        n11.part.location && n11.part.command ? r11 = new PM().appendText(C(1169, `Go to Definition ({0}), right click for more`, i11)) : n11.part.location ? r11 = new PM().appendText(C(1170, `Go to Definition ({0})`, i11)) : n11.part.command && (r11 = new PM(`[${C(1171, `Execute Command`)}](${PCe(n11.part.command)} "${n11.part.command.title}") (${i11})`, { isTrusted: true })), r11 && t11.emitOne(new CQ(this, e206.range, [r11], false, 1e4));
      }
      let o10 = this._resolveInlayHintLabelPartHover(n11, r10);
      for await (let e207 of o10) t11.emitOne(e207);
    }) : ys.EMPTY;
  }
  async *_resolveInlayHintLabelPartHover(e206, t10) {
    if (!e206.part.location) return;
    let { uri: n10, range: r10 } = e206.part.location, i10 = await this._resolverService.createModelReference(n10);
    try {
      let n11 = i10.object.textEditorModel;
      if (!this._languageFeaturesService.hoverProvider.has(n11)) return;
      for await (let i11 of yQ(this._languageFeaturesService.hoverProvider, n11, new j(r10.startLineNumber, r10.startColumn), t10)) FM(i11.hover.contents) || (yield new CQ(this, e206.item.anchor.range, i11.hover.contents, false, 2 + i11.ordinal));
    } finally {
      i10.dispose();
    }
  }
};
e1 = cwe([Q$(1, LP), Q$(2, Dw), Q$(3, uj), Q$(4, Uf), Q$(5, wu), Q$(6, X), Q$(7, Mu)], e1);
var t1 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, n1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, r1 = class {
  constructor(e206, t10, n10) {
    this.marker = e206, this.index = t10, this.total = n10;
  }
}, i1 = class {
  constructor(e206, t10, n10) {
    this._markerService = t10, this._configService = n10, this._onDidChange = new k(), this.onDidChange = this._onDidChange.event, this._dispoables = new E(), this._markers = [], this._nextIdx = -1, $r.isUri(e206) ? this._resourceFilter = (t11) => t11.toString() === e206.toString() : e206 && (this._resourceFilter = e206);
    let r10 = this._configService.getValue(`problems.sortOrder`), i10 = (e207, t11) => {
      let n11 = Ja(e207.resource.toString(), t11.resource.toString());
      return n11 === 0 && (n11 = r10 === `position` ? M.compareRangesUsingStarts(e207, t11) || UL.compare(e207.severity, t11.severity) : UL.compare(e207.severity, t11.severity) || M.compareRangesUsingStarts(e207, t11)), n11;
    }, a10 = () => {
      let t11 = this._markerService.read({ resource: $r.isUri(e206) ? e206 : void 0, severities: UL.Error | UL.Warning | UL.Info });
      return typeof e206 == `function` && (t11 = t11.filter((e207) => this._resourceFilter(e207.resource))), t11.sort(i10), o(t11, this._markers, (e207, t12) => e207.resource.toString() === t12.resource.toString() && e207.startLineNumber === t12.startLineNumber && e207.startColumn === t12.startColumn && e207.endLineNumber === t12.endLineNumber && e207.endColumn === t12.endColumn && e207.severity === t12.severity && e207.message === t12.message) ? false : (this._markers = t11, true);
    };
    a10(), this._dispoables.add(t10.onMarkerChanged((e207) => {
      (!this._resourceFilter || e207.some((e208) => this._resourceFilter(e208))) && a10() && (this._nextIdx = -1, this._onDidChange.fire());
    }));
  }
  dispose() {
    this._dispoables.dispose(), this._onDidChange.dispose();
  }
  matches(e206) {
    return !this._resourceFilter && !e206 ? true : !this._resourceFilter || !e206 ? false : this._resourceFilter(e206);
  }
  get selected() {
    let e206 = this._markers[this._nextIdx];
    return e206 && new r1(e206, this._nextIdx + 1, this._markers.length);
  }
  _initIdx(e206, t10, n10) {
    let r10 = this._markers.findIndex((t11) => Fd(t11.resource, e206.uri));
    if (r10 < 0) r10 = l(this._markers.length, (t11) => Ja(this._markers[t11].resource.toString(), e206.uri.toString())), r10 < 0 && (r10 = ~r10), n10 ? this._nextIdx = r10 : this._nextIdx = (this._markers.length + r10 - 1) % this._markers.length;
    else {
      let i10 = false, a10 = false;
      for (let n11 = r10; n11 < this._markers.length; n11++) {
        let r11 = M.lift(this._markers[n11]);
        if (r11.isEmpty()) {
          let t11 = e206.getWordAtPosition(r11.getStartPosition());
          t11 && (r11 = new M(r11.startLineNumber, t11.startColumn, r11.startLineNumber, t11.endColumn));
        }
        if (t10 && (r11.containsPosition(t10) || t10.isBeforeOrEqual(r11.getStartPosition()))) {
          this._nextIdx = n11, i10 = true, a10 = !r11.containsPosition(t10);
          break;
        }
        if (this._markers[n11].resource.toString() !== e206.uri.toString()) break;
      }
      i10 ? a10 && !n10 && --this._nextIdx : this._nextIdx = n10 ? 0 : this._markers.length - 1;
    }
    this._nextIdx < 0 && (this._nextIdx = this._markers.length - 1);
  }
  resetIndex() {
    this._nextIdx = -1;
  }
  move(e206, t10, n10) {
    if (this._markers.length === 0) return false;
    let r10 = this._nextIdx;
    return this._nextIdx === -1 ? this._initIdx(t10, n10, e206) : e206 ? this._nextIdx = (this._nextIdx + 1) % this._markers.length : e206 || (this._nextIdx = (this._nextIdx - 1 + this._markers.length) % this._markers.length), r10 !== this._nextIdx;
  }
  find(e206, t10) {
    let n10 = this._markers.findIndex((t11) => t11.resource.toString() === e206.toString());
    if (!(n10 < 0)) {
      for (; n10 < this._markers.length; n10++) if (M.containsPosition(this._markers[n10], t10)) return new r1(this._markers[n10], n10 + 1, this._markers.length);
    }
  }
};
i1 = t1([n1(1, GL), n1(2, Uf)], i1);
var a1 = xu(`IMarkerNavigationService`), o1 = class {
  constructor(e206, t10) {
    this._markerService = e206, this._configService = t10, this._provider = new Qt();
  }
  getMarkerList(e206) {
    for (let t10 of this._provider) {
      let n10 = t10.getMarkerList(e206);
      if (n10) return n10;
    }
    return new i1(e206, this._markerService, this._configService);
  }
};
o1 = t1([n1(0, GL), n1(1, Uf)], o1), Zf(a1, o1, 1);
var s1;
(function(e206) {
  function t10(e207) {
    switch (e207) {
      case lw.Ignore:
        return `severity-ignore ` + ju.asClassName(F.info);
      case lw.Info:
        return ju.asClassName(F.info);
      case lw.Warning:
        return ju.asClassName(F.warning);
      case lw.Error:
        return ju.asClassName(F.error);
      default:
        return ``;
    }
  }
  e206.className = t10;
})(s1 || (s1 = {}));
var lwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, c1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, l1, uwe = class {
  constructor(e206, t10, n10, r10, i10) {
    this._openerService = r10, this._labelService = i10, this._lines = 0, this._longestLineLength = 0, this._relatedDiagnostics = /* @__PURE__ */ new WeakMap(), this._disposables = new E(), this._editor = t10;
    let a10 = document.createElement(`div`);
    a10.className = `descriptioncontainer`, this._messageBlock = document.createElement(`div`), this._messageBlock.classList.add(`message`), this._messageBlock.setAttribute(`aria-live`, `assertive`), this._messageBlock.setAttribute(`role`, `alert`), a10.appendChild(this._messageBlock), this._relatedBlock = document.createElement(`div`), a10.appendChild(this._relatedBlock), this._disposables.add(el(this._relatedBlock, `click`, (e207) => {
      e207.preventDefault();
      let t11 = this._relatedDiagnostics.get(e207.target);
      t11 && n10(t11);
    })), this._scrollable = new px(a10, { horizontal: 1, vertical: 1, useShadows: false, horizontalScrollbarSize: 6, verticalScrollbarSize: 6 }), e206.appendChild(this._scrollable.getDomNode()), this._disposables.add(this._scrollable.onScroll((e207) => {
      a10.style.left = `-${e207.scrollLeft}px`, a10.style.top = `-${e207.scrollTop}px`;
    })), this._disposables.add(this._scrollable);
  }
  dispose() {
    Kt(this._disposables);
  }
  update(e206) {
    let { source: t10, message: n10, relatedInformation: r10, code: i10 } = e206, a10 = (t10?.length || 0) + 2;
    i10 && (typeof i10 == `string` ? a10 += i10.length : a10 += i10.value.length);
    let o10 = Wa(n10);
    this._lines = o10.length, this._longestLineLength = 0;
    for (let e207 of o10) this._longestLineLength = Math.max(e207.length + a10, this._longestLineLength);
    Xc(this._messageBlock), this._messageBlock.setAttribute(`aria-label`, this.getAriaLabel(e206)), this._editor.applyFontInfo(this._messageBlock);
    let s10 = this._messageBlock;
    for (let e207 of o10) s10 = document.createElement(`div`), s10.innerText = e207, e207 === `` && (s10.style.height = this._messageBlock.style.lineHeight), this._messageBlock.appendChild(s10);
    if (t10 || i10) {
      let e207 = document.createElement(`span`);
      if (e207.classList.add(`details`), s10.appendChild(e207), t10) {
        let n11 = document.createElement(`span`);
        n11.innerText = t10, n11.classList.add(`source`), e207.appendChild(n11);
      }
      if (i10) if (typeof i10 == `string`) {
        let t11 = document.createElement(`span`);
        t11.innerText = `(${i10})`, t11.classList.add(`code`), e207.appendChild(t11);
      } else {
        this._codeLink = B(`a.code-link`), this._codeLink.setAttribute(`href`, `${i10.target.toString()}`), this._codeLink.onclick = (e208) => {
          this._openerService.open(i10.target, { allowCommands: true }), e208.preventDefault(), e208.stopPropagation();
        };
        let t11 = z(this._codeLink, B(`span`));
        t11.innerText = i10.value, e207.appendChild(this._codeLink);
      }
    }
    if (Xc(this._relatedBlock), this._editor.applyFontInfo(this._relatedBlock), v(r10)) {
      let e207 = this._relatedBlock.appendChild(document.createElement(`div`));
      e207.style.paddingTop = `${Math.floor(this._editor.getOption(75) * 0.66)}px`, this._lines += 1;
      for (let t11 of r10) {
        let n11 = document.createElement(`div`), r11 = document.createElement(`a`);
        r11.classList.add(`filename`), r11.innerText = `${this._labelService.getUriBasenameLabel(t11.resource)}(${t11.startLineNumber}, ${t11.startColumn}): `, r11.title = this._labelService.getUriLabel(t11.resource), this._relatedDiagnostics.set(r11, t11);
        let i11 = document.createElement(`span`);
        i11.innerText = t11.message, n11.appendChild(r11), n11.appendChild(i11), this._lines += 1, e207.appendChild(n11);
      }
    }
    let c10 = this._editor.getOption(59), l10 = Math.ceil(c10.typicalFullwidthCharacterWidth * this._longestLineLength * 0.75), u10 = c10.lineHeight * this._lines;
    this._scrollable.setScrollDimensions({ scrollWidth: l10, scrollHeight: u10 });
  }
  layout(e206, t10) {
    this._scrollable.getDomNode().style.height = `${e206}px`, this._scrollable.getDomNode().style.width = `${t10}px`, this._scrollable.setScrollDimensions({ width: t10, height: e206 });
  }
  getHeightInLines() {
    return Math.min(17, this._lines);
  }
  getAriaLabel(e206) {
    let t10 = ``;
    switch (e206.severity) {
      case UL.Error:
        t10 = C(1024, `Error`);
        break;
      case UL.Warning:
        t10 = C(1025, `Warning`);
        break;
      case UL.Info:
        t10 = C(1026, `Info`);
        break;
      case UL.Hint:
        t10 = C(1027, `Hint`);
        break;
    }
    let n10 = C(1028, `{0} at {1}. `, t10, e206.startLineNumber + `:` + e206.startColumn), r10 = this._editor.getModel();
    return r10 && e206.startLineNumber <= r10.getLineCount() && e206.startLineNumber >= 1 && (n10 = `${r10.getLineContent(e206.startLineNumber)}, ${n10}`), n10;
  }
}, u1 = (_rc = class extends t$ {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(e206, { showArrow: true, showFrame: true, isAccessible: true, frameWidth: 1 }, i10), this._themeService = t10, this._openerService = n10, this._menuService = r10, this._contextKeyService = a10, this._labelService = o10, this._callOnDispose = new E(), this._onDidSelectRelatedInformation = new k(), this.onDidSelectRelatedInformation = this._onDidSelectRelatedInformation.event, this._severity = UL.Warning, this._backgroundColor = Y.white, this._applyTheme(t10.getColorTheme()), this._callOnDispose.add(t10.onDidColorThemeChange(this._applyTheme.bind(this))), this.create();
  }
  _applyTheme(e206) {
    this._backgroundColor = e206.getColor(mwe);
    let t10 = m1, n10 = dwe;
    this._severity === UL.Warning ? (t10 = h1, n10 = fwe) : this._severity === UL.Info && (t10 = g1, n10 = pwe);
    let r10 = e206.getColor(t10), i10 = e206.getColor(n10);
    this.style({ arrowColor: r10, frameColor: r10, headerBackgroundColor: i10, primaryHeadingColor: e206.getColor(n$), secondaryHeadingColor: e206.getColor(r$) });
  }
  _applyStyles() {
    this._parentContainer && (this._parentContainer.style.backgroundColor = this._backgroundColor ? this._backgroundColor.toString() : ``), super._applyStyles();
  }
  dispose() {
    this._callOnDispose.dispose(), super.dispose();
  }
  _fillHead(e206) {
    super._fillHead(e206), this._disposables.add(this._actionbarWidget.actionRunner.onWillRun((e207) => this.editor.focus()));
    let t10 = m_e(this._menuService.getMenuActions(l1.TitleMenu, this._contextKeyService));
    this._actionbarWidget.push(t10, { label: false, icon: true, index: 0 });
  }
  _fillTitleIcon(e206) {
    this._icon = z(e206, B(``));
  }
  _fillBody(e206) {
    this._parentContainer = e206, e206.classList.add(`marker-widget`), this._parentContainer.tabIndex = 0, this._parentContainer.setAttribute(`role`, `tooltip`), this._container = document.createElement(`div`), e206.appendChild(this._container), this._message = new uwe(this._container, this.editor, (e207) => this._onDidSelectRelatedInformation.fire(e207), this._openerService, this._labelService), this._disposables.add(this._message);
  }
  show() {
    throw Error(`call showAtMarker`);
  }
  showAtMarker(e206, t10, n10) {
    this._container.classList.remove(`stale`), this._message.update(e206), this._severity = e206.severity, this._applyTheme(this._themeService.getColorTheme());
    let r10 = M.lift(e206), i10 = this.editor.getPosition(), a10 = i10 && r10.containsPosition(i10) ? i10 : r10.getStartPosition();
    super.show(a10, this.computeRequiredHeight());
    let o10 = this.editor.getModel();
    if (o10) {
      let e207 = n10 > 1 ? C(1029, `{0} of {1} problems`, t10, n10) : C(1030, `{0} of {1} problem`, t10, n10);
      this.setTitle(Id(o10.uri), e207);
    }
    this._icon.className = `codicon ${s1.className(UL.toSeverity(this._severity))}`, this.editor.revealPositionNearTop(a10, 0), this.editor.focus();
  }
  updateMarker(e206) {
    this._container.classList.remove(`stale`), this._message.update(e206);
  }
  showStale() {
    this._container.classList.add(`stale`), this._relayout();
  }
  _doLayoutBody(e206, t10) {
    super._doLayoutBody(e206, t10), this._heightInPixel = e206, this._message.layout(e206, t10), this._container.style.height = `${e206}px`;
  }
  _onWidth(e206) {
    this._message.layout(this._heightInPixel, e206);
  }
  _relayout() {
    super._relayout(this.computeRequiredHeight());
  }
  computeRequiredHeight() {
    return 3 + this._message.getHeightInLines();
  }
}, l1 = _rc, _rc.TitleMenu = new W(`gotoErrorTitleMenu`), _rc);
u1 = l1 = lwe([c1(1, US), c1(2, IP), c1(3, pd), c1(4, V), c1(5, nd), c1(6, BF)], u1);
var d1 = I_(cv, lv), f1 = I_(dv, fv), p1 = I_(pv, mv), m1 = Q(`editorMarkerNavigationError.background`, { dark: d1, light: d1, hcDark: q_, hcLight: q_ }, C(1031, `Editor marker navigation widget error color.`)), dwe = Q(`editorMarkerNavigationError.headerBackground`, { dark: F_(m1, 0.1), light: F_(m1, 0.1), hcDark: null, hcLight: null }, C(1032, `Editor marker navigation widget error heading background.`)), h1 = Q(`editorMarkerNavigationWarning.background`, { dark: f1, light: f1, hcDark: q_, hcLight: q_ }, C(1033, `Editor marker navigation widget warning color.`)), fwe = Q(`editorMarkerNavigationWarning.headerBackground`, { dark: F_(h1, 0.1), light: F_(h1, 0.1), hcDark: `#0C141F`, hcLight: F_(h1, 0.2) }, C(1034, `Editor marker navigation widget warning heading background.`)), g1 = Q(`editorMarkerNavigationInfo.background`, { dark: p1, light: p1, hcDark: q_, hcLight: q_ }, C(1035, `Editor marker navigation widget info color.`)), pwe = Q(`editorMarkerNavigationInfo.headerBackground`, { dark: F_(g1, 0.1), light: F_(g1, 0.1), hcDark: null, hcLight: null }, C(1036, `Editor marker navigation widget info heading background.`)), mwe = Q(`editorMarkerNavigation.background`, rv, C(1037, `Editor marker navigation widget background.`)), hwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, _1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, v1, y1 = (_sc = class {
  static get(e206) {
    return e206.getContribution(v1.ID);
  }
  constructor(e206, t10, n10, r10, i10) {
    this._markerNavigationService = t10, this._contextKeyService = n10, this._editorService = r10, this._instantiationService = i10, this._sessionDispoables = new E(), this._editor = e206, this._widgetVisible = S1.bindTo(this._contextKeyService);
  }
  dispose() {
    this._cleanUp(), this._sessionDispoables.dispose();
  }
  _cleanUp() {
    this._widgetVisible.reset(), this._sessionDispoables.clear(), this._widget = void 0, this._model = void 0;
  }
  _getOrCreateModel(e206) {
    if (this._model && this._model.matches(e206)) return this._model;
    let t10 = false;
    return this._model && (t10 = true, this._cleanUp()), this._model = this._markerNavigationService.getMarkerList(e206), t10 && this._model.move(true, this._editor.getModel(), this._editor.getPosition()), this._widget = this._instantiationService.createInstance(u1, this._editor), this._widget.onDidClose(() => this.close(), this, this._sessionDispoables), this._widgetVisible.set(true), this._sessionDispoables.add(this._model), this._sessionDispoables.add(this._widget), this._sessionDispoables.add(this._editor.onDidChangeCursorPosition((e207) => {
      (!this._model?.selected || !M.containsPosition(this._model?.selected.marker, e207.position)) && this._model?.resetIndex();
    })), this._sessionDispoables.add(this._model.onDidChange(() => {
      if (!this._widget || !this._widget.position || !this._model) return;
      let e207 = this._model.find(this._editor.getModel().uri, this._widget.position);
      e207 ? this._widget.updateMarker(e207.marker) : this._widget.showStale();
    })), this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((e207) => {
      this._editorService.openCodeEditor({ resource: e207.resource, options: { pinned: true, revealIfOpened: true, selection: M.lift(e207).collapseToStart() } }, this._editor), this.close(false);
    })), this._sessionDispoables.add(this._editor.onDidChangeModel(() => this._cleanUp())), this._model;
  }
  close(e206 = true) {
    this._cleanUp(), e206 && this._editor.focus();
  }
  showAtMarker(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._editor.getModel(), n10 = this._getOrCreateModel(t10.uri);
    n10.resetIndex(), n10.move(true, t10, new j(e206.startLineNumber, e206.startColumn)), n10.selected && this._widget.showAtMarker(n10.selected.marker, n10.selected.index, n10.selected.total);
  }
  async navigate(e206, t10) {
    if (!this._editor.hasModel()) return;
    let n10 = this._editor.getModel(), r10 = this._getOrCreateModel(t10 ? void 0 : n10.uri);
    if (r10.move(e206, n10, this._editor.getPosition()), r10.selected) if (r10.selected.marker.resource.toString() !== n10.uri.toString()) {
      this._cleanUp();
      let n11 = await this._editorService.openCodeEditor({ resource: r10.selected.marker.resource, options: { pinned: false, revealIfOpened: true, selectionRevealType: 2, selection: r10.selected.marker } }, this._editor);
      n11 && (v1.get(n11)?.close(), v1.get(n11)?.navigate(e206, t10));
    } else this._widget.showAtMarker(r10.selected.marker, r10.selected.index, r10.selected.total);
  }
}, v1 = _sc, _sc.ID = `editor.contrib.markerController`, _sc);
y1 = v1 = hwe([_1(1, a1), _1(2, nd), _1(3, Su), _1(4, V)], y1);
var b1 = class extends G {
  constructor(e206, t10, n10) {
    super(n10), this._next = e206, this._multiFile = t10;
  }
  async run(e206, t10) {
    t10.hasModel() && await y1.get(t10)?.navigate(this._next, this._multiFile);
  }
}, x1 = (_tc = class extends b1 {
  constructor() {
    super(true, false, { id: _tc.ID, label: _tc.LABEL, precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 578, weight: 100 }, menuOpts: { menuId: u1.TitleMenu, title: _tc.LABEL.value, icon: AU(`marker-navigation-next`, F.arrowDown, C(1016, `Icon for goto next marker.`)), group: `navigation`, order: 1 } });
  }
}, _tc.ID = `editor.action.marker.next`, _tc.LABEL = w(1020, `Go to Next Problem (Error, Warning, Info)`), _tc), gwe = (_uc = class extends b1 {
  constructor() {
    super(false, false, { id: _uc.ID, label: _uc.LABEL, precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 1602, weight: 100 }, menuOpts: { menuId: u1.TitleMenu, title: _uc.LABEL.value, icon: AU(`marker-navigation-previous`, F.arrowUp, C(1017, `Icon for goto previous marker.`)), group: `navigation`, order: 2 } });
  }
}, _uc.ID = `editor.action.marker.prev`, _uc.LABEL = w(1021, `Go to Previous Problem (Error, Warning, Info)`), _uc), _we = class extends b1 {
  constructor() {
    super(true, true, { id: `editor.action.marker.nextInFiles`, label: w(1022, `Go to Next Problem in Files (Error, Warning, Info)`), precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 66, weight: 100 }, menuOpts: { menuId: W.MenubarGoMenu, title: C(1018, `Next &&Problem`), group: `6_problem_nav`, order: 1 } });
  }
}, vwe = class extends b1 {
  constructor() {
    super(false, true, { id: `editor.action.marker.prevInFiles`, label: w(1023, `Go to Previous Problem in Files (Error, Warning, Info)`), precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 1090, weight: 100 }, menuOpts: { menuId: W.MenubarGoMenu, title: C(1019, `Previous &&Problem`), group: `6_problem_nav`, order: 2 } });
  }
};
af(y1.ID, y1, 4), q(x1), q(gwe), q(_we), q(vwe);
var S1 = new U(`markersNavigationVisible`, false);
K(new ($d.bindToContribution(y1.get))({ id: `closeMarkersNavigation`, precondition: S1, handler: (e206) => e206.close(), kbOpts: { weight: 150, kbExpr: $.focus, primary: 9, secondary: [1033] } }));
var ywe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, C1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, w1 = B, T1 = class {
  constructor(e206, t10, n10) {
    this.owner = e206, this.range = t10, this.marker = n10;
  }
  isValidForHoverAnchor(e206) {
    return e206.type === 1 && this.range.startColumn <= e206.range.startColumn && this.range.endColumn >= e206.range.endColumn;
  }
}, E1 = { type: 1, filter: { include: nX.QuickFix }, triggerAction: rX.QuickFixHover }, D1 = class {
  constructor(e206, t10, n10, r10) {
    this._editor = e206, this._markerDecorationsService = t10, this._openerService = n10, this._languageFeaturesService = r10, this.hoverOrdinal = 1, this.recentMarkerCodeActionsInfo = void 0;
  }
  computeSync(e206, t10) {
    if (!this._editor.hasModel() || e206.type !== 1 && !e206.supportsMarkerHover) return [];
    let n10 = this._editor.getModel(), r10 = e206.range;
    if (!n10.isValidRange(e206.range)) return [];
    let i10 = r10.startLineNumber, a10 = n10.getLineMaxColumn(i10), o10 = [];
    for (let r11 of t10) {
      let t11 = r11.range.startLineNumber === i10 ? r11.range.startColumn : 1, s10 = r11.range.endLineNumber === i10 ? r11.range.endColumn : a10, c10 = this._markerDecorationsService.getMarker(n10.uri, r11);
      if (!c10) continue;
      let l10 = new M(e206.range.startLineNumber, t11, e206.range.startLineNumber, s10);
      o10.push(new T1(this, l10, c10));
    }
    return o10;
  }
  renderHoverParts(e206, t10) {
    if (!t10.length) return new qX([]);
    let n10 = [];
    t10.forEach((t11) => {
      let r11 = this._renderMarkerHover(t11);
      e206.fragment.appendChild(r11.hoverElement), n10.push(r11);
    });
    let r10 = t10.length === 1 ? t10[0] : t10.sort((e207, t11) => UL.compare(e207.marker.severity, t11.marker.severity))[0];
    return new qX(n10, this._renderMarkerStatusbar(e206, r10));
  }
  getAccessibleContent(e206) {
    return e206.marker.message;
  }
  _renderMarkerHover(e206) {
    let t10 = new E(), n10 = w1(`div.hover-row`), r10 = z(n10, w1(`div.marker.hover-contents`)), { source: i10, message: a10, code: o10, relatedInformation: s10 } = e206.marker;
    this._editor.applyFontInfo(r10);
    let c10 = z(r10, w1(`span`));
    if (c10.style.whiteSpace = `pre-wrap`, c10.innerText = a10, i10 || o10) if (o10 && typeof o10 != `string`) {
      let e207 = w1(`span`);
      if (i10) {
        let t11 = z(e207, w1(`span`));
        t11.innerText = i10;
      }
      let n11 = z(e207, w1(`a.code-link`));
      n11.setAttribute(`href`, o10.target.toString(true)), t10.add(L(n11, `click`, (e208) => {
        this._openerService.open(o10.target, { allowCommands: true }), e208.preventDefault(), e208.stopPropagation();
      }));
      let a11 = z(n11, w1(`span`));
      a11.innerText = o10.value;
      let s11 = z(r10, e207);
      s11.style.opacity = `0.6`, s11.style.paddingLeft = `6px`;
    } else {
      let e207 = z(r10, w1(`span`));
      e207.style.opacity = `0.6`, e207.style.paddingLeft = `6px`, e207.innerText = i10 && o10 ? `${i10}(${o10})` : i10 || `(${o10})`;
    }
    if (v(s10)) for (let { message: e207, resource: n11, startLineNumber: i11, startColumn: a11 } of s10) {
      let o11 = z(r10, w1(`div`));
      o11.style.marginTop = `8px`;
      let s11 = z(o11, w1(`a`));
      s11.innerText = `${Id(n11)}(${i11}, ${a11}): `, s11.style.cursor = `pointer`, t10.add(L(s11, `click`, (e208) => {
        if (e208.stopPropagation(), e208.preventDefault(), this._openerService) {
          let e209 = { selection: { startLineNumber: i11, startColumn: a11 } };
          this._openerService.open(n11, { fromUserGesture: true, editorOptions: e209 }).catch(be);
        }
      }));
      let c11 = z(o11, w1(`span`));
      c11.innerText = e207, this._editor.applyFontInfo(c11);
    }
    return { hoverPart: e206, hoverElement: n10, dispose: () => t10.dispose() };
  }
  _renderMarkerStatusbar(e206, t10) {
    let n10 = new E();
    if (t10.marker.severity === UL.Error || t10.marker.severity === UL.Warning || t10.marker.severity === UL.Info) {
      let n11 = y1.get(this._editor);
      n11 && e206.statusBar.addAction({ label: C(1139, `View Problem`), commandId: x1.ID, run: () => {
        e206.hide(), n11.showAtMarker(t10.marker), this._editor.focus();
      } });
    }
    if (!this._editor.getOption(104)) {
      let r10 = e206.statusBar.append(w1(`div`));
      this.recentMarkerCodeActionsInfo && (WL.makeKey(this.recentMarkerCodeActionsInfo.marker) === WL.makeKey(t10.marker) ? this.recentMarkerCodeActionsInfo.hasCodeActions || (r10.textContent = C(1140, `No quick fixes available`)) : this.recentMarkerCodeActionsInfo = void 0);
      let i10 = this.recentMarkerCodeActionsInfo && !this.recentMarkerCodeActionsInfo.hasCodeActions ? D.None : as(() => r10.textContent = C(1141, `Checking for quick fixes...`), 200, n10);
      r10.textContent || (r10.textContent = `\xA0`);
      let a10 = this.getCodeActions(t10.marker);
      n10.add(T(() => a10.cancel())), a10.then((a11) => {
        if (i10.dispose(), this.recentMarkerCodeActionsInfo = { marker: t10.marker, hasCodeActions: a11.validActions.length > 0 }, !this.recentMarkerCodeActionsInfo.hasCodeActions) {
          a11.dispose(), r10.textContent = C(1142, `No quick fixes available`);
          return;
        }
        r10.style.display = `none`;
        let o10 = false;
        n10.add(T(() => {
          o10 || a11.dispose();
        })), e206.statusBar.addAction({ label: C(1143, `Quick Fix...`), commandId: sX, run: (t11) => {
          o10 = true;
          let n11 = jX.get(this._editor), r11 = _l2(t11);
          e206.hide(), n11?.showCodeActions(E1, a11, { x: r11.left, y: r11.top, width: r11.width, height: r11.height });
        } });
        let s10 = a11.validActions.find((e207) => e207.action.isAI);
        s10 && e206.statusBar.addAction({ label: s10.action.title, commandId: s10.action.command?.id ?? ``, iconClass: ju.asClassName(F.sparkle), run: () => {
          jX.get(this._editor)?.applyCodeAction(s10, false, false, mX.FromProblemsHover);
        } }), e206.onContentsChanged();
      }, be);
    }
    return n10;
  }
  getCodeActions(e206) {
    return es((t10) => pX(this._languageFeaturesService.codeActionProvider, this._editor.getModel(), new M(e206.startLineNumber, e206.startColumn, e206.endLineNumber, e206.endColumn), E1, HF.None, t10));
  }
};
D1 = ywe([C1(1, qg), C1(2, IP), C1(3, X)], D1);
var O1 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, k1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, A1, j1, M1 = A1 = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super();
    let s10 = t10.hoverParts;
    this._renderedHoverParts = this._register(new N1(e206, n10, s10, r10, i10, a10, o10));
    let c10 = t10.options, l10 = c10.anchor, { showAtPosition: u10, showAtSecondaryPosition: d10 } = A1.computeHoverPositions(e206, l10.range, s10);
    this.shouldAppearBeforeContent = s10.some((e207) => e207.isBeforeContent), this.showAtPosition = u10, this.showAtSecondaryPosition = d10, this.initialMousePosX = l10.initialMousePosX, this.initialMousePosY = l10.initialMousePosY, this.shouldFocus = c10.shouldFocus, this.source = c10.source;
  }
  get domNode() {
    return this._renderedHoverParts.domNode;
  }
  get domNodeHasChildren() {
    return this._renderedHoverParts.domNodeHasChildren;
  }
  get focusedHoverPartIndex() {
    return this._renderedHoverParts.focusedHoverPartIndex;
  }
  get hoverPartsCount() {
    return this._renderedHoverParts.hoverPartsCount;
  }
  focusHoverPartWithIndex(e206) {
    this._renderedHoverParts.focusHoverPartWithIndex(e206);
  }
  async updateHoverVerbosityLevel(e206, t10, n10) {
    this._renderedHoverParts.updateHoverVerbosityLevel(e206, t10, n10);
  }
  isColorPickerVisible() {
    return this._renderedHoverParts.isColorPickerVisible();
  }
  static computeHoverPositions(e206, t10, n10) {
    let r10 = 1;
    if (e206.hasModel()) {
      let n11 = e206._getViewModel(), i11 = n11.coordinatesConverter, a11 = i11.convertModelRangeToViewRange(t10), o11 = n11.getLineMinColumn(a11.startLineNumber), s11 = new j(a11.startLineNumber, o11);
      r10 = i11.convertViewPositionToModelPosition(s11).column;
    }
    let i10 = t10.startLineNumber, a10 = t10.startColumn, o10;
    for (let e207 of n10) {
      let t11 = e207.range, n11 = t11.startLineNumber === i10, s11 = t11.endLineNumber === i10;
      if (n11 && s11) {
        let e208 = t11.startColumn;
        a10 = Math.max(Math.min(a10, e208), r10);
      }
      e207.forceShowAtRange && (o10 = t11);
    }
    let s10, c10;
    if (o10) {
      let e207 = o10.getStartPosition();
      s10 = e207, c10 = e207;
    } else s10 = t10.getStartPosition(), c10 = new j(i10, a10);
    return { showAtPosition: s10, showAtSecondaryPosition: c10 };
  }
};
M1 = A1 = O1([k1(4, Dw), k1(5, uj), k1(6, hW)], M1);
var bwe = class {
  constructor(e206, t10) {
    this._statusBar = t10, e206.appendChild(this._statusBar.hoverElement);
  }
  get hoverElement() {
    return this._statusBar.hoverElement;
  }
  get actions() {
    return this._statusBar.actions;
  }
  dispose() {
    this._statusBar.dispose();
  }
}, N1 = (_vc = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this._hoverService = a10, this._clipboardService = o10, this._renderedParts = [], this._focusedHoverPartIndex = -1, this._context = r10, this._fragment = document.createDocumentFragment(), this._register(this._renderParts(t10, n10, r10, i10, this._hoverService)), this._register(this._registerListenersOnRenderedParts()), this._register(this._createEditorDecorations(e206, n10)), this._updateMarkdownAndColorParticipantInfo(t10);
  }
  _createEditorDecorations(e206, t10) {
    if (t10.length === 0) return D.None;
    let n10 = t10[0].range;
    for (let e207 of t10) {
      let t11 = e207.range;
      n10 = M.plusRange(n10, t11);
    }
    let r10 = e206.createDecorationsCollection();
    return r10.set([{ range: n10, options: j1._DECORATION_OPTIONS }]), T(() => {
      r10.clear();
    });
  }
  _renderParts(e206, t10, n10, r10, i10) {
    let a10 = new MZ(r10, i10), o10 = { fragment: this._fragment, statusBar: a10, ...n10 }, s10 = new E();
    s10.add(a10);
    for (let n11 of e206) {
      let e207 = this._renderHoverPartsForParticipant(t10, n11, o10);
      s10.add(e207);
      for (let t11 of e207.renderedHoverParts) this._renderedParts.push({ type: `hoverPart`, participant: n11, hoverPart: t11.hoverPart, hoverElement: t11.hoverElement });
    }
    let c10 = this._renderStatusBar(this._fragment, a10);
    return c10 && (s10.add(c10), this._renderedParts.push({ type: `statusBar`, hoverElement: c10.hoverElement, actions: c10.actions })), s10;
  }
  _renderHoverPartsForParticipant(e206, t10, n10) {
    let r10 = e206.filter((e207) => e207.owner === t10);
    return r10.length > 0 ? t10.renderHoverParts(n10, r10) : new qX([]);
  }
  _renderStatusBar(e206, t10) {
    if (t10.hasContent) return new bwe(e206, t10);
  }
  _registerListenersOnRenderedParts() {
    let e206 = new E();
    return this._renderedParts.forEach((t10, n10) => {
      let r10 = t10.hoverElement;
      r10.tabIndex = 0, e206.add(L(r10, R.FOCUS_IN, (e207) => {
        e207.stopPropagation(), this._focusedHoverPartIndex = n10;
      })), e206.add(L(r10, R.FOCUS_OUT, (e207) => {
        e207.stopPropagation(), this._focusedHoverPartIndex = -1;
      })), t10.type === `hoverPart` && t10.hoverPart instanceof T1 && e206.add(new vQ(r10, () => t10.participant.getAccessibleContent(t10.hoverPart), this._clipboardService, this._hoverService));
    }), e206;
  }
  _updateMarkdownAndColorParticipantInfo(e206) {
    let t10 = e206.find((e207) => e207 instanceof TQ && !(e207 instanceof e1));
    t10 && (this._markdownHoverParticipant = t10), this._colorHoverParticipant = e206.find((e207) => e207 instanceof LQ);
  }
  focusHoverPartWithIndex(e206) {
    e206 < 0 || e206 >= this._renderedParts.length || this._renderedParts[e206].hoverElement.focus();
  }
  async updateHoverVerbosityLevel(e206, t10, n10) {
    if (!this._markdownHoverParticipant) return;
    let r10;
    r10 = t10 >= 0 ? { start: t10, endExclusive: t10 + 1 } : this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);
    for (let t11 = r10.start; t11 < r10.endExclusive; t11++) {
      let n11 = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, t11);
      if (n11 === void 0) continue;
      let r11 = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e206, n11);
      r11 && (this._renderedParts[t11] = { type: `hoverPart`, participant: this._markdownHoverParticipant, hoverPart: r11.hoverPart, hoverElement: r11.hoverElement });
    }
    n10 && (t10 >= 0 ? this.focusHoverPartWithIndex(t10) : this._context.focus()), this._context.onContentsChanged();
  }
  isColorPickerVisible() {
    return this._colorHoverParticipant?.isColorPickerVisible() ?? false;
  }
  _normalizedIndexToMarkdownHoverIndexRange(e206, t10) {
    let n10 = this._renderedParts[t10];
    if (!n10 || n10.type !== `hoverPart` || n10.participant !== e206) return;
    let r10 = this._renderedParts.findIndex((t11) => t11.type === `hoverPart` && t11.participant === e206);
    if (r10 === -1) throw new je();
    return t10 - r10;
  }
  _findRangeOfMarkdownHoverParts(e206) {
    let t10 = this._renderedParts.slice(), n10 = t10.findIndex((t11) => t11.type === `hoverPart` && t11.participant === e206), r10 = t10.reverse().findIndex((t11) => t11.type === `hoverPart` && t11.participant === e206);
    return { start: n10, endExclusive: (r10 >= 0 ? t10.length - r10 : r10) + 1 };
  }
  get domNode() {
    return this._fragment;
  }
  get domNodeHasChildren() {
    return this._fragment.hasChildNodes();
  }
  get focusedHoverPartIndex() {
    return this._focusedHoverPartIndex;
  }
  get hoverPartsCount() {
    return this._renderedParts.length;
  }
}, j1 = _vc, _vc._DECORATION_OPTIONS = UO.register({ description: `content-hover-highlight`, className: `hoverHighlight` }), _vc);
N1 = j1 = O1([k1(4, Dw), k1(5, uj), k1(6, hW)], N1);
var xwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, P1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, F1 = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._editor = e206, this._instantiationService = t10, this._keybindingService = n10, this._hoverService = r10, this._clipboardService = i10, this._currentResult = null, this._renderedContentHover = this._register(new Jt()), this._onContentsChanged = this._register(new k()), this.onContentsChanged = this._onContentsChanged.event, this._contentHoverWidget = this._register(this._instantiationService.createInstance(DZ, this._editor)), this._participants = this._initializeHoverParticipants(), this._hoverOperation = this._register(new xZ(this._editor, new OSe(this._editor, this._participants))), this._registerListeners();
  }
  _initializeHoverParticipants() {
    let e206 = [];
    for (let t10 of JX.getAll()) {
      let n10 = this._instantiationService.createInstance(t10, this._editor);
      e206.push(n10);
    }
    return e206.sort((e207, t10) => e207.hoverOrdinal - t10.hoverOrdinal), this._register(this._contentHoverWidget.onDidResize(() => {
      this._participants.forEach((e207) => e207.handleResize?.());
    })), this._register(this._contentHoverWidget.onDidScroll((e207) => {
      this._participants.forEach((t10) => t10.handleScroll?.(e207));
    })), this._register(this._contentHoverWidget.onContentsChanged(() => {
      this._participants.forEach((e207) => e207.handleContentsChanged?.());
    })), e206;
  }
  _registerListeners() {
    this._register(this._hoverOperation.onResult((e207) => {
      let t10 = e207.hasLoadingMessage ? this._addLoadingMessage(e207) : e207.value;
      this._withResult(new kZ(t10, e207.isComplete, e207.options));
    }));
    let e206 = this._contentHoverWidget.getDomNode();
    this._register(el(e206, `keydown`, (e207) => {
      e207.equals(9) && this.hide();
    })), this._register(el(e206, `mouseleave`, (e207) => {
      this._onMouseLeave(e207);
    })), this._register(Pi.onDidChange(() => {
      this._contentHoverWidget.position && this._currentResult && this._setCurrentResult(this._currentResult);
    })), this._register(this._contentHoverWidget.onContentsChanged(() => {
      this._onContentsChanged.fire();
    }));
  }
  _startShowingOrUpdateHover(e206, t10, n10, r10, i10) {
    if (!(this._contentHoverWidget.position && this._currentResult)) return e206 ? (this._startHoverOperationIfNecessary(e206, t10, n10, r10, false), true) : false;
    let a10 = this._editor.getOption(69).sticky, o10 = i10 && this._contentHoverWidget.isMouseGettingCloser(i10.event.posx, i10.event.posy);
    return a10 && o10 ? (e206 && this._startHoverOperationIfNecessary(e206, t10, n10, r10, true), true) : e206 ? this._currentResult && this._currentResult.options.anchor.equals(e206) ? true : this._currentResult && e206.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position) ? (this._currentResult && this._setCurrentResult(this._currentResult.filter(e206)), this._startHoverOperationIfNecessary(e206, t10, n10, r10, false), true) : (this._setCurrentResult(null), this._startHoverOperationIfNecessary(e206, t10, n10, r10, false), true) : (this._setCurrentResult(null), false);
  }
  _startHoverOperationIfNecessary(e206, t10, n10, r10, i10) {
    if (this._hoverOperation.options && this._hoverOperation.options.anchor.equals(e206)) return;
    this._hoverOperation.cancel();
    let a10 = { anchor: e206, source: n10, shouldFocus: r10, insistOnKeepingHoverVisible: i10 };
    this._hoverOperation.start(t10, a10);
  }
  _setCurrentResult(e206) {
    let t10 = e206;
    this._currentResult !== t10 && (t10 && t10.hoverParts.length === 0 && (t10 = null), this._currentResult = t10, this._currentResult ? this._showHover(this._currentResult) : this._hideHover());
  }
  _addLoadingMessage(e206) {
    for (let t10 of this._participants) {
      if (!t10.createLoadingMessage) continue;
      let n10 = t10.createLoadingMessage(e206.options.anchor);
      if (n10) return e206.value.slice(0).concat([n10]);
    }
    return e206.value;
  }
  _withResult(e206) {
    if (this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete || this._setCurrentResult(e206), !e206.isComplete) return;
    let t10 = e206.hoverParts.length === 0, n10 = e206.options.insistOnKeepingHoverVisible;
    t10 && n10 || this._setCurrentResult(e206);
  }
  _showHover(e206) {
    let t10 = this._getHoverContext();
    this._renderedContentHover.value = new M1(this._editor, e206, this._participants, t10, this._keybindingService, this._hoverService, this._clipboardService), this._renderedContentHover.value.domNodeHasChildren ? this._contentHoverWidget.show(this._renderedContentHover.value) : this._renderedContentHover.clear();
  }
  _hideHover() {
    this._contentHoverWidget.hide(), this._participants.forEach((e206) => e206.handleHide?.());
  }
  _getHoverContext() {
    return { hide: () => {
      this.hide();
    }, onContentsChanged: () => {
      this._contentHoverWidget.handleContentsChanged();
    }, setMinimumDimensions: (e206) => {
      this._contentHoverWidget.setMinimumDimensions(e206);
    }, focus: () => this.focus() };
  }
  showsOrWillShow(e206) {
    if (this._contentHoverWidget.isResizing) return true;
    let t10 = this._findHoverAnchorCandidates(e206);
    if (!(t10.length > 0)) return this._startShowingOrUpdateHover(null, 0, 0, false, e206);
    let n10 = t10[0];
    return this._startShowingOrUpdateHover(n10, 0, 0, false, e206);
  }
  _findHoverAnchorCandidates(e206) {
    let t10 = [];
    for (let n11 of this._participants) {
      if (!n11.suggestHoverAnchor) continue;
      let r10 = n11.suggestHoverAnchor(e206);
      r10 && t10.push(r10);
    }
    let n10 = e206.target;
    switch (n10.type) {
      case 6:
        t10.push(new GX(0, n10.range, e206.event.posx, e206.event.posy));
        break;
      case 7: {
        let r10 = this._editor.getOption(59).typicalHalfwidthCharacterWidth / 2;
        if (!(!n10.detail.isAfterLines && typeof n10.detail.horizontalDistanceToText == `number` && n10.detail.horizontalDistanceToText < r10)) break;
        t10.push(new GX(0, n10.range, e206.event.posx, e206.event.posy));
        break;
      }
    }
    return t10.sort((e207, t11) => t11.priority - e207.priority), t10;
  }
  _onMouseLeave(e206) {
    let t10 = this._editor.getDomNode();
    (!t10 || !bZ(t10, e206.x, e206.y)) && this.hide();
  }
  startShowingAtRange(e206, t10, n10, r10) {
    this._startShowingOrUpdateHover(new GX(0, e206, void 0, void 0), t10, n10, r10, null);
  }
  async updateHoverVerbosityLevel(e206, t10, n10) {
    this._renderedContentHover.value?.updateHoverVerbosityLevel(e206, t10, n10);
  }
  focusedHoverPartIndex() {
    return this._renderedContentHover.value?.focusedHoverPartIndex ?? -1;
  }
  containsNode(e206) {
    return e206 ? this._contentHoverWidget.getDomNode().contains(e206) : false;
  }
  focus() {
    if (this._renderedContentHover.value?.hoverPartsCount === 1) {
      this.focusHoverPartWithIndex(0);
      return;
    }
    this._contentHoverWidget.focus();
  }
  focusHoverPartWithIndex(e206) {
    this._renderedContentHover.value?.focusHoverPartWithIndex(e206);
  }
  scrollUp() {
    this._contentHoverWidget.scrollUp();
  }
  scrollDown() {
    this._contentHoverWidget.scrollDown();
  }
  scrollLeft() {
    this._contentHoverWidget.scrollLeft();
  }
  scrollRight() {
    this._contentHoverWidget.scrollRight();
  }
  pageUp() {
    this._contentHoverWidget.pageUp();
  }
  pageDown() {
    this._contentHoverWidget.pageDown();
  }
  goToTop() {
    this._contentHoverWidget.goToTop();
  }
  goToBottom() {
    this._contentHoverWidget.goToBottom();
  }
  hide() {
    this._hoverOperation.cancel(), this._setCurrentResult(null);
  }
  getDomNode() {
    return this._contentHoverWidget.getDomNode();
  }
  get isColorPickerVisible() {
    return this._renderedContentHover.value?.isColorPickerVisible() ?? false;
  }
  get isVisibleFromKeyboard() {
    return this._contentHoverWidget.isVisibleFromKeyboard;
  }
  get isVisible() {
    return this._contentHoverWidget.isVisible;
  }
  get isFocused() {
    return this._contentHoverWidget.isFocused;
  }
  get isResizing() {
    return this._contentHoverWidget.isResizing;
  }
  get widget() {
    return this._contentHoverWidget;
  }
};
F1 = xwe([P1(1, V), P1(2, Dw), P1(3, uj), P1(4, hW)], F1);
function I1(e206) {
  let t10 = e206.target;
  return !!t10 && t10.type === 6 && t10.detail.injectedText?.options.attachedData === aZ;
}
var Swe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, L1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, R1, z1 = (_wc = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._instantiationService = n10, this._keybindingService = r10, this._onHoverContentsChanged = this._register(new k()), this.shouldKeepOpenOnEditorMouseMoveOrLeave = false, this._listenersStore = new E(), this._isMouseDown = false, this._ignoreMouseEvents = false, this._reactToEditorMouseMoveRunner = this._register(new us(() => {
      this._mouseMoveEvent && this._reactToEditorMouseMove(this._mouseMoveEvent);
    }, 0)), this._register(t10.onDidShowContextMenu(() => {
      this.hideContentHover(), this._ignoreMouseEvents = true;
    })), this._register(t10.onDidHideContextMenu(() => {
      this._ignoreMouseEvents = false;
    })), this._hookListeners(), this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(69) && (this._unhookListeners(), this._hookListeners());
    }));
  }
  static get(e206) {
    return e206.getContribution(R1.ID);
  }
  _hookListeners() {
    let e206 = this._editor.getOption(69);
    this._hoverSettings = { enabled: e206.enabled, sticky: e206.sticky, hidingDelay: e206.hidingDelay }, e206.enabled || this._cancelSchedulerAndHide(), this._listenersStore.add(this._editor.onMouseDown((e207) => this._onEditorMouseDown(e207))), this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())), this._listenersStore.add(this._editor.onMouseMove((e207) => this._onEditorMouseMove(e207))), this._listenersStore.add(this._editor.onKeyDown((e207) => this._onKeyDown(e207))), this._listenersStore.add(this._editor.onMouseLeave((e207) => this._onEditorMouseLeave(e207))), this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide())), this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())), this._listenersStore.add(this._editor.onDidScrollChange((e207) => this._onEditorScrollChanged(e207)));
  }
  _unhookListeners() {
    this._listenersStore.clear();
  }
  _cancelSchedulerAndHide() {
    this._cancelScheduler(), this.hideContentHover();
  }
  _cancelScheduler() {
    this._mouseMoveEvent = void 0, this._reactToEditorMouseMoveRunner.cancel();
  }
  _onEditorScrollChanged(e206) {
    this._ignoreMouseEvents || (e206.scrollTopChanged || e206.scrollLeftChanged) && this.hideContentHover();
  }
  _onEditorMouseDown(e206) {
    this._ignoreMouseEvents || (this._isMouseDown = true, !this._shouldKeepHoverWidgetVisible(e206) && this.hideContentHover());
  }
  _shouldKeepHoverWidgetVisible(e206) {
    return this._isMouseOnContentHoverWidget(e206) || this._isContentWidgetResizing() || I1(e206);
  }
  _isMouseOnContentHoverWidget(e206) {
    return this._contentWidget ? bZ(this._contentWidget.getDomNode(), e206.event.posx, e206.event.posy) : false;
  }
  _onEditorMouseUp() {
    this._ignoreMouseEvents || (this._isMouseDown = false);
  }
  _onEditorMouseLeave(e206) {
    this._ignoreMouseEvents || this.shouldKeepOpenOnEditorMouseMoveOrLeave || (this._cancelScheduler(), !this._shouldKeepHoverWidgetVisible(e206) && this.hideContentHover());
  }
  _shouldKeepCurrentHover(e206) {
    let t10 = this._contentWidget;
    if (!t10) return false;
    let n10 = this._hoverSettings.sticky, r10 = (e207, t11) => {
      let n11 = this._isMouseOnContentHoverWidget(e207);
      return t11 && n11;
    }, i10 = (e207) => {
      let n11 = t10.isColorPickerVisible, r11 = this._isMouseOnContentHoverWidget(e207), i11 = n11 && r11, a11 = n11 && this._isMouseDown;
      return i11 || a11;
    }, a10 = (e207, n11) => {
      let r11 = e207.event.browserEvent.view;
      return r11 ? n11 && t10.containsNode(r11.document.activeElement) && !r11.getSelection()?.isCollapsed : false;
    }, o10 = t10.isFocused, s10 = t10.isResizing, c10 = this._hoverSettings.sticky && t10.isVisibleFromKeyboard;
    return this.shouldKeepOpenOnEditorMouseMoveOrLeave || o10 || s10 || c10 || r10(e206, n10) || i10(e206) || a10(e206, n10);
  }
  _onEditorMouseMove(e206) {
    if (!this._ignoreMouseEvents) {
      if (this._mouseMoveEvent = e206, this._shouldKeepCurrentHover(e206)) {
        this._reactToEditorMouseMoveRunner.cancel();
        return;
      }
      if (this._shouldRescheduleHoverComputation()) {
        this._reactToEditorMouseMoveRunner.isScheduled() || this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);
        return;
      }
      this._reactToEditorMouseMove(e206);
    }
  }
  _shouldRescheduleHoverComputation() {
    let e206 = this._hoverSettings.hidingDelay;
    return (this._contentWidget?.isVisible ?? false) && this._hoverSettings.sticky && e206 > 0;
  }
  _reactToEditorMouseMove(e206) {
    this._hoverSettings.enabled && this._getOrCreateContentWidget().showsOrWillShow(e206) || this.hideContentHover();
  }
  _onKeyDown(e206) {
    if (this._ignoreMouseEvents || !this._contentWidget) return;
    let t10 = this._isPotentialKeyboardShortcut(e206), n10 = this._isModifierKeyPressed(e206);
    t10 || n10 || this._contentWidget.isFocused && e206.keyCode === 2 || this.hideContentHover();
  }
  _isPotentialKeyboardShortcut(e206) {
    if (!this._editor.hasModel() || !this._contentWidget) return false;
    let t10 = this._keybindingService.softDispatch(e206, this._editor.getDomNode()), n10 = t10.kind === 1, r10 = t10.kind === 2 && (t10.commandId === `editor.action.showHover` || t10.commandId === `editor.action.increaseHoverVerbosityLevel` || t10.commandId === `editor.action.decreaseHoverVerbosityLevel`) && this._contentWidget.isVisible;
    return n10 || r10;
  }
  _isModifierKeyPressed(e206) {
    return e206.keyCode === 5 || e206.keyCode === 6 || e206.keyCode === 57 || e206.keyCode === 4;
  }
  hideContentHover() {
    vZ.dropDownVisible || this._contentWidget?.hide();
  }
  _getOrCreateContentWidget() {
    return this._contentWidget || (this._contentWidget = this._instantiationService.createInstance(F1, this._editor), this._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire()))), this._contentWidget;
  }
  showContentHover(e206, t10, n10, r10) {
    this._getOrCreateContentWidget().startShowingAtRange(e206, t10, n10, r10);
  }
  _isContentWidgetResizing() {
    return this._contentWidget?.widget.isResizing || false;
  }
  focusedHoverPartIndex() {
    return this._getOrCreateContentWidget().focusedHoverPartIndex();
  }
  updateHoverVerbosityLevel(e206, t10, n10) {
    this._getOrCreateContentWidget().updateHoverVerbosityLevel(e206, t10, n10);
  }
  focus() {
    this._contentWidget?.focus();
  }
  scrollUp() {
    this._contentWidget?.scrollUp();
  }
  scrollDown() {
    this._contentWidget?.scrollDown();
  }
  scrollLeft() {
    this._contentWidget?.scrollLeft();
  }
  scrollRight() {
    this._contentWidget?.scrollRight();
  }
  pageUp() {
    this._contentWidget?.pageUp();
  }
  pageDown() {
    this._contentWidget?.pageDown();
  }
  goToTop() {
    this._contentWidget?.goToTop();
  }
  goToBottom() {
    this._contentWidget?.goToBottom();
  }
  get isColorPickerVisible() {
    return this._contentWidget?.isColorPickerVisible;
  }
  get isHoverVisible() {
    return this._contentWidget?.isVisible;
  }
  dispose() {
    super.dispose(), this._unhookListeners(), this._listenersStore.dispose(), this._contentWidget?.dispose();
  }
}, R1 = _wc, _wc.ID = `editor.contrib.contentHover`, _wc);
z1 = R1 = Swe([L1(1, mj), L1(2, V), L1(3, Dw)], z1);
var B1 = (_xc = class extends D {
  constructor(e206) {
    super(), this._editor = e206, this._register(e206.onMouseDown((e207) => this.onMouseDown(e207)));
  }
  dispose() {
    super.dispose();
  }
  onMouseDown(e206) {
    let t10 = this._editor.getOption(168);
    if (t10 !== `click` && t10 !== `clickAndHover` || !I1(e206)) return;
    let n10 = this._editor.getContribution(z1.ID);
    if (!n10 || n10.isColorPickerVisible) return;
    let r10 = e206.target.range;
    if (!r10) return;
    let i10 = new M(r10.startLineNumber, r10.startColumn + 1, r10.endLineNumber, r10.endColumn + 1);
    n10.showContentHover(i10, 1, 1, false);
  }
}, _xc.ID = `editor.contrib.colorContribution`, _xc), Cwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, wwe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Twe = class e184 {
  constructor(e206, t10, n10, r10) {
    this.owner = e206, this.range = t10, this.model = n10, this.provider = r10;
  }
  static fromBaseColor(t10, n10) {
    return new e184(t10, n10.range, n10.model, n10.provider);
  }
}, Ewe = class extends D {
  constructor(e206, t10, n10, r10) {
    super();
    let i10 = e206.getModel(), a10 = n10.model;
    this.color = n10.model.color, this.colorPicker = this._register(new MQ(t10.fragment, a10, e206.getOption(163), r10, `standalone`)), this._register(a10.onColorFlushed((e207) => {
      this.color = e207;
    })), this._register(a10.onDidChangeColor((e207) => {
      FQ(i10, a10, e207, n10.range, n10);
    })), this._register(e206.onDidChangeModelContent((n11) => {
      t10.hide(), e206.focus();
    })), FQ(i10, a10, this.color, n10.range, n10);
  }
}, V1 = class {
  constructor(e206, t10) {
    this._editor = e206, this._themeService = t10;
  }
  async createColorHover(e206, t10, n10) {
    if (!this._editor.hasModel() || !oZ.get(this._editor)) return null;
    let r10 = await $X(n10, this._editor.getModel(), dr.None), i10 = null, a10 = null;
    for (let t11 of r10) {
      let n11 = t11.colorInfo;
      M.containsRange(n11.range, e206.range) && (i10 = n11, a10 = t11.provider);
    }
    let o10 = i10 ?? e206, s10 = a10 ?? t10, c10 = !!i10;
    return { colorHover: Twe.fromBaseColor(this, await NQ(this._editor.getModel(), o10, s10)), foundInEditor: c10 };
  }
  async updateEditorModel(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = e206.model, n10 = new M(e206.range.startLineNumber, e206.range.startColumn, e206.range.endLineNumber, e206.range.endColumn);
    this._color && (await FQ(this._editor.getModel(), t10, this._color, n10, e206), n10 = PQ(this._editor, n10, t10));
  }
  renderHoverParts(e206, t10) {
    if (!(t10.length === 0 || !this._editor.hasModel())) return this._setMinimumDimensions(e206), this._renderedParts = new Ewe(this._editor, e206, t10[0], this._themeService), this._renderedParts;
  }
  _setMinimumDimensions(e206) {
    let t10 = this._editor.getOption(75) + 8;
    e206.setMinimumDimensions(new ml(302, t10));
  }
  get _color() {
    return this._renderedParts?.color;
  }
};
V1 = Cwe([wwe(1, US)], V1);
var Dwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, H1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, U1, Owe = class {
  constructor(e206, t10) {
    this.value = e206, this.foundInEditor = t10;
  }
}, W1 = 8, kwe = 22, G1 = (_yc = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(), this._editor = e206, this._standaloneColorPickerVisible = t10, this._standaloneColorPickerFocused = n10, this._keybindingService = i10, this._languageFeaturesService = a10, this._editorWorkerService = o10, this._hoverService = s10, this.allowEditorOverflow = true, this._position = void 0, this._body = document.createElement(`div`), this._colorHover = null, this._selectionSetInEditor = false, this._onResult = this._register(new k()), this.onResult = this._onResult.event, this._renderedHoverParts = this._register(new Jt()), this._renderedStatusBar = this._register(new Jt()), this._standaloneColorPickerVisible.set(true), this._standaloneColorPickerParticipant = r10.createInstance(V1, this._editor), this._position = this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;
    let c10 = this._editor.getSelection(), l10 = c10 ? { startLineNumber: c10.startLineNumber, startColumn: c10.startColumn, endLineNumber: c10.endLineNumber, endColumn: c10.endColumn } : { startLineNumber: 0, endLineNumber: 0, endColumn: 0, startColumn: 0 }, u10 = this._register(Gl(this._body));
    this._register(u10.onDidBlur((e207) => {
      this.hide();
    })), this._register(u10.onDidFocus((e207) => {
      this.focus();
    })), this._register(this._editor.onDidChangeCursorPosition(() => {
      this._selectionSetInEditor ? this._selectionSetInEditor = false : this.hide();
    })), this._register(this._editor.onMouseMove((e207) => {
      let t11 = e207.target.element?.classList;
      t11 && t11.contains(`colorpicker-color-decoration`) && this.hide();
    })), this._register(this.onResult((e207) => {
      this._render(e207.value, e207.foundInEditor);
    })), this._start(l10), this._body.style.zIndex = `50`, this._editor.addContentWidget(this);
  }
  updateEditor() {
    this._colorHover && this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover);
  }
  getId() {
    return U1.ID;
  }
  getDomNode() {
    return this._body;
  }
  getPosition() {
    if (!this._position) return null;
    let e206 = this._editor.getOption(69).above;
    return { position: this._position, secondaryPosition: this._position, preference: e206 ? [1, 2] : [2, 1], positionAffinity: 2 };
  }
  hide() {
    this.dispose(), this._standaloneColorPickerVisible.set(false), this._standaloneColorPickerFocused.set(false), this._editor.removeContentWidget(this), this._editor.focus();
  }
  focus() {
    this._standaloneColorPickerFocused.set(true), this._body.focus();
  }
  async _start(e206) {
    let t10 = await this._computeAsync(e206);
    t10 && this._onResult.fire(new Owe(t10.result, t10.foundInEditor));
  }
  async _computeAsync(e206) {
    if (!this._editor.hasModel()) return null;
    let t10 = { range: e206, color: { red: 0, green: 0, blue: 0, alpha: 1 } }, n10 = await this._standaloneColorPickerParticipant.createColorHover(t10, new ZX(this._editorWorkerService), this._languageFeaturesService.colorProvider);
    return n10 ? { result: n10.colorHover, foundInEditor: n10.foundInEditor } : null;
  }
  _render(e206, t10) {
    let n10 = document.createDocumentFragment();
    this._renderedStatusBar.value = this._register(new MZ(this._keybindingService, this._hoverService));
    let r10 = { fragment: n10, statusBar: this._renderedStatusBar.value, onContentsChanged: () => {
    }, setMinimumDimensions: () => {
    }, hide: () => this.hide(), focus: () => this.focus() };
    if (this._colorHover = e206, this._renderedHoverParts.value = this._standaloneColorPickerParticipant.renderHoverParts(r10, [e206]), !this._renderedHoverParts.value) {
      this._renderedStatusBar.clear(), this._renderedHoverParts.clear();
      return;
    }
    let i10 = this._renderedHoverParts.value.colorPicker;
    this._body.classList.add(`standalone-colorpicker-body`), this._body.style.maxHeight = Math.max(this._editor.getLayoutInfo().height / 4, 250) + `px`, this._body.style.maxWidth = Math.max(this._editor.getLayoutInfo().width * 0.66, 500) + `px`, this._body.tabIndex = 0, this._body.appendChild(n10), i10.layout();
    let a10 = i10.body, o10 = a10.saturationBox.domNode.clientWidth, s10 = a10.domNode.clientWidth - o10 - kwe - W1, c10 = i10.body.enterButton;
    c10?.onClicked(() => {
      this.updateEditor(), this.hide();
    });
    let l10 = i10.header, u10 = l10.pickedColorNode;
    u10.style.width = o10 + W1 + `px`;
    let d10 = l10.originalColorNode;
    d10.style.width = s10 + `px`, i10.header.closeButton?.onClicked(() => {
      this.hide();
    }), t10 && (c10 && (c10.button.textContent = `Replace`), this._selectionSetInEditor = true, this._editor.setSelection(e206.range)), this._editor.layoutContentWidget(this);
  }
}, U1 = _yc, _yc.ID = `editor.contrib.standaloneColorPickerWidget`, _yc);
G1 = U1 = Dwe([H1(3, V), H1(4, Dw), H1(5, X), H1(6, HL), H1(7, uj)], G1);
var Awe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, K1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, q1, J1 = (_zc = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._instantiationService = n10, this._standaloneColorPickerWidget = null, this._standaloneColorPickerVisible = $.standaloneColorPickerVisible.bindTo(t10), this._standaloneColorPickerFocused = $.standaloneColorPickerFocused.bindTo(t10);
  }
  showOrFocus() {
    this._editor.hasModel() && (this._standaloneColorPickerVisible.get() ? this._standaloneColorPickerFocused.get() || this._standaloneColorPickerWidget?.focus() : this._standaloneColorPickerWidget = this._instantiationService.createInstance(G1, this._editor, this._standaloneColorPickerVisible, this._standaloneColorPickerFocused));
  }
  hide() {
    this._standaloneColorPickerFocused.set(false), this._standaloneColorPickerVisible.set(false), this._standaloneColorPickerWidget?.hide(), this._editor.focus();
  }
  insertColor() {
    this._standaloneColorPickerWidget?.updateEditor(), this.hide();
  }
  static get(e206) {
    return e206.getContribution(q1.ID);
  }
}, q1 = _zc, _zc.ID = `editor.contrib.standaloneColorPickerController`, _zc);
J1 = q1 = Awe([K1(1, nd), K1(2, V)], J1);
var jwe = class extends tf {
  constructor() {
    super({ id: `editor.action.showOrFocusStandaloneColorPicker`, title: { ...w(889, `Show or Focus Standalone Color Picker`), mnemonicTitle: C(888, `&&Show or Focus Standalone Color Picker`) }, precondition: void 0, menu: [{ id: W.CommandPalette }], metadata: { description: w(890, `Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.`) } });
  }
  runEditorCommand(e206, t10) {
    J1.get(t10)?.showOrFocus();
  }
}, Mwe = class extends G {
  constructor() {
    super({ id: `editor.action.hideColorPicker`, label: w(891, `Hide the Color Picker`), precondition: $.standaloneColorPickerVisible.isEqualTo(true), kbOpts: { primary: 9, weight: 100 }, metadata: { description: w(892, `Hide the standalone color picker.`) } });
  }
  run(e206, t10) {
    J1.get(t10)?.hide();
  }
}, Nwe = class extends G {
  constructor() {
    super({ id: `editor.action.insertColorWithStandaloneColorPicker`, label: w(893, `Insert Color with Standalone Color Picker`), precondition: $.standaloneColorPickerFocused.isEqualTo(true), kbOpts: { primary: 3, weight: 100 }, metadata: { description: w(894, `Insert hex/rgb/hsl colors with the focused standalone color picker.`) } });
  }
  run(e206, t10) {
    J1.get(t10)?.insertColor();
  }
};
q(Mwe), q(Nwe), yd(jwe), af(B1.ID, B1, 2), af(J1.ID, J1, 1), af(oZ.ID, oZ, 1), XW(QX), JX.register(LQ), Nu.registerCommand(`_executeDocumentColorProvider`, function(e206, ...t10) {
  let [n10] = t10;
  if (!(n10 instanceof $r)) throw De();
  let { model: r10, colorProviderRegistry: i10, defaultColorDecoratorsEnablement: a10 } = nZ(e206, n10);
  return tZ(new tSe(), i10, r10, dr.None, a10);
}), Nu.registerCommand(`_executeColorPresentationProvider`, function(e206, ...t10) {
  let [n10, r10] = t10;
  if (!r10) return;
  let { uri: i10, range: a10 } = r10;
  if (!(i10 instanceof $r) || !Array.isArray(n10) || n10.length !== 4 || !M.isIRange(a10)) throw De();
  let { model: o10, colorProviderRegistry: s10, defaultColorDecoratorsEnablement: c10 } = nZ(e206, i10), [l10, u10, d10, f10] = n10;
  return tZ(new nSe({ range: a10, color: { red: l10, green: u10, blue: d10, alpha: f10 } }), s10, o10, dr.None, c10);
});
var Y1 = class e185 {
  constructor(e206, t10, n10) {
    this.languageConfigurationService = n10, this._selection = e206, this._insertSpace = t10, this._usedEndToken = null;
  }
  static _haystackHasNeedleAtOffset(e206, t10, n10) {
    if (n10 < 0) return false;
    let r10 = t10.length, i10 = e206.length;
    if (n10 + r10 > i10) return false;
    for (let i11 = 0; i11 < r10; i11++) {
      let r11 = e206.charCodeAt(n10 + i11), a10 = t10.charCodeAt(i11);
      if (r11 !== a10 && !(r11 >= 65 && r11 <= 90 && r11 + 32 === a10) && !(a10 >= 65 && a10 <= 90 && a10 + 32 === r11)) return false;
    }
    return true;
  }
  _createOperationsForBlockComment(t10, n10, r10, i10, a10, o10) {
    let s10 = t10.startLineNumber, c10 = t10.startColumn, l10 = t10.endLineNumber, u10 = t10.endColumn, d10 = a10.getLineContent(s10), f10 = a10.getLineContent(l10), p10 = d10.lastIndexOf(n10, c10 - 1 + n10.length), m10 = f10.indexOf(r10, u10 - 1 - r10.length);
    if (p10 !== -1 && m10 !== -1) if (s10 === l10) d10.substring(p10 + n10.length, m10).indexOf(r10) >= 0 && (p10 = -1, m10 = -1);
    else {
      let e206 = d10.substring(p10 + n10.length), t11 = f10.substring(0, m10);
      (e206.indexOf(r10) >= 0 || t11.indexOf(r10) >= 0) && (p10 = -1, m10 = -1);
    }
    let h10;
    p10 !== -1 && m10 !== -1 ? (i10 && p10 + n10.length < d10.length && d10.charCodeAt(p10 + n10.length) === 32 && (n10 += ` `), i10 && m10 > 0 && f10.charCodeAt(m10 - 1) === 32 && (r10 = ` ` + r10, --m10), h10 = e185._createRemoveBlockCommentOperations(new M(s10, p10 + n10.length + 1, l10, m10 + 1), n10, r10)) : (h10 = e185._createAddBlockCommentOperations(t10, n10, r10, this._insertSpace), this._usedEndToken = h10.length === 1 ? r10 : null);
    for (let e206 of h10) o10.addTrackedEditOperation(e206.range, e206.text);
  }
  static _createRemoveBlockCommentOperations(e206, t10, n10) {
    let r10 = [];
    return M.isEmpty(e206) ? r10.push(DF.delete(new M(e206.startLineNumber, e206.startColumn - t10.length, e206.endLineNumber, e206.endColumn + n10.length))) : (r10.push(DF.delete(new M(e206.startLineNumber, e206.startColumn - t10.length, e206.startLineNumber, e206.startColumn))), r10.push(DF.delete(new M(e206.endLineNumber, e206.endColumn, e206.endLineNumber, e206.endColumn + n10.length)))), r10;
  }
  static _createAddBlockCommentOperations(e206, t10, n10, r10) {
    let i10 = [];
    return M.isEmpty(e206) ? i10.push(DF.replace(new M(e206.startLineNumber, e206.startColumn, e206.endLineNumber, e206.endColumn), t10 + `  ` + n10)) : (i10.push(DF.insert(new j(e206.startLineNumber, e206.startColumn), t10 + (r10 ? ` ` : ``))), i10.push(DF.insert(new j(e206.endLineNumber, e206.endColumn), (r10 ? ` ` : ``) + n10))), i10;
  }
  getEditOperations(e206, t10) {
    let n10 = this._selection.startLineNumber, r10 = this._selection.startColumn;
    e206.tokenization.tokenizeIfCheap(n10);
    let i10 = e206.getLanguageIdAtPosition(n10, r10), a10 = this.languageConfigurationService.getLanguageConfiguration(i10).comments;
    !a10 || !a10.blockCommentStartToken || !a10.blockCommentEndToken || this._createOperationsForBlockComment(this._selection, a10.blockCommentStartToken, a10.blockCommentEndToken, this._insertSpace, e206, t10);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations();
    if (n10.length === 2) {
      let e207 = n10[0], t11 = n10[1];
      return new N(e207.range.endLineNumber, e207.range.endColumn, t11.range.startLineNumber, t11.range.startColumn);
    } else {
      let e207 = n10[0].range, t11 = this._usedEndToken ? -this._usedEndToken.length - 1 : 0;
      return new N(e207.endLineNumber, e207.endColumn + t11, e207.endLineNumber, e207.endColumn + t11);
    }
  }
}, Pwe = class e186 {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.languageConfigurationService = e206, this._selection = t10, this._indentSize = n10, this._type = r10, this._insertSpace = i10, this._selectionId = null, this._deltaColumn = 0, this._moveEndPositionDown = false, this._ignoreEmptyLines = a10, this._ignoreFirstLine = o10 || false;
  }
  static _gatherPreflightCommentStrings(e206, t10, n10, r10) {
    e206.tokenization.tokenizeIfCheap(t10);
    let i10 = e206.getLanguageIdAtPosition(t10, 1), a10 = r10.getLanguageConfiguration(i10).comments, o10 = a10 ? a10.lineCommentToken : null;
    if (!o10) return null;
    let s10 = [];
    for (let e207 = 0, r11 = n10 - t10 + 1; e207 < r11; e207++) s10[e207] = { ignore: false, commentStr: o10, commentStrOffset: 0, commentStrLength: o10.length };
    return s10;
  }
  static _analyzeLines(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let l10 = true, u10 = s10.getLanguageConfiguration(c10).comments?.lineCommentNoIndent ?? false, d10;
    d10 = e206 === 0 ? true : e206 !== 1;
    for (let s11 = 0, c11 = r10.length; s11 < c11; s11++) {
      let c12 = r10[s11], f10 = i10 + s11;
      if (f10 === i10 && o10) {
        c12.ignore = true;
        continue;
      }
      let p10 = n10.getLineContent(f10), m10 = Ga(p10);
      if (m10 === -1) {
        c12.ignore = a10, c12.commentStrOffset = u10 ? 0 : p10.length;
        continue;
      }
      l10 = false;
      let h10 = u10 ? 0 : m10;
      if (c12.ignore = false, c12.commentStrOffset = h10, d10 && !Y1._haystackHasNeedleAtOffset(p10, c12.commentStr, h10) && (e206 === 0 ? d10 = false : e206 === 1 || (c12.ignore = true)), d10 && t10) {
        let e207 = m10 + c12.commentStrLength;
        e207 < p10.length && p10.charCodeAt(e207) === 32 && (c12.commentStrLength += 1);
      }
    }
    if (e206 === 0 && l10) {
      d10 = false;
      for (let e207 = 0, t11 = r10.length; e207 < t11; e207++) r10[e207].ignore = false;
    }
    return { supported: true, shouldRemoveComments: d10, lines: r10 };
  }
  static _gatherPreflightData(t10, n10, r10, i10, a10, o10, s10, c10) {
    let l10 = e186._gatherPreflightCommentStrings(r10, i10, a10, c10), u10 = r10.getLanguageIdAtPosition(i10, 1);
    return l10 === null ? { supported: false } : e186._analyzeLines(t10, n10, r10, l10, i10, o10, s10, c10, u10);
  }
  _executeLineComments(t10, n10, r10, i10) {
    let a10;
    r10.shouldRemoveComments ? a10 = e186._createRemoveLineCommentsOperations(r10.lines, i10.startLineNumber) : (e186._normalizeInsertionPoint(t10, r10.lines, i10.startLineNumber, this._indentSize), a10 = this._createAddLineCommentsOperations(r10.lines, i10.startLineNumber));
    let o10 = new j(i10.positionLineNumber, i10.positionColumn);
    for (let e206 = 0, r11 = a10.length; e206 < r11; e206++) n10.addEditOperation(a10[e206].range, a10[e206].text), M.isEmpty(a10[e206].range) && M.getStartPosition(a10[e206].range).equals(o10) && t10.getLineContent(o10.lineNumber).length + 1 === o10.column && (this._deltaColumn = (a10[e206].text || ``).length);
    this._selectionId = n10.trackSelection(i10);
  }
  _attemptRemoveBlockComment(e206, t10, n10, r10) {
    let i10 = t10.startLineNumber, a10 = t10.endLineNumber, o10 = r10.length + Math.max(e206.getLineFirstNonWhitespaceColumn(t10.startLineNumber), t10.startColumn), s10 = e206.getLineContent(i10).lastIndexOf(n10, o10 - 1), c10 = e206.getLineContent(a10).indexOf(r10, t10.endColumn - 1 - n10.length);
    return s10 !== -1 && c10 === -1 && (c10 = e206.getLineContent(i10).indexOf(r10, s10 + n10.length), a10 = i10), s10 === -1 && c10 !== -1 && (s10 = e206.getLineContent(a10).lastIndexOf(n10, c10), i10 = a10), t10.isEmpty() && (s10 === -1 || c10 === -1) && (s10 = e206.getLineContent(i10).indexOf(n10), s10 !== -1 && (c10 = e206.getLineContent(i10).indexOf(r10, s10 + n10.length))), s10 !== -1 && e206.getLineContent(i10).charCodeAt(s10 + n10.length) === 32 && (n10 += ` `), c10 !== -1 && e206.getLineContent(a10).charCodeAt(c10 - 1) === 32 && (r10 = ` ` + r10, --c10), s10 !== -1 && c10 !== -1 ? Y1._createRemoveBlockCommentOperations(new M(i10, s10 + n10.length + 1, a10, c10 + 1), n10, r10) : null;
  }
  _executeBlockComment(e206, t10, n10) {
    e206.tokenization.tokenizeIfCheap(n10.startLineNumber);
    let r10 = e206.getLanguageIdAtPosition(n10.startLineNumber, 1), i10 = this.languageConfigurationService.getLanguageConfiguration(r10).comments;
    if (!i10 || !i10.blockCommentStartToken || !i10.blockCommentEndToken) return;
    let a10 = i10.blockCommentStartToken, o10 = i10.blockCommentEndToken, s10 = this._attemptRemoveBlockComment(e206, n10, a10, o10);
    if (!s10) {
      if (n10.isEmpty()) {
        let t11 = e206.getLineContent(n10.startLineNumber), r11 = Ga(t11);
        r11 === -1 && (r11 = t11.length), s10 = Y1._createAddBlockCommentOperations(new M(n10.startLineNumber, r11 + 1, n10.startLineNumber, t11.length + 1), a10, o10, this._insertSpace);
      } else s10 = Y1._createAddBlockCommentOperations(new M(n10.startLineNumber, e206.getLineFirstNonWhitespaceColumn(n10.startLineNumber), n10.endLineNumber, e206.getLineMaxColumn(n10.endLineNumber)), a10, o10, this._insertSpace);
      s10.length === 1 && (this._deltaColumn = a10.length + 1);
    }
    this._selectionId = t10.trackSelection(n10);
    for (let e207 of s10) t10.addEditOperation(e207.range, e207.text);
  }
  getEditOperations(t10, n10) {
    let r10 = this._selection;
    if (this._moveEndPositionDown = false, r10.startLineNumber === r10.endLineNumber && this._ignoreFirstLine) {
      n10.addEditOperation(new M(r10.startLineNumber, t10.getLineMaxColumn(r10.startLineNumber), r10.startLineNumber + 1, 1), r10.startLineNumber === t10.getLineCount() ? `` : `
`), this._selectionId = n10.trackSelection(r10);
      return;
    }
    r10.startLineNumber < r10.endLineNumber && r10.endColumn === 1 && (this._moveEndPositionDown = true, r10 = r10.setEndPosition(r10.endLineNumber - 1, t10.getLineMaxColumn(r10.endLineNumber - 1)));
    let i10 = e186._gatherPreflightData(this._type, this._insertSpace, t10, r10.startLineNumber, r10.endLineNumber, this._ignoreEmptyLines, this._ignoreFirstLine, this.languageConfigurationService);
    return i10.supported ? this._executeLineComments(t10, n10, i10, r10) : this._executeBlockComment(t10, n10, r10);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getTrackedSelection(this._selectionId);
    return this._moveEndPositionDown && (n10 = n10.setEndPosition(n10.endLineNumber + 1, 1)), new N(n10.selectionStartLineNumber, n10.selectionStartColumn + this._deltaColumn, n10.positionLineNumber, n10.positionColumn + this._deltaColumn);
  }
  static _createRemoveLineCommentsOperations(e206, t10) {
    let n10 = [];
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
      let i11 = e206[r10];
      i11.ignore || n10.push(DF.delete(new M(t10 + r10, i11.commentStrOffset + 1, t10 + r10, i11.commentStrOffset + i11.commentStrLength + 1)));
    }
    return n10;
  }
  _createAddLineCommentsOperations(e206, t10) {
    let n10 = [], r10 = this._insertSpace ? ` ` : ``;
    for (let i10 = 0, a10 = e206.length; i10 < a10; i10++) {
      let a11 = e206[i10];
      a11.ignore || n10.push(DF.insert(new j(t10 + i10, a11.commentStrOffset + 1), a11.commentStr + r10));
    }
    return n10;
  }
  static nextVisibleColumn(e206, t10, n10, r10) {
    return n10 ? e206 + (t10 - e206 % t10) : e206 + r10;
  }
  static _normalizeInsertionPoint(t10, n10, r10, i10) {
    let a10 = 1073741824, o10, s10;
    for (let o11 = 0, s11 = n10.length; o11 < s11; o11++) {
      if (n10[o11].ignore) continue;
      let s12 = t10.getLineContent(r10 + o11), c10 = 0;
      for (let t11 = 0, r11 = n10[o11].commentStrOffset; c10 < a10 && t11 < r11; t11++) c10 = e186.nextVisibleColumn(c10, i10, s12.charCodeAt(t11) === 9, 1);
      c10 < a10 && (a10 = c10);
    }
    a10 = Math.floor(a10 / i10) * i10;
    for (let c10 = 0, l10 = n10.length; c10 < l10; c10++) {
      if (n10[c10].ignore) continue;
      let l11 = t10.getLineContent(r10 + c10), u10 = 0;
      for (o10 = 0, s10 = n10[c10].commentStrOffset; u10 < a10 && o10 < s10; o10++) u10 = e186.nextVisibleColumn(u10, i10, l11.charCodeAt(o10) === 9, 1);
      u10 > a10 ? n10[c10].commentStrOffset = o10 - 1 : n10[c10].commentStrOffset = o10;
    }
  }
}, X1 = class extends G {
  constructor(e206, t10) {
    super(t10), this._type = e206;
  }
  run(e206, t10) {
    let n10 = e206.get(bp);
    if (!t10.hasModel()) return;
    let r10 = t10.getModel(), i10 = [], a10 = r10.getOptions(), o10 = t10.getOption(29), s10 = t10.getSelections().map((e207, t11) => ({ selection: e207, index: t11, ignoreFirstLine: false }));
    s10.sort((e207, t11) => M.compareRangesUsingStarts(e207.selection, t11.selection));
    let c10 = s10[0];
    for (let e207 = 1; e207 < s10.length; e207++) {
      let t11 = s10[e207];
      c10.selection.endLineNumber === t11.selection.startLineNumber && (c10.index < t11.index ? t11.ignoreFirstLine = true : (c10.ignoreFirstLine = true, c10 = t11));
    }
    for (let e207 of s10) i10.push(new Pwe(n10, e207.selection, a10.indentSize, this._type, o10.insertSpace, o10.ignoreEmptyLines, e207.ignoreFirstLine));
    t10.pushUndoStop(), t10.executeCommands(this.id, i10), t10.pushUndoStop();
  }
}, Fwe = class extends X1 {
  constructor() {
    super(0, { id: `editor.action.commentLine`, label: w(897, `Toggle Line Comment`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 2138, weight: 100 }, menuOpts: { menuId: W.MenubarEditMenu, group: `5_insert`, title: C(895, `&&Toggle Line Comment`), order: 1 }, canTriggerInlineEdits: true });
  }
}, Iwe = class extends X1 {
  constructor() {
    super(1, { id: `editor.action.addCommentLine`, label: w(898, `Add Line Comment`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2081), weight: 100 }, canTriggerInlineEdits: true });
  }
}, Lwe = class extends X1 {
  constructor() {
    super(2, { id: `editor.action.removeCommentLine`, label: w(899, `Remove Line Comment`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2099), weight: 100 }, canTriggerInlineEdits: true });
  }
}, Rwe = class extends G {
  constructor() {
    super({ id: `editor.action.blockComment`, label: w(900, `Toggle Block Comment`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 1567, linux: { primary: 3103 }, weight: 100 }, menuOpts: { menuId: W.MenubarEditMenu, group: `5_insert`, title: C(896, `Toggle &&Block Comment`), order: 2 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = e206.get(bp);
    if (!t10.hasModel()) return;
    let r10 = t10.getOption(29), i10 = [], a10 = t10.getSelections();
    for (let e207 of a10) i10.push(new Y1(e207, r10.insertSpace, n10));
    t10.pushUndoStop(), t10.executeCommands(this.id, i10), t10.pushUndoStop();
  }
};
q(Fwe), q(Iwe), q(Lwe), q(Rwe);
var zwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Z1 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Q1, $1 = (_Ac = class {
  static get(e206) {
    return e206.getContribution(Q1.ID);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this._contextMenuService = t10, this._contextViewService = n10, this._contextKeyService = r10, this._keybindingService = i10, this._menuService = a10, this._configurationService = o10, this._workspaceContextService = s10, this._toDispose = new E(), this._contextMenuIsBeingShownCount = 0, this._editor = e206, this._toDispose.add(this._editor.onContextMenu((e207) => this._onContextMenu(e207))), this._toDispose.add(this._editor.onMouseWheel((e207) => {
      if (this._contextMenuIsBeingShownCount > 0) {
        let t11 = this._contextViewService.getContextViewElement(), n11 = e207.srcElement;
        n11.shadowRoot && Ol(t11) === n11.shadowRoot || this._contextViewService.hideContextView();
      }
    })), this._toDispose.add(this._editor.onKeyDown((e207) => {
      this._editor.getOption(30) && e207.keyCode === 58 && (e207.preventDefault(), e207.stopPropagation(), this.showContextMenu());
    }));
  }
  _onContextMenu(e206) {
    if (!this._editor.hasModel()) return;
    if (!this._editor.getOption(30)) {
      this._editor.focus(), e206.target.position && !this._editor.getSelection().containsPosition(e206.target.position) && this._editor.setPosition(e206.target.position);
      return;
    }
    if (e206.target.type === 12 || e206.target.type === 6 && e206.target.detail.injectedText) return;
    if (e206.event.preventDefault(), e206.event.stopPropagation(), e206.target.type === 11) return this._showScrollbarContextMenu(e206.event);
    if (e206.target.type !== 6 && e206.target.type !== 7 && e206.target.type !== 1) return;
    if (this._editor.focus(), e206.target.position) {
      let t11 = false;
      for (let n10 of this._editor.getSelections()) if (n10.containsPosition(e206.target.position)) {
        t11 = true;
        break;
      }
      t11 || this._editor.setPosition(e206.target.position);
    }
    let t10 = null;
    e206.target.type !== 1 && (t10 = e206.event), this.showContextMenu(t10);
  }
  showContextMenu(e206) {
    if (!this._editor.getOption(30) || !this._editor.hasModel()) return;
    let t10 = this._getMenuActions(this._editor.getModel(), this._editor.contextMenuId);
    t10.length > 0 && this._doShowContextMenu(t10, e206);
  }
  _getMenuActions(e206, t10) {
    let n10 = [], r10 = this._menuService.getMenuActions(t10, this._contextKeyService, { arg: e206.uri });
    for (let t11 of r10) {
      let [, r11] = t11, i10 = 0;
      for (let t12 of r11) if (t12 instanceof gd) {
        let r12 = this._getMenuActions(e206, t12.item.submenu);
        r12.length > 0 && (n10.push(new Ou(t12.id, t12.label, r12)), i10++);
      } else n10.push(t12), i10++;
      i10 && n10.push(new Du());
    }
    return n10.length && n10.pop(), n10;
  }
  _doShowContextMenu(e206, t10 = null) {
    if (!this._editor.hasModel()) return;
    let n10 = t10;
    if (!n10) {
      this._editor.revealPosition(this._editor.getPosition(), 1), this._editor.render();
      let e207 = this._editor.getScrolledVisiblePosition(this._editor.getPosition()), t11 = _l2(this._editor.getDomNode());
      n10 = { x: t11.left + e207.left, y: t11.top + e207.top + e207.height };
    }
    let r10 = this._editor.getOption(144) && !kt;
    this._contextMenuIsBeingShownCount++, this._contextMenuService.showContextMenu({ domForShadowRoot: r10 ? this._editor.getOverflowWidgetsDomNode() ?? this._editor.getDomNode() : void 0, getAnchor: () => n10, getActions: () => e206, getActionViewItem: (e207) => {
      let t11 = this._keybindingFor(e207);
      if (t11) return new rL(e207, e207, { label: true, keybinding: t11.getLabel(), isMenu: true });
      let n11 = e207;
      return typeof n11.getActionViewItem == `function` ? n11.getActionViewItem() : new rL(e207, e207, { icon: true, label: true, isMenu: true });
    }, getKeyBinding: (e207) => this._keybindingFor(e207), onHide: (e207) => {
      this._contextMenuIsBeingShownCount--;
    } });
  }
  _showScrollbarContextMenu(e206) {
    if (!this._editor.hasModel() || sge(this._workspaceContextService.getWorkspace())) return;
    let t10 = this._editor.getOption(81), n10 = 0, r10 = (e207) => ({ id: `menu-action-${++n10}`, label: e207.label, tooltip: ``, class: void 0, enabled: e207.enabled === void 0 ? true : e207.enabled, checked: e207.checked, run: e207.run }), i10 = (e207, t11) => new Ou(`menu-action-${++n10}`, e207, t11, void 0), a10 = (e207, t11, n11, a11, o11) => {
      if (!t11) return r10({ label: e207, enabled: t11, run: () => {
      } });
      let s11 = (e208) => () => {
        this._configurationService.updateValue(n11, e208);
      }, c10 = [];
      for (let e208 of o11) c10.push(r10({ label: e208.label, checked: a11 === e208.value, run: s11(e208.value) }));
      return i10(e207, c10);
    }, o10 = [];
    o10.push(r10({ label: C(901, `Minimap`), checked: t10.enabled, run: () => {
      this._configurationService.updateValue(`editor.minimap.enabled`, !t10.enabled);
    } })), o10.push(new Du()), o10.push(r10({ label: C(902, `Render Characters`), enabled: t10.enabled, checked: t10.renderCharacters, run: () => {
      this._configurationService.updateValue(`editor.minimap.renderCharacters`, !t10.renderCharacters);
    } })), o10.push(a10(C(903, `Vertical size`), t10.enabled, `editor.minimap.size`, t10.size, [{ label: C(904, `Proportional`), value: `proportional` }, { label: C(905, `Fill`), value: `fill` }, { label: C(906, `Fit`), value: `fit` }])), o10.push(a10(C(907, `Slider`), t10.enabled, `editor.minimap.showSlider`, t10.showSlider, [{ label: C(908, `Mouse Over`), value: `mouseover` }, { label: C(909, `Always`), value: `always` }]));
    let s10 = this._editor.getOption(144) && !kt;
    this._contextMenuIsBeingShownCount++, this._contextMenuService.showContextMenu({ domForShadowRoot: s10 ? this._editor.getDomNode() : void 0, getAnchor: () => e206, getActions: () => o10, onHide: (e207) => {
      this._contextMenuIsBeingShownCount--, this._editor.focus();
    } });
  }
  _keybindingFor(e206) {
    return this._keybindingService.lookupKeybinding(e206.id);
  }
  dispose() {
    this._contextMenuIsBeingShownCount > 0 && this._contextViewService.hideContextView(), this._toDispose.dispose();
  }
}, Q1 = _Ac, _Ac.ID = `editor.contrib.contextmenu`, _Ac);
$1 = Q1 = zwe([Z1(1, mj), Z1(2, pj), Z1(3, nd), Z1(4, Dw), Z1(5, pd), Z1(6, Uf), Z1(7, qF)], $1);
var Bwe = class extends G {
  constructor() {
    super({ id: `editor.action.showContextMenu`, label: w(910, `Show Editor Context Menu`), precondition: void 0, kbOpts: { kbExpr: $.textInputFocus, primary: 1092, weight: 100 } });
  }
  run(e206, t10) {
    $1.get(t10)?.showContextMenu();
  }
};
af($1.ID, $1, 2), q(Bwe);
var e0 = class {
  constructor(e206) {
    this.selections = e206;
  }
  equals(e206) {
    let t10 = this.selections.length;
    if (t10 !== e206.selections.length) return false;
    for (let n10 = 0; n10 < t10; n10++) if (!this.selections[n10].equalsSelection(e206.selections[n10])) return false;
    return true;
  }
}, t0 = class {
  constructor(e206, t10, n10) {
    this.cursorState = e206, this.scrollTop = t10, this.scrollLeft = n10;
  }
}, n0 = (_Bc = class extends D {
  static get(t10) {
    return t10.getContribution(_Bc.ID);
  }
  constructor(e206) {
    super(), this._editor = e206, this._isCursorUndoRedo = false, this._undoStack = [], this._redoStack = [], this._register(e206.onDidChangeModel((e207) => {
      this._undoStack = [], this._redoStack = [];
    })), this._register(e206.onDidChangeModelContent((e207) => {
      this._undoStack = [], this._redoStack = [];
    })), this._register(e206.onDidChangeCursorSelection((t10) => {
      if (this._isCursorUndoRedo || !t10.oldSelections || t10.oldModelVersionId !== t10.modelVersionId) return;
      let n10 = new e0(t10.oldSelections);
      this._undoStack.length > 0 && this._undoStack[this._undoStack.length - 1].cursorState.equals(n10) || (this._undoStack.push(new t0(n10, e206.getScrollTop(), e206.getScrollLeft())), this._redoStack = [], this._undoStack.length > 50 && this._undoStack.shift());
    }));
  }
  cursorUndo() {
    !this._editor.hasModel() || this._undoStack.length === 0 || (this._redoStack.push(new t0(new e0(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())), this._applyState(this._undoStack.pop()));
  }
  cursorRedo() {
    !this._editor.hasModel() || this._redoStack.length === 0 || (this._undoStack.push(new t0(new e0(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())), this._applyState(this._redoStack.pop()));
  }
  _applyState(e206) {
    this._isCursorUndoRedo = true, this._editor.setSelections(e206.cursorState.selections), this._editor.setScrollPosition({ scrollTop: e206.scrollTop, scrollLeft: e206.scrollLeft }), this._isCursorUndoRedo = false;
  }
}, _Bc.ID = `editor.contrib.cursorUndoRedoController`, _Bc), Vwe = class extends G {
  constructor() {
    super({ id: `cursorUndo`, label: w(911, `Cursor Undo`), precondition: void 0, kbOpts: { kbExpr: $.textInputFocus, primary: 2099, weight: 100 } });
  }
  run(e206, t10, n10) {
    n0.get(t10)?.cursorUndo();
  }
}, Hwe = class extends G {
  constructor() {
    super({ id: `cursorRedo`, label: w(912, `Cursor Redo`), precondition: void 0 });
  }
  run(e206, t10, n10) {
    n0.get(t10)?.cursorRedo();
  }
};
af(n0.ID, n0, 0), q(Vwe), q(Hwe);
var Uwe = class {
  constructor(e206, t10, n10) {
    this.selection = e206, this.targetPosition = t10, this.copy = n10, this.targetSelection = null;
  }
  getEditOperations(e206, t10) {
    let n10 = e206.getValueInRange(this.selection);
    if (this.copy || t10.addEditOperation(this.selection, null), t10.addEditOperation(new M(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column), n10), this.selection.containsPosition(this.targetPosition) && !(this.copy && (this.selection.getEndPosition().equals(this.targetPosition) || this.selection.getStartPosition().equals(this.targetPosition)))) {
      this.targetSelection = this.selection;
      return;
    }
    if (this.copy) {
      this.targetSelection = new N(this.targetPosition.lineNumber, this.targetPosition.column, this.selection.endLineNumber - this.selection.startLineNumber + this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn);
      return;
    }
    if (this.targetPosition.lineNumber > this.selection.endLineNumber) {
      this.targetSelection = new N(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn);
      return;
    }
    if (this.targetPosition.lineNumber < this.selection.endLineNumber) {
      this.targetSelection = new N(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber + this.selection.endLineNumber - this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn);
      return;
    }
    this.selection.endColumn <= this.targetPosition.column ? this.targetSelection = new N(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, (this.selection.startLineNumber, this.selection.endLineNumber, this.targetPosition.column - this.selection.endColumn + this.selection.startColumn), this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column : this.selection.endColumn) : this.targetSelection = new N(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column + this.selection.endColumn - this.selection.startColumn);
  }
  computeCursorState(e206, t10) {
    return this.targetSelection;
  }
};
function r0(e206) {
  return Tt ? e206.altKey : e206.ctrlKey;
}
var i0 = (_Cc = class extends D {
  constructor(e206) {
    super(), this._editor = e206, this._dndDecorationIds = this._editor.createDecorationsCollection(), this._register(this._editor.onMouseDown((e207) => this._onEditorMouseDown(e207))), this._register(this._editor.onMouseUp((e207) => this._onEditorMouseUp(e207))), this._register(this._editor.onMouseDrag((e207) => this._onEditorMouseDrag(e207))), this._register(this._editor.onMouseDrop((e207) => this._onEditorMouseDrop(e207))), this._register(this._editor.onMouseDropCanceled(() => this._onEditorMouseDropCanceled())), this._register(this._editor.onKeyDown((e207) => this.onEditorKeyDown(e207))), this._register(this._editor.onKeyUp((e207) => this.onEditorKeyUp(e207))), this._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur())), this._register(this._editor.onDidBlurEditorText(() => this.onEditorBlur())), this._mouseDown = false, this._modifierPressed = false, this._dragSelection = null;
  }
  onEditorBlur() {
    this._removeDecoration(), this._dragSelection = null, this._mouseDown = false, this._modifierPressed = false;
  }
  onEditorKeyDown(e206) {
    !this._editor.getOption(42) || this._editor.getOption(28) || (r0(e206) && (this._modifierPressed = true), this._mouseDown && r0(e206) && this._editor.updateOptions({ mouseStyle: `copy` }));
  }
  onEditorKeyUp(t10) {
    !this._editor.getOption(42) || this._editor.getOption(28) || (r0(t10) && (this._modifierPressed = false), this._mouseDown && t10.keyCode === _Cc.TRIGGER_KEY_VALUE && this._editor.updateOptions({ mouseStyle: `default` }));
  }
  _onEditorMouseDown(e206) {
    this._mouseDown = true;
  }
  _onEditorMouseUp(e206) {
    this._mouseDown = false, this._editor.updateOptions({ mouseStyle: `text` });
  }
  _onEditorMouseDrag(e206) {
    let t10 = e206.target;
    if (this._dragSelection === null) {
      let e207 = (this._editor.getSelections() || []).filter((e208) => t10.position && e208.containsPosition(t10.position));
      if (e207.length === 1) this._dragSelection = e207[0];
      else return;
    }
    r0(e206.event) ? this._editor.updateOptions({ mouseStyle: `copy` }) : this._editor.updateOptions({ mouseStyle: `default` }), t10.position && (this._dragSelection.containsPosition(t10.position) ? this._removeDecoration() : this.showAt(t10.position));
  }
  _onEditorMouseDropCanceled() {
    this._editor.updateOptions({ mouseStyle: `text` }), this._removeDecoration(), this._dragSelection = null, this._mouseDown = false;
  }
  _onEditorMouseDrop(t10) {
    if (t10.target && (this._hitContent(t10.target) || this._hitMargin(t10.target)) && t10.target.position) {
      let n10 = new j(t10.target.position.lineNumber, t10.target.position.column);
      if (this._dragSelection === null) {
        let e206 = null;
        if (t10.event.shiftKey) {
          let t11 = this._editor.getSelection();
          if (t11) {
            let { selectionStartLineNumber: r10, selectionStartColumn: i10 } = t11;
            e206 = [new N(r10, i10, n10.lineNumber, n10.column)];
          }
        } else e206 = (this._editor.getSelections() || []).map((e207) => e207.containsPosition(n10) ? new N(n10.lineNumber, n10.column, n10.lineNumber, n10.column) : e207);
        this._editor.setSelections(e206 || [], `mouse`, 3);
      } else (!this._dragSelection.containsPosition(n10) || (r0(t10.event) || this._modifierPressed) && (this._dragSelection.getEndPosition().equals(n10) || this._dragSelection.getStartPosition().equals(n10))) && (this._editor.pushUndoStop(), this._editor.executeCommand(_Cc.ID, new Uwe(this._dragSelection, n10, r0(t10.event) || this._modifierPressed)), this._editor.pushUndoStop());
    }
    this._editor.updateOptions({ mouseStyle: `text` }), this._removeDecoration(), this._dragSelection = null, this._mouseDown = false;
  }
  showAt(t10) {
    this._dndDecorationIds.set([{ range: new M(t10.lineNumber, t10.column, t10.lineNumber, t10.column), options: _Cc._DECORATION_OPTIONS }]), this._editor.revealPosition(t10, 1);
  }
  _removeDecoration() {
    this._dndDecorationIds.clear();
  }
  _hitContent(e206) {
    return e206.type === 6 || e206.type === 7;
  }
  _hitMargin(e206) {
    return e206.type === 2 || e206.type === 3 || e206.type === 4;
  }
  dispose() {
    this._removeDecoration(), this._dragSelection = null, this._mouseDown = false, this._modifierPressed = false, super.dispose();
  }
}, _Cc.ID = `editor.contrib.dragAndDrop`, _Cc.TRIGGER_KEY_VALUE = Tt ? 6 : 5, _Cc._DECORATION_OPTIONS = UO.register({ description: `dnd-target`, className: `dnd-target` }), _Cc);
af(i0.ID, i0, 2);
var Wwe = `editor.action.pasteAs`;
af(YY.ID, YY, 0), XW(lY), K(new class extends $d {
  constructor() {
    super({ id: KY, precondition: qY, kbOpts: { weight: 100, primary: 2137 } });
  }
  runEditorCommand(e206, t10) {
    return YY.get(t10)?.changePasteType();
  }
}()), K(new class extends $d {
  constructor() {
    super({ id: `editor.hidePasteWidget`, precondition: qY, kbOpts: { weight: 100, primary: 9 } });
  }
  runEditorCommand(e206, t10) {
    YY.get(t10)?.clearWidgets();
  }
}()), q((_Dc = class extends G {
  constructor() {
    super({ id: Wwe, label: w(915, `Paste As...`), precondition: $.writable, metadata: { description: `Paste as`, args: [{ name: `args`, schema: _Dc.argsSchema }] }, canTriggerInlineEdits: true });
  }
  run(e206, t10, n10) {
    let r10;
    return n10 && (`kind` in n10 ? r10 = { only: new WJ(n10.kind) } : `preferences` in n10 && (r10 = { preferences: n10.preferences.map((e207) => new WJ(e207)) })), YY.get(t10)?.pasteAs(r10);
  }
}, _Dc.argsSchema = { oneOf: [{ type: `object`, required: [`kind`], properties: { kind: { type: `string`, description: C(913, `The kind of the paste edit to try pasting with.
If there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.`) } } }, { type: `object`, required: [`preferences`], properties: { preferences: { type: `array`, description: C(914, `List of preferred paste edit kind to try applying.
The first edit matching the preferences will be applied.`), items: { type: `string` } } } }] }, _Dc)), q(class extends G {
  constructor() {
    super({ id: `editor.action.pasteAsText`, label: w(916, `Paste as Text`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    return YY.get(t10)?.pasteAs({ providerId: rY.id });
  }
});
var Gwe = class {
  constructor() {
    this._dragOperations = /* @__PURE__ */ new Map();
  }
  removeDragOperationTransfer(e206) {
    if (e206 && this._dragOperations.has(e206)) {
      let t10 = this._dragOperations.get(e206);
      return this._dragOperations.delete(e206), t10;
    }
  }
}, a0 = class {
  constructor(e206) {
    this.identifier = e206;
  }
}, o0 = xu(`treeViewsDndService`);
Zf(o0, Gwe, 1);
var Kwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, s0 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, c0, qwe = `editor.dropIntoEditor.preferences`, l0 = `editor.changeDropType`, u0 = new U(`dropWidgetVisible`, false, C(934, `Whether the drop widget is showing`)), d0 = (_Ec = class extends D {
  static get(e206) {
    return e206.getContribution(c0.ID);
  }
  constructor(e206, t10, n10, r10, i10) {
    super(), this._configService = n10, this._languageFeaturesService = r10, this._treeViewsDragAndDropService = i10, this.treeItemsTransfer = Qbe.getInstance(), this._dropProgressManager = this._register(t10.createInstance(YJ, `dropIntoEditor`, e206)), this._postDropWidgetManager = this._register(t10.createInstance(UY, `dropIntoEditor`, e206, u0, { id: l0, label: C(935, `Show drop options...`) }, () => c0._configureDefaultAction ? [c0._configureDefaultAction] : [])), this._register(e206.onDropIntoEditor((t11) => this.onDropIntoEditor(e206, t11.position, t11.event)));
  }
  clearWidgets() {
    this._postDropWidgetManager.clear();
  }
  changeDropType() {
    this._postDropWidgetManager.tryShowSelector();
  }
  async onDropIntoEditor(e206, t10, n10) {
    if (!n10.dataTransfer || !e206.hasModel()) return;
    c0._currentDropOperation?.cancel(), e206.focus(), e206.setPosition(t10);
    let r10 = es(async (i10) => {
      let a10 = new E(), o10 = a10.add(new tJ(e206, 1, void 0, i10));
      try {
        let r11 = await this.extractDataTransferData(n10);
        if (r11.size === 0 || o10.token.isCancellationRequested) return;
        let s10 = e206.getModel();
        if (!s10) return;
        let c10 = this._languageFeaturesService.documentDropEditProvider.ordered(s10).filter((e207) => e207.dropMimeTypes ? e207.dropMimeTypes.some((e208) => r11.matches(e208)) : true), l10 = a10.add(await this.getDropEdits(c10, s10, t10, r11, o10.token));
        if (o10.token.isCancellationRequested) return;
        if (l10.edits.length) {
          let n11 = this.getInitialActiveEditIndex(s10, l10.edits), r12 = e206.getOption(43).showDropSelector === `afterDrop`;
          await this._postDropWidgetManager.applyEditAndShowIfNeeded([M.fromPositions(t10)], { activeEditIndex: n11, allEdits: l10.edits }, r12, async (e207) => e207, i10);
        }
      } finally {
        a10.dispose(), c0._currentDropOperation === r10 && (c0._currentDropOperation = void 0);
      }
    });
    this._dropProgressManager.showWhile(t10, C(936, `Running drop handlers. Click to cancel`), r10, { cancel: () => r10.cancel() }), c0._currentDropOperation = r10;
  }
  async getDropEdits(e206, t10, n10, r10, i10) {
    let a10 = new E();
    return { edits: xY(h(await ts(Promise.all(e206.map(async (e207) => {
      try {
        let o10 = await e207.provideDocumentDropEdits(t10, n10, r10, i10);
        return o10 && a10.add(o10), o10?.edits.map((t11) => ({ ...t11, providerId: e207.id }));
      } catch (e208) {
        we(e208) || console.error(e208), console.error(e208);
      }
    })), i10) ?? []).flat()), dispose: () => a10.dispose() };
  }
  getInitialActiveEditIndex(e206, t10) {
    let n10 = this._configService.getValue(qwe, { resource: e206.uri });
    for (let e207 of Array.isArray(n10) ? n10 : []) {
      let n11 = new WJ(e207), r10 = t10.findIndex((e208) => e208.kind && n11.contains(e208.kind));
      if (r10 >= 0) return r10;
    }
    return 0;
  }
  async extractDataTransferData(e206) {
    if (!e206.dataTransfer) return new zJ();
    let t10 = JJ(e206.dataTransfer);
    if (this.treeItemsTransfer.hasData(a0.prototype)) {
      let e207 = this.treeItemsTransfer.getData(a0.prototype);
      if (Array.isArray(e207)) for (let n10 of e207) {
        let e208 = await this._treeViewsDragAndDropService.removeDragOperationTransfer(n10.identifier);
        if (e208) for (let [n11, r10] of e208) t10.replace(n11, r10);
      }
    }
    return t10;
  }
}, c0 = _Ec, _Ec.ID = `editor.contrib.dropIntoEditorController`, _Ec);
d0 = c0 = Kwe([s0(1, V), s0(2, Uf), s0(3, X), s0(4, o0)], d0), af(d0.ID, d0, 2), XW(cY), K(new class extends $d {
  constructor() {
    super({ id: l0, precondition: u0, kbOpts: { weight: 100, primary: 2137 } });
  }
  runEditorCommand(e206, t10, n10) {
    d0.get(t10)?.changeDropType();
  }
}()), K(new class extends $d {
  constructor() {
    super({ id: `editor.hideDropWidget`, precondition: u0, kbOpts: { weight: 100, primary: 9 } });
  }
  runEditorCommand(e206, t10, n10) {
    d0.get(t10)?.clearWidgets();
  }
}());
var Jwe = (_Fc = class extends rx {
  constructor(e206, t10, n10) {
    super(), this._hideSoon = this._register(new us(() => this._hide(), 2e3)), this._isVisible = false, this._editor = e206, this._state = t10, this._keybindingService = n10, this._domNode = document.createElement(`div`), this._domNode.className = `findOptionsWidget`, this._domNode.style.display = `none`, this._domNode.style.top = `10px`, this._domNode.style.zIndex = `12`, this._domNode.setAttribute(`role`, `presentation`), this._domNode.setAttribute(`aria-hidden`, `true`);
    let r10 = { inputActiveOptionBorder: Z(Sy), inputActiveOptionForeground: Z(Ty), inputActiveOptionBackground: Z(wy) }, i10 = { groupId: `find-options-widget` };
    this.caseSensitive = this._register(new ER({ appendTitle: this._keybindingLabelFor(qZ.ToggleCaseSensitiveCommand), isChecked: this._state.matchCase, hoverLifecycleOptions: i10, ...r10 })), this._domNode.appendChild(this.caseSensitive.domNode), this._register(this.caseSensitive.onChange(() => {
      this._state.change({ matchCase: this.caseSensitive.checked }, false);
    })), this.wholeWords = this._register(new DR({ appendTitle: this._keybindingLabelFor(qZ.ToggleWholeWordCommand), isChecked: this._state.wholeWord, hoverLifecycleOptions: i10, ...r10 })), this._domNode.appendChild(this.wholeWords.domNode), this._register(this.wholeWords.onChange(() => {
      this._state.change({ wholeWord: this.wholeWords.checked }, false);
    })), this.regex = this._register(new OR({ appendTitle: this._keybindingLabelFor(qZ.ToggleRegexCommand), isChecked: this._state.isRegex, hoverLifecycleOptions: i10, ...r10 })), this._domNode.appendChild(this.regex.domNode), this._register(this.regex.onChange(() => {
      this._state.change({ isRegex: this.regex.checked }, false);
    })), this._editor.addOverlayWidget(this), this._register(this._state.onFindReplaceStateChange((e207) => {
      let t11 = false;
      e207.isRegex && (this.regex.checked = this._state.isRegex, t11 = true), e207.wholeWord && (this.wholeWords.checked = this._state.wholeWord, t11 = true), e207.matchCase && (this.caseSensitive.checked = this._state.matchCase, t11 = true), !this._state.isRevealed && t11 && this._revealTemporarily();
    })), this._register(L(this._domNode, R.MOUSE_LEAVE, (e207) => this._onMouseLeave())), this._register(L(this._domNode, `mouseover`, (e207) => this._onMouseOver()));
  }
  _keybindingLabelFor(e206) {
    let t10 = this._keybindingService.lookupKeybinding(e206);
    return t10 ? ` (${t10.getLabel()})` : ``;
  }
  dispose() {
    this._editor.removeOverlayWidget(this), super.dispose();
  }
  getId() {
    return _Fc.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return { preference: 0 };
  }
  highlightFindOptions() {
    this._revealTemporarily();
  }
  _revealTemporarily() {
    this._show(), this._hideSoon.schedule();
  }
  _onMouseLeave() {
    this._hideSoon.schedule();
  }
  _onMouseOver() {
    this._hideSoon.cancel();
  }
  _show() {
    this._isVisible || (this._isVisible = true, this._domNode.style.display = `block`);
  }
  _hide() {
    this._isVisible && (this._isVisible = false, this._domNode.style.display = `none`);
  }
}, _Fc.ID = `editor.contrib.findOptionsWidget`, _Fc);
function f0(e206, t10) {
  return e206 === 1 ? true : e206 === 2 ? false : t10;
}
var Ywe = class extends D {
  get searchString() {
    return this._searchString;
  }
  get replaceString() {
    return this._replaceString;
  }
  get isRevealed() {
    return this._isRevealed;
  }
  get isReplaceRevealed() {
    return this._isReplaceRevealed;
  }
  get isRegex() {
    return f0(this._isRegexOverride, this._isRegex);
  }
  get wholeWord() {
    return f0(this._wholeWordOverride, this._wholeWord);
  }
  get matchCase() {
    return f0(this._matchCaseOverride, this._matchCase);
  }
  get preserveCase() {
    return f0(this._preserveCaseOverride, this._preserveCase);
  }
  get actualIsRegex() {
    return this._isRegex;
  }
  get actualWholeWord() {
    return this._wholeWord;
  }
  get actualMatchCase() {
    return this._matchCase;
  }
  get actualPreserveCase() {
    return this._preserveCase;
  }
  get searchScope() {
    return this._searchScope;
  }
  get matchesPosition() {
    return this._matchesPosition;
  }
  get matchesCount() {
    return this._matchesCount;
  }
  get currentMatch() {
    return this._currentMatch;
  }
  constructor() {
    super(), this._onFindReplaceStateChange = this._register(new k()), this.onFindReplaceStateChange = this._onFindReplaceStateChange.event, this._searchString = ``, this._replaceString = ``, this._isRevealed = false, this._isReplaceRevealed = false, this._isRegex = false, this._isRegexOverride = 0, this._wholeWord = false, this._wholeWordOverride = 0, this._matchCase = false, this._matchCaseOverride = 0, this._preserveCase = false, this._preserveCaseOverride = 0, this._searchScope = null, this._matchesPosition = 0, this._matchesCount = 0, this._currentMatch = null, this._loop = true, this._isSearching = false, this._filters = null;
  }
  changeMatchInfo(e206, t10, n10) {
    let r10 = { moveCursor: false, updateHistory: false, searchString: false, replaceString: false, isRevealed: false, isReplaceRevealed: false, isRegex: false, wholeWord: false, matchCase: false, preserveCase: false, searchScope: false, matchesPosition: false, matchesCount: false, currentMatch: false, loop: false, isSearching: false, filters: false }, i10 = false;
    t10 === 0 && (e206 = 0), e206 > t10 && (e206 = t10), this._matchesPosition !== e206 && (this._matchesPosition = e206, r10.matchesPosition = true, i10 = true), this._matchesCount !== t10 && (this._matchesCount = t10, r10.matchesCount = true, i10 = true), n10 !== void 0 && (M.equalsRange(this._currentMatch, n10) || (this._currentMatch = n10, r10.currentMatch = true, i10 = true)), i10 && this._onFindReplaceStateChange.fire(r10);
  }
  change(e206, t10, n10 = true) {
    let r10 = { moveCursor: t10, updateHistory: n10, searchString: false, replaceString: false, isRevealed: false, isReplaceRevealed: false, isRegex: false, wholeWord: false, matchCase: false, preserveCase: false, searchScope: false, matchesPosition: false, matchesCount: false, currentMatch: false, loop: false, isSearching: false, filters: false }, i10 = false, a10 = this.isRegex, o10 = this.wholeWord, s10 = this.matchCase, c10 = this.preserveCase;
    e206.searchString !== void 0 && this._searchString !== e206.searchString && (this._searchString = e206.searchString, r10.searchString = true, i10 = true), e206.replaceString !== void 0 && this._replaceString !== e206.replaceString && (this._replaceString = e206.replaceString, r10.replaceString = true, i10 = true), e206.isRevealed !== void 0 && this._isRevealed !== e206.isRevealed && (this._isRevealed = e206.isRevealed, r10.isRevealed = true, i10 = true), e206.isReplaceRevealed !== void 0 && this._isReplaceRevealed !== e206.isReplaceRevealed && (this._isReplaceRevealed = e206.isReplaceRevealed, r10.isReplaceRevealed = true, i10 = true), e206.isRegex !== void 0 && (this._isRegex = e206.isRegex), e206.wholeWord !== void 0 && (this._wholeWord = e206.wholeWord), e206.matchCase !== void 0 && (this._matchCase = e206.matchCase), e206.preserveCase !== void 0 && (this._preserveCase = e206.preserveCase), e206.searchScope !== void 0 && (e206.searchScope?.every((e207) => this._searchScope?.some((t11) => !M.equalsRange(t11, e207))) || (this._searchScope = e206.searchScope, r10.searchScope = true, i10 = true)), e206.loop !== void 0 && this._loop !== e206.loop && (this._loop = e206.loop, r10.loop = true, i10 = true), e206.isSearching !== void 0 && this._isSearching !== e206.isSearching && (this._isSearching = e206.isSearching, r10.isSearching = true, i10 = true), e206.filters !== void 0 && (this._filters ? this._filters.update(e206.filters) : this._filters = e206.filters, r10.filters = true, i10 = true), this._isRegexOverride = e206.isRegexOverride === void 0 ? 0 : e206.isRegexOverride, this._wholeWordOverride = e206.wholeWordOverride === void 0 ? 0 : e206.wholeWordOverride, this._matchCaseOverride = e206.matchCaseOverride === void 0 ? 0 : e206.matchCaseOverride, this._preserveCaseOverride = e206.preserveCaseOverride === void 0 ? 0 : e206.preserveCaseOverride, a10 !== this.isRegex && (i10 = true, r10.isRegex = true), o10 !== this.wholeWord && (i10 = true, r10.wholeWord = true), s10 !== this.matchCase && (i10 = true, r10.matchCase = true), c10 !== this.preserveCase && (i10 = true, r10.preserveCase = true), i10 && this._onFindReplaceStateChange.fire(r10);
  }
  canNavigateBack() {
    return this.canNavigateInLoop() || this.matchesPosition !== 1;
  }
  canNavigateForward() {
    return this.canNavigateInLoop() || this.matchesPosition < this.matchesCount;
  }
  canNavigateInLoop() {
    return this._loop || this.matchesCount >= 19999;
  }
}, Xwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Zwe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, p0, m0 = (_Gc = class {
  static getOrCreate(e206) {
    return p0._instance || (p0._instance = new p0(e206)), p0._instance;
  }
  constructor(e206) {
    this.storageService = e206, this.inMemoryValues = /* @__PURE__ */ new Set(), this._onDidChangeEmitter = new k(), this.onDidChange = this._onDidChangeEmitter.event, this.load();
  }
  delete(e206) {
    let t10 = this.inMemoryValues.delete(e206);
    return this.save(), t10;
  }
  add(e206) {
    return this.inMemoryValues.add(e206), this.save(), this;
  }
  has(e206) {
    return this.inMemoryValues.has(e206);
  }
  forEach(e206, t10) {
    return this.load(), this.inMemoryValues.forEach(e206);
  }
  replace(e206) {
    this.inMemoryValues = new Set(e206), this.save();
  }
  load() {
    let e206, t10 = this.storageService.get(p0.FIND_HISTORY_KEY, 1);
    if (t10) try {
      e206 = JSON.parse(t10);
    } catch {
    }
    this.inMemoryValues = new Set(e206 || []);
  }
  save() {
    let e206 = [];
    return this.inMemoryValues.forEach((t10) => e206.push(t10)), new Promise((t10) => {
      this.storageService.store(p0.FIND_HISTORY_KEY, JSON.stringify(e206), 1, 0), this._onDidChangeEmitter.fire(e206), t10();
    });
  }
}, p0 = _Gc, _Gc.FIND_HISTORY_KEY = `workbench.find.history`, _Gc._instance = null, _Gc);
m0 = p0 = Xwe([Zwe(0, dF)], m0);
var Qwe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, $we = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, h0, g0 = (_Hc = class {
  static getOrCreate(e206) {
    return h0._instance || (h0._instance = new h0(e206)), h0._instance;
  }
  constructor(e206) {
    this.storageService = e206, this.inMemoryValues = /* @__PURE__ */ new Set(), this._onDidChangeEmitter = new k(), this.onDidChange = this._onDidChangeEmitter.event, this.load();
  }
  delete(e206) {
    let t10 = this.inMemoryValues.delete(e206);
    return this.save(), t10;
  }
  add(e206) {
    return this.inMemoryValues.add(e206), this.save(), this;
  }
  has(e206) {
    return this.inMemoryValues.has(e206);
  }
  forEach(e206, t10) {
    return this.load(), this.inMemoryValues.forEach(e206);
  }
  replace(e206) {
    this.inMemoryValues = new Set(e206), this.save();
  }
  load() {
    let e206, t10 = this.storageService.get(h0.FIND_HISTORY_KEY, 1);
    if (t10) try {
      e206 = JSON.parse(t10);
    } catch {
    }
    this.inMemoryValues = new Set(e206 || []);
  }
  save() {
    let e206 = [];
    return this.inMemoryValues.forEach((t10) => e206.push(t10)), new Promise((t10) => {
      this.storageService.store(h0.FIND_HISTORY_KEY, JSON.stringify(e206), 1, 0), this._onDidChangeEmitter.fire(e206), t10();
    });
  }
}, h0 = _Hc, _Hc.FIND_HISTORY_KEY = `workbench.replace.history`, _Hc._instance = null, _Hc);
g0 = h0 = Qwe([$we(0, dF)], g0);
var _0 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, v0 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, y0, eTe = 524288;
function b0(e206, t10 = `single`, n10 = false) {
  if (!e206.hasModel()) return null;
  let r10 = e206.getSelection();
  if (t10 === `single` && r10.startLineNumber === r10.endLineNumber || t10 === `multiple`) {
    if (r10.isEmpty()) {
      let t11 = e206.getConfiguredWordAtPosition(r10.getStartPosition());
      if (t11 && false === n10) return t11.word;
    } else if (e206.getModel().getValueLengthInRange(r10) < eTe) return e206.getModel().getValueInRange(r10);
  }
  return null;
}
var x0 = (_Ic = class extends D {
  get editor() {
    return this._editor;
  }
  static get(e206) {
    return e206.getContribution(y0.ID);
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._editor = e206, this._findWidgetVisible = zZ.bindTo(t10), this._contextKeyService = t10, this._storageService = n10, this._clipboardService = r10, this._notificationService = i10, this._hoverService = a10, this._updateHistoryDelayer = new ns(500), this._state = this._register(new Ywe()), this.loadQueryState(), this._register(this._state.onFindReplaceStateChange((e207) => this._onStateChanged(e207))), this._model = null, this._register(this._editor.onDidChangeModel(() => {
      let e207 = this._editor.getModel() && this._state.isRevealed;
      this.disposeModel(), this._state.change({ searchScope: null, matchCase: this._storageService.getBoolean(`editor.matchCase`, 1, false), wholeWord: this._storageService.getBoolean(`editor.wholeWord`, 1, false), isRegex: this._storageService.getBoolean(`editor.isRegex`, 1, false), preserveCase: this._storageService.getBoolean(`editor.preserveCase`, 1, false) }, false), e207 && this._start({ forceRevealReplace: false, seedSearchStringFromSelection: `none`, seedSearchStringFromNonEmptySelection: false, seedSearchStringFromGlobalClipboard: false, shouldFocus: 0, shouldAnimate: false, updateSearchScope: false, loop: this._editor.getOption(50).loop });
    }));
  }
  dispose() {
    this.disposeModel(), super.dispose();
  }
  disposeModel() {
    this._model && (this._model = (this._model.dispose(), null));
  }
  _onStateChanged(e206) {
    this.saveQueryState(e206), e206.isRevealed && (this._state.isRevealed ? this._findWidgetVisible.set(true) : (this._findWidgetVisible.reset(), this.disposeModel())), e206.searchString && this.setGlobalBufferTerm(this._state.searchString);
  }
  saveQueryState(e206) {
    e206.isRegex && this._storageService.store(`editor.isRegex`, this._state.actualIsRegex, 1, 1), e206.wholeWord && this._storageService.store(`editor.wholeWord`, this._state.actualWholeWord, 1, 1), e206.matchCase && this._storageService.store(`editor.matchCase`, this._state.actualMatchCase, 1, 1), e206.preserveCase && this._storageService.store(`editor.preserveCase`, this._state.actualPreserveCase, 1, 1);
  }
  loadQueryState() {
    this._state.change({ matchCase: this._storageService.getBoolean(`editor.matchCase`, 1, this._state.matchCase), wholeWord: this._storageService.getBoolean(`editor.wholeWord`, 1, this._state.wholeWord), isRegex: this._storageService.getBoolean(`editor.isRegex`, 1, this._state.isRegex), preserveCase: this._storageService.getBoolean(`editor.preserveCase`, 1, this._state.preserveCase) }, false);
  }
  isFindInputFocused() {
    return !!BZ.getValue(this._contextKeyService);
  }
  getState() {
    return this._state;
  }
  closeFindWidget() {
    this._state.change({ isRevealed: false, searchScope: null }, false), this._editor.focus();
  }
  toggleCaseSensitive() {
    this._state.change({ matchCase: !this._state.matchCase }, false), this._state.isRevealed || this.highlightFindOptions();
  }
  toggleWholeWords() {
    this._state.change({ wholeWord: !this._state.wholeWord }, false), this._state.isRevealed || this.highlightFindOptions();
  }
  toggleRegex() {
    this._state.change({ isRegex: !this._state.isRegex }, false), this._state.isRevealed || this.highlightFindOptions();
  }
  togglePreserveCase() {
    this._state.change({ preserveCase: !this._state.preserveCase }, false), this._state.isRevealed || this.highlightFindOptions();
  }
  toggleSearchScope() {
    if (this._state.searchScope) this._state.change({ searchScope: null }, true);
    else if (this._editor.hasModel()) {
      let e206 = this._editor.getSelections();
      e206 = e206.map((e207) => (e207.endColumn === 1 && e207.endLineNumber > e207.startLineNumber && (e207 = e207.setEndPosition(e207.endLineNumber - 1, this._editor.getModel().getLineMaxColumn(e207.endLineNumber - 1))), e207.isEmpty() ? null : e207)).filter((e207) => !!e207), e206.length && this._state.change({ searchScope: e206 }, true);
    }
  }
  setSearchString(e206) {
    this._state.isRegex && (e206 = za(e206)), this._state.change({ searchString: e206 }, false);
  }
  highlightFindOptions(e206 = false) {
  }
  async _start(e206, t10) {
    if (this.disposeModel(), !this._editor.hasModel()) return;
    let n10 = { ...t10, isRevealed: true };
    if (e206.seedSearchStringFromSelection === `single`) {
      let t11 = b0(this._editor, e206.seedSearchStringFromSelection, e206.seedSearchStringFromNonEmptySelection);
      t11 && (this._state.isRegex ? n10.searchString = za(t11) : n10.searchString = t11);
    } else if (e206.seedSearchStringFromSelection === `multiple` && !e206.updateSearchScope) {
      let t11 = b0(this._editor, e206.seedSearchStringFromSelection);
      t11 && (n10.searchString = t11);
    }
    if (!n10.searchString && e206.seedSearchStringFromGlobalClipboard) {
      let e207 = await this.getGlobalBufferTerm();
      if (!this._editor.hasModel()) return;
      e207 && (n10.searchString = e207);
    }
    if (e206.forceRevealReplace || n10.isReplaceRevealed ? n10.isReplaceRevealed = true : this._findWidgetVisible.get() || (n10.isReplaceRevealed = false), e206.updateSearchScope) {
      let e207 = this._editor.getSelections();
      e207.some((e208) => !e208.isEmpty()) && (n10.searchScope = e207);
    }
    n10.loop = e206.loop, this._state.change(n10, false), this._model || (this._model = new LSe(this._editor, this._state));
  }
  start(e206, t10) {
    return this._start(e206, t10);
  }
  moveToNextMatch() {
    return this._model ? (this._model.moveToNextMatch(), true) : false;
  }
  moveToPrevMatch() {
    return this._model ? (this._model.moveToPrevMatch(), true) : false;
  }
  goToMatch(e206) {
    return this._model ? (this._model.moveToMatch(e206), true) : false;
  }
  replace() {
    return this._model ? (this._model.replace(), true) : false;
  }
  replaceAll() {
    return this._model ? this._editor.getModel()?.isTooLargeForHeapOperation() ? (this._notificationService.warn(C(940, `The file is too large to perform a replace all operation.`)), false) : (this._model.replaceAll(), true) : false;
  }
  selectAllMatches() {
    return this._model ? (this._model.selectAllMatches(), this._editor.focus(), true) : false;
  }
  async getGlobalBufferTerm() {
    return this._editor.getOption(50).globalFindClipboard && this._editor.hasModel() && !this._editor.getModel().isTooLargeForSyncing() ? this._clipboardService.readFindText() : ``;
  }
  setGlobalBufferTerm(e206) {
    this._editor.getOption(50).globalFindClipboard && this._editor.hasModel() && !this._editor.getModel().isTooLargeForSyncing() && this._clipboardService.writeFindText(e206);
  }
}, y0 = _Ic, _Ic.ID = `editor.contrib.findController`, _Ic);
x0 = y0 = _0([v0(1, nd), v0(2, dF), v0(3, hW), v0(4, dw), v0(5, uj)], x0);
var S0 = class extends x0 {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    super(e206, n10, a10, o10, i10, s10), this._contextViewService = t10, this._keybindingService = r10, this._widget = null, this._findOptionsWidget = null, this._findWidgetSearchHistory = m0.getOrCreate(a10), this._replaceWidgetHistory = g0.getOrCreate(a10);
  }
  async _start(e206, t10) {
    this._widget || this._createFindWidget();
    let n10 = this._editor.getSelection(), r10 = false;
    switch (this._editor.getOption(50).autoFindInSelection) {
      case `always`:
        r10 = true;
        break;
      case `never`:
        r10 = false;
        break;
      case `multiline`:
        r10 = !!n10 && n10.startLineNumber !== n10.endLineNumber;
        break;
    }
    e206.updateSearchScope = e206.updateSearchScope || r10, await super._start(e206, t10), this._widget && (e206.shouldFocus === 2 ? this._widget.focusReplaceInput() : e206.shouldFocus === 1 && this._widget.focusFindInput());
  }
  highlightFindOptions(e206 = false) {
    this._widget || this._createFindWidget(), this._state.isRevealed && !e206 ? this._widget.highlightFindOptions() : this._findOptionsWidget.highlightFindOptions();
  }
  _createFindWidget() {
    this._widget = this._register(new lCe(this._editor, this, this._state, this._contextViewService, this._keybindingService, this._contextKeyService, this._hoverService, this._findWidgetSearchHistory, this._replaceWidgetHistory)), this._findOptionsWidget = this._register(new Jwe(this._editor, this._state, this._keybindingService));
  }
  saveViewState() {
    return this._widget?.getViewState();
  }
  restoreViewState(e206) {
    this._widget?.setViewState(e206);
  }
};
S0 = _0([v0(1, pj), v0(2, nd), v0(3, Dw), v0(4, dw), v0(5, dF), v0(6, hW), v0(7, uj)], S0), rf(new ef({ id: qZ.StartFindAction, label: w(947, `Find`), precondition: H.or($.focus, H.has(`editorIsOpen`)), kbOpts: { kbExpr: null, primary: 2084, weight: 100 }, menuOpts: { menuId: W.MenubarEditMenu, group: `3_find`, title: C(941, `&&Find`), order: 1 } })).addImplementation(0, (e206, t10, n10) => {
  let r10 = x0.get(t10);
  return r10 ? r10.start({ forceRevealReplace: false, seedSearchStringFromSelection: t10.getOption(50).seedSearchStringFromSelection === `never` ? `none` : `single`, seedSearchStringFromNonEmptySelection: t10.getOption(50).seedSearchStringFromSelection === `selection`, seedSearchStringFromGlobalClipboard: t10.getOption(50).globalFindClipboard, shouldFocus: 1, shouldAnimate: true, updateSearchScope: false, loop: t10.getOption(50).loop }) : false;
});
var tTe = { description: `Open a new In-Editor Find Widget.`, args: [{ name: `Open a new In-Editor Find Widget args`, schema: { properties: { searchString: { type: `string` }, replaceString: { type: `string` }, isRegex: { type: `boolean` }, matchWholeWord: { type: `boolean` }, isCaseSensitive: { type: `boolean` }, preserveCase: { type: `boolean` }, findInSelection: { type: `boolean` } } } }] }, nTe = class extends G {
  constructor() {
    super({ id: qZ.StartFindWithArgs, label: w(948, `Find with Arguments`), precondition: void 0, kbOpts: { kbExpr: null, primary: 0, weight: 100 }, metadata: tTe });
  }
  async run(e206, t10, n10) {
    let r10 = x0.get(t10);
    if (r10) {
      let e207 = n10 ? { searchString: n10.searchString, replaceString: n10.replaceString, isReplaceRevealed: n10.replaceString !== void 0, isRegex: n10.isRegex, wholeWord: n10.matchWholeWord, matchCase: n10.isCaseSensitive, preserveCase: n10.preserveCase } : {};
      await r10.start({ forceRevealReplace: false, seedSearchStringFromSelection: r10.getState().searchString.length === 0 && t10.getOption(50).seedSearchStringFromSelection !== `never` ? `single` : `none`, seedSearchStringFromNonEmptySelection: t10.getOption(50).seedSearchStringFromSelection === `selection`, seedSearchStringFromGlobalClipboard: true, shouldFocus: 1, shouldAnimate: true, updateSearchScope: n10?.findInSelection || false, loop: t10.getOption(50).loop }, e207), r10.setGlobalBufferTerm(r10.getState().searchString);
    }
  }
}, rTe = class extends G {
  constructor() {
    super({ id: qZ.StartFindWithSelection, label: w(949, `Find with Selection`), precondition: void 0, kbOpts: { kbExpr: null, primary: 0, mac: { primary: 2083 }, weight: 100 } });
  }
  async run(e206, t10) {
    let n10 = x0.get(t10);
    n10 && (await n10.start({ forceRevealReplace: false, seedSearchStringFromSelection: `multiple`, seedSearchStringFromNonEmptySelection: false, seedSearchStringFromGlobalClipboard: false, shouldFocus: 0, shouldAnimate: true, updateSearchScope: false, loop: t10.getOption(50).loop }), n10.setGlobalBufferTerm(n10.getState().searchString));
  }
};
async function C0(e206, t10) {
  let n10 = x0.get(e206);
  if (!n10) return;
  let r10 = () => (t10 ? n10.moveToNextMatch() : n10.moveToPrevMatch()) ? (n10.editor.pushUndoStop(), true) : false;
  r10() || (await n10.start({ forceRevealReplace: false, seedSearchStringFromSelection: n10.getState().searchString.length === 0 && e206.getOption(50).seedSearchStringFromSelection !== `never` ? `single` : `none`, seedSearchStringFromNonEmptySelection: e206.getOption(50).seedSearchStringFromSelection === `selection`, seedSearchStringFromGlobalClipboard: true, shouldFocus: 0, shouldAnimate: true, updateSearchScope: false, loop: e206.getOption(50).loop }), r10());
}
rf(new ef({ id: qZ.NextMatchFindAction, label: w(950, `Find Next`), precondition: void 0, kbOpts: [{ kbExpr: $.focus, primary: 61, mac: { primary: 2085, secondary: [61] }, weight: 100 }, { kbExpr: H.and($.focus, BZ), primary: 3, weight: 100 }] })).addImplementation(0, async (e206, t10, n10) => C0(t10, true)), rf(new ef({ id: qZ.PreviousMatchFindAction, label: w(951, `Find Previous`), precondition: void 0, kbOpts: [{ kbExpr: $.focus, primary: 1085, mac: { primary: 3109, secondary: [1085] }, weight: 100 }, { kbExpr: H.and($.focus, BZ), primary: 1027, weight: 100 }] })).addImplementation(0, async (e206, t10, n10) => C0(t10, false));
var iTe = class extends G {
  constructor() {
    super({ id: qZ.GoToMatchFindAction, label: w(952, `Go to Match...`), precondition: zZ }), this._highlightDecorations = [];
  }
  run(e206, t10, n10) {
    let r10 = x0.get(t10);
    if (!r10) return;
    let i10 = r10.getState().matchesCount;
    if (i10 < 1) {
      e206.get(dw).notify({ severity: uw.Warning, message: C(942, `No matches. Try searching for something else.`) });
      return;
    }
    let a10 = e206.get(aF), o10 = new E(), s10 = o10.add(a10.createInputBox());
    s10.placeholder = C(943, `Type a number to go to a specific match (between 1 and {0})`, i10);
    let c10 = (e207) => {
      let t11 = parseInt(e207);
      if (isNaN(t11)) return;
      let n11 = r10.getState().matchesCount;
      if (t11 > 0 && t11 <= n11) return t11 - 1;
      if (t11 < 0 && t11 >= -n11) return n11 + t11;
    }, l10 = (e207) => {
      let n11 = c10(e207);
      if (typeof n11 == `number`) {
        s10.validationMessage = void 0, r10.goToMatch(n11);
        let e208 = r10.getState().currentMatch;
        e208 && this.addDecorations(t10, e208);
      } else s10.validationMessage = C(944, `Please type a number between 1 and {0}`, r10.getState().matchesCount), this.clearDecorations(t10);
    };
    o10.add(s10.onDidChangeValue((e207) => {
      l10(e207);
    })), o10.add(s10.onDidAccept(() => {
      let e207 = c10(s10.value);
      typeof e207 == `number` ? (r10.goToMatch(e207), s10.hide()) : s10.validationMessage = C(945, `Please type a number between 1 and {0}`, r10.getState().matchesCount);
    })), o10.add(s10.onDidHide(() => {
      this.clearDecorations(t10), o10.dispose();
    })), s10.show();
  }
  clearDecorations(e206) {
    e206.changeDecorations((e207) => {
      this._highlightDecorations = e207.deltaDecorations(this._highlightDecorations, []);
    });
  }
  addDecorations(e206, t10) {
    e206.changeDecorations((e207) => {
      this._highlightDecorations = e207.deltaDecorations(this._highlightDecorations, [{ range: t10, options: { description: `find-match-quick-access-range-highlight`, className: `rangeHighlight`, isWholeLine: true } }, { range: t10, options: { description: `find-match-quick-access-range-highlight-overview`, overviewRuler: { color: WS(iC), position: Qp.Full } } }]);
    });
  }
}, w0 = class extends G {
  async run(e206, t10) {
    let n10 = x0.get(t10);
    if (!n10) return;
    let r10 = b0(t10, `single`, false);
    r10 && n10.setSearchString(r10), this._run(n10) || (await n10.start({ forceRevealReplace: false, seedSearchStringFromSelection: `none`, seedSearchStringFromNonEmptySelection: false, seedSearchStringFromGlobalClipboard: false, shouldFocus: 0, shouldAnimate: true, updateSearchScope: false, loop: t10.getOption(50).loop }), this._run(n10));
  }
}, aTe = class extends w0 {
  constructor() {
    super({ id: qZ.NextSelectionMatchFindAction, label: w(953, `Find Next Selection`), precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 2109, weight: 100 } });
  }
  _run(e206) {
    return e206.moveToNextMatch();
  }
}, oTe = class extends w0 {
  constructor() {
    super({ id: qZ.PreviousSelectionMatchFindAction, label: w(954, `Find Previous Selection`), precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 3133, weight: 100 } });
  }
  _run(e206) {
    return e206.moveToPrevMatch();
  }
};
rf(new ef({ id: qZ.StartFindReplaceAction, label: w(955, `Replace`), precondition: H.or($.focus, H.has(`editorIsOpen`)), kbOpts: { kbExpr: null, primary: 2086, mac: { primary: 2596 }, weight: 100 }, menuOpts: { menuId: W.MenubarEditMenu, group: `3_find`, title: C(946, `&&Replace`), order: 2 } })).addImplementation(0, (e206, t10, n10) => {
  if (!t10.hasModel() || t10.getOption(104)) return false;
  let r10 = x0.get(t10);
  if (!r10) return false;
  let i10 = t10.getSelection(), a10 = r10.isFindInputFocused(), o10 = !i10.isEmpty() && i10.startLineNumber === i10.endLineNumber && t10.getOption(50).seedSearchStringFromSelection !== `never` && !a10, s10 = a10 || o10 ? 2 : 1;
  return r10.start({ forceRevealReplace: true, seedSearchStringFromSelection: o10 ? `single` : `none`, seedSearchStringFromNonEmptySelection: t10.getOption(50).seedSearchStringFromSelection === `selection`, seedSearchStringFromGlobalClipboard: t10.getOption(50).seedSearchStringFromSelection !== `never`, shouldFocus: s10, shouldAnimate: true, updateSearchScope: false, loop: t10.getOption(50).loop });
}), af(x0.ID, S0, 0), q(nTe), q(rTe), q(iTe), q(aTe), q(oTe);
var T0 = $d.bindToContribution(x0.get);
K(new T0({ id: qZ.CloseFindWidgetCommand, precondition: zZ, handler: (e206) => e206.closeFindWidget(), kbOpts: { weight: 105, kbExpr: H.and($.focus, H.not(`isComposing`)), primary: 9, secondary: [1033] } })), K(new T0({ id: qZ.ToggleCaseSensitiveCommand, precondition: void 0, handler: (e206) => e206.toggleCaseSensitive(), kbOpts: { weight: 105, kbExpr: $.focus, primary: HZ.primary, mac: HZ.mac, win: HZ.win, linux: HZ.linux } })), K(new T0({ id: qZ.ToggleWholeWordCommand, precondition: void 0, handler: (e206) => e206.toggleWholeWords(), kbOpts: { weight: 105, kbExpr: $.focus, primary: UZ.primary, mac: UZ.mac, win: UZ.win, linux: UZ.linux } })), K(new T0({ id: qZ.ToggleRegexCommand, precondition: void 0, handler: (e206) => e206.toggleRegex(), kbOpts: { weight: 105, kbExpr: $.focus, primary: WZ.primary, mac: WZ.mac, win: WZ.win, linux: WZ.linux } })), K(new T0({ id: qZ.ToggleSearchScopeCommand, precondition: void 0, handler: (e206) => e206.toggleSearchScope(), kbOpts: { weight: 105, kbExpr: $.focus, primary: GZ.primary, mac: GZ.mac, win: GZ.win, linux: GZ.linux } })), K(new T0({ id: qZ.TogglePreserveCaseCommand, precondition: void 0, handler: (e206) => e206.togglePreserveCase(), kbOpts: { weight: 105, kbExpr: $.focus, primary: KZ.primary, mac: KZ.mac, win: KZ.win, linux: KZ.linux } })), K(new T0({ id: qZ.ReplaceOneAction, precondition: zZ, handler: (e206) => e206.replace(), kbOpts: { weight: 105, kbExpr: $.focus, primary: 3094 } })), K(new T0({ id: qZ.ReplaceOneAction, precondition: zZ, handler: (e206) => e206.replace(), kbOpts: { weight: 105, kbExpr: H.and($.focus, VZ), primary: 3 } })), K(new T0({ id: qZ.ReplaceAllAction, precondition: zZ, handler: (e206) => e206.replaceAll(), kbOpts: { weight: 105, kbExpr: $.focus, primary: 2563 } })), K(new T0({ id: qZ.ReplaceAllAction, precondition: zZ, handler: (e206) => e206.replaceAll(), kbOpts: { weight: 105, kbExpr: H.and($.focus, VZ), primary: void 0, mac: { primary: 2051 } } })), K(new T0({ id: qZ.SelectAllMatchesAction, precondition: zZ, handler: (e206) => e206.selectAllMatches(), kbOpts: { weight: 105, kbExpr: $.focus, primary: 515 } }));
var sTe = { 0: ` `, 1: `u`, 2: `r` }, E0 = 16777215, D0 = 4278190080, O0 = class {
  constructor(e206) {
    let t10 = Math.ceil(e206 / 32);
    this._states = new Uint32Array(t10);
  }
  get(e206) {
    let t10 = e206 / 32 | 0, n10 = e206 % 32;
    return (this._states[t10] & 1 << n10) != 0;
  }
  set(e206, t10) {
    let n10 = e206 / 32 | 0, r10 = e206 % 32, i10 = this._states[n10];
    t10 ? this._states[n10] = i10 | 1 << r10 : this._states[n10] = i10 & ~(1 << r10);
  }
}, k0 = class e187 {
  constructor(e206, t10, n10) {
    if (e206.length !== t10.length || e206.length > 65535) throw Error(`invalid startIndexes or endIndexes size`);
    this._startIndexes = e206, this._endIndexes = t10, this._collapseStates = new O0(e206.length), this._userDefinedStates = new O0(e206.length), this._recoveredStates = new O0(e206.length), this._types = n10, this._parentsComputed = false;
  }
  ensureParentIndices() {
    if (!this._parentsComputed) {
      this._parentsComputed = true;
      let e206 = [], t10 = (t11, n10) => {
        let r10 = e206[e206.length - 1];
        return this.getStartLineNumber(r10) <= t11 && this.getEndLineNumber(r10) >= n10;
      };
      for (let n10 = 0, r10 = this._startIndexes.length; n10 < r10; n10++) {
        let r11 = this._startIndexes[n10], i10 = this._endIndexes[n10];
        if (r11 > 16777215 || i10 > 16777215) throw Error(`startLineNumber or endLineNumber must not exceed ` + E0);
        for (; e206.length > 0 && !t10(r11, i10); ) e206.pop();
        let a10 = e206.length > 0 ? e206[e206.length - 1] : -1;
        e206.push(n10), this._startIndexes[n10] = r11 + ((a10 & 255) << 24), this._endIndexes[n10] = i10 + ((a10 & 65280) << 16);
      }
    }
  }
  get length() {
    return this._startIndexes.length;
  }
  getStartLineNumber(e206) {
    return this._startIndexes[e206] & E0;
  }
  getEndLineNumber(e206) {
    return this._endIndexes[e206] & E0;
  }
  getType(e206) {
    return this._types ? this._types[e206] : void 0;
  }
  hasTypes() {
    return !!this._types;
  }
  isCollapsed(e206) {
    return this._collapseStates.get(e206);
  }
  setCollapsed(e206, t10) {
    this._collapseStates.set(e206, t10);
  }
  isUserDefined(e206) {
    return this._userDefinedStates.get(e206);
  }
  setUserDefined(e206, t10) {
    return this._userDefinedStates.set(e206, t10);
  }
  isRecovered(e206) {
    return this._recoveredStates.get(e206);
  }
  setRecovered(e206, t10) {
    return this._recoveredStates.set(e206, t10);
  }
  getSource(e206) {
    return this.isUserDefined(e206) ? 1 : this.isRecovered(e206) ? 2 : 0;
  }
  setSource(e206, t10) {
    t10 === 1 ? (this.setUserDefined(e206, true), this.setRecovered(e206, false)) : t10 === 2 ? (this.setUserDefined(e206, false), this.setRecovered(e206, true)) : (this.setUserDefined(e206, false), this.setRecovered(e206, false));
  }
  setCollapsedAllOfType(e206, t10) {
    let n10 = false;
    if (this._types) for (let r10 = 0; r10 < this._types.length; r10++) this._types[r10] === e206 && (this.setCollapsed(r10, t10), n10 = true);
    return n10;
  }
  toRegion(e206) {
    return new cTe(this, e206);
  }
  getParentIndex(e206) {
    this.ensureParentIndices();
    let t10 = ((this._startIndexes[e206] & D0) >>> 24) + ((this._endIndexes[e206] & D0) >>> 16);
    return t10 === 65535 ? -1 : t10;
  }
  contains(e206, t10) {
    return this.getStartLineNumber(e206) <= t10 && this.getEndLineNumber(e206) >= t10;
  }
  findIndex(e206) {
    let t10 = 0, n10 = this._startIndexes.length;
    if (n10 === 0) return -1;
    for (; t10 < n10; ) {
      let r10 = Math.floor((t10 + n10) / 2);
      e206 < this.getStartLineNumber(r10) ? n10 = r10 : t10 = r10 + 1;
    }
    return t10 - 1;
  }
  findRange(e206) {
    let t10 = this.findIndex(e206);
    if (t10 >= 0) {
      if (this.getEndLineNumber(t10) >= e206) return t10;
      for (t10 = this.getParentIndex(t10); t10 !== -1; ) {
        if (this.contains(t10, e206)) return t10;
        t10 = this.getParentIndex(t10);
      }
    }
    return -1;
  }
  toString() {
    let e206 = [];
    for (let t10 = 0; t10 < this.length; t10++) e206[t10] = `[${sTe[this.getSource(t10)]}${this.isCollapsed(t10) ? `+` : `-`}] ${this.getStartLineNumber(t10)}/${this.getEndLineNumber(t10)}`;
    return e206.join(`, `);
  }
  toFoldRange(e206) {
    return { startLineNumber: this._startIndexes[e206] & E0, endLineNumber: this._endIndexes[e206] & E0, type: this._types ? this._types[e206] : void 0, isCollapsed: this.isCollapsed(e206), source: this.getSource(e206) };
  }
  static fromFoldRanges(t10) {
    let n10 = t10.length, r10 = new Uint32Array(n10), i10 = new Uint32Array(n10), a10 = [], o10 = false;
    for (let e206 = 0; e206 < n10; e206++) {
      let n11 = t10[e206];
      r10[e206] = n11.startLineNumber, i10[e206] = n11.endLineNumber, a10.push(n11.type), n11.type && (o10 = true);
    }
    o10 || (a10 = void 0);
    let s10 = new e187(r10, i10, a10);
    for (let e206 = 0; e206 < n10; e206++) t10[e206].isCollapsed && s10.setCollapsed(e206, true), s10.setSource(e206, t10[e206].source);
    return s10;
  }
  static sanitizeAndMerge(e206, t10, n10, r10) {
    n10 ?? (n10 = Number.MAX_VALUE);
    let i10 = (e207, t11) => Array.isArray(e207) ? ((n11) => n11 < t11 ? e207[n11] : void 0) : ((n11) => n11 < t11 ? e207.toFoldRange(n11) : void 0), a10 = i10(e206, e206.length), o10 = i10(t10, t10.length), s10 = 0, c10 = 0, l10 = a10(0), u10 = o10(0), d10 = [], f10, p10 = 0, m10 = [];
    for (; l10 || u10; ) {
      let e207;
      if (u10 && (!l10 || l10.startLineNumber >= u10.startLineNumber)) l10 && l10.startLineNumber === u10.startLineNumber ? (u10.source === 1 ? e207 = u10 : (e207 = l10, e207.isCollapsed = u10.isCollapsed && (l10.endLineNumber === u10.endLineNumber || !r10?.startsInside(l10.startLineNumber + 1, l10.endLineNumber + 1)), e207.source = 0), l10 = a10(++s10)) : (e207 = u10, u10.isCollapsed && u10.source === 0 && (e207.source = 2)), u10 = o10(++c10);
      else {
        let t11 = c10, n11 = u10;
        for (; ; ) {
          if (!n11 || n11.startLineNumber > l10.endLineNumber) {
            e207 = l10;
            break;
          }
          if (n11.source === 1 && n11.endLineNumber > l10.endLineNumber) break;
          n11 = o10(++t11);
        }
        l10 = a10(++s10);
      }
      if (e207) {
        for (; f10 && f10.endLineNumber < e207.startLineNumber; ) f10 = d10.pop();
        e207.endLineNumber > e207.startLineNumber && e207.startLineNumber > p10 && e207.endLineNumber <= n10 && (!f10 || f10.endLineNumber >= e207.endLineNumber) && (m10.push(e207), p10 = e207.startLineNumber, f10 && d10.push(f10), f10 = e207);
      }
    }
    return m10;
  }
}, cTe = class {
  constructor(e206, t10) {
    this.ranges = e206, this.index = t10;
  }
  get startLineNumber() {
    return this.ranges.getStartLineNumber(this.index);
  }
  get endLineNumber() {
    return this.ranges.getEndLineNumber(this.index);
  }
  get regionIndex() {
    return this.index;
  }
  get parentIndex() {
    return this.ranges.getParentIndex(this.index);
  }
  get isCollapsed() {
    return this.ranges.isCollapsed(this.index);
  }
  containedBy(e206) {
    return e206.startLineNumber <= this.startLineNumber && e206.endLineNumber >= this.endLineNumber;
  }
  containsLine(e206) {
    return this.startLineNumber <= e206 && e206 <= this.endLineNumber;
  }
}, lTe = class {
  get regions() {
    return this._regions;
  }
  get textModel() {
    return this._textModel;
  }
  constructor(e206, t10) {
    this._updateEventEmitter = new k(), this.onDidChange = this._updateEventEmitter.event, this._textModel = e206, this._decorationProvider = t10, this._regions = new k0(new Uint32Array(), new Uint32Array()), this._editorDecorationIds = [];
  }
  toggleCollapseState(e206) {
    if (!e206.length) return;
    e206 = e206.sort((e207, t11) => e207.regionIndex - t11.regionIndex);
    let t10 = {};
    this._decorationProvider.changeDecorations((n10) => {
      let r10 = 0, i10 = -1, a10 = -1, o10 = (e207) => {
        for (; r10 < e207; ) {
          let e208 = this._regions.getEndLineNumber(r10), t11 = this._regions.isCollapsed(r10);
          if (e208 <= i10) {
            let i11 = this.regions.getSource(r10) !== 0;
            n10.changeDecorationOptions(this._editorDecorationIds[r10], this._decorationProvider.getDecorationOption(t11, e208 <= a10, i11));
          }
          t11 && e208 > a10 && (a10 = e208), r10++;
        }
      };
      for (let n11 of e206) {
        let e207 = n11.regionIndex, r11 = this._editorDecorationIds[e207];
        if (r11 && !t10[r11]) {
          t10[r11] = true, o10(e207);
          let n12 = !this._regions.isCollapsed(e207);
          this._regions.setCollapsed(e207, n12), i10 = Math.max(i10, this._regions.getEndLineNumber(e207));
        }
      }
      o10(this._regions.length);
    }), this._updateEventEmitter.fire({ model: this, collapseStateChanged: e206 });
  }
  removeManualRanges(e206) {
    let t10 = [], n10 = (t11) => {
      for (let n11 of e206) if (!(n11.startLineNumber > t11.endLineNumber || t11.startLineNumber > n11.endLineNumber)) return true;
      return false;
    };
    for (let e207 = 0; e207 < this._regions.length; e207++) {
      let r10 = this._regions.toFoldRange(e207);
      (r10.source === 0 || !n10(r10)) && t10.push(r10);
    }
    this.updatePost(k0.fromFoldRanges(t10));
  }
  update(e206, t10) {
    let n10 = this._currentFoldedOrManualRanges(t10), r10 = k0.sanitizeAndMerge(e206, n10, this._textModel.getLineCount(), t10);
    this.updatePost(k0.fromFoldRanges(r10));
  }
  updatePost(e206) {
    let t10 = [], n10 = -1;
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
      let i11 = e206.getStartLineNumber(r10), a10 = e206.getEndLineNumber(r10), o10 = e206.isCollapsed(r10), s10 = e206.getSource(r10) !== 0, c10 = { startLineNumber: i11, startColumn: this._textModel.getLineMaxColumn(i11), endLineNumber: a10, endColumn: this._textModel.getLineMaxColumn(a10) + 1 };
      t10.push({ range: c10, options: this._decorationProvider.getDecorationOption(o10, a10 <= n10, s10) }), o10 && a10 > n10 && (n10 = a10);
    }
    this._decorationProvider.changeDecorations((e207) => this._editorDecorationIds = e207.deltaDecorations(this._editorDecorationIds, t10)), this._regions = e206, this._updateEventEmitter.fire({ model: this });
  }
  _currentFoldedOrManualRanges(e206) {
    let t10 = [];
    for (let n10 = 0, r10 = this._regions.length; n10 < r10; n10++) {
      let r11 = this.regions.isCollapsed(n10), i10 = this.regions.getSource(n10);
      if (r11 || i10 !== 0) {
        let a10 = this._regions.toFoldRange(n10), o10 = this._textModel.getDecorationRange(this._editorDecorationIds[n10]);
        o10 && (r11 && e206?.startsInside(o10.startLineNumber + 1, o10.endLineNumber) && (r11 = false), t10.push({ startLineNumber: o10.startLineNumber, endLineNumber: o10.endLineNumber, type: a10.type, isCollapsed: r11, source: i10 }));
      }
    }
    return t10;
  }
  getMemento() {
    let e206 = this._currentFoldedOrManualRanges(), t10 = [], n10 = this._textModel.getLineCount();
    for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) {
      let i11 = e206[r10];
      if (i11.startLineNumber >= i11.endLineNumber || i11.startLineNumber < 1 || i11.endLineNumber > n10) continue;
      let a10 = this._getLinesChecksum(i11.startLineNumber + 1, i11.endLineNumber);
      t10.push({ startLineNumber: i11.startLineNumber, endLineNumber: i11.endLineNumber, isCollapsed: i11.isCollapsed, source: i11.source, checksum: a10 });
    }
    return t10.length > 0 ? t10 : void 0;
  }
  applyMemento(e206) {
    if (!Array.isArray(e206)) return;
    let t10 = [], n10 = this._textModel.getLineCount();
    for (let r11 of e206) {
      if (r11.startLineNumber >= r11.endLineNumber || r11.startLineNumber < 1 || r11.endLineNumber > n10) continue;
      let e207 = this._getLinesChecksum(r11.startLineNumber + 1, r11.endLineNumber);
      (!r11.checksum || e207 === r11.checksum) && t10.push({ startLineNumber: r11.startLineNumber, endLineNumber: r11.endLineNumber, type: void 0, isCollapsed: r11.isCollapsed ?? true, source: r11.source ?? 0 });
    }
    let r10 = k0.sanitizeAndMerge(this._regions, t10, n10);
    this.updatePost(k0.fromFoldRanges(r10));
  }
  _getLinesChecksum(e206, t10) {
    return Is(this._textModel.getLineContent(e206) + this._textModel.getLineContent(t10)) % 1e6;
  }
  dispose() {
    this._decorationProvider.removeDecorations(this._editorDecorationIds);
  }
  getAllRegionsAtLine(e206, t10) {
    let n10 = [];
    if (this._regions) {
      let r10 = this._regions.findRange(e206), i10 = 1;
      for (; r10 >= 0; ) {
        let e207 = this._regions.toRegion(r10);
        (!t10 || t10(e207, i10)) && n10.push(e207), i10++, r10 = e207.parentIndex;
      }
    }
    return n10;
  }
  getRegionAtLine(e206) {
    if (this._regions) {
      let t10 = this._regions.findRange(e206);
      if (t10 >= 0) return this._regions.toRegion(t10);
    }
    return null;
  }
  getRegionsInside(e206, t10) {
    let n10 = [], r10 = e206 ? e206.regionIndex + 1 : 0, i10 = e206 ? e206.endLineNumber : Number.MAX_VALUE;
    if (t10 && t10.length === 2) {
      let e207 = [];
      for (let a10 = r10, o10 = this._regions.length; a10 < o10; a10++) {
        let r11 = this._regions.toRegion(a10);
        if (this._regions.getStartLineNumber(a10) < i10) {
          for (; e207.length > 0 && !r11.containedBy(e207[e207.length - 1]); ) e207.pop();
          e207.push(r11), t10(r11, e207.length) && n10.push(r11);
        } else break;
      }
    } else for (let e207 = r10, a10 = this._regions.length; e207 < a10; e207++) {
      let r11 = this._regions.toRegion(e207);
      if (this._regions.getStartLineNumber(e207) < i10) (!t10 || t10(r11)) && n10.push(r11);
      else break;
    }
    return n10;
  }
};
function A0(e206, t10, n10) {
  let r10 = [];
  for (let i10 of n10) {
    let n11 = e206.getRegionAtLine(i10);
    if (n11) {
      let i11 = !n11.isCollapsed;
      if (r10.push(n11), t10 > 1) {
        let a10 = e206.getRegionsInside(n11, (e207, n12) => e207.isCollapsed !== i11 && n12 < t10);
        r10.push(...a10);
      }
    }
  }
  e206.toggleCollapseState(r10);
}
function j0(e206, t10, n10 = Number.MAX_VALUE, r10) {
  let i10 = [];
  if (r10 && r10.length > 0) for (let a10 of r10) {
    let r11 = e206.getRegionAtLine(a10);
    if (r11 && (r11.isCollapsed !== t10 && i10.push(r11), n10 > 1)) {
      let a11 = e206.getRegionsInside(r11, (e207, r12) => e207.isCollapsed !== t10 && r12 < n10);
      i10.push(...a11);
    }
  }
  else {
    let r11 = e206.getRegionsInside(null, (e207, r12) => e207.isCollapsed !== t10 && r12 < n10);
    i10.push(...r11);
  }
  e206.toggleCollapseState(i10);
}
function M0(e206, t10, n10, r10) {
  let i10 = [];
  for (let a10 of r10) {
    let r11 = e206.getAllRegionsAtLine(a10, (e207, r12) => e207.isCollapsed !== t10 && r12 <= n10);
    i10.push(...r11);
  }
  e206.toggleCollapseState(i10);
}
function uTe(e206, t10, n10) {
  let r10 = [];
  for (let i10 of n10) {
    let n11 = e206.getAllRegionsAtLine(i10, (e207) => e207.isCollapsed !== t10);
    n11.length > 0 && r10.push(n11[0]);
  }
  e206.toggleCollapseState(r10);
}
function dTe(e206, t10, n10, r10) {
  let i10 = e206.getRegionsInside(null, (e207, i11) => i11 === t10 && e207.isCollapsed !== n10 && !r10.some((t11) => e207.containsLine(t11)));
  e206.toggleCollapseState(i10);
}
function N0(e206, t10, n10) {
  let r10 = [];
  for (let t11 of n10) {
    let n11 = e206.getAllRegionsAtLine(t11, void 0);
    n11.length > 0 && r10.push(n11[0]);
  }
  let i10 = e206.getRegionsInside(null, (e207) => r10.every((t11) => !t11.containedBy(e207) && !e207.containedBy(t11)) && e207.isCollapsed !== t10);
  e206.toggleCollapseState(i10);
}
function P0(e206, t10, n10) {
  let r10 = e206.textModel, i10 = e206.regions, a10 = [];
  for (let e207 = i10.length - 1; e207 >= 0; e207--) if (n10 !== i10.isCollapsed(e207)) {
    let n11 = i10.getStartLineNumber(e207);
    t10.test(r10.getLineContent(n11)) && a10.push(i10.toRegion(e207));
  }
  e206.toggleCollapseState(a10);
}
function F0(e206, t10, n10) {
  let r10 = e206.regions, i10 = [];
  for (let e207 = r10.length - 1; e207 >= 0; e207--) n10 !== r10.isCollapsed(e207) && t10 === r10.getType(e207) && i10.push(r10.toRegion(e207));
  e206.toggleCollapseState(i10);
}
function fTe(e206, t10) {
  let n10 = null, r10 = t10.getRegionAtLine(e206);
  if (r10 !== null && (n10 = r10.startLineNumber, e206 === n10)) {
    let e207 = r10.parentIndex;
    n10 = e207 === -1 ? null : t10.regions.getStartLineNumber(e207);
  }
  return n10;
}
function pTe(e206, t10) {
  let n10 = t10.getRegionAtLine(e206);
  if (n10 !== null && n10.startLineNumber === e206) {
    if (e206 !== n10.startLineNumber) return n10.startLineNumber;
    {
      let e207 = n10.parentIndex, r10 = 0;
      for (e207 !== -1 && (r10 = t10.regions.getStartLineNumber(n10.parentIndex)); n10 !== null; ) if (n10.regionIndex > 0) {
        if (n10 = t10.regions.toRegion(n10.regionIndex - 1), n10.startLineNumber <= r10) return null;
        if (n10.parentIndex === e207) return n10.startLineNumber;
      } else return null;
    }
  } else if (t10.regions.length > 0) for (n10 = t10.regions.toRegion(t10.regions.length - 1); n10 !== null; ) {
    if (n10.startLineNumber < e206) return n10.startLineNumber;
    n10 = n10.regionIndex > 0 ? t10.regions.toRegion(n10.regionIndex - 1) : null;
  }
  return null;
}
function mTe(e206, t10) {
  let n10 = t10.getRegionAtLine(e206);
  if (n10 !== null && n10.startLineNumber === e206) {
    let e207 = n10.parentIndex, r10 = 0;
    if (e207 !== -1) r10 = t10.regions.getEndLineNumber(n10.parentIndex);
    else if (t10.regions.length === 0) return null;
    else r10 = t10.regions.getEndLineNumber(t10.regions.length - 1);
    for (; n10 !== null; ) if (n10.regionIndex < t10.regions.length) {
      if (n10 = t10.regions.toRegion(n10.regionIndex + 1), n10.startLineNumber >= r10) return null;
      if (n10.parentIndex === e207) return n10.startLineNumber;
    } else return null;
  } else if (t10.regions.length > 0) for (n10 = t10.regions.toRegion(0); n10 !== null; ) {
    if (n10.startLineNumber > e206) return n10.startLineNumber;
    n10 = n10.regionIndex < t10.regions.length ? t10.regions.toRegion(n10.regionIndex + 1) : null;
  }
  return null;
}
var hTe = class {
  get onDidChange() {
    return this._updateEventEmitter.event;
  }
  get hiddenRanges() {
    return this._hiddenRanges;
  }
  constructor(e206) {
    this._updateEventEmitter = new k(), this._hasLineChanges = false, this._foldingModel = e206, this._foldingModelListener = e206.onDidChange((e207) => this.updateHiddenRanges()), this._hiddenRanges = [], e206.regions.length && this.updateHiddenRanges();
  }
  notifyChangeModelContent(e206) {
    this._hiddenRanges.length && !this._hasLineChanges && (this._hasLineChanges = e206.changes.some((e207) => e207.range.endLineNumber !== e207.range.startLineNumber || pT(e207.text)[0] !== 0));
  }
  updateHiddenRanges() {
    let e206 = false, t10 = [], n10 = 0, r10 = 0, i10 = Number.MAX_VALUE, a10 = -1, o10 = this._foldingModel.regions;
    for (; n10 < o10.length; n10++) {
      if (!o10.isCollapsed(n10)) continue;
      let s10 = o10.getStartLineNumber(n10) + 1, c10 = o10.getEndLineNumber(n10);
      i10 <= s10 && c10 <= a10 || (!e206 && r10 < this._hiddenRanges.length && this._hiddenRanges[r10].startLineNumber === s10 && this._hiddenRanges[r10].endLineNumber === c10 ? (t10.push(this._hiddenRanges[r10]), r10++) : (e206 = true, t10.push(new M(s10, 1, c10, 1))), i10 = s10, a10 = c10);
    }
    (this._hasLineChanges || e206 || r10 < this._hiddenRanges.length) && this.applyHiddenRanges(t10);
  }
  applyHiddenRanges(e206) {
    this._hiddenRanges = e206, this._hasLineChanges = false, this._updateEventEmitter.fire(e206);
  }
  hasRanges() {
    return this._hiddenRanges.length > 0;
  }
  isHidden(e206) {
    return I0(this._hiddenRanges, e206) !== null;
  }
  adjustSelections(e206) {
    let t10 = false, n10 = this._foldingModel.textModel, r10 = null, i10 = (e207) => ((!r10 || !gTe(e207, r10)) && (r10 = I0(this._hiddenRanges, e207)), r10 ? r10.startLineNumber - 1 : null);
    for (let r11 = 0, a10 = e206.length; r11 < a10; r11++) {
      let a11 = e206[r11], o10 = i10(a11.startLineNumber);
      o10 && (a11 = a11.setStartPosition(o10, n10.getLineMaxColumn(o10)), t10 = true);
      let s10 = i10(a11.endLineNumber);
      s10 && (a11 = a11.setEndPosition(s10, n10.getLineMaxColumn(s10)), t10 = true), e206[r11] = a11;
    }
    return t10;
  }
  dispose() {
    this.hiddenRanges.length > 0 && (this._hiddenRanges = [], this._updateEventEmitter.fire(this._hiddenRanges)), this._foldingModelListener && (this._foldingModelListener = (this._foldingModelListener.dispose(), null));
  }
};
function gTe(e206, t10) {
  return e206 >= t10.startLineNumber && e206 <= t10.endLineNumber;
}
function I0(e206, t10) {
  let n10 = Mm(e206, (e207) => t10 < e207.startLineNumber) - 1;
  return n10 >= 0 && e206[n10].endLineNumber >= t10 ? e206[n10] : null;
}
var _Te = 5e3, vTe = `indent`, L0 = class {
  constructor(e206, t10, n10) {
    this.editorModel = e206, this.languageConfigurationService = t10, this.foldingRangesLimit = n10, this.id = vTe;
  }
  dispose() {
  }
  compute(e206) {
    let t10 = this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules, n10 = t10 && !!t10.offSide, r10 = t10 && t10.markers;
    return Promise.resolve(xTe(this.editorModel, n10, r10, this.foldingRangesLimit));
  }
}, yTe = class {
  constructor(e206) {
    this._startIndexes = [], this._endIndexes = [], this._indentOccurrences = [], this._length = 0, this._foldingRangesLimit = e206;
  }
  insertFirst(e206, t10, n10) {
    if (e206 > 16777215 || t10 > 16777215) return;
    let r10 = this._length;
    this._startIndexes[r10] = e206, this._endIndexes[r10] = t10, this._length++, n10 < 1e3 && (this._indentOccurrences[n10] = (this._indentOccurrences[n10] || 0) + 1);
  }
  toIndentRanges(e206) {
    let t10 = this._foldingRangesLimit.limit;
    if (this._length <= t10) {
      this._foldingRangesLimit.update(this._length, false);
      let e207 = new Uint32Array(this._length), t11 = new Uint32Array(this._length);
      for (let n10 = this._length - 1, r10 = 0; n10 >= 0; n10--, r10++) e207[r10] = this._startIndexes[n10], t11[r10] = this._endIndexes[n10];
      return new k0(e207, t11);
    } else {
      this._foldingRangesLimit.update(this._length, t10);
      let n10 = 0, r10 = this._indentOccurrences.length;
      for (let e207 = 0; e207 < this._indentOccurrences.length; e207++) {
        let i11 = this._indentOccurrences[e207];
        if (i11) {
          if (i11 + n10 > t10) {
            r10 = e207;
            break;
          }
          n10 += i11;
        }
      }
      let i10 = e206.getOptions().tabSize, a10 = new Uint32Array(t10), o10 = new Uint32Array(t10);
      for (let s10 = this._length - 1, c10 = 0; s10 >= 0; s10--) {
        let l10 = this._startIndexes[s10], u10 = hC(e206.getLineContent(l10), i10);
        (u10 < r10 || u10 === r10 && n10++ < t10) && (a10[c10] = l10, o10[c10] = this._endIndexes[s10], c10++);
      }
      return new k0(a10, o10);
    }
  }
}, bTe = { limit: _Te, update: () => {
} };
function xTe(e206, t10, n10, r10 = bTe) {
  let i10 = e206.getOptions().tabSize, a10 = new yTe(r10), o10;
  n10 && (o10 = RegExp(`(${n10.start.source})|(?:${n10.end.source})`));
  let s10 = [], c10 = e206.getLineCount() + 1;
  s10.push({ indent: -1, endAbove: c10, line: c10 });
  for (let n11 = e206.getLineCount(); n11 > 0; n11--) {
    let r11 = e206.getLineContent(n11), c11 = hC(r11, i10), l10 = s10[s10.length - 1];
    if (c11 === -1) {
      t10 && (l10.endAbove = n11);
      continue;
    }
    let u10;
    if (o10 && (u10 = r11.match(o10))) if (u10[1]) {
      let e207 = s10.length - 1;
      for (; e207 > 0 && s10[e207].indent !== -2; ) e207--;
      if (e207 > 0) {
        s10.length = e207 + 1, l10 = s10[e207], a10.insertFirst(n11, l10.line, c11), l10.line = n11, l10.indent = c11, l10.endAbove = n11;
        continue;
      }
    } else {
      s10.push({ indent: -2, endAbove: n11, line: n11 });
      continue;
    }
    if (l10.indent > c11) {
      do
        s10.pop(), l10 = s10[s10.length - 1];
      while (l10.indent > c11);
      let e207 = l10.endAbove - 1;
      e207 - n11 >= 1 && a10.insertFirst(n11, e207, c11);
    }
    l10.indent === c11 ? l10.endAbove = n11 : s10.push({ indent: c11, endAbove: n11, line: n11 });
  }
  return a10.toIndentRanges(e206);
}
var STe = Q(`editor.foldBackground`, { light: F_(_v2, 0.3), dark: F_(_v2, 0.3), hcDark: null, hcLight: null }, C(1002, `Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`editor.foldPlaceholderForeground`, { light: `#808080`, dark: `#808080`, hcDark: null, hcLight: null }, C(1003, `Color of the collapsed text after the first line of a folded range.`)), Q(`editorGutter.foldingControlForeground`, G_, C(1004, `Color of the folding control in the editor gutter.`));
var R0 = AU(`folding-expanded`, F.chevronDown, C(1005, `Icon for expanded ranges in the editor glyph margin.`)), z0 = AU(`folding-collapsed`, F.chevronRight, C(1006, `Icon for collapsed ranges in the editor glyph margin.`)), B0 = AU(`folding-manual-collapsed`, z0, C(1007, `Icon for manually collapsed ranges in the editor glyph margin.`)), V0 = AU(`folding-manual-expanded`, R0, C(1008, `Icon for manually expanded ranges in the editor glyph margin.`)), H0 = { color: WS(STe), position: 1 }, U0 = C(1009, `Click to expand the range.`), W0 = C(1010, `Click to collapse the range.`), CTe = (_Jc = class {
  constructor(e206) {
    this.editor = e206, this.showFoldingControls = `mouseover`, this.showFoldingHighlights = true;
  }
  getDecorationOption(t10, n10, r10) {
    return n10 ? _Jc.HIDDEN_RANGE_DECORATION : this.showFoldingControls === `never` ? t10 ? this.showFoldingHighlights ? _Jc.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION : _Jc.NO_CONTROLS_COLLAPSED_RANGE_DECORATION : _Jc.NO_CONTROLS_EXPANDED_RANGE_DECORATION : t10 ? r10 ? this.showFoldingHighlights ? _Jc.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : _Jc.MANUALLY_COLLAPSED_VISUAL_DECORATION : this.showFoldingHighlights ? _Jc.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : _Jc.COLLAPSED_VISUAL_DECORATION : this.showFoldingControls === `mouseover` ? r10 ? _Jc.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION : _Jc.EXPANDED_AUTO_HIDE_VISUAL_DECORATION : r10 ? _Jc.MANUALLY_EXPANDED_VISUAL_DECORATION : _Jc.EXPANDED_VISUAL_DECORATION;
  }
  changeDecorations(e206) {
    return this.editor.changeDecorations(e206);
  }
  removeDecorations(e206) {
    this.editor.removeDecorations(e206);
  }
}, _Jc.COLLAPSED_VISUAL_DECORATION = UO.register({ description: `folding-collapsed-visual-decoration`, stickiness: 0, afterContentClassName: `inline-folded`, isWholeLine: true, linesDecorationsTooltip: U0, firstLineDecorationClassName: ju.asClassName(z0) }), _Jc.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = UO.register({ description: `folding-collapsed-highlighted-visual-decoration`, stickiness: 0, afterContentClassName: `inline-folded`, className: `folded-background`, minimap: H0, isWholeLine: true, linesDecorationsTooltip: U0, firstLineDecorationClassName: ju.asClassName(z0) }), _Jc.MANUALLY_COLLAPSED_VISUAL_DECORATION = UO.register({ description: `folding-manually-collapsed-visual-decoration`, stickiness: 0, afterContentClassName: `inline-folded`, isWholeLine: true, linesDecorationsTooltip: U0, firstLineDecorationClassName: ju.asClassName(B0) }), _Jc.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = UO.register({ description: `folding-manually-collapsed-highlighted-visual-decoration`, stickiness: 0, afterContentClassName: `inline-folded`, className: `folded-background`, minimap: H0, isWholeLine: true, linesDecorationsTooltip: U0, firstLineDecorationClassName: ju.asClassName(B0) }), _Jc.NO_CONTROLS_COLLAPSED_RANGE_DECORATION = UO.register({ description: `folding-no-controls-range-decoration`, stickiness: 0, afterContentClassName: `inline-folded`, isWholeLine: true, linesDecorationsTooltip: U0 }), _Jc.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION = UO.register({ description: `folding-no-controls-range-decoration`, stickiness: 0, afterContentClassName: `inline-folded`, className: `folded-background`, minimap: H0, isWholeLine: true, linesDecorationsTooltip: U0 }), _Jc.EXPANDED_VISUAL_DECORATION = UO.register({ description: `folding-expanded-visual-decoration`, stickiness: 1, isWholeLine: true, firstLineDecorationClassName: `alwaysShowFoldIcons ` + ju.asClassName(R0), linesDecorationsTooltip: W0 }), _Jc.EXPANDED_AUTO_HIDE_VISUAL_DECORATION = UO.register({ description: `folding-expanded-auto-hide-visual-decoration`, stickiness: 1, isWholeLine: true, firstLineDecorationClassName: ju.asClassName(R0), linesDecorationsTooltip: W0 }), _Jc.MANUALLY_EXPANDED_VISUAL_DECORATION = UO.register({ description: `folding-manually-expanded-visual-decoration`, stickiness: 0, isWholeLine: true, firstLineDecorationClassName: `alwaysShowFoldIcons ` + ju.asClassName(V0), linesDecorationsTooltip: W0 }), _Jc.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION = UO.register({ description: `folding-manually-expanded-auto-hide-visual-decoration`, stickiness: 0, isWholeLine: true, firstLineDecorationClassName: ju.asClassName(V0), linesDecorationsTooltip: W0 }), _Jc.NO_CONTROLS_EXPANDED_RANGE_DECORATION = UO.register({ description: `folding-no-controls-range-decoration`, stickiness: 0, isWholeLine: true }), _Jc.HIDDEN_RANGE_DECORATION = UO.register({ description: `folding-hidden-range-decoration`, stickiness: 1 }), _Jc), wTe = {}, TTe = `syntax`, G0 = class {
  constructor(e206, t10, n10, r10, i10) {
    this.editorModel = e206, this.providers = t10, this.handleFoldingRangesChange = n10, this.foldingRangesLimit = r10, this.fallbackRangeProvider = i10, this.id = TTe, this.disposables = new E(), i10 && this.disposables.add(i10);
    for (let e207 of t10) typeof e207.onDidChange == `function` && this.disposables.add(e207.onDidChange(n10));
  }
  compute(e206) {
    return ETe(this.providers, this.editorModel, e206).then((t10) => this.editorModel.isDisposed() ? null : t10 ? OTe(t10, this.foldingRangesLimit) : this.fallbackRangeProvider?.compute(e206) ?? null);
  }
  dispose() {
    this.disposables.dispose();
  }
};
function ETe(e206, t10, n10) {
  let r10 = null, i10 = e206.map((e207, i11) => Promise.resolve(e207.provideFoldingRanges(t10, wTe, n10)).then((e208) => {
    if (!n10.isCancellationRequested && Array.isArray(e208)) {
      Array.isArray(r10) || (r10 = []);
      let n11 = t10.getLineCount();
      for (let t11 of e208) t11.start > 0 && t11.end > t11.start && t11.end <= n11 && r10.push({ start: t11.start, end: t11.end, rank: i11, kind: t11.kind });
    }
  }, xe));
  return Promise.all(i10).then((e207) => r10);
}
var DTe = class {
  constructor(e206) {
    this._startIndexes = [], this._endIndexes = [], this._nestingLevels = [], this._nestingLevelCounts = [], this._types = [], this._length = 0, this._foldingRangesLimit = e206;
  }
  add(e206, t10, n10, r10) {
    if (e206 > 16777215 || t10 > 16777215) return;
    let i10 = this._length;
    this._startIndexes[i10] = e206, this._endIndexes[i10] = t10, this._nestingLevels[i10] = r10, this._types[i10] = n10, this._length++, r10 < 30 && (this._nestingLevelCounts[r10] = (this._nestingLevelCounts[r10] || 0) + 1);
  }
  toIndentRanges() {
    let e206 = this._foldingRangesLimit.limit;
    if (this._length <= e206) {
      this._foldingRangesLimit.update(this._length, false);
      let e207 = new Uint32Array(this._length), t10 = new Uint32Array(this._length);
      for (let n10 = 0; n10 < this._length; n10++) e207[n10] = this._startIndexes[n10], t10[n10] = this._endIndexes[n10];
      return new k0(e207, t10, this._types);
    } else {
      this._foldingRangesLimit.update(this._length, e206);
      let t10 = 0, n10 = this._nestingLevelCounts.length;
      for (let r11 = 0; r11 < this._nestingLevelCounts.length; r11++) {
        let i11 = this._nestingLevelCounts[r11];
        if (i11) {
          if (i11 + t10 > e206) {
            n10 = r11;
            break;
          }
          t10 += i11;
        }
      }
      let r10 = new Uint32Array(e206), i10 = new Uint32Array(e206), a10 = [];
      for (let o10 = 0, s10 = 0; o10 < this._length; o10++) {
        let c10 = this._nestingLevels[o10];
        (c10 < n10 || c10 === n10 && t10++ < e206) && (r10[s10] = this._startIndexes[o10], i10[s10] = this._endIndexes[o10], a10[s10] = this._types[o10], s10++);
      }
      return new k0(r10, i10, a10);
    }
  }
};
function OTe(e206, t10) {
  let n10 = e206.sort((e207, t11) => {
    let n11 = e207.start - t11.start;
    return n11 === 0 && (n11 = e207.rank - t11.rank), n11;
  }), r10 = new DTe(t10), i10, a10 = [];
  for (let e207 of n10) if (!i10) i10 = e207, r10.add(e207.start, e207.end, e207.kind && e207.kind.value, a10.length);
  else if (e207.start > i10.start) if (e207.end <= i10.end) a10.push(i10), i10 = e207, r10.add(e207.start, e207.end, e207.kind && e207.kind.value, a10.length);
  else {
    if (e207.start > i10.end) {
      do
        i10 = a10.pop();
      while (i10 && e207.start > i10.end);
      i10 && a10.push(i10), i10 = e207;
    }
    r10.add(e207.start, e207.end, e207.kind && e207.kind.value, a10.length);
  }
  return r10.toIndentRanges();
}
var kTe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, K0 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, q0, J0 = new U(`foldingEnabled`, false), Y0 = (_Kc = class extends D {
  static get(e206) {
    return e206.getContribution(q0.ID);
  }
  static getFoldingRangeProviders(e206, t10) {
    let n10 = e206.foldingRangeProvider.ordered(t10);
    return q0._foldingRangeSelector?.(n10, t10) ?? n10;
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this.contextKeyService = t10, this.languageConfigurationService = n10, this.languageFeaturesService = a10, this.localToDispose = this._register(new E()), this.editor = e206, this._foldingLimitReporter = this._register(new X0(e206));
    let o10 = this.editor.getOptions();
    this._isEnabled = o10.get(52), this._useFoldingProviders = o10.get(53) !== `indentation`, this._unfoldOnClickAfterEndOfLine = o10.get(57), this._restoringViewState = false, this._currentModelHasFoldedImports = false, this._foldingImportsByDefault = o10.get(55), this.updateDebounceInfo = i10.for(a10.foldingRangeProvider, `Folding`, { min: 200 }), this.foldingModel = null, this.hiddenRangeModel = null, this.rangeProvider = null, this.foldingRegionPromise = null, this.foldingModelPromise = null, this.updateScheduler = null, this.cursorChangedScheduler = null, this.mouseDownInfo = null, this.foldingDecorationProvider = new CTe(e206), this.foldingDecorationProvider.showFoldingControls = o10.get(126), this.foldingDecorationProvider.showFoldingHighlights = o10.get(54), this.foldingEnabled = J0.bindTo(this.contextKeyService), this.foldingEnabled.set(this._isEnabled), this._register(this.editor.onDidChangeModel(() => this.onModelChanged())), this._register(this.editor.onDidChangeConfiguration((e207) => {
      if (e207.hasChanged(52) && (this._isEnabled = this.editor.getOptions().get(52), this.foldingEnabled.set(this._isEnabled), this.onModelChanged()), e207.hasChanged(56) && this.onModelChanged(), e207.hasChanged(126) || e207.hasChanged(54)) {
        let e208 = this.editor.getOptions();
        this.foldingDecorationProvider.showFoldingControls = e208.get(126), this.foldingDecorationProvider.showFoldingHighlights = e208.get(54), this.triggerFoldingModelChanged();
      }
      e207.hasChanged(53) && (this._useFoldingProviders = this.editor.getOptions().get(53) !== `indentation`, this.onFoldingStrategyChanged()), e207.hasChanged(57) && (this._unfoldOnClickAfterEndOfLine = this.editor.getOptions().get(57)), e207.hasChanged(55) && (this._foldingImportsByDefault = this.editor.getOptions().get(55));
    })), this.onModelChanged();
  }
  saveViewState() {
    let e206 = this.editor.getModel();
    if (!e206 || !this._isEnabled || e206.isTooLargeForTokenization()) return {};
    if (this.foldingModel) {
      let t10 = this.foldingModel.getMemento(), n10 = this.rangeProvider ? this.rangeProvider.id : void 0;
      return { collapsedRegions: t10, lineCount: e206.getLineCount(), provider: n10, foldedImports: this._currentModelHasFoldedImports };
    }
  }
  restoreViewState(e206) {
    let t10 = this.editor.getModel();
    if (!(!t10 || !this._isEnabled || t10.isTooLargeForTokenization() || !this.hiddenRangeModel) && e206 && (this._currentModelHasFoldedImports = !!e206.foldedImports, e206.collapsedRegions && e206.collapsedRegions.length > 0 && this.foldingModel)) {
      this._restoringViewState = true;
      try {
        this.foldingModel.applyMemento(e206.collapsedRegions);
      } finally {
        this._restoringViewState = false;
      }
    }
  }
  onModelChanged() {
    this.localToDispose.clear();
    let e206 = this.editor.getModel();
    !this._isEnabled || !e206 || e206.isTooLargeForTokenization() || (this._currentModelHasFoldedImports = false, this.foldingModel = new lTe(e206, this.foldingDecorationProvider), this.localToDispose.add(this.foldingModel), this.hiddenRangeModel = new hTe(this.foldingModel), this.localToDispose.add(this.hiddenRangeModel), this.localToDispose.add(this.hiddenRangeModel.onDidChange((e207) => this.onHiddenRangesChanges(e207))), this.updateScheduler = new ns(this.updateDebounceInfo.get(e206)), this.localToDispose.add(this.updateScheduler), this.cursorChangedScheduler = new us(() => this.revealCursor(), 200), this.localToDispose.add(this.cursorChangedScheduler), this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(() => this.onFoldingStrategyChanged())), this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())), this.localToDispose.add(this.editor.onDidChangeModelContent((e207) => this.onDidChangeModelContent(e207))), this.localToDispose.add(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged())), this.localToDispose.add(this.editor.onMouseDown((e207) => this.onEditorMouseDown(e207))), this.localToDispose.add(this.editor.onMouseUp((e207) => this.onEditorMouseUp(e207))), this.localToDispose.add({ dispose: () => {
      this.foldingRegionPromise && (this.foldingRegionPromise = (this.foldingRegionPromise.cancel(), null)), this.updateScheduler?.cancel(), this.updateScheduler = null, this.foldingModel = null, this.foldingModelPromise = null, this.hiddenRangeModel = null, this.cursorChangedScheduler = null, this.rangeProvider?.dispose(), this.rangeProvider = null;
    } }), this.triggerFoldingModelChanged());
  }
  onFoldingStrategyChanged() {
    this.rangeProvider?.dispose(), this.rangeProvider = null, this.triggerFoldingModelChanged();
  }
  getRangeProvider(e206) {
    if (this.rangeProvider) return this.rangeProvider;
    let t10 = new L0(e206, this.languageConfigurationService, this._foldingLimitReporter);
    if (this.rangeProvider = t10, this._useFoldingProviders && this.foldingModel) {
      let n10 = q0.getFoldingRangeProviders(this.languageFeaturesService, e206);
      n10.length > 0 && (this.rangeProvider = new G0(e206, n10, () => this.triggerFoldingModelChanged(), this._foldingLimitReporter, t10));
    }
    return this.rangeProvider;
  }
  getFoldingModel() {
    return this.foldingModelPromise;
  }
  onDidChangeModelContent(e206) {
    this.hiddenRangeModel?.notifyChangeModelContent(e206), this.triggerFoldingModelChanged();
  }
  triggerFoldingModelChanged() {
    this.updateScheduler && (this.foldingRegionPromise && (this.foldingRegionPromise = (this.foldingRegionPromise.cancel(), null)), this.foldingModelPromise = this.updateScheduler.trigger(() => {
      let e206 = this.foldingModel;
      if (!e206) return null;
      let t10 = new $t(), n10 = this.getRangeProvider(e206.textModel), r10 = this.foldingRegionPromise = es((e207) => n10.compute(e207));
      return r10.then((n11) => {
        if (n11 && r10 === this.foldingRegionPromise) {
          let r11;
          if (this._foldingImportsByDefault && !this._currentModelHasFoldedImports) {
            let e207 = n11.setCollapsedAllOfType(Oi.Imports.value, true);
            e207 && (r11 = FG.capture(this.editor), this._currentModelHasFoldedImports = e207);
          }
          let i10 = this.editor.getSelections();
          e206.update(n11, ATe(i10)), r11?.restore(this.editor);
          let a10 = this.updateDebounceInfo.update(e206.textModel, t10.elapsed());
          this.updateScheduler && (this.updateScheduler.defaultDelay = a10);
        }
        return e206;
      });
    }).then(void 0, (e206) => (be(e206), null)));
  }
  onHiddenRangesChanges(e206) {
    if (this.hiddenRangeModel && e206.length && !this._restoringViewState) {
      let e207 = this.editor.getSelections();
      e207 && this.hiddenRangeModel.adjustSelections(e207) && this.editor.setSelections(e207);
    }
    this.editor.setHiddenAreas(e206, this);
  }
  onCursorPositionChanged() {
    this.hiddenRangeModel && this.hiddenRangeModel.hasRanges() && this.cursorChangedScheduler.schedule();
  }
  revealCursor() {
    let e206 = this.getFoldingModel();
    e206 && e206.then((e207) => {
      if (e207) {
        let t10 = this.editor.getSelections();
        if (t10 && t10.length > 0) {
          let n10 = [];
          for (let r10 of t10) {
            let t11 = r10.selectionStartLineNumber;
            this.hiddenRangeModel && this.hiddenRangeModel.isHidden(t11) && n10.push(...e207.getAllRegionsAtLine(t11, (e208) => e208.isCollapsed && t11 > e208.startLineNumber));
          }
          n10.length && (e207.toggleCollapseState(n10), this.reveal(t10[0].getPosition()));
        }
      }
    }).then(void 0, be);
  }
  onEditorMouseDown(e206) {
    if (this.mouseDownInfo = null, !this.hiddenRangeModel || !e206.target || !e206.target.range || !e206.event.leftButton && !e206.event.middleButton) return;
    let t10 = e206.target.range, n10 = false;
    switch (e206.target.type) {
      case 4: {
        let t11 = e206.target.detail, r10 = e206.target.element.offsetLeft;
        if (t11.offsetX - r10 < 4) return;
        n10 = true;
        break;
      }
      case 7:
        if (this._unfoldOnClickAfterEndOfLine && this.hiddenRangeModel.hasRanges() && !e206.target.detail.isAfterLines) break;
        return;
      case 6:
        if (this.hiddenRangeModel.hasRanges()) {
          let e207 = this.editor.getModel();
          if (e207 && t10.startColumn === e207.getLineMaxColumn(t10.startLineNumber)) break;
        }
        return;
      default:
        return;
    }
    this.mouseDownInfo = { lineNumber: t10.startLineNumber, iconClicked: n10 };
  }
  onEditorMouseUp(e206) {
    let t10 = this.foldingModel;
    if (!t10 || !this.mouseDownInfo || !e206.target) return;
    let n10 = this.mouseDownInfo.lineNumber, r10 = this.mouseDownInfo.iconClicked, i10 = e206.target.range;
    if (!i10 || i10.startLineNumber !== n10) return;
    if (r10) {
      if (e206.target.type !== 4) return;
    } else {
      let e207 = this.editor.getModel();
      if (!e207 || i10.startColumn !== e207.getLineMaxColumn(n10)) return;
    }
    let a10 = t10.getRegionAtLine(n10);
    if (a10 && a10.startLineNumber === n10) {
      let i11 = a10.isCollapsed;
      if (r10 || i11) {
        let r11 = e206.event.altKey, o10 = [];
        if (r11) {
          let e207 = t10.getRegionsInside(null, (e208) => !e208.containedBy(a10) && !a10.containedBy(e208));
          for (let t11 of e207) t11.isCollapsed && o10.push(t11);
          o10.length === 0 && (o10 = e207);
        } else {
          let n11 = e206.event.middleButton || e206.event.shiftKey;
          if (n11) for (let e207 of t10.getRegionsInside(a10)) e207.isCollapsed === i11 && o10.push(e207);
          (i11 || !n11 || o10.length === 0) && o10.push(a10);
        }
        t10.toggleCollapseState(o10), this.reveal({ lineNumber: n10, column: 1 });
      }
    }
  }
  reveal(e206) {
    this.editor.revealPositionInCenterIfOutsideViewport(e206, 0);
  }
}, q0 = _Kc, _Kc.ID = `editor.contrib.folding`, _Kc);
Y0 = q0 = kTe([K0(1, nd), K0(2, bp), K0(3, dw), K0(4, lA), K0(5, X)], Y0);
var X0 = class extends D {
  constructor(e206) {
    super(), this.editor = e206, this._onDidChange = this._register(new k()), this._computed = 0, this._limited = false;
  }
  get limit() {
    return this.editor.getOptions().get(56);
  }
  update(e206, t10) {
    (e206 !== this._computed || t10 !== this._limited) && (this._computed = e206, this._limited = t10, this._onDidChange.fire());
  }
}, Z0 = class extends G {
  runEditorCommand(e206, t10, n10) {
    let r10 = e206.get(bp), i10 = Y0.get(t10);
    if (!i10) return;
    let a10 = i10.getFoldingModel();
    if (a10) return this.reportTelemetry(e206, t10), a10.then((e207) => {
      if (e207) {
        this.invoke(i10, e207, t10, n10, r10);
        let a11 = t10.getSelection();
        a11 && i10.reveal(a11.getStartPosition());
      }
    });
  }
  getSelectedLines(e206) {
    let t10 = e206.getSelections();
    return t10 ? t10.map((e207) => e207.startLineNumber) : [];
  }
  getLineNumbers(e206, t10) {
    return e206 && e206.selectionLines ? e206.selectionLines.map((e207) => e207 + 1) : this.getSelectedLines(t10);
  }
  run(e206, t10) {
  }
};
function ATe(e206) {
  return !e206 || e206.length === 0 ? { startsInside: () => false } : { startsInside(t10, n10) {
    for (let r10 of e206) {
      let e207 = r10.startLineNumber;
      if (e207 >= t10 && e207 <= n10) return true;
    }
    return false;
  } };
}
function Q0(e206) {
  if (!Ge(e206)) {
    if (!Be(e206)) return false;
    let t10 = e206;
    if (!Ge(t10.levels) && !He(t10.levels) || !Ge(t10.direction) && !Re(t10.direction) || !Ge(t10.selectionLines) && (!Array.isArray(t10.selectionLines) || !t10.selectionLines.every(He))) return false;
  }
  return true;
}
var jTe = class extends Z0 {
  constructor() {
    super({ id: `editor.unfold`, label: w(982, `Unfold`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: 3166, mac: { primary: 2654 }, weight: 100 }, metadata: { description: `Unfold the content in the editor`, args: [{ name: `Unfold editor argument`, description: `Property-value pairs that can be passed through this argument:
						* 'levels': Number of levels to unfold. If not set, defaults to 1.
						* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
						* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
						`, constraint: Q0, schema: { type: `object`, properties: { levels: { type: `number`, default: 1 }, direction: { type: `string`, enum: [`up`, `down`], default: `down` }, selectionLines: { type: `array`, items: { type: `number` } } } } }] } });
  }
  invoke(e206, t10, n10, r10) {
    let i10 = r10 && r10.levels || 1, a10 = this.getLineNumbers(r10, n10);
    r10 && r10.direction === `up` ? M0(t10, false, i10, a10) : j0(t10, false, i10, a10);
  }
}, MTe = class extends Z0 {
  constructor() {
    super({ id: `editor.unfoldRecursively`, label: w(983, `Unfold Recursively`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2142), weight: 100 } });
  }
  invoke(e206, t10, n10, r10) {
    j0(t10, false, Number.MAX_VALUE, this.getSelectedLines(n10));
  }
}, NTe = class extends Z0 {
  constructor() {
    super({ id: `editor.fold`, label: w(984, `Fold`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: 3164, mac: { primary: 2652 }, weight: 100 }, metadata: { description: `Fold the content in the editor`, args: [{ name: `Fold editor argument`, description: `Property-value pairs that can be passed through this argument:
							* 'levels': Number of levels to fold.
							* 'direction': If 'up', folds given number of levels up otherwise folds down.
							* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.
							If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
						`, constraint: Q0, schema: { type: `object`, properties: { levels: { type: `number` }, direction: { type: `string`, enum: [`up`, `down`] }, selectionLines: { type: `array`, items: { type: `number` } } } } }] } });
  }
  invoke(e206, t10, n10, r10) {
    let i10 = this.getLineNumbers(r10, n10), a10 = r10 && r10.levels, o10 = r10 && r10.direction;
    typeof a10 != `number` && typeof o10 != `string` ? uTe(t10, true, i10) : o10 === `up` ? M0(t10, true, a10 || 1, i10) : j0(t10, true, a10 || 1, i10);
  }
}, PTe = class extends Z0 {
  constructor() {
    super({ id: `editor.toggleFold`, label: w(985, `Toggle Fold`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2090), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    A0(t10, 1, this.getSelectedLines(n10));
  }
}, FTe = class extends Z0 {
  constructor() {
    super({ id: `editor.foldRecursively`, label: w(986, `Fold Recursively`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2140), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    let r10 = this.getSelectedLines(n10);
    j0(t10, true, Number.MAX_VALUE, r10);
  }
}, ITe = class extends Z0 {
  constructor() {
    super({ id: `editor.toggleFoldRecursively`, label: w(987, `Toggle Fold Recursively`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 3114), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    let r10 = this.getSelectedLines(n10);
    A0(t10, Number.MAX_VALUE, r10);
  }
}, LTe = class extends Z0 {
  constructor() {
    super({ id: `editor.foldAllBlockComments`, label: w(988, `Fold All Block Comments`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2138), weight: 100 } });
  }
  invoke(e206, t10, n10, r10, i10) {
    if (t10.regions.hasTypes()) F0(t10, Oi.Comment.value, true);
    else {
      let e207 = n10.getModel();
      if (!e207) return;
      let r11 = i10.getLanguageConfiguration(e207.getLanguageId()).comments;
      r11 && r11.blockCommentStartToken && P0(t10, RegExp(`^\\s*` + za(r11.blockCommentStartToken)), true);
    }
  }
}, RTe = class extends Z0 {
  constructor() {
    super({ id: `editor.foldAllMarkerRegions`, label: w(989, `Fold All Regions`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2077), weight: 100 } });
  }
  invoke(e206, t10, n10, r10, i10) {
    if (t10.regions.hasTypes()) F0(t10, Oi.Region.value, true);
    else {
      let e207 = n10.getModel();
      if (!e207) return;
      let r11 = i10.getLanguageConfiguration(e207.getLanguageId()).foldingRules;
      r11 && r11.markers && r11.markers.start && P0(t10, new RegExp(r11.markers.start), true);
    }
  }
}, zTe = class extends Z0 {
  constructor() {
    super({ id: `editor.unfoldAllMarkerRegions`, label: w(990, `Unfold All Regions`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2078), weight: 100 } });
  }
  invoke(e206, t10, n10, r10, i10) {
    if (t10.regions.hasTypes()) F0(t10, Oi.Region.value, false);
    else {
      let e207 = n10.getModel();
      if (!e207) return;
      let r11 = i10.getLanguageConfiguration(e207.getLanguageId()).foldingRules;
      r11 && r11.markers && r11.markers.start && P0(t10, new RegExp(r11.markers.start), false);
    }
  }
}, BTe = class extends Z0 {
  constructor() {
    super({ id: `editor.foldAllExcept`, label: w(991, `Fold All Except Selected`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2136), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    N0(t10, true, this.getSelectedLines(n10));
  }
}, VTe = class extends Z0 {
  constructor() {
    super({ id: `editor.unfoldAllExcept`, label: w(992, `Unfold All Except Selected`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2134), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    N0(t10, false, this.getSelectedLines(n10));
  }
}, HTe = class extends Z0 {
  constructor() {
    super({ id: `editor.foldAll`, label: w(993, `Fold All`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2069), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    j0(t10, true);
  }
}, UTe = class extends Z0 {
  constructor() {
    super({ id: `editor.unfoldAll`, label: w(994, `Unfold All`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2088), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    j0(t10, false);
  }
}, $0 = (_Lc = class extends Z0 {
  getFoldingLevel() {
    return parseInt(this.id.substr(_Lc.ID_PREFIX.length));
  }
  invoke(e206, t10, n10) {
    dTe(t10, this.getFoldingLevel(), true, this.getSelectedLines(n10));
  }
}, _Lc.ID_PREFIX = `editor.foldLevel`, _Lc.ID = (t10) => _Lc.ID_PREFIX + t10, _Lc), WTe = class extends Z0 {
  constructor() {
    super({ id: `editor.gotoParentFold`, label: w(995, `Go to Parent Fold`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, weight: 100 } });
  }
  invoke(e206, t10, n10) {
    let r10 = this.getSelectedLines(n10);
    if (r10.length > 0) {
      let e207 = fTe(r10[0], t10);
      e207 !== null && n10.setSelection({ startLineNumber: e207, startColumn: 1, endLineNumber: e207, endColumn: 1 });
    }
  }
}, GTe = class extends Z0 {
  constructor() {
    super({ id: `editor.gotoPreviousFold`, label: w(996, `Go to Previous Folding Range`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, weight: 100 } });
  }
  invoke(e206, t10, n10) {
    let r10 = this.getSelectedLines(n10);
    if (r10.length > 0) {
      let e207 = pTe(r10[0], t10);
      e207 !== null && n10.setSelection({ startLineNumber: e207, startColumn: 1, endLineNumber: e207, endColumn: 1 });
    }
  }
}, KTe = class extends Z0 {
  constructor() {
    super({ id: `editor.gotoNextFold`, label: w(997, `Go to Next Folding Range`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, weight: 100 } });
  }
  invoke(e206, t10, n10) {
    let r10 = this.getSelectedLines(n10);
    if (r10.length > 0) {
      let e207 = mTe(r10[0], t10);
      e207 !== null && n10.setSelection({ startLineNumber: e207, startColumn: 1, endLineNumber: e207, endColumn: 1 });
    }
  }
}, qTe = class extends Z0 {
  constructor() {
    super({ id: `editor.createFoldingRangeFromSelection`, label: w(998, `Create Folding Range from Selection`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2135), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    let r10 = [], i10 = n10.getSelections();
    if (i10) {
      for (let e207 of i10) {
        let t11 = e207.endLineNumber;
        e207.endColumn === 1 && --t11, t11 > e207.startLineNumber && (r10.push({ startLineNumber: e207.startLineNumber, endLineNumber: t11, type: void 0, isCollapsed: true, source: 1 }), n10.setSelection({ startLineNumber: e207.startLineNumber, startColumn: 1, endLineNumber: e207.startLineNumber, endColumn: 1 }));
      }
      if (r10.length > 0) {
        r10.sort((e208, t11) => e208.startLineNumber - t11.startLineNumber);
        let e207 = k0.sanitizeAndMerge(t10.regions, r10, n10.getModel()?.getLineCount());
        t10.updatePost(k0.fromFoldRanges(e207));
      }
    }
  }
}, JTe = class extends Z0 {
  constructor() {
    super({ id: `editor.removeManualFoldingRanges`, label: w(999, `Remove Manual Folding Ranges`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2137), weight: 100 } });
  }
  invoke(e206, t10, n10) {
    let r10 = n10.getSelections();
    if (r10) {
      let n11 = [];
      for (let e207 of r10) {
        let { startLineNumber: t11, endLineNumber: r11 } = e207;
        n11.push(r11 >= t11 ? { startLineNumber: t11, endLineNumber: r11 } : { endLineNumber: r11, startLineNumber: t11 });
      }
      t10.removeManualRanges(n11), e206.triggerFoldingModelChanged();
    }
  }
}, YTe = class extends Z0 {
  constructor() {
    super({ id: `editor.toggleImportFold`, label: w(1e3, `Toggle Import Fold`), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, weight: 100 } });
  }
  async invoke(e206, t10) {
    let n10 = [], r10 = t10.regions;
    for (let e207 = r10.length - 1; e207 >= 0; e207--) r10.getType(e207) === Oi.Imports.value && n10.push(r10.toRegion(e207));
    t10.toggleCollapseState(n10), e206.triggerFoldingModelChanged();
  }
};
af(Y0.ID, Y0, 0), q(jTe), q(MTe), q(NTe), q(FTe), q(ITe), q(HTe), q(UTe), q(LTe), q(RTe), q(zTe), q(BTe), q(VTe), q(PTe), q(WTe), q(GTe), q(KTe), q(qTe), q(JTe), q(YTe);
for (let e206 = 1; e206 <= 7; e206++) pre(new $0({ id: $0.ID(e206), label: w(1001, `Fold Level {0}`, e206), precondition: J0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2048 | 21 + e206), weight: 100 } }));
Nu.registerCommand(`_executeFoldingRangeProvider`, async function(e206, ...t10) {
  let [n10] = t10;
  if (!(n10 instanceof $r)) throw De();
  let r10 = e206.get(X), i10 = e206.get(Cu).getModel(n10);
  if (!i10) throw De();
  let a10 = e206.get(Uf);
  if (!a10.getValue(`editor.folding`, { resource: n10 })) return [];
  let o10 = e206.get(bp), s10 = a10.getValue(`editor.foldingStrategy`, { resource: n10 }), c10 = { get limit() {
    return a10.getValue(`editor.foldingMaximumRegions`, { resource: n10 });
  }, update: (e207, t11) => {
  } }, l10 = new L0(i10, o10, c10), u10 = l10;
  if (s10 !== `indentation`) {
    let e207 = Y0.getFoldingRangeProviders(r10, i10);
    e207.length && (u10 = new G0(i10, e207, () => {
    }, c10, l10));
  }
  let d10 = await u10.compute(dr.None), f10 = [];
  try {
    if (d10) for (let e207 = 0; e207 < d10.length; e207++) {
      let t11 = d10.getType(e207);
      f10.push({ start: d10.getStartLineNumber(e207), end: d10.getEndLineNumber(e207), kind: t11 ? Oi.fromValue(t11) : void 0 });
    }
    return f10;
  } finally {
    u10.dispose();
  }
});
var XTe = class extends G {
  constructor() {
    super({ id: `editor.action.fontZoomIn`, label: w(1011, `Increase Editor Font Size`), precondition: void 0 });
  }
  run(e206, t10) {
    pn.setZoomLevel(pn.getZoomLevel() + 1);
  }
}, ZTe = class extends G {
  constructor() {
    super({ id: `editor.action.fontZoomOut`, label: w(1012, `Decrease Editor Font Size`), precondition: void 0 });
  }
  run(e206, t10) {
    pn.setZoomLevel(pn.getZoomLevel() - 1);
  }
}, QTe = class extends G {
  constructor() {
    super({ id: `editor.action.fontZoomReset`, label: w(1013, `Reset Editor Font Size`), precondition: void 0 });
  }
  run(e206, t10) {
    pn.setZoomLevel(0);
  }
};
q(XTe), q(ZTe), q(QTe);
var e210 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, t2 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, n2 = (_Mc = class {
  constructor(e206, t10, n10, r10) {
    this._editor = e206, this._languageFeaturesService = t10, this._workerService = n10, this._accessibilitySignalService = r10, this._disposables = new E(), this._sessionDisposables = new E(), this._disposables.add(t10.onTypeFormattingEditProvider.onDidChange(this._update, this)), this._disposables.add(e206.onDidChangeModel(() => this._update())), this._disposables.add(e206.onDidChangeModelLanguage(() => this._update())), this._disposables.add(e206.onDidChangeConfiguration((e207) => {
      e207.hasChanged(65) && this._update();
    })), this._update();
  }
  dispose() {
    this._disposables.dispose(), this._sessionDisposables.dispose();
  }
  _update() {
    if (this._sessionDisposables.clear(), !this._editor.getOption(65) || !this._editor.hasModel()) return;
    let e206 = this._editor.getModel(), [t10] = this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e206);
    if (!t10 || !t10.autoFormatTriggerCharacters) return;
    let n10 = new Rp();
    for (let e207 of t10.autoFormatTriggerCharacters) n10.add(e207.charCodeAt(0));
    this._sessionDisposables.add(this._editor.onDidType((e207) => {
      let t11 = e207.charCodeAt(e207.length - 1);
      n10.has(t11) && this._trigger(String.fromCharCode(t11));
    }));
  }
  _trigger(e206) {
    if (!this._editor.hasModel() || this._editor.getSelections().length > 1 || !this._editor.getSelection().isEmpty()) return;
    let t10 = this._editor.getModel(), n10 = this._editor.getPosition(), r10 = new pr(), i10 = this._editor.onDidChangeModelContent((e207) => {
      if (e207.isFlush) {
        r10.cancel(), i10.dispose();
        return;
      }
      for (let t11 = 0, a10 = e207.changes.length; t11 < a10; t11++) if (e207.changes[t11].range.endLineNumber <= n10.lineNumber) {
        r10.cancel(), i10.dispose();
        return;
      }
    });
    cJ(this._workerService, this._languageFeaturesService, t10, n10, e206, t10.getFormattingOptions(), r10.token).then((e207) => {
      r10.token.isCancellationRequested || v(e207) && (this._accessibilitySignalService.playSignal(qW.format, { userGesture: false }), rJ.execute(this._editor, e207, true));
    }).finally(() => {
      i10.dispose();
    });
  }
}, _Mc.ID = `editor.contrib.autoFormat`, _Mc);
n2 = e210([t2(1, X), t2(2, HL), t2(3, WW)], n2);
var r2 = (_Nc = class {
  constructor(e206, t10, n10) {
    this.editor = e206, this._languageFeaturesService = t10, this._instantiationService = n10, this._callOnDispose = new E(), this._callOnModel = new E(), this._callOnDispose.add(e206.onDidChangeConfiguration(() => this._update())), this._callOnDispose.add(e206.onDidChangeModel(() => this._update())), this._callOnDispose.add(e206.onDidChangeModelLanguage(() => this._update())), this._callOnDispose.add(t10.documentRangeFormattingEditProvider.onDidChange(this._update, this));
  }
  dispose() {
    this._callOnDispose.dispose(), this._callOnModel.dispose();
  }
  _update() {
    this._callOnModel.clear(), this.editor.getOption(64) && this.editor.hasModel() && this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel()) && this._callOnModel.add(this.editor.onDidPaste(({ range: e206 }) => this._trigger(e206)));
  }
  _trigger(e206) {
    this.editor.hasModel() && (this.editor.getSelections().length > 1 || this._instantiationService.invokeFunction(sJ, this.editor, e206, 2, HF.None, dr.None, false).catch(be));
  }
}, _Nc.ID = `editor.contrib.formatOnPaste`, _Nc);
r2 = e210([t2(1, X), t2(2, V)], r2);
var $Te = class extends G {
  constructor() {
    super({ id: `editor.action.formatDocument`, label: w(1014, `Format Document`), precondition: H.and($.notInCompositeEditor, $.writable, $.hasDocumentFormattingProvider), kbOpts: { kbExpr: $.editorTextFocus, primary: 1572, linux: { primary: 3111 }, weight: 100 }, contextMenuOpts: { group: `1_modification`, order: 1.3 } });
  }
  async run(e206, t10) {
    if (t10.hasModel()) {
      let n10 = e206.get(V);
      await e206.get(UF).showWhile(n10.invokeFunction(Cbe, t10, 1, HF.None, dr.None, true), 250);
    }
  }
}, eEe = class extends G {
  constructor() {
    super({ id: `editor.action.formatSelection`, label: w(1015, `Format Selection`), precondition: H.and($.writable, $.hasDocumentSelectionFormattingProvider), kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2084), weight: 100 }, contextMenuOpts: { when: $.hasNonEmptySelection, group: `1_modification`, order: 1.31 } });
  }
  async run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = e206.get(V), r10 = t10.getModel(), i10 = t10.getSelections().map((e207) => e207.isEmpty() ? new M(e207.startLineNumber, 1, e207.startLineNumber, r10.getLineMaxColumn(e207.startLineNumber)) : e207);
    await e206.get(UF).showWhile(n10.invokeFunction(sJ, t10, i10, 1, HF.None, dr.None, true), 250);
  }
};
af(n2.ID, n2, 2), af(r2.ID, r2, 2), q($Te), q(eEe), Nu.registerCommand(`editor.action.format`, async (e206) => {
  let t10 = e206.get(Su).getFocusedCodeEditor();
  if (!t10 || !t10.hasModel()) return;
  let n10 = e206.get(Mu);
  t10.getSelection().isEmpty() ? await n10.executeCommand(`editor.action.formatDocument`) : await n10.executeCommand(`editor.action.formatSelection`);
});
var tEe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, i2 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, a2 = class {
  remove() {
    this.parent?.children.delete(this.id);
  }
  static findId(e206, t10) {
    let n10;
    typeof e206 == `string` ? n10 = `${t10.id}/${e206}` : (n10 = `${t10.id}/${e206.name}`, t10.children.get(n10) !== void 0 && (n10 = `${t10.id}/${e206.name}_${e206.range.startLineNumber}_${e206.range.startColumn}`));
    let r10 = n10;
    for (let e207 = 0; t10.children.get(r10) !== void 0; e207++) r10 = `${n10}_${e207}`;
    return r10;
  }
  static empty(e206) {
    return e206.children.size === 0;
  }
}, o2 = class extends a2 {
  constructor(e206, t10, n10) {
    super(), this.id = e206, this.parent = t10, this.symbol = n10, this.children = /* @__PURE__ */ new Map();
  }
}, s2 = class extends a2 {
  constructor(e206, t10, n10, r10) {
    super(), this.id = e206, this.parent = t10, this.label = n10, this.order = r10, this.children = /* @__PURE__ */ new Map();
  }
}, c2 = class e188 extends a2 {
  static create(t10, n10, r10) {
    let i10 = new pr(r10), a10 = new e188(n10.uri), s10 = t10.ordered(n10), c10 = s10.map((t11, r11) => {
      let o10 = a2.findId(`provider_${r11}`, a10), s11 = new s2(o10, a10, t11.displayName ?? `Unknown Outline Provider`, r11);
      return Promise.resolve(t11.provideDocumentSymbols(n10, i10.token)).then((t12) => {
        for (let n11 of t12 || []) e188._makeOutlineElement(n11, s11);
        return s11;
      }, (e206) => (xe(e206), s11)).then((e206) => {
        a2.empty(e206) ? e206.remove() : a10._groups.set(o10, e206);
      });
    }), l10 = t10.onDidChange(() => {
      o(t10.ordered(n10), s10) || i10.cancel();
    });
    return Promise.all(c10).then(() => i10.token.isCancellationRequested && !r10.isCancellationRequested ? e188.create(t10, n10, r10) : a10._compact()).finally(() => {
      i10.dispose(), l10.dispose(), i10.dispose();
    });
  }
  static _makeOutlineElement(t10, n10) {
    let r10 = new o2(a2.findId(t10, n10), n10, t10);
    if (t10.children) for (let n11 of t10.children) e188._makeOutlineElement(n11, r10);
    n10.children.set(r10.id, r10);
  }
  constructor(e206) {
    super(), this.uri = e206, this.id = `root`, this.parent = void 0, this._groups = /* @__PURE__ */ new Map(), this.children = /* @__PURE__ */ new Map(), this.id = `root`, this.parent = void 0;
  }
  _compact() {
    let e206 = 0;
    for (let [t10, n10] of this._groups) n10.children.size === 0 ? this._groups.delete(t10) : e206 += 1;
    if (e206 !== 1) this.children = this._groups;
    else {
      let e207 = Ut.first(this._groups.values());
      for (let [, t10] of e207.children) t10.parent = this, this.children.set(t10.id, t10);
    }
    return this;
  }
  getTopLevelSymbols() {
    let e206 = [];
    for (let t10 of this.children.values()) t10 instanceof o2 ? e206.push(t10.symbol) : e206.push(...Ut.map(t10.children.values(), (e207) => e207.symbol));
    return e206.sort((e207, t10) => M.compareRangesUsingStarts(e207.range, t10.range));
  }
  asListOfDocumentSymbols() {
    let t10 = this.getTopLevelSymbols(), n10 = [];
    return e188._flattenDocumentSymbols(n10, t10, ``), n10.sort((e206, t11) => j.compare(M.getStartPosition(e206.range), M.getStartPosition(t11.range)) || j.compare(M.getEndPosition(t11.range), M.getEndPosition(e206.range)));
  }
  static _flattenDocumentSymbols(t10, n10, r10) {
    for (let i10 of n10) t10.push({ kind: i10.kind, tags: i10.tags, name: i10.name, detail: i10.detail, containerName: i10.containerName || r10, range: i10.range, selectionRange: i10.selectionRange, children: void 0 }), i10.children && e188._flattenDocumentSymbols(t10, i10.children, i10.name);
  }
}, l2 = xu(`IOutlineModelService`), u2 = class {
  constructor(e206, t10, n10) {
    this._languageFeaturesService = e206, this._disposables = new E(), this._cache = new Td(15, 0.7), this._debounceInformation = t10.for(e206.documentSymbolProvider, `DocumentSymbols`, { min: 350 }), this._disposables.add(n10.onModelRemoved((e207) => {
      this._cache.delete(e207.id);
    }));
  }
  dispose() {
    this._disposables.dispose();
  }
  async getOrCreate(e206, t10) {
    let n10 = this._languageFeaturesService.documentSymbolProvider, r10 = n10.ordered(e206), i10 = this._cache.get(e206.id);
    if (!i10 || i10.versionId !== e206.getVersionId() || !o(i10.provider, r10)) {
      let t11 = new pr();
      i10 = { versionId: e206.getVersionId(), provider: r10, promiseCnt: 0, source: t11, promise: c2.create(n10, e206, t11.token), model: void 0 }, this._cache.set(e206.id, i10);
      let a11 = Date.now();
      i10.promise.then((t12) => {
        i10.model = t12, this._debounceInformation.update(e206, Date.now() - a11);
      }).catch((t12) => {
        this._cache.delete(e206.id);
      });
    }
    if (i10.model) return i10.model;
    i10.promiseCnt += 1;
    let a10 = t10.onCancellationRequested(() => {
      --i10.promiseCnt === 0 && (i10.source.cancel(), this._cache.delete(e206.id));
    });
    try {
      return await i10.promise;
    } finally {
      a10.dispose();
    }
  }
};
u2 = tEe([i2(0, X), i2(1, lA), i2(2, Cu)], u2), Zf(l2, u2, 1), Nu.registerCommand(`_executeDocumentSymbolProvider`, async function(e206, ...t10) {
  let [n10] = t10;
  Je($r.isUri(n10));
  let r10 = e206.get(l2), i10 = await e206.get(wu).createModelReference(n10);
  try {
    return (await r10.getOrCreate(i10.object.textEditorModel, dr.None)).getTopLevelSymbols();
  } finally {
    i10.dispose();
  }
});
var d2 = new class {
  constructor() {
    this._implementations = [];
  }
  register(e206) {
    return this._implementations.push(e206), { dispose: () => {
      let t10 = this._implementations.indexOf(e206);
      t10 !== -1 && this._implementations.splice(t10, 1);
    } };
  }
  getImplementations() {
    return this._implementations;
  }
}(), nEe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, rEe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
};
function iEe(e206) {
  return e206 instanceof f2 ? e206._instance : e206;
}
var f2 = class {
  constructor(e206) {
    this.instantiationService = e206;
  }
  init(...e206) {
  }
};
function aEe(e206) {
  return e206.get();
}
var p2 = class extends f2 {
  constructor(e206, t10) {
    super(t10), this.init(e206);
  }
};
p2 = nEe([rEe(1, V)], p2);
var m2 = class {
  validateOrThrow(e206) {
    let t10 = this.validate(e206);
    if (t10.error) throw Error(t10.error.message);
    return t10.content;
  }
}, h2 = class extends m2 {
  constructor(e206) {
    super(), this.type = e206;
  }
  validate(e206) {
    return typeof e206 === this.type ? { content: e206, error: void 0 } : { content: void 0, error: { message: `Expected ${this.type}, but got ${typeof e206}` } };
  }
  getJSONSchema() {
    return { type: this.type };
  }
}, oEe = new h2(`string`);
function sEe() {
  return oEe;
}
new h2(`number`);
var cEe = new h2(`boolean`);
function g2() {
  return cEe;
}
new h2(`object`);
var _2 = class extends m2 {
  validate(e206) {
    return e206 === void 0 ? { content: void 0, error: void 0 } : { content: void 0, error: { message: `Expected undefined, but got ${typeof e206}` } };
  }
  getJSONSchema() {
    return {};
  }
};
function lEe() {
  return new _2();
}
var v2 = class {
  constructor(e206) {
    this.validator = e206;
  }
};
function y2(e206) {
  return new v2(e206);
}
var uEe = class extends m2 {
  constructor(e206) {
    super(), this.properties = e206;
  }
  validate(e206) {
    if (typeof e206 != `object` || !e206) return { content: void 0, error: { message: `Expected object` } };
    let t10 = {};
    for (let n10 in this.properties) {
      let r10 = this.properties[n10], i10 = e206[n10], a10 = r10 instanceof v2, o10 = a10 ? r10.validator : r10;
      if (a10 && i10 === void 0) continue;
      let { content: s10, error: c10 } = o10.validate(i10);
      if (c10) return { content: void 0, error: { message: `Error in property '${n10}': ${c10.message}` } };
      t10[n10] = s10;
    }
    return { content: t10, error: void 0 };
  }
  getJSONSchema() {
    let e206 = [], t10 = {};
    for (let [n10, r10] of Object.entries(this.properties)) {
      let i10 = r10 instanceof v2;
      t10[n10] = (i10 ? r10.validator : r10).getJSONSchema(), i10 || e206.push(n10);
    }
    return { type: `object`, properties: t10, ...e206.length > 0 ? { required: e206 } : {} };
  }
};
function dEe(e206) {
  return new uEe(e206);
}
var fEe = class extends m2 {
  constructor(e206) {
    super(), this.validators = e206;
  }
  validate(e206) {
    let t10;
    for (let n10 of this.validators) {
      let { content: r10, error: i10 } = n10.validate(e206);
      if (!i10) return { content: r10, error: void 0 };
      t10 = i10;
    }
    return { content: void 0, error: t10 };
  }
  getJSONSchema() {
    return { oneOf: ne(this.validators, (e206) => {
      if (!(e206 instanceof _2)) return e206.getJSONSchema();
    }) };
  }
};
function pEe(...e206) {
  return new fEe(e206);
}
var mEe = class extends m2 {
  constructor(e206, t10) {
    super(), this._ref = e206, this._validator = t10;
  }
  validate(e206) {
    return this._validator.validate(e206);
  }
  getJSONSchema() {
    return { $ref: this._ref };
  }
};
function hEe(e206, t10) {
  return new mEe(e206, t10);
}
var b2 = { Visible: ZZ, HasFocusedSuggestion: new U(`suggestWidgetHasFocusedSuggestion`, false, C(1455, `Whether any suggestion is focused`)), DetailsVisible: new U(`suggestWidgetDetailsVisible`, false, C(1456, `Whether suggestion details are visible`)), MultipleSuggestions: new U(`suggestWidgetMultipleSuggestions`, false, C(1457, `Whether there are multiple suggestions to pick from`)), MakesTextEdit: new U(`suggestionMakesTextEdit`, true, C(1458, `Whether inserting the current suggestion yields in a change or has everything already been typed`)), AcceptSuggestionsOnEnter: new U(`acceptSuggestionOnEnter`, true, C(1459, `Whether suggestions are inserted when pressing Enter`)), HasInsertAndReplaceRange: new U(`suggestionHasInsertAndReplaceRange`, false, C(1460, `Whether the current suggestion has insert and replace behaviour`)), InsertMode: new U(`suggestionInsertMode`, void 0, { type: `string`, description: C(1461, `Whether the default behaviour is to insert or replace`) }), CanResolve: new U(`suggestionCanResolve`, false, C(1462, `Whether the current suggestion supports to resolve further details`)) }, x2 = new W(`suggestWidgetStatusBar`), gEe = class {
  constructor(e206, t10, n10, r10) {
    this.position = e206, this.completion = t10, this.container = n10, this.provider = r10, this.isInvalid = false, this.score = CM.Default, this.distance = 0, this.textLabel = typeof t10.label == `string` ? t10.label : t10.label?.label, this.labelLow = this.textLabel.toLowerCase(), this.isInvalid = !this.textLabel, this.sortTextLow = t10.sortText && t10.sortText.toLowerCase(), this.filterTextLow = t10.filterText && t10.filterText.toLowerCase(), this.extensionId = t10.extensionId, M.isIRange(t10.range) ? (this.editStart = new j(t10.range.startLineNumber, t10.range.startColumn), this.editInsertEnd = new j(t10.range.endLineNumber, t10.range.endColumn), this.editReplaceEnd = new j(t10.range.endLineNumber, t10.range.endColumn), this.isInvalid = this.isInvalid || M.spansMultipleLines(t10.range) || t10.range.startLineNumber !== e206.lineNumber) : (this.editStart = new j(t10.range.insert.startLineNumber, t10.range.insert.startColumn), this.editInsertEnd = new j(t10.range.insert.endLineNumber, t10.range.insert.endColumn), this.editReplaceEnd = new j(t10.range.replace.endLineNumber, t10.range.replace.endColumn), this.isInvalid = this.isInvalid || M.spansMultipleLines(t10.range.insert) || M.spansMultipleLines(t10.range.replace) || t10.range.insert.startLineNumber !== e206.lineNumber || t10.range.replace.startLineNumber !== e206.lineNumber || t10.range.insert.startColumn !== t10.range.replace.startColumn), typeof r10.resolveCompletionItem != `function` && (this._resolveCache = Promise.resolve(), this._resolveDuration = 0);
  }
  get isResolved() {
    return this._resolveDuration !== void 0;
  }
  get resolveDuration() {
    return this._resolveDuration === void 0 ? -1 : this._resolveDuration;
  }
  async resolve(e206) {
    if (!this._resolveCache) {
      let t10 = e206.onCancellationRequested(() => {
        this._resolveCache = void 0, this._resolveDuration = void 0;
      }), n10 = new $t(true);
      this._resolveCache = Promise.resolve(this.provider.resolveCompletionItem(this.completion, e206)).then((e207) => {
        Object.assign(this.completion, e207), this._resolveDuration = n10.elapsed();
      }, (e207) => {
        we(e207) && (this._resolveCache = void 0, this._resolveDuration = void 0);
      }).finally(() => {
        t10.dispose();
      });
    }
    return this._resolveCache;
  }
}, S2 = (_Oc = class {
  constructor(e206 = 2, t10 = /* @__PURE__ */ new Set(), n10 = /* @__PURE__ */ new Set(), r10 = /* @__PURE__ */ new Map(), i10 = true) {
    this.snippetSortOrder = e206, this.kindFilter = t10, this.providerFilter = n10, this.providerItemsToReuse = r10, this.showDeprecated = i10;
  }
}, _Oc.default = new _Oc(), _Oc), _Ee = class {
  constructor(e206, t10, n10, r10) {
    this.items = e206, this.needsClipboard = t10, this.durations = n10, this.disposable = r10;
  }
};
async function C2(e206, t10, n10, r10 = S2.default, i10 = { triggerKind: 0 }, a10 = dr.None) {
  let o10 = new $t();
  n10 = n10.clone();
  let s10 = t10.getWordAtPosition(n10), c10 = s10 ? new M(n10.lineNumber, s10.startColumn, n10.lineNumber, s10.endColumn) : M.fromPositions(n10), l10 = { replace: c10, insert: c10.setEndPosition(n10.lineNumber, n10.column) }, u10 = [], d10 = new E(), f10 = [], p10 = false, m10 = (e207, t11, i11) => {
    let a11 = false;
    if (!t11) return a11;
    for (let i12 of t11.suggestions) if (!r10.kindFilter.has(i12.kind)) {
      if (!r10.showDeprecated && i12?.tags?.includes(1)) continue;
      i12.range || (i12.range = l10), i12.sortText || (i12.sortText = typeof i12.label == `string` ? i12.label : i12.label.label), !p10 && i12.insertTextRules && i12.insertTextRules & 4 && (p10 = yY.guessNeedsClipboard(i12.insertText)), u10.push(new gEe(n10, i12, t11, e207)), a11 = true;
    }
    return Gt(t11) && d10.add(t11), f10.push({ providerName: e207._debugDisplayName ?? `unknown_provider`, elapsedProvider: t11.duration ?? -1, elapsedOverall: i11.elapsed() }), a11;
  }, h10 = (async () => {
  })();
  for (let o11 of e206.orderedGroups(t10)) {
    let e207 = false;
    if (await Promise.all(o11.map(async (o12) => {
      if (r10.providerItemsToReuse.has(o12)) {
        let t11 = r10.providerItemsToReuse.get(o12);
        t11.forEach((e208) => u10.push(e208)), e207 || (e207 = t11.length > 0);
        return;
      }
      if (!(r10.providerFilter.size > 0 && !r10.providerFilter.has(o12))) try {
        let r11 = new $t();
        e207 = m10(o12, await o12.provideCompletionItems(t10, n10, i10, a10), r11) || e207;
      } catch (e208) {
        xe(e208);
      }
    })), e207 || a10.isCancellationRequested) break;
  }
  return await h10, a10.isCancellationRequested ? (d10.dispose(), Promise.reject(new Te())) : new _Ee(u10.sort(bEe(r10.snippetSortOrder)), p10, { entries: f10, elapsed: o10.elapsed() }, d10);
}
function w2(e206, t10) {
  if (e206.sortTextLow && t10.sortTextLow) {
    if (e206.sortTextLow < t10.sortTextLow) return -1;
    if (e206.sortTextLow > t10.sortTextLow) return 1;
  }
  return e206.textLabel < t10.textLabel ? -1 : e206.textLabel > t10.textLabel ? 1 : e206.completion.kind - t10.completion.kind;
}
function vEe(e206, t10) {
  if (e206.completion.kind !== t10.completion.kind) {
    if (e206.completion.kind === 28) return -1;
    if (t10.completion.kind === 28) return 1;
  }
  return w2(e206, t10);
}
function yEe(e206, t10) {
  if (e206.completion.kind !== t10.completion.kind) {
    if (e206.completion.kind === 28) return 1;
    if (t10.completion.kind === 28) return -1;
  }
  return w2(e206, t10);
}
var T2 = /* @__PURE__ */ new Map();
T2.set(0, vEe), T2.set(2, yEe), T2.set(1, w2);
function bEe(e206) {
  return T2.get(e206);
}
Nu.registerCommand(`_executeCompletionItemProvider`, async (e206, ...t10) => {
  let [n10, r10, i10, a10] = t10;
  Je($r.isUri(n10)), Je(j.isIPosition(r10)), Je(typeof i10 == `string` || !i10), Je(typeof a10 == `number` || !a10);
  let { completionProvider: o10 } = e206.get(X), s10 = await e206.get(wu).createModelReference(n10);
  try {
    let e207 = { incomplete: false, suggestions: [] }, t11 = [], n11 = s10.object.textEditorModel.validatePosition(r10), c10 = await C2(o10, s10.object.textEditorModel, n11, void 0, { triggerCharacter: i10 ?? void 0, triggerKind: +!!i10 });
    for (let n12 of c10.items) t11.length < (a10 ?? 0) && t11.push(n12.resolve(dr.None)), e207.incomplete = e207.incomplete || n12.container.incomplete, e207.suggestions.push(n12.completion);
    try {
      return await Promise.all(t11), e207;
    } finally {
      setTimeout(() => c10.disposable.dispose(), 100);
    }
  } finally {
    s10.dispose();
  }
});
function xEe(e206, t10) {
  e206.getContribution(`editor.contrib.suggestController`)?.triggerSuggest((/* @__PURE__ */ new Set()).add(t10), void 0, true);
}
var E2 = class {
  static isAllOff(e206) {
    return e206.other === `off` && e206.comments === `off` && e206.strings === `off`;
  }
  static isAllOn(e206) {
    return e206.other === `on` && e206.comments === `on` && e206.strings === `on`;
  }
  static valueFor(e206, t10) {
    switch (t10) {
      case 1:
        return e206.comments;
      case 2:
        return e206.strings;
      default:
        return e206.other;
    }
  }
}, D2 = (_Pc = class {
}, _Pc.inlineSuggestionVisible = new U(`inlineSuggestionVisible`, false, C(1192, `Whether an inline suggestion is visible`)), _Pc.inlineSuggestionHasIndentation = new U(`inlineSuggestionHasIndentation`, false, C(1193, `Whether the inline suggestion starts with whitespace`)), _Pc.inlineSuggestionHasIndentationLessThanTabSize = new U(`inlineSuggestionHasIndentationLessThanTabSize`, true, C(1194, `Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab`)), _Pc.suppressSuggestions = new U(`inlineSuggestionSuppressSuggestions`, void 0, C(1195, `Whether suggestions should be suppressed for the current suggestion`)), _Pc.cursorBeforeGhostText = new U(`cursorBeforeGhostText`, false, C(1196, `Whether the cursor is at ghost text`)), _Pc.cursorInIndentation = new U(`cursorInIndentation`, false, C(1197, `Whether the cursor is in indentation`)), _Pc.hasSelection = new U(`editor.hasSelection`, false, C(1198, `Whether the editor has a selection`)), _Pc.cursorAtInlineEdit = new U(`cursorAtInlineEdit`, false, C(1199, `Whether the cursor is at an inline edit`)), _Pc.inlineEditVisible = new U(`inlineEditIsVisible`, false, C(1200, `Whether an inline edit is visible`)), _Pc.tabShouldJumpToInlineEdit = new U(`tabShouldJumpToInlineEdit`, false, C(1201, `Whether tab should jump to an inline edit.`)), _Pc.tabShouldAcceptInlineEdit = new U(`tabShouldAcceptInlineEdit`, false, C(1202, `Whether tab should accept the inline edit.`)), _Pc.inInlineEditsPreviewEditor = new U(`inInlineEditsPreviewEditor`, true, C(1203, `Whether the current code editor is showing an inline edits preview`)), _Pc), SEe = class {
  constructor(e206, t10, n10) {
    this._selection = e206, this._cursors = t10, this._selectionId = null, this._trimInRegexesAndStrings = n10;
  }
  getEditOperations(e206, t10) {
    let n10 = CEe(e206, this._cursors, this._trimInRegexesAndStrings);
    for (let e207 = 0, r10 = n10.length; e207 < r10; e207++) {
      let r11 = n10[e207];
      t10.addEditOperation(r11.range, r11.text);
    }
    this._selectionId = t10.trackSelection(this._selection);
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this._selectionId);
  }
};
function CEe(e206, t10, n10) {
  t10.sort((e207, t11) => e207.lineNumber === t11.lineNumber ? e207.column - t11.column : e207.lineNumber - t11.lineNumber);
  for (let e207 = t10.length - 2; e207 >= 0; e207--) t10[e207].lineNumber === t10[e207 + 1].lineNumber && t10.splice(e207, 1);
  let r10 = [], i10 = 0, a10 = 0, o10 = t10.length;
  for (let s10 = 1, c10 = e206.getLineCount(); s10 <= c10; s10++) {
    let c11 = e206.getLineContent(s10), l10 = c11.length + 1, u10 = 0;
    if (a10 < o10 && t10[a10].lineNumber === s10 && (u10 = t10[a10].column, a10++, u10 === l10) || c11.length === 0) continue;
    let d10 = qa(c11), f10 = 0;
    if (d10 === -1) f10 = 1;
    else if (d10 !== c11.length - 1) f10 = d10 + 2;
    else continue;
    if (!n10) {
      if (!e206.tokenization.hasAccurateTokensForLine(s10)) continue;
      let t11 = e206.tokenization.getLineTokens(s10), n11 = t11.getStandardTokenType(t11.findTokenIndexAtOffset(f10));
      if (n11 === 2 || n11 === 3) continue;
    }
    f10 = Math.max(u10, f10), r10[i10++] = DF.delete(new M(s10, f10, s10, l10));
  }
  return r10;
}
var O2 = class {
  constructor(e206, t10, n10) {
    this._selection = e206, this._isCopyingDown = t10, this._noop = n10 || false, this._selectionDirection = 0, this._selectionId = null, this._startLineNumberDelta = 0, this._endLineNumberDelta = 0;
  }
  getEditOperations(e206, t10) {
    let n10 = this._selection;
    this._startLineNumberDelta = 0, this._endLineNumberDelta = 0, n10.startLineNumber < n10.endLineNumber && n10.endColumn === 1 && (this._endLineNumberDelta = 1, n10 = n10.setEndPosition(n10.endLineNumber - 1, e206.getLineMaxColumn(n10.endLineNumber - 1)));
    let r10 = [];
    for (let t11 = n10.startLineNumber; t11 <= n10.endLineNumber; t11++) r10.push(e206.getLineContent(t11));
    let i10 = r10.join(`
`);
    i10 === `` && this._isCopyingDown && (this._startLineNumberDelta++, this._endLineNumberDelta++), this._noop ? t10.addEditOperation(new M(n10.endLineNumber, e206.getLineMaxColumn(n10.endLineNumber), n10.endLineNumber + 1, 1), n10.endLineNumber === e206.getLineCount() ? `` : `
`) : this._isCopyingDown ? t10.addEditOperation(new M(n10.startLineNumber, 1, n10.startLineNumber, 1), i10 + `
`) : t10.addEditOperation(new M(n10.endLineNumber, e206.getLineMaxColumn(n10.endLineNumber), n10.endLineNumber, e206.getLineMaxColumn(n10.endLineNumber)), `
` + i10), this._selectionId = t10.trackSelection(n10), this._selectionDirection = this._selection.getDirection();
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getTrackedSelection(this._selectionId);
    if (this._startLineNumberDelta !== 0 || this._endLineNumberDelta !== 0) {
      let e207 = n10.startLineNumber, t11 = n10.startColumn, r10 = n10.endLineNumber, i10 = n10.endColumn;
      this._startLineNumberDelta !== 0 && (e207 += this._startLineNumberDelta, t11 = 1), this._endLineNumberDelta !== 0 && (r10 += this._endLineNumberDelta, i10 = 1), n10 = N.createWithDirection(e207, t11, r10, i10, this._selectionDirection);
    }
    return n10;
  }
};
function k2(e206, t10) {
  let n10 = 0;
  for (let r10 = 0; r10 < e206.length; r10++) e206.charAt(r10) === `	` ? n10 += t10 : n10++;
  return n10;
}
function A2(e206, t10, n10) {
  e206 = e206 < 0 ? 0 : e206;
  let r10 = ``;
  if (!n10) {
    let n11 = Math.floor(e206 / t10);
    e206 %= t10;
    for (let e207 = 0; e207 < n11; e207++) r10 += `	`;
  }
  for (let t11 = 0; t11 < e206; t11++) r10 += ` `;
  return r10;
}
var wEe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, TEe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, j2 = class {
  constructor(e206, t10, n10, r10) {
    this._languageConfigurationService = r10, this._selection = e206, this._isMovingDown = t10, this._autoIndent = n10, this._selectionId = null, this._moveEndLineSelectionShrink = false;
  }
  getEditOperations(e206, t10) {
    let n10 = () => e206.getLanguageId(), r10 = (t11, n11) => e206.getLanguageIdAtPosition(t11, n11), i10 = e206.getLineCount();
    if (this._isMovingDown && this._selection.endLineNumber === i10) {
      this._selectionId = t10.trackSelection(this._selection);
      return;
    }
    if (!this._isMovingDown && this._selection.startLineNumber === 1) {
      this._selectionId = t10.trackSelection(this._selection);
      return;
    }
    this._moveEndPositionDown = false;
    let a10 = this._selection;
    a10.startLineNumber < a10.endLineNumber && a10.endColumn === 1 && (this._moveEndPositionDown = true, a10 = a10.setEndPosition(a10.endLineNumber - 1, e206.getLineMaxColumn(a10.endLineNumber - 1)));
    let { tabSize: o10, indentSize: s10, insertSpaces: c10 } = e206.getOptions(), l10 = this.buildIndentConverter(o10, s10, c10);
    if (a10.startLineNumber === a10.endLineNumber && e206.getLineMaxColumn(a10.startLineNumber) === 1) {
      let n11 = a10.startLineNumber, r11 = this._isMovingDown ? n11 + 1 : n11 - 1;
      e206.getLineMaxColumn(r11) === 1 ? t10.addEditOperation(new M(1, 1, 1, 1), null) : (t10.addEditOperation(new M(n11, 1, n11, 1), e206.getLineContent(r11)), t10.addEditOperation(new M(r11, 1, r11, e206.getLineMaxColumn(r11)), null)), a10 = new N(r11, 1, r11, 1);
    } else {
      let i11, s11;
      if (this._isMovingDown) {
        i11 = a10.endLineNumber + 1, s11 = e206.getLineContent(i11), t10.addEditOperation(new M(i11 - 1, e206.getLineMaxColumn(i11 - 1), i11, e206.getLineMaxColumn(i11)), null);
        let u10 = s11;
        if (this.shouldAutoIndent(e206, a10)) {
          let d10 = this.matchEnterRule(e206, l10, o10, i11, a10.startLineNumber - 1);
          if (d10 !== null) u10 = A2(d10 + k2(Ka(e206.getLineContent(i11)), o10), o10, c10) + this.trimStart(s11);
          else {
            let t11 = { tokenization: { getLineTokens: (t12) => t12 === a10.startLineNumber ? e206.tokenization.getLineTokens(i11) : e206.tokenization.getLineTokens(t12), getLanguageId: n10, getLanguageIdAtPosition: r10 }, getLineContent: (t12) => t12 === a10.startLineNumber ? e206.getLineContent(i11) : e206.getLineContent(t12) }, d11 = sS(this._autoIndent, t11, e206.getLanguageIdAtPosition(i11, 1), a10.startLineNumber, l10, this._languageConfigurationService);
            if (d11 !== null) {
              let t12 = Ka(e206.getLineContent(i11)), n11 = k2(d11, o10);
              n11 !== k2(t12, o10) && (u10 = A2(n11, o10, c10) + this.trimStart(s11));
            }
          }
          t10.addEditOperation(new M(a10.startLineNumber, 1, a10.startLineNumber, 1), u10 + `
`);
          let f10 = this.matchEnterRuleMovingDown(e206, l10, o10, a10.startLineNumber, i11, u10);
          if (f10 !== null) f10 !== 0 && this.getIndentEditsOfMovingBlock(e206, t10, a10, o10, c10, f10);
          else {
            let s12 = { tokenization: { getLineTokens: (t11) => t11 === a10.startLineNumber ? e206.tokenization.getLineTokens(i11) : t11 >= a10.startLineNumber + 1 && t11 <= a10.endLineNumber + 1 ? e206.tokenization.getLineTokens(t11 - 1) : e206.tokenization.getLineTokens(t11), getLanguageId: n10, getLanguageIdAtPosition: r10 }, getLineContent: (t11) => t11 === a10.startLineNumber ? u10 : t11 >= a10.startLineNumber + 1 && t11 <= a10.endLineNumber + 1 ? e206.getLineContent(t11 - 1) : e206.getLineContent(t11) }, d11 = sS(this._autoIndent, s12, e206.getLanguageIdAtPosition(i11, 1), a10.startLineNumber + 1, l10, this._languageConfigurationService);
            if (d11 !== null) {
              let n11 = Ka(e206.getLineContent(a10.startLineNumber)), r11 = k2(d11, o10), i12 = k2(n11, o10);
              if (r11 !== i12) {
                let n12 = r11 - i12;
                this.getIndentEditsOfMovingBlock(e206, t10, a10, o10, c10, n12);
              }
            }
          }
        } else t10.addEditOperation(new M(a10.startLineNumber, 1, a10.startLineNumber, 1), u10 + `
`);
      } else if (i11 = a10.startLineNumber - 1, s11 = e206.getLineContent(i11), t10.addEditOperation(new M(i11, 1, i11 + 1, 1), null), t10.addEditOperation(new M(a10.endLineNumber, e206.getLineMaxColumn(a10.endLineNumber), a10.endLineNumber, e206.getLineMaxColumn(a10.endLineNumber)), `
` + s11), this.shouldAutoIndent(e206, a10)) {
        let s12 = { tokenization: { getLineTokens: (t11) => t11 === i11 ? e206.tokenization.getLineTokens(a10.startLineNumber) : e206.tokenization.getLineTokens(t11), getLanguageId: n10, getLanguageIdAtPosition: r10 }, getLineContent: (t11) => t11 === i11 ? e206.getLineContent(a10.startLineNumber) : e206.getLineContent(t11) }, u10 = this.matchEnterRule(e206, l10, o10, a10.startLineNumber, a10.startLineNumber - 2);
        if (u10 !== null) u10 !== 0 && this.getIndentEditsOfMovingBlock(e206, t10, a10, o10, c10, u10);
        else {
          let n11 = sS(this._autoIndent, s12, e206.getLanguageIdAtPosition(a10.startLineNumber, 1), i11, l10, this._languageConfigurationService);
          if (n11 !== null) {
            let r11 = Ka(e206.getLineContent(a10.startLineNumber)), i12 = k2(n11, o10), s13 = k2(r11, o10);
            if (i12 !== s13) {
              let n12 = i12 - s13;
              this.getIndentEditsOfMovingBlock(e206, t10, a10, o10, c10, n12);
            }
          }
        }
      }
    }
    this._selectionId = t10.trackSelection(a10);
  }
  buildIndentConverter(e206, t10, n10) {
    return { shiftIndent: (r10) => aS.shiftIndent(r10, r10.length + 1, e206, t10, n10), unshiftIndent: (r10) => aS.unshiftIndent(r10, r10.length + 1, e206, t10, n10) };
  }
  parseEnterResult(e206, t10, n10, r10, i10) {
    if (i10) {
      let a10 = i10.indentation;
      i10.indentAction === xf.None || i10.indentAction === xf.Indent ? a10 = i10.indentation + i10.appendText : i10.indentAction === xf.IndentOutdent ? a10 = i10.indentation : i10.indentAction === xf.Outdent && (a10 = t10.unshiftIndent(i10.indentation) + i10.appendText);
      let o10 = e206.getLineContent(r10);
      if (this.trimStart(o10).indexOf(this.trimStart(a10)) >= 0) {
        let i11 = Ka(e206.getLineContent(r10)), o11 = Ka(a10), s10 = cS(e206, r10, this._languageConfigurationService);
        return s10 !== null && s10 & 2 && (o11 = t10.unshiftIndent(o11)), k2(o11, n10) - k2(i11, n10);
      }
    }
    return null;
  }
  matchEnterRuleMovingDown(e206, t10, n10, r10, i10, a10) {
    if (qa(a10) >= 0) {
      let a11 = e206.getLineMaxColumn(i10), o10 = tS(this._autoIndent, e206, new M(i10, a11, i10, a11), this._languageConfigurationService);
      return this.parseEnterResult(e206, t10, n10, r10, o10);
    } else {
      let i11 = r10 - 1;
      for (; i11 >= 1 && !(qa(e206.getLineContent(i11)) >= 0); ) i11--;
      if (i11 < 1 || r10 > e206.getLineCount()) return null;
      let a11 = e206.getLineMaxColumn(i11), o10 = tS(this._autoIndent, e206, new M(i11, a11, i11, a11), this._languageConfigurationService);
      return this.parseEnterResult(e206, t10, n10, r10, o10);
    }
  }
  matchEnterRule(e206, t10, n10, r10, i10, a10) {
    let o10 = i10;
    for (; o10 >= 1; ) {
      let t11;
      if (t11 = o10 === i10 && a10 !== void 0 ? a10 : e206.getLineContent(o10), qa(t11) >= 0) break;
      o10--;
    }
    if (o10 < 1 || r10 > e206.getLineCount()) return null;
    let s10 = e206.getLineMaxColumn(o10), c10 = tS(this._autoIndent, e206, new M(o10, s10, o10, s10), this._languageConfigurationService);
    return this.parseEnterResult(e206, t10, n10, r10, c10);
  }
  trimStart(e206) {
    return e206.replace(/^\s+/, ``);
  }
  shouldAutoIndent(e206, t10) {
    if (this._autoIndent < 4 || !e206.tokenization.isCheapToTokenize(t10.startLineNumber)) return false;
    let n10 = e206.getLanguageIdAtPosition(t10.startLineNumber, 1);
    return !(n10 !== e206.getLanguageIdAtPosition(t10.endLineNumber, 1) || this._languageConfigurationService.getLanguageConfiguration(n10).indentRulesSupport === null);
  }
  getIndentEditsOfMovingBlock(e206, t10, n10, r10, i10, a10) {
    for (let o10 = n10.startLineNumber; o10 <= n10.endLineNumber; o10++) {
      let s10 = Ka(e206.getLineContent(o10)), c10 = A2(k2(s10, r10) + a10, r10, i10);
      c10 !== s10 && (t10.addEditOperation(new M(o10, 1, o10, s10.length + 1), c10), o10 === n10.endLineNumber && n10.endColumn <= s10.length + 1 && c10 === `` && (this._moveEndLineSelectionShrink = true));
    }
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getTrackedSelection(this._selectionId);
    return this._moveEndPositionDown && (n10 = n10.setEndPosition(n10.endLineNumber + 1, 1)), this._moveEndLineSelectionShrink && n10.startLineNumber < n10.endLineNumber && (n10 = n10.setEndPosition(n10.endLineNumber, 2)), n10;
  }
};
j2 = wEe([TEe(3, bp)], j2);
var M2 = (_Qc = class {
  constructor(e206, t10) {
    this.selection = e206, this.descending = t10, this.selectionId = null;
  }
  getEditOperations(e206, t10) {
    let n10 = EEe(e206, this.selection, this.descending);
    n10 && t10.addEditOperation(n10.range, n10.text), this.selectionId = t10.trackSelection(this.selection);
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this.selectionId);
  }
  static canRun(e206, t10, n10) {
    if (e206 === null) return false;
    let r10 = N2(e206, t10, n10);
    if (!r10) return false;
    for (let e207 = 0, t11 = r10.before.length; e207 < t11; e207++) if (r10.before[e207] !== r10.after[e207]) return true;
    return false;
  }
}, _Qc._COLLATOR = Jp.Collator(), _Qc);
function N2(e206, t10, n10) {
  let r10 = t10.startLineNumber, i10 = t10.endLineNumber;
  if (t10.endColumn === 1 && i10--, r10 >= i10) return null;
  let a10 = [];
  for (let t11 = r10; t11 <= i10; t11++) a10.push(e206.getLineContent(t11));
  let o10 = a10.slice(0);
  return o10.sort(M2._COLLATOR.value.compare), n10 === true && (o10 = o10.reverse()), { startLineNumber: r10, endLineNumber: i10, before: a10, after: o10 };
}
function EEe(e206, t10, n10) {
  let r10 = N2(e206, t10, n10);
  return r10 ? DF.replace(new M(r10.startLineNumber, 1, r10.endLineNumber, e206.getLineMaxColumn(r10.endLineNumber)), r10.after.join(`
`)) : null;
}
var P2 = class extends G {
  constructor(e206, t10) {
    super(t10), this.down = e206;
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getSelections().map((e207, t11) => ({ selection: e207, index: t11, ignore: false }));
    n10.sort((e207, t11) => M.compareRangesUsingStarts(e207.selection, t11.selection));
    let r10 = n10[0];
    for (let e207 = 1; e207 < n10.length; e207++) {
      let t11 = n10[e207];
      r10.selection.endLineNumber === t11.selection.startLineNumber && (r10.index < t11.index ? t11.ignore = true : (r10.ignore = true, r10 = t11));
    }
    let i10 = [];
    for (let e207 of n10) i10.push(new O2(e207.selection, this.down, e207.ignore));
    t10.pushUndoStop(), t10.executeCommands(this.id, i10), t10.pushUndoStop();
  }
}, DEe = class extends P2 {
  constructor() {
    super(false, { id: `editor.action.copyLinesUpAction`, label: w(1249, `Copy Line Up`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 1552, linux: { primary: 3600 }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `2_line`, title: C(1244, `&&Copy Line Up`), order: 1 }, canTriggerInlineEdits: true });
  }
}, OEe = class extends P2 {
  constructor() {
    super(true, { id: `editor.action.copyLinesDownAction`, label: w(1250, `Copy Line Down`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 1554, linux: { primary: 3602 }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `2_line`, title: C(1245, `Co&&py Line Down`), order: 2 }, canTriggerInlineEdits: true });
  }
}, kEe = class extends G {
  constructor() {
    super({ id: `editor.action.duplicateSelection`, label: w(1251, `Duplicate Selection`), precondition: $.writable, menuOpts: { menuId: W.MenubarSelectionMenu, group: `2_line`, title: C(1246, `&&Duplicate Selection`), order: 5 }, canTriggerInlineEdits: true });
  }
  run(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = [], i10 = t10.getSelections(), a10 = t10.getModel();
    for (let e207 of i10) if (e207.isEmpty()) r10.push(new O2(e207, true));
    else {
      let t11 = new N(e207.endLineNumber, e207.endColumn, e207.endLineNumber, e207.endColumn);
      r10.push(new fse(t11, a10.getValueInRange(e207)));
    }
    t10.pushUndoStop(), t10.executeCommands(this.id, r10), t10.pushUndoStop();
  }
}, F2 = class extends G {
  constructor(e206, t10) {
    super(t10), this.down = e206;
  }
  run(e206, t10) {
    let n10 = e206.get(bp), r10 = [], i10 = t10.getSelections() || [], a10 = t10.getOption(16);
    for (let e207 of i10) r10.push(new j2(e207, this.down, a10, n10));
    t10.pushUndoStop(), t10.executeCommands(this.id, r10), t10.pushUndoStop();
  }
}, AEe = class extends F2 {
  constructor() {
    super(false, { id: `editor.action.moveLinesUpAction`, label: w(1252, `Move Line Up`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 528, linux: { primary: 528 }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `2_line`, title: C(1247, `Mo&&ve Line Up`), order: 3 }, canTriggerInlineEdits: true });
  }
}, jEe = class extends F2 {
  constructor() {
    super(true, { id: `editor.action.moveLinesDownAction`, label: w(1253, `Move Line Down`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 530, linux: { primary: 530 }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `2_line`, title: C(1248, `Move &&Line Down`), order: 4 }, canTriggerInlineEdits: true });
  }
}, I2 = class extends G {
  constructor(e206, t10) {
    super(t10), this.descending = e206;
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getModel(), r10 = t10.getSelections();
    r10.length === 1 && r10[0].isEmpty() && (r10 = [new N(1, 1, n10.getLineCount(), n10.getLineMaxColumn(n10.getLineCount()))]);
    for (let e207 of r10) if (!M2.canRun(t10.getModel(), e207, this.descending)) return;
    let i10 = [];
    for (let e207 = 0, t11 = r10.length; e207 < t11; e207++) i10[e207] = new M2(r10[e207], this.descending);
    t10.pushUndoStop(), t10.executeCommands(this.id, i10), t10.pushUndoStop();
  }
}, MEe = class extends I2 {
  constructor() {
    super(false, { id: `editor.action.sortLinesAscending`, label: w(1254, `Sort Lines Ascending`), precondition: $.writable, canTriggerInlineEdits: true });
  }
}, NEe = class extends I2 {
  constructor() {
    super(true, { id: `editor.action.sortLinesDescending`, label: w(1255, `Sort Lines Descending`), precondition: $.writable, canTriggerInlineEdits: true });
  }
}, PEe = class extends G {
  constructor() {
    super({ id: `editor.action.removeDuplicateLines`, label: w(1256, `Delete Duplicate Lines`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getModel();
    if (n10.getLineCount() === 1 && n10.getLineMaxColumn(1) === 1) return;
    let r10 = [], i10 = [], a10 = 0, o10 = true, s10 = t10.getSelections();
    s10.length === 1 && s10[0].isEmpty() && (s10 = [new N(1, 1, n10.getLineCount(), n10.getLineMaxColumn(n10.getLineCount()))], o10 = false);
    for (let e207 of s10) {
      let t11 = /* @__PURE__ */ new Set(), o11 = [];
      for (let r11 = e207.startLineNumber; r11 <= e207.endLineNumber; r11++) {
        let e208 = n10.getLineContent(r11);
        t11.has(e208) || (o11.push(e208), t11.add(e208));
      }
      let s11 = new N(e207.startLineNumber, 1, e207.endLineNumber, n10.getLineMaxColumn(e207.endLineNumber)), c10 = e207.startLineNumber - a10, l10 = new N(c10, 1, c10 + o11.length - 1, o11[o11.length - 1].length);
      r10.push(DF.replace(s11, o11.join(`
`))), i10.push(l10), a10 += e207.endLineNumber - e207.startLineNumber + 1 - o11.length;
    }
    t10.pushUndoStop(), t10.executeEdits(this.id, r10, o10 ? i10 : void 0), t10.pushUndoStop();
  }
}, FEe = class extends G {
  constructor() {
    super({ id: `editor.action.reverseLines`, label: w(1257, `Reverse lines`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getModel(), r10 = t10.getSelections(), i10 = r10;
    i10.length === 1 && i10[0].isEmpty() && (i10 = [new N(1, 1, n10.getLineCount(), n10.getLineMaxColumn(n10.getLineCount()))]);
    let a10 = [], o10 = [];
    for (let e207 = 0; e207 < i10.length; e207++) {
      let t11 = i10[e207], s10 = r10[e207], c10 = t11.endLineNumber;
      t11.startLineNumber < t11.endLineNumber && t11.endColumn === 1 && c10--;
      let l10 = new M(t11.startLineNumber, 1, c10, n10.getLineMaxColumn(c10));
      c10 === n10.getLineCount() && n10.getLineContent(l10.endLineNumber) === `` && (l10 = l10.setEndPosition(l10.endLineNumber - 1, n10.getLineMaxColumn(l10.endLineNumber - 1)));
      let u10 = [];
      for (let e208 = l10.endLineNumber; e208 >= l10.startLineNumber; e208--) u10.push(n10.getLineContent(e208));
      let d10 = DF.replace(l10, u10.join(`
`));
      a10.push(d10);
      let f10 = function(e208) {
        return e208 <= l10.endLineNumber ? l10.endLineNumber - e208 + l10.startLineNumber : e208;
      };
      o10.push((function(e208) {
        if (e208.isEmpty()) return new N(f10(e208.positionLineNumber), e208.positionColumn, f10(e208.positionLineNumber), e208.positionColumn);
        {
          let t12 = f10(e208.selectionStartLineNumber), n11 = f10(e208.positionLineNumber), r11 = e208.selectionStartColumn, i11 = e208.positionColumn;
          return new N(t12, r11, n11, i11);
        }
      })(s10));
    }
    t10.pushUndoStop(), t10.executeEdits(this.id, a10, o10), t10.pushUndoStop();
  }
}, IEe = (_Rc = class extends G {
  constructor() {
    super({ id: _Rc.ID, label: w(1258, `Trim Trailing Whitespace`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2102), weight: 100 } });
  }
  run(e206, t10, n10) {
    let r10 = [];
    n10.reason === `auto-save` && (r10 = (t10.getSelections() || []).map((e207) => new j(e207.positionLineNumber, e207.positionColumn)));
    let i10 = t10.getSelection();
    if (i10 === null) return;
    let a10 = e206.get(Uf), o10 = t10.getModel(), s10 = a10.getValue(`files.trimTrailingWhitespaceInRegexAndStrings`, { overrideIdentifier: o10?.getLanguageId(), resource: o10?.uri }), c10 = new SEe(i10, r10, s10);
    t10.pushUndoStop(), t10.executeCommands(this.id, [c10]), t10.pushUndoStop();
  }
}, _Rc.ID = `editor.action.trimTrailingWhitespace`, _Rc), LEe = class extends G {
  constructor() {
    super({ id: `editor.action.deleteLines`, label: w(1259, `Delete Line`), precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 3113, weight: 100 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = this._getLinesToRemove(t10), r10 = t10.getModel();
    if (r10.getLineCount() === 1 && r10.getLineMaxColumn(1) === 1) return;
    let i10 = 0, a10 = [], o10 = [];
    for (let e207 = 0, t11 = n10.length; e207 < t11; e207++) {
      let t12 = n10[e207], s10 = t12.startLineNumber, c10 = t12.endLineNumber, l10 = 1, u10 = r10.getLineMaxColumn(c10);
      c10 < r10.getLineCount() ? (c10 += 1, u10 = 1) : s10 > 1 && (--s10, l10 = r10.getLineMaxColumn(s10)), a10.push(DF.replace(new N(s10, l10, c10, u10), ``)), o10.push(new N(s10 - i10, t12.positionColumn, s10 - i10, t12.positionColumn)), i10 += t12.endLineNumber - t12.startLineNumber + 1;
    }
    t10.pushUndoStop(), t10.executeEdits(this.id, a10, o10), t10.pushUndoStop();
  }
  _getLinesToRemove(e206) {
    let t10 = e206.getSelections().map((e207) => {
      let t11 = e207.endLineNumber;
      return e207.startLineNumber < e207.endLineNumber && e207.endColumn === 1 && --t11, { startLineNumber: e207.startLineNumber, selectionStartColumn: e207.selectionStartColumn, endLineNumber: t11, positionColumn: e207.positionColumn };
    });
    t10.sort((e207, t11) => e207.startLineNumber === t11.startLineNumber ? e207.endLineNumber - t11.endLineNumber : e207.startLineNumber - t11.startLineNumber);
    let n10 = [], r10 = t10[0];
    for (let e207 = 1; e207 < t10.length; e207++) r10.endLineNumber + 1 >= t10[e207].startLineNumber ? r10.endLineNumber = t10[e207].endLineNumber : (n10.push(r10), r10 = t10[e207]);
    return n10.push(r10), n10;
  }
}, REe = class extends G {
  constructor() {
    super({ id: `editor.action.indentLines`, label: w(1260, `Indent Line`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 2142, weight: 100 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = t10._getViewModel();
    n10 && (t10.pushUndoStop(), t10.executeCommands(this.id, SS.indent(n10.cursorConfig, t10.getModel(), t10.getSelections())), t10.pushUndoStop());
  }
}, zEe = class extends G {
  constructor() {
    super({ id: `editor.action.outdentLines`, label: w(1261, `Outdent Line`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 2140, weight: 100 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    jS.Outdent.runEditorCommand(e206, t10, null);
  }
}, L2 = (_Sc = class extends G {
  constructor() {
    super({ id: _Sc.ID, label: w(1262, `Insert Line Above`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 3075, weight: 100 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = t10._getViewModel();
    n10 && (t10.pushUndoStop(), t10.executeCommands(this.id, dS.lineInsertBefore(n10.cursorConfig, t10.getModel(), t10.getSelections())));
  }
}, _Sc.ID = `editor.action.insertLineBefore`, _Sc), R2 = (_Tc = class extends G {
  constructor() {
    super({ id: _Tc.ID, label: w(1263, `Insert Line Below`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 2051, weight: 100 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = t10._getViewModel();
    n10 && (t10.pushUndoStop(), t10.executeCommands(this.id, dS.lineInsertAfter(n10.cursorConfig, t10.getModel(), t10.getSelections())));
  }
}, _Tc.ID = `editor.action.insertLineAfter`, _Tc), z2 = class extends G {
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getSelection(), r10 = this._getRangesToDelete(t10), i10 = [];
    for (let e207 = 0, t11 = r10.length - 1; e207 < t11; e207++) {
      let t12 = r10[e207], n11 = r10[e207 + 1];
      M.intersectRanges(t12, n11) === null ? i10.push(t12) : r10[e207 + 1] = M.plusRange(t12, n11);
    }
    i10.push(r10[r10.length - 1]);
    let a10 = this._getEndCursorState(n10, i10), o10 = i10.map((e207) => DF.replace(e207, ``));
    t10.pushUndoStop(), t10.executeEdits(this.id, o10, a10), t10.pushUndoStop();
  }
}, BEe = class extends z2 {
  constructor() {
    super({ id: `deleteAllLeft`, label: w(1264, `Delete All Left`), precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 2049 }, weight: 100 }, canTriggerInlineEdits: true });
  }
  _getEndCursorState(e206, t10) {
    let n10 = null, r10 = [], i10 = 0;
    return t10.forEach((t11) => {
      let a10;
      if (t11.endColumn === 1 && i10 > 0) {
        let e207 = t11.startLineNumber - i10;
        a10 = new N(e207, t11.startColumn, e207, t11.startColumn);
      } else a10 = new N(t11.startLineNumber, t11.startColumn, t11.startLineNumber, t11.startColumn);
      i10 += t11.endLineNumber - t11.startLineNumber, t11.intersectRanges(e206) ? n10 = a10 : r10.push(a10);
    }), n10 && r10.unshift(n10), r10;
  }
  _getRangesToDelete(e206) {
    let t10 = e206.getSelections();
    if (t10 === null) return [];
    let n10 = t10, r10 = e206.getModel();
    return r10 === null ? [] : (n10.sort(M.compareRangesUsingStarts), n10 = n10.map((e207) => {
      if (e207.isEmpty()) if (e207.startColumn === 1) {
        let t11 = Math.max(1, e207.startLineNumber - 1);
        return new M(t11, e207.startLineNumber === 1 ? 1 : r10.getLineLength(t11) + 1, e207.startLineNumber, 1);
      } else return new M(e207.startLineNumber, 1, e207.startLineNumber, e207.startColumn);
      else return new M(e207.startLineNumber, 1, e207.endLineNumber, e207.endColumn);
    }), n10);
  }
}, VEe = class extends z2 {
  constructor() {
    super({ id: `deleteAllRight`, label: w(1265, `Delete All Right`), precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 297, secondary: [2068] }, weight: 100 }, canTriggerInlineEdits: true });
  }
  _getEndCursorState(e206, t10) {
    let n10 = null, r10 = [];
    for (let i10 = 0, a10 = t10.length; i10 < a10; i10++) {
      let a11 = t10[i10], o10 = new N(a11.startLineNumber - 0, a11.startColumn, a11.startLineNumber - 0, a11.startColumn);
      a11.intersectRanges(e206) ? n10 = o10 : r10.push(o10);
    }
    return n10 && r10.unshift(n10), r10;
  }
  _getRangesToDelete(e206) {
    let t10 = e206.getModel();
    if (t10 === null) return [];
    let n10 = e206.getSelections();
    if (n10 === null) return [];
    let r10 = n10.map((e207) => {
      if (e207.isEmpty()) {
        let n11 = t10.getLineMaxColumn(e207.startLineNumber);
        return e207.startColumn === n11 ? new M(e207.startLineNumber, e207.startColumn, e207.startLineNumber + 1, 1) : new M(e207.startLineNumber, e207.startColumn, e207.startLineNumber, n11);
      }
      return e207;
    });
    return r10.sort(M.compareRangesUsingStarts), r10;
  }
}, HEe = class extends G {
  constructor() {
    super({ id: `editor.action.joinLines`, label: w(1266, `Join Lines`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 0, mac: { primary: 296 }, weight: 100 }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = t10.getSelections();
    if (n10 === null) return;
    let r10 = t10.getSelection();
    if (r10 === null) return;
    n10.sort(M.compareRangesUsingStarts);
    let i10 = [], a10 = n10.reduce((e207, t11) => e207.isEmpty() ? e207.endLineNumber === t11.startLineNumber ? (r10.equalsSelection(e207) && (r10 = t11), t11) : t11.startLineNumber > e207.endLineNumber + 1 ? (i10.push(e207), t11) : new N(e207.startLineNumber, e207.startColumn, t11.endLineNumber, t11.endColumn) : t11.startLineNumber > e207.endLineNumber ? (i10.push(e207), t11) : new N(e207.startLineNumber, e207.startColumn, t11.endLineNumber, t11.endColumn));
    i10.push(a10);
    let o10 = t10.getModel();
    if (o10 === null) return;
    let s10 = [], c10 = [], l10 = r10, u10 = 0;
    for (let e207 = 0, t11 = i10.length; e207 < t11; e207++) {
      let t12 = i10[e207], n11 = t12.startLineNumber, a11 = 0, d10, f10, p10 = o10.getLineLength(t12.endLineNumber) - t12.endColumn;
      if (t12.isEmpty() || t12.startLineNumber === t12.endLineNumber) {
        let e208 = t12.getStartPosition();
        e208.lineNumber < o10.getLineCount() ? (d10 = n11 + 1, f10 = o10.getLineMaxColumn(d10)) : (d10 = e208.lineNumber, f10 = o10.getLineMaxColumn(e208.lineNumber));
      } else d10 = t12.endLineNumber, f10 = o10.getLineMaxColumn(d10);
      let m10 = o10.getLineContent(n11);
      for (let e208 = n11 + 1; e208 <= d10; e208++) {
        let t13 = o10.getLineContent(e208), n12 = o10.getLineFirstNonWhitespaceColumn(e208);
        if (n12 >= 1) {
          let e209 = true;
          m10 === `` && (e209 = false), e209 && (m10.charAt(m10.length - 1) === ` ` || m10.charAt(m10.length - 1) === `	`) && (e209 = false, m10 = m10.replace(/[\s\uFEFF\xA0]+$/g, ` `));
          let r11 = t13.substr(n12 - 1);
          m10 += (e209 ? ` ` : ``) + r11, a11 = e209 ? r11.length + 1 : r11.length;
        } else a11 = 0;
      }
      let h10 = new M(n11, 1, d10, f10);
      if (!h10.isEmpty()) {
        let e208;
        t12.isEmpty() ? (s10.push(DF.replace(h10, m10)), e208 = new N(h10.startLineNumber - u10, m10.length - a11 + 1, n11 - u10, m10.length - a11 + 1)) : t12.startLineNumber === t12.endLineNumber ? (s10.push(DF.replace(h10, m10)), e208 = new N(t12.startLineNumber - u10, t12.startColumn, t12.endLineNumber - u10, t12.endColumn)) : (s10.push(DF.replace(h10, m10)), e208 = new N(t12.startLineNumber - u10, t12.startColumn, t12.startLineNumber - u10, m10.length - p10)), M.intersectRanges(h10, r10) === null ? c10.push(e208) : l10 = e208;
      }
      u10 += h10.endLineNumber - h10.startLineNumber;
    }
    c10.unshift(l10), t10.pushUndoStop(), t10.executeEdits(this.id, s10, c10), t10.pushUndoStop();
  }
}, UEe = class extends G {
  constructor() {
    super({ id: `editor.action.transpose`, label: w(1267, `Transpose Characters around the Cursor`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = t10.getSelections();
    if (n10 === null) return;
    let r10 = t10.getModel();
    if (r10 === null) return;
    let i10 = [];
    for (let e207 = 0, t11 = n10.length; e207 < t11; e207++) {
      let t12 = n10[e207];
      if (!t12.isEmpty()) continue;
      let a10 = t12.getStartPosition(), o10 = r10.getLineMaxColumn(a10.lineNumber);
      if (a10.column >= o10) {
        if (a10.lineNumber === r10.getLineCount()) continue;
        let e208 = new M(a10.lineNumber, Math.max(1, a10.column - 1), a10.lineNumber + 1, 1), t13 = r10.getValueInRange(e208).split(``).reverse().join(``);
        i10.push(new Lx(new N(a10.lineNumber, Math.max(1, a10.column - 1), a10.lineNumber + 1, 1), t13));
      } else {
        let e208 = new M(a10.lineNumber, Math.max(1, a10.column - 1), a10.lineNumber, a10.column + 1), t13 = r10.getValueInRange(e208).split(``).reverse().join(``);
        i10.push(new Vx(e208, t13, new N(a10.lineNumber, a10.column + 1, a10.lineNumber, a10.column + 1)));
      }
    }
    t10.pushUndoStop(), t10.executeCommands(this.id, i10), t10.pushUndoStop();
  }
}, B2 = class extends G {
  run(e206, t10) {
    let n10 = t10.getSelections();
    if (n10 === null) return;
    let r10 = t10.getModel();
    if (r10 === null) return;
    let i10 = t10.getOption(148), a10 = [];
    for (let e207 of n10) if (e207.isEmpty()) {
      let n11 = e207.getStartPosition(), o10 = t10.getConfiguredWordAtPosition(n11);
      if (!o10) continue;
      let s10 = new M(n11.lineNumber, o10.startColumn, n11.lineNumber, o10.endColumn), c10 = r10.getValueInRange(s10);
      a10.push(DF.replace(s10, this._modifyText(c10, i10)));
    } else {
      let t11 = r10.getValueInRange(e207);
      a10.push(DF.replace(e207, this._modifyText(t11, i10)));
    }
    t10.pushUndoStop(), t10.executeEdits(this.id, a10), t10.pushUndoStop();
  }
}, WEe = class extends B2 {
  constructor() {
    super({ id: `editor.action.transformToUppercase`, label: w(1268, `Transform to Uppercase`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  _modifyText(e206, t10) {
    return e206.toLocaleUpperCase();
  }
}, GEe = class extends B2 {
  constructor() {
    super({ id: `editor.action.transformToLowercase`, label: w(1269, `Transform to Lowercase`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  _modifyText(e206, t10) {
    return e206.toLocaleLowerCase();
  }
}, V2 = class {
  constructor(e206, t10) {
    this._pattern = e206, this._flags = t10, this._actual = null, this._evaluated = false;
  }
  get() {
    if (!this._evaluated) {
      this._evaluated = true;
      try {
        this._actual = new RegExp(this._pattern, this._flags);
      } catch {
      }
    }
    return this._actual;
  }
  isSupported() {
    return this.get() !== null;
  }
}, H2 = (_Uc = class extends B2 {
  constructor() {
    super({ id: `editor.action.transformToTitlecase`, label: w(1270, `Transform to Title Case`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  _modifyText(t10, n10) {
    let r10 = _Uc.titleBoundary.get();
    return r10 ? t10.toLocaleLowerCase().replace(r10, (e206) => e206.toLocaleUpperCase()) : t10;
  }
}, _Uc.titleBoundary = new V2(`(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}`, `gmu`), _Uc), U2 = (_Vc = class extends B2 {
  constructor() {
    super({ id: `editor.action.transformToSnakecase`, label: w(1271, `Transform to Snake Case`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  _modifyText(t10, n10) {
    let r10 = _Vc.caseBoundary.get(), i10 = _Vc.singleLetters.get();
    return !r10 || !i10 ? t10 : t10.replace(r10, `$1_$2`).replace(i10, `$1_$2$3`).toLocaleLowerCase();
  }
}, _Vc.caseBoundary = new V2(`(\\p{Ll})(\\p{Lu})`, `gmu`), _Vc.singleLetters = new V2(`(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})`, `gmu`), _Vc), W2 = (_Wc = class extends B2 {
  constructor() {
    super({ id: `editor.action.transformToCamelcase`, label: w(1272, `Transform to Camel Case`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  _modifyText(t10, n10) {
    let r10 = /\r\n|\r|\n/.test(t10) ? _Wc.multiLineWordBoundary.get() : _Wc.singleLineWordBoundary.get(), i10 = _Wc.validWordStart.get();
    if (!r10 || !i10) return t10;
    let a10 = t10.split(r10);
    return a10.shift()?.replace(i10, (e206) => e206.toLocaleLowerCase()) + a10.map((e206) => e206.substring(0, 1).toLocaleUpperCase() + e206.substring(1)).join(``);
  }
}, _Wc.singleLineWordBoundary = new V2(`[_\\s-]+`, `gm`), _Wc.multiLineWordBoundary = new V2(`[_-]+`, `gm`), _Wc.validWordStart = new V2(`^(\\p{Lu}[^\\p{Lu}])`, `gmu`), _Wc), G2 = (_Xc = class extends B2 {
  constructor() {
    super({ id: `editor.action.transformToPascalcase`, label: w(1273, `Transform to Pascal Case`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  _modifyText(t10, n10) {
    let r10 = _Xc.wordBoundary.get(), i10 = _Xc.wordBoundaryToMaintain.get(), a10 = _Xc.upperCaseWordMatcher.get();
    return !r10 || !i10 || !a10 ? t10 : t10.split(i10).map((e206) => e206.split(r10)).flat().map((e206) => {
      let t11 = e206.charAt(0).toLocaleUpperCase() + e206.slice(1);
      return t11.length > 1 && a10.test(t11) ? t11.charAt(0) + t11.slice(1).toLocaleLowerCase() : t11;
    }).join(``);
  }
}, _Xc.wordBoundary = new V2(`[_ \\t-]`, `gm`), _Xc.wordBoundaryToMaintain = new V2(`(?<=\\.)`, `gm`), _Xc.upperCaseWordMatcher = new V2(`^\\p{Lu}+$`, `mu`), _Xc), K2 = (_Yc = class extends B2 {
  static isSupported() {
    return [this.caseBoundary, this.singleLetters, this.underscoreBoundary].every((e206) => e206.isSupported());
  }
  constructor() {
    super({ id: `editor.action.transformToKebabcase`, label: w(1274, `Transform to Kebab Case`), precondition: $.writable, canTriggerInlineEdits: true });
  }
  _modifyText(t10, n10) {
    let r10 = _Yc.caseBoundary.get(), i10 = _Yc.singleLetters.get(), a10 = _Yc.underscoreBoundary.get();
    return !r10 || !i10 || !a10 ? t10 : t10.replace(a10, `$1-$3`).replace(r10, `$1-$2`).replace(i10, `$1-$2`).toLocaleLowerCase();
  }
}, _Yc.caseBoundary = new V2(`(\\p{Ll})(\\p{Lu})`, `gmu`), _Yc.singleLetters = new V2(`(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})`, `gmu`), _Yc.underscoreBoundary = new V2(`(\\S)(_)(\\S)`, `gm`), _Yc);
q(DEe), q(OEe), q(kEe), q(AEe), q(jEe), q(MEe), q(NEe), q(PEe), q(IEe), q(LEe), q(REe), q(zEe), q(L2), q(R2), q(BEe), q(VEe), q(HEe), q(UEe), q(WEe), q(GEe), q(FEe), U2.caseBoundary.isSupported() && U2.singleLetters.isSupported() && q(U2), W2.singleLineWordBoundary.isSupported() && W2.multiLineWordBoundary.isSupported() && q(W2), G2.wordBoundary.isSupported() && q(G2), H2.titleBoundary.isSupported() && q(H2), K2.isSupported() && q(K2);
var KEe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, q2 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
};
function qEe(e206) {
  return e206.sourceId + ` @@ ` + JSON.stringify({ ...e206, modelUri: e206.modelUri?.toString(), sourceId: void 0 });
}
var J2 = class extends D {
  static cast() {
    return this;
  }
  constructor(e206, t10, n10) {
    super(), this._key = e206, this._contextKeyService = t10, this._dataChannelService = n10, this._isEnabledContextKeyValue = JEe(`structuredLogger.enabled:` + this._key, this._contextKeyService).recomputeInitiallyAndOnChange(this._store), this.isEnabled = this._isEnabledContextKeyValue.map((e207) => e207 !== void 0);
  }
  log(e206) {
    return this._isEnabledContextKeyValue.get() ? (this._dataChannelService.getDataChannel(`structuredLogger:` + this._key).sendData(e206), true) : false;
  }
};
J2 = KEe([q2(1, nd), q2(2, $W)], J2);
function JEe(e206, t10) {
  return Tc(t10.onDidChangeContext, () => t10.getContextKeyValue(e206));
}
var YEe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Y2 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, X2 = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._instantiationService = t10, this._loggerService = n10, this._structuredLogger = this._register(this._instantiationService.createInstance(J2.cast(), `editor.inlineSuggest.logChangeReason.commandId`));
    let r10 = this._loggerService?.createLogger(`textModelChanges`, { hidden: false, name: `Text Model Changes Reason` }), i10 = Tc(this, r10.onDidChangeLogLevel, () => r10.getLevel());
    this._register(hc((e207) => {
      qd(i10.read(e207), Gd.Trace) && e207.store.add(this._editor.onDidChangeModelContent((e208) => {
        this._editor.getModel()?.uri.scheme !== `output` && r10.trace(`onDidChangeModelContent: ` + e208.detailedReasons.map((e209) => e209.toKey(Number.MAX_VALUE)).join(`, `));
      }));
    })), this._register(hc((e207) => {
      this._editor instanceof Mk && this._structuredLogger.isEnabled.read(e207) && e207.store.add(this._editor.onDidChangeModelContent((e208) => {
        let t11 = this._editor.getModel();
        if (!t11) return;
        let n11 = e208.detailedReasons[0], r11 = { ...n11.metadata, sourceId: `TextModel.setChangeReason`, source: n11.metadata.source, time: Date.now(), modelUri: t11.uri, modelVersion: t11.getVersionId() };
        setTimeout(() => {
          this._structuredLogger.log(r11);
        }, 0);
      }));
    }));
  }
};
X2 = YEe([Y2(1, V), Y2(2, Wd)], X2);
function Z2(e206, t10 = wt) {
  return nre(e206, t10) ? e206.charAt(0).toUpperCase() + e206.slice(1) : e206;
}
var XEe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, ZEe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Q2 = class {
  constructor(e206) {
    this._delegates = e206;
  }
  resolve(e206) {
    for (let t10 of this._delegates) {
      let n10 = t10.resolve(e206);
      if (n10 !== void 0) return n10;
    }
  }
}, $2 = class {
  constructor(e206, t10, n10, r10) {
    this._model = e206, this._selection = t10, this._selectionIdx = n10, this._overtypingCapturer = r10;
  }
  resolve(e206) {
    let { name: t10 } = e206;
    if (t10 === `SELECTION` || t10 === `TM_SELECTED_TEXT`) {
      let t11 = this._model.getValueInRange(this._selection) || void 0, n10 = this._selection.startLineNumber !== this._selection.endLineNumber;
      if (!t11 && this._overtypingCapturer) {
        let e207 = this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);
        e207 && (t11 = e207.value, n10 = e207.multiline);
      }
      if (t11 && n10 && e206.snippet) {
        let n11 = Ka(this._model.getLineContent(this._selection.startLineNumber), 0, this._selection.startColumn - 1), r10 = n11;
        e206.snippet.walk((t12) => t12 === e206 ? false : (t12 instanceof dY && (r10 = Ka(Wa(t12.value).pop())), true));
        let i10 = ro(r10, n11);
        t11 = t11.replace(/(\r\n|\r|\n)(.*)/g, (e207, t12, n12) => `${t12}${r10.substr(i10)}${n12}`);
      }
      return t11;
    } else if (t10 === `TM_CURRENT_LINE`) return this._model.getLineContent(this._selection.positionLineNumber);
    else if (t10 === `TM_CURRENT_WORD`) {
      let e207 = this._model.getWordAtPosition({ lineNumber: this._selection.positionLineNumber, column: this._selection.positionColumn });
      return e207 && e207.word || void 0;
    } else if (t10 === `TM_LINE_INDEX`) return String(this._selection.positionLineNumber - 1);
    else if (t10 === `TM_LINE_NUMBER`) return String(this._selection.positionLineNumber);
    else if (t10 === `CURSOR_INDEX`) return String(this._selectionIdx);
    else if (t10 === `CURSOR_NUMBER`) return String(this._selectionIdx + 1);
  }
}, e410 = class {
  constructor(e206, t10) {
    this._labelService = e206, this._model = t10;
  }
  resolve(e206) {
    let { name: t10 } = e206;
    if (t10 === `TM_FILENAME`) return Yr(this._model.uri.fsPath);
    if (t10 === `TM_FILENAME_BASE`) {
      let e207 = Yr(this._model.uri.fsPath), t11 = e207.lastIndexOf(`.`);
      return t11 <= 0 ? e207 : e207.slice(0, t11);
    } else if (t10 === `TM_DIRECTORY`) return Jr(this._model.uri.fsPath) === `.` ? `` : this._labelService.getUriLabel(Ld(this._model.uri));
    else if (t10 === `TM_DIRECTORY_BASE`) return Jr(this._model.uri.fsPath) === `.` ? `` : Yr(Jr(this._model.uri.fsPath));
    else if (t10 === `TM_FILEPATH`) return this._labelService.getUriLabel(this._model.uri);
    else if (t10 === `RELATIVE_FILEPATH`) return this._labelService.getUriLabel(this._model.uri, { relative: true, noPrefix: true });
  }
}, t4 = class {
  constructor(e206, t10, n10, r10) {
    this._readClipboardText = e206, this._selectionIdx = t10, this._selectionCount = n10, this._spread = r10;
  }
  resolve(e206) {
    if (e206.name !== `CLIPBOARD`) return;
    let t10 = this._readClipboardText();
    if (t10) {
      if (this._spread) {
        let e207 = t10.split(/\r\n|\n|\r/).filter((e208) => !Ia(e208));
        if (e207.length === this._selectionCount) return e207[this._selectionIdx];
      }
      return t10;
    }
  }
}, n4 = class {
  constructor(e206, t10, n10) {
    this._model = e206, this._selection = t10, this._languageConfigurationService = n10;
  }
  resolve(e206) {
    let { name: t10 } = e206, n10 = this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber, this._selection.selectionStartColumn), r10 = this._languageConfigurationService.getLanguageConfiguration(n10).comments;
    if (r10) {
      if (t10 === `LINE_COMMENT`) return r10.lineCommentToken || void 0;
      if (t10 === `BLOCK_COMMENT_START`) return r10.blockCommentStartToken || void 0;
      if (t10 === `BLOCK_COMMENT_END`) return r10.blockCommentEndToken || void 0;
    }
  }
};
n4 = XEe([ZEe(2, bp)], n4);
var r4 = (_Zc = class {
  constructor() {
    this._date = /* @__PURE__ */ new Date();
  }
  resolve(t10) {
    let { name: n10 } = t10;
    if (n10 === `CURRENT_YEAR`) return String(this._date.getFullYear());
    if (n10 === `CURRENT_YEAR_SHORT`) return String(this._date.getFullYear()).slice(-2);
    if (n10 === `CURRENT_MONTH`) return String(this._date.getMonth().valueOf() + 1).padStart(2, `0`);
    if (n10 === `CURRENT_DATE`) return String(this._date.getDate().valueOf()).padStart(2, `0`);
    if (n10 === `CURRENT_HOUR`) return String(this._date.getHours().valueOf()).padStart(2, `0`);
    if (n10 === `CURRENT_MINUTE`) return String(this._date.getMinutes().valueOf()).padStart(2, `0`);
    if (n10 === `CURRENT_SECOND`) return String(this._date.getSeconds().valueOf()).padStart(2, `0`);
    if (n10 === `CURRENT_DAY_NAME`) return _Zc.dayNames[this._date.getDay()];
    if (n10 === `CURRENT_DAY_NAME_SHORT`) return _Zc.dayNamesShort[this._date.getDay()];
    if (n10 === `CURRENT_MONTH_NAME`) return _Zc.monthNames[this._date.getMonth()];
    if (n10 === `CURRENT_MONTH_NAME_SHORT`) return _Zc.monthNamesShort[this._date.getMonth()];
    if (n10 === `CURRENT_SECONDS_UNIX`) return String(Math.floor(this._date.getTime() / 1e3));
    if (n10 === `CURRENT_TIMEZONE_OFFSET`) {
      let e206 = this._date.getTimezoneOffset(), t11 = e206 > 0 ? `-` : `+`, n11 = Math.trunc(Math.abs(e206 / 60)), r10 = n11 < 10 ? `0` + n11 : n11, i10 = Math.abs(e206) - n11 * 60, a10 = i10 < 10 ? `0` + i10 : i10;
      return t11 + r10 + `:` + a10;
    }
  }
}, _Zc.dayNames = [C(1406, `Sunday`), C(1407, `Monday`), C(1408, `Tuesday`), C(1409, `Wednesday`), C(1410, `Thursday`), C(1411, `Friday`), C(1412, `Saturday`)], _Zc.dayNamesShort = [C(1413, `Sun`), C(1414, `Mon`), C(1415, `Tue`), C(1416, `Wed`), C(1417, `Thu`), C(1418, `Fri`), C(1419, `Sat`)], _Zc.monthNames = [C(1420, `January`), C(1421, `February`), C(1422, `March`), C(1423, `April`), C(1424, `May`), C(1425, `June`), C(1426, `July`), C(1427, `August`), C(1428, `September`), C(1429, `October`), C(1430, `November`), C(1431, `December`)], _Zc.monthNamesShort = [C(1432, `Jan`), C(1433, `Feb`), C(1434, `Mar`), C(1435, `Apr`), C(1436, `May`), C(1437, `Jun`), C(1438, `Jul`), C(1439, `Aug`), C(1440, `Sep`), C(1441, `Oct`), C(1442, `Nov`), C(1443, `Dec`)], _Zc), i4 = class {
  constructor(e206) {
    this._workspaceService = e206;
  }
  resolve(e206) {
    if (!this._workspaceService) return;
    let t10 = rge(this._workspaceService.getWorkspace());
    if (!tge(t10)) {
      if (e206.name === `WORKSPACE_NAME`) return this._resolveWorkspaceName(t10);
      if (e206.name === `WORKSPACE_FOLDER`) return this._resoveWorkspacePath(t10);
    }
  }
  _resolveWorkspaceName(e206) {
    if (JF(e206)) return Yr(e206.uri.path);
    let t10 = Yr(e206.configPath.path);
    return t10.endsWith(`code-workspace`) && (t10 = t10.substr(0, t10.length - oge.length - 1)), t10;
  }
  _resoveWorkspacePath(e206) {
    if (JF(e206)) return Z2(e206.uri.fsPath);
    let t10 = Yr(e206.configPath.path), n10 = e206.configPath.fsPath;
    return n10.endsWith(t10) && (n10 = n10.substr(0, n10.length - t10.length - 1)), n10 ? Z2(n10) : `/`;
  }
}, a4 = class {
  resolve(e206) {
    let { name: t10 } = e206;
    if (t10 === `RANDOM`) return Math.random().toString().slice(-6);
    if (t10 === `RANDOM_HEX`) return Math.random().toString(16).slice(-6);
    if (t10 === `UUID`) return Tx();
  }
}, QEe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, $Ee = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, o4, s4 = (__c = class {
  constructor(e206, t10, n10) {
    this._editor = e206, this._snippet = t10, this._snippetLineLeadingWhitespace = n10, this._offset = -1, this._nestingLevel = 1, this._placeholderGroups = d(t10.placeholders, pY.compareByIndex), this._placeholderGroupsIdx = -1;
  }
  initialize(e206) {
    this._offset = e206.newPosition;
  }
  dispose() {
    this._placeholderDecorations && this._editor.removeDecorations([...this._placeholderDecorations.values()]), this._placeholderGroups.length = 0;
  }
  _initDecorations() {
    if (this._offset === -1) throw Error(`Snippet not initialized!`);
    if (this._placeholderDecorations) return;
    this._placeholderDecorations = /* @__PURE__ */ new Map();
    let t10 = this._editor.getModel();
    this._editor.changeDecorations((n10) => {
      for (let r10 of this._snippet.placeholders) {
        let i10 = this._snippet.offset(r10), a10 = this._snippet.fullLen(r10), o10 = M.fromPositions(t10.getPositionAt(this._offset + i10), t10.getPositionAt(this._offset + i10 + a10)), s10 = r10.isFinalTabstop ? __c._decor.inactiveFinal : __c._decor.inactive, c10 = n10.addDecoration(o10, s10);
        this._placeholderDecorations.set(r10, c10);
      }
    });
  }
  move(t10) {
    if (!this._editor.hasModel()) return [];
    if (this._initDecorations(), this._placeholderGroupsIdx >= 0) {
      let e206 = [];
      for (let t11 of this._placeholderGroups[this._placeholderGroupsIdx]) if (t11.transform) {
        let n11 = this._placeholderDecorations.get(t11), r11 = this._editor.getModel().getDecorationRange(n11), i10 = this._editor.getModel().getValueInRange(r11), a10 = t11.transform.resolve(i10).split(/\r\n|\r|\n/);
        for (let e207 = 1; e207 < a10.length; e207++) a10[e207] = this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace + a10[e207]);
        e206.push(DF.replace(r11, a10.join(this._editor.getModel().getEOL())));
      }
      e206.length > 0 && this._editor.executeEdits(`snippet.placeholderTransform`, e206);
    }
    let n10 = false;
    t10 === true && this._placeholderGroupsIdx < this._placeholderGroups.length - 1 ? (this._placeholderGroupsIdx += 1, n10 = true) : t10 === false && this._placeholderGroupsIdx > 0 && (--this._placeholderGroupsIdx, n10 = true);
    let r10 = this._editor.getModel().changeDecorations((t11) => {
      let r11 = /* @__PURE__ */ new Set(), i10 = [];
      for (let a10 of this._placeholderGroups[this._placeholderGroupsIdx]) {
        let o10 = this._placeholderDecorations.get(a10), s10 = this._editor.getModel().getDecorationRange(o10);
        i10.push(new N(s10.startLineNumber, s10.startColumn, s10.endLineNumber, s10.endColumn)), n10 && (n10 = this._hasPlaceholderBeenCollapsed(a10)), t11.changeDecorationOptions(o10, a10.isFinalTabstop ? __c._decor.activeFinal : __c._decor.active), r11.add(a10);
        for (let n11 of this._snippet.enclosingPlaceholders(a10)) {
          let i11 = this._placeholderDecorations.get(n11);
          t11.changeDecorationOptions(i11, n11.isFinalTabstop ? __c._decor.activeFinal : __c._decor.active), r11.add(n11);
        }
      }
      for (let [n11, i11] of this._placeholderDecorations) r11.has(n11) || t11.changeDecorationOptions(i11, n11.isFinalTabstop ? __c._decor.inactiveFinal : __c._decor.inactive);
      return i10;
    });
    return n10 ? this.move(t10) : r10 ?? [];
  }
  _hasPlaceholderBeenCollapsed(e206) {
    let t10 = e206;
    for (; t10; ) {
      if (t10 instanceof pY) {
        let e207 = this._placeholderDecorations.get(t10);
        if (this._editor.getModel().getDecorationRange(e207).isEmpty() && t10.toString().length > 0) return true;
      }
      t10 = t10.parent;
    }
    return false;
  }
  get isAtFirstPlaceholder() {
    return this._placeholderGroupsIdx <= 0 || this._placeholderGroups.length === 0;
  }
  get isAtLastPlaceholder() {
    return this._placeholderGroupsIdx === this._placeholderGroups.length - 1;
  }
  get hasPlaceholder() {
    return this._snippet.placeholders.length > 0;
  }
  get isTrivialSnippet() {
    if (this._snippet.placeholders.length === 0) return true;
    if (this._snippet.placeholders.length === 1) {
      let [e206] = this._snippet.placeholders;
      if (e206.isFinalTabstop && this._snippet.rightMostDescendant === e206) return true;
    }
    return false;
  }
  computePossibleSelections() {
    let e206 = /* @__PURE__ */ new Map();
    for (let t10 of this._placeholderGroups) {
      let n10;
      for (let r10 of t10) {
        if (r10.isFinalTabstop) break;
        n10 || (n10 = [], e206.set(r10.index, n10));
        let t11 = this._placeholderDecorations.get(r10), i10 = this._editor.getModel().getDecorationRange(t11);
        if (!i10) {
          e206.delete(r10.index);
          break;
        }
        n10.push(i10);
      }
    }
    return e206;
  }
  get activeChoice() {
    if (!this._placeholderDecorations) return;
    let e206 = this._placeholderGroups[this._placeholderGroupsIdx][0];
    if (!e206?.choice) return;
    let t10 = this._placeholderDecorations.get(e206);
    if (!t10) return;
    let n10 = this._editor.getModel().getDecorationRange(t10);
    if (n10) return { range: n10, choice: e206.choice };
  }
  get hasChoice() {
    let e206 = false;
    return this._snippet.walk((t10) => (e206 = t10 instanceof mY, !e206)), e206;
  }
  merge(t10) {
    let n10 = this._editor.getModel();
    this._nestingLevel *= 10, this._editor.changeDecorations((r10) => {
      for (let i10 of this._placeholderGroups[this._placeholderGroupsIdx]) {
        let a10 = t10.shift();
        console.assert(a10._offset !== -1), console.assert(!a10._placeholderDecorations);
        let o10 = a10._snippet.placeholderInfo.last.index;
        for (let e206 of a10._snippet.placeholderInfo.all) e206.isFinalTabstop ? e206.index = i10.index + (o10 + 1) / this._nestingLevel : e206.index = i10.index + e206.index / this._nestingLevel;
        this._snippet.replace(i10, a10._snippet.children);
        let s10 = this._placeholderDecorations.get(i10);
        r10.removeDecoration(s10), this._placeholderDecorations.delete(i10);
        for (let t11 of a10._snippet.placeholders) {
          let i11 = a10._snippet.offset(t11), o11 = a10._snippet.fullLen(t11), s11 = M.fromPositions(n10.getPositionAt(a10._offset + i11), n10.getPositionAt(a10._offset + i11 + o11)), c10 = r10.addDecoration(s11, __c._decor.inactive);
          this._placeholderDecorations.set(t11, c10);
        }
      }
      this._placeholderGroups = d(this._snippet.placeholders, pY.compareByIndex);
    });
  }
}, __c._decor = { active: UO.register({ description: `snippet-placeholder-1`, stickiness: 0, className: `snippet-placeholder` }), inactive: UO.register({ description: `snippet-placeholder-2`, stickiness: 1, className: `snippet-placeholder` }), activeFinal: UO.register({ description: `snippet-placeholder-3`, stickiness: 1, className: `finish-snippet-placeholder` }), inactiveFinal: UO.register({ description: `snippet-placeholder-4`, stickiness: 1, className: `finish-snippet-placeholder` }) }, __c), c4 = { overwriteBefore: 0, overwriteAfter: 0, adjustWhitespace: true, clipboardText: void 0, overtypingCapturer: void 0 }, l4 = o4 = class {
  static adjustWhitespace(e206, t10, n10, r10, i10) {
    let a10 = Ka(e206.getLineContent(t10.lineNumber), 0, t10.column - 1), o10;
    return r10.walk((t11) => {
      if (!(t11 instanceof dY) || t11.parent instanceof mY || i10 && !i10.has(t11)) return true;
      let s10 = t11.value.split(/\r\n|\r|\n/);
      if (n10) {
        let n11 = r10.offset(t11);
        if (n11 === 0) s10[0] = e206.normalizeIndentation(s10[0]);
        else {
          o10 ?? (o10 = r10.toString());
          let t12 = o10.charCodeAt(n11 - 1);
          (t12 === 10 || t12 === 13) && (s10[0] = e206.normalizeIndentation(a10 + s10[0]));
        }
        for (let t12 = 1; t12 < s10.length; t12++) s10[t12] = e206.normalizeIndentation(a10 + s10[t12]);
      }
      let c10 = s10.join(e206.getEOL());
      return c10 !== t11.value && (t11.parent.replace(t11, [new dY(c10)]), o10 = void 0), true;
    }), a10;
  }
  static adjustSelection(e206, t10, n10, r10) {
    if (n10 !== 0 || r10 !== 0) {
      let { positionLineNumber: i10, positionColumn: a10 } = t10, o10 = a10 - n10, s10 = a10 + r10, c10 = e206.validateRange({ startLineNumber: i10, startColumn: o10, endLineNumber: i10, endColumn: s10 });
      t10 = N.createWithDirection(c10.startLineNumber, c10.startColumn, c10.endLineNumber, c10.endColumn, t10.getDirection());
    }
    return t10;
  }
  static createEditsAndSnippetsFromSelections(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    let l10 = [], u10 = [];
    if (!e206.hasModel()) return { edits: l10, snippets: u10 };
    let d10 = e206.getModel(), f10 = e206.invokeWithinContext((e207) => e207.get(qF)), p10 = e206.invokeWithinContext((e207) => new e410(e207.get(BF), d10)), m10 = () => o10, h10 = d10.getValueInRange(o4.adjustSelection(d10, e206.getSelection(), n10, 0)), g10 = d10.getValueInRange(o4.adjustSelection(d10, e206.getSelection(), 0, r10)), _10 = d10.getLineFirstNonWhitespaceColumn(e206.getSelection().positionLineNumber), v10 = e206.getSelections().map((e207, t11) => ({ selection: e207, idx: t11 })).sort((e207, t11) => M.compareRangesUsingStarts(e207.selection, t11.selection));
    for (let { selection: o11, idx: y10 } of v10) {
      let b10 = o4.adjustSelection(d10, o11, n10, 0), x10 = o4.adjustSelection(d10, o11, 0, r10);
      h10 !== d10.getValueInRange(b10) && (b10 = o11), g10 !== d10.getValueInRange(x10) && (x10 = o11);
      let S10 = o11.setStartPosition(b10.startLineNumber, b10.startColumn).setEndPosition(x10.endLineNumber, x10.endColumn), ee2 = new yY().parse(t10, true, i10), te2 = S10.getStartPosition(), ne2 = o4.adjustWhitespace(d10, te2, a10 || y10 > 0 && _10 !== d10.getLineFirstNonWhitespaceColumn(o11.positionLineNumber), ee2);
      ee2.resolveVariables(new Q2([p10, new t4(m10, y10, v10.length, e206.getOption(88) === `spread`), new $2(d10, o11, y10, s10), new n4(d10, o11, c10), new r4(), new i4(f10), new a4()])), l10[y10] = DF.replace(S10, ee2.toString()), l10[y10].identifier = { major: y10, minor: 0 }, l10[y10]._isTracked = true, u10[y10] = new s4(e206, ee2, ne2);
    }
    return { edits: l10, snippets: u10 };
  }
  static createEditsAndSnippetsFromEdits(e206, t10, n10, r10, i10, a10, o10) {
    if (!e206.hasModel() || t10.length === 0) return { edits: [], snippets: [] };
    let s10 = [], c10 = e206.getModel(), l10 = new yY(), u10 = new vY(), d10 = new Q2([e206.invokeWithinContext((e207) => new e410(e207.get(BF), c10)), new t4(() => i10, 0, e206.getSelections().length, e206.getOption(88) === `spread`), new $2(c10, e206.getSelection(), 0, a10), new n4(c10, e206.getSelection(), o10), new r4(), new i4(e206.invokeWithinContext((e207) => e207.get(qF))), new a4()]);
    t10 = t10.sort((e207, t11) => M.compareRangesUsingStarts(e207.range, t11.range));
    let f10 = 0;
    for (let e207 = 0; e207 < t10.length; e207++) {
      let { range: n11, template: i11, keepWhitespace: a11 } = t10[e207];
      if (e207 > 0) {
        let r11 = t10[e207 - 1].range, i12 = M.fromPositions(r11.getEndPosition(), n11.getStartPosition()), a12 = new dY(c10.getValueInRange(i12));
        u10.appendChild(a12), f10 += a12.value.length;
      }
      let o11 = l10.parseFragment(i11, u10);
      o4.adjustWhitespace(c10, n11.getStartPosition(), a11 === void 0 ? r10 : !a11, u10, new Set(o11)), u10.resolveVariables(d10);
      let p10 = u10.toString(), m10 = p10.slice(f10);
      f10 = p10.length;
      let h10 = DF.replace(n11, m10);
      h10.identifier = { major: e207, minor: 0 }, h10._isTracked = true, s10.push(h10);
    }
    return l10.ensureFinalTabstop(u10, n10, true), { edits: s10, snippets: [new s4(e206, u10, ``)] };
  }
  constructor(e206, t10, n10 = c4, r10) {
    this._editor = e206, this._template = t10, this._options = n10, this._languageConfigurationService = r10, this._templateMerges = [], this._snippets = [];
  }
  dispose() {
    Kt(this._snippets);
  }
  _logInfo() {
    return `template="${this._template}", merged_templates="${this._templateMerges.join(` -> `)}"`;
  }
  insert(e206) {
    if (!this._editor.hasModel()) return;
    let { edits: t10, snippets: n10 } = typeof this._template == `string` ? o4.createEditsAndSnippetsFromSelections(this._editor, this._template, this._options.overwriteBefore, this._options.overwriteAfter, false, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer, this._languageConfigurationService) : o4.createEditsAndSnippetsFromEdits(this._editor, this._template, false, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer, this._languageConfigurationService);
    this._snippets = n10, this._editor.executeEdits(e206 ?? mE.snippet(), t10, (e207) => {
      let t11 = e207.filter((e208) => !!e208.identifier);
      for (let e208 = 0; e208 < n10.length; e208++) n10[e208].initialize(t11[e208].textChange);
      return this._snippets[0].hasPlaceholder ? this._move(true) : t11.map((e208) => N.fromPositions(e208.range.getEndPosition()));
    }), this._editor.revealRange(this._editor.getSelections()[0]);
  }
  merge(e206, t10 = c4) {
    if (!this._editor.hasModel()) return;
    this._templateMerges.push([this._snippets[0]._nestingLevel, this._snippets[0]._placeholderGroupsIdx, e206]);
    let { edits: n10, snippets: r10 } = o4.createEditsAndSnippetsFromSelections(this._editor, e206, t10.overwriteBefore, t10.overwriteAfter, true, t10.adjustWhitespace, t10.clipboardText, t10.overtypingCapturer, this._languageConfigurationService);
    this._editor.executeEdits(`snippet`, n10, (e207) => {
      let t11 = e207.filter((e208) => !!e208.identifier);
      for (let e208 = 0; e208 < r10.length; e208++) r10[e208].initialize(t11[e208].textChange);
      let n11 = r10[0].isTrivialSnippet;
      if (!n11) {
        for (let e208 of this._snippets) e208.merge(r10);
        console.assert(r10.length === 0);
      }
      return this._snippets[0].hasPlaceholder && !n11 ? this._move(void 0) : t11.map((e208) => N.fromPositions(e208.range.getEndPosition()));
    });
  }
  next() {
    let e206 = this._move(true);
    this._editor.setSelections(e206), this._editor.revealPositionInCenterIfOutsideViewport(e206[0].getPosition());
  }
  prev() {
    let e206 = this._move(false);
    this._editor.setSelections(e206), this._editor.revealPositionInCenterIfOutsideViewport(e206[0].getPosition());
  }
  _move(e206) {
    let t10 = [];
    for (let n10 of this._snippets) {
      let r10 = n10.move(e206);
      t10.push(...r10);
    }
    return t10;
  }
  get isAtFirstPlaceholder() {
    return this._snippets[0].isAtFirstPlaceholder;
  }
  get isAtLastPlaceholder() {
    return this._snippets[0].isAtLastPlaceholder;
  }
  get hasPlaceholder() {
    return this._snippets[0].hasPlaceholder;
  }
  get hasChoice() {
    return this._snippets[0].hasChoice;
  }
  get activeChoice() {
    return this._snippets[0].activeChoice;
  }
  isSelectionWithinPlaceholders() {
    if (!this.hasPlaceholder) return false;
    let e206 = this._editor.getSelections();
    if (e206.length < this._snippets.length) return false;
    let t10 = /* @__PURE__ */ new Map();
    for (let n10 of this._snippets) {
      let r10 = n10.computePossibleSelections();
      if (t10.size === 0) for (let [n11, i10] of r10) {
        i10.sort(M.compareRangesUsingStarts);
        for (let r11 of e206) if (i10[0].containsRange(r11)) {
          t10.set(n11, []);
          break;
        }
      }
      if (t10.size === 0) return false;
      t10.forEach((e207, t11) => {
        e207.push(...r10.get(t11));
      });
    }
    e206.sort(M.compareRangesUsingStarts);
    for (let [n10, r10] of t10) {
      if (r10.length !== e206.length) {
        t10.delete(n10);
        continue;
      }
      r10.sort(M.compareRangesUsingStarts);
      for (let i10 = 0; i10 < r10.length; i10++) if (!r10[i10].containsRange(e206[i10])) {
        t10.delete(n10);
        continue;
      }
    }
    return t10.size > 0;
  }
};
l4 = o4 = QEe([$Ee(3, bp)], l4);
var eDe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, u4 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, d4, f4 = { overwriteBefore: 0, overwriteAfter: 0, undoStopBefore: true, undoStopAfter: true, adjustWhitespace: true, clipboardText: void 0, overtypingCapturer: void 0 }, p4 = (_$c = class {
  static get(e206) {
    return e206.getContribution(d4.ID);
  }
  constructor(e206, t10, n10, r10, i10) {
    this._editor = e206, this._logService = t10, this._languageFeaturesService = n10, this._languageConfigurationService = i10, this._inSnippetObservable = Ic(this, false), this._snippetListener = new E(), this._modelVersionId = -1, this._inSnippet = d4.InSnippetMode.bindTo(r10), this._hasNextTabstop = d4.HasNextTabstop.bindTo(r10), this._hasPrevTabstop = d4.HasPrevTabstop.bindTo(r10);
  }
  dispose() {
    this._inSnippet.reset(), this._inSnippetObservable.set(false, void 0), this._hasPrevTabstop.reset(), this._hasNextTabstop.reset(), this._session?.dispose(), this._snippetListener.dispose();
  }
  insert(e206, t10) {
    try {
      this._doInsert(e206, t10 === void 0 ? f4 : { ...f4, ...t10 });
    } catch (t11) {
      this.cancel(), this._logService.error(t11), this._logService.error(`snippet_error`), this._logService.error(`insert_template=`, e206), this._logService.error(`existing_template=`, this._session ? this._session._logInfo() : `<no_session>`);
    }
  }
  _doInsert(e206, t10) {
    if (this._editor.hasModel()) {
      if (this._snippetListener.clear(), t10.undoStopBefore && this._editor.getModel().pushStackElement(), this._session && typeof e206 != `string` && this.cancel(), this._session ? (Je(typeof e206 == `string`), this._session.merge(e206, t10)) : (this._modelVersionId = this._editor.getModel().getAlternativeVersionId(), this._session = new l4(this._editor, e206, t10, this._languageConfigurationService), this._session.insert(t10.reason)), t10.undoStopAfter && this._editor.getModel().pushStackElement(), this._session?.hasChoice) {
        let e207 = { _debugDisplayName: `snippetChoiceCompletions`, provideCompletionItems: (e208, t12) => {
          if (!this._session || e208 !== this._editor.getModel() || !j.equals(this._editor.getPosition(), t12)) return;
          let { activeChoice: n11 } = this._session;
          if (!n11 || n11.choice.options.length === 0) return;
          let r11 = e208.getValueInRange(n11.range), i10 = !!n11.choice.options.find((e209) => e209.value === r11), a10 = [];
          for (let e209 = 0; e209 < n11.choice.options.length; e209++) {
            let t13 = n11.choice.options[e209];
            a10.push({ kind: 13, label: t13.value, insertText: t13.value, sortText: `a`.repeat(e209 + 1), range: n11.range, filterText: i10 ? `${r11}_${t13.value}` : void 0, command: { id: `jumpToNextSnippetPlaceholder`, title: C(1405, `Go to next placeholder...`) } });
          }
          return { suggestions: a10 };
        } }, t11 = this._editor.getModel(), n10, r10 = false;
        this._choiceCompletions = { provider: e207, enable: () => {
          r10 || (r10 = (n10 = this._languageFeaturesService.completionProvider.register({ language: t11.getLanguageId(), pattern: t11.uri.fsPath, scheme: t11.uri.scheme, exclusive: true }, e207), this._snippetListener.add(n10), true));
        }, disable: () => {
          n10?.dispose(), r10 = false;
        } };
      }
      this._updateState(), this._snippetListener.add(this._editor.onDidChangeModelContent((e207) => e207.isFlush && this.cancel())), this._snippetListener.add(this._editor.onDidChangeModel(() => this.cancel())), this._snippetListener.add(this._editor.onDidChangeCursorSelection(() => this._updateState()));
    }
  }
  _updateState() {
    if (!(!this._session || !this._editor.hasModel())) {
      if (this._modelVersionId === this._editor.getModel().getAlternativeVersionId() || !this._session.hasPlaceholder) return this.cancel();
      if (this._session.isAtLastPlaceholder || !this._session.isSelectionWithinPlaceholders()) return this._editor.getModel().pushStackElement(), this.cancel();
      this._inSnippet.set(true), this._inSnippetObservable.set(true, void 0), this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder), this._hasNextTabstop.set(!this._session.isAtLastPlaceholder), this._handleChoice();
    }
  }
  _handleChoice() {
    if (!this._session || !this._editor.hasModel()) {
      this._currentChoice = void 0;
      return;
    }
    let { activeChoice: e206 } = this._session;
    if (!e206 || !this._choiceCompletions) {
      this._choiceCompletions?.disable(), this._currentChoice = void 0;
      return;
    }
    this._currentChoice !== e206.choice && (this._currentChoice = e206.choice, this._choiceCompletions.enable(), queueMicrotask(() => {
      xEe(this._editor, this._choiceCompletions.provider);
    }));
  }
  finish() {
    for (; this._inSnippet.get(); ) this.next();
  }
  cancel(e206 = false) {
    this._inSnippet.reset(), this._inSnippetObservable.set(false, void 0), this._hasPrevTabstop.reset(), this._hasNextTabstop.reset(), this._snippetListener.clear(), this._currentChoice = void 0, this._session?.dispose(), this._session = void 0, this._modelVersionId = -1, e206 && this._editor.setSelections([this._editor.getSelection()]);
  }
  prev() {
    this._session?.prev(), this._updateState();
  }
  next() {
    this._session?.next(), this._updateState();
  }
  isInSnippet() {
    return !!this._inSnippet.get();
  }
  get isInSnippetObservable() {
    return this._inSnippetObservable;
  }
}, d4 = _$c, _$c.ID = `snippetController2`, _$c.InSnippetMode = new U(`inSnippetMode`, false, C(1402, `Whether the editor in current in snippet mode`)), _$c.HasNextTabstop = new U(`hasNextTabstop`, false, C(1403, `Whether there is a next tab stop when in snippet mode`)), _$c.HasPrevTabstop = new U(`hasPrevTabstop`, false, C(1404, `Whether there is a previous tab stop when in snippet mode`)), _$c);
p4 = d4 = eDe([u4(1, Ud), u4(2, X), u4(3, nd), u4(4, bp)], p4), af(p4.ID, p4, 4);
var m4 = $d.bindToContribution(p4.get);
K(new m4({ id: `jumpToNextSnippetPlaceholder`, precondition: H.and(p4.InSnippetMode, p4.HasNextTabstop), handler: (e206) => e206.next(), kbOpts: { weight: 130, kbExpr: $.textInputFocus, primary: 2 } })), K(new m4({ id: `jumpToPrevSnippetPlaceholder`, precondition: H.and(p4.InSnippetMode, p4.HasPrevTabstop), handler: (e206) => e206.prev(), kbOpts: { weight: 130, kbExpr: $.textInputFocus, primary: 1026 } })), K(new m4({ id: `leaveSnippet`, precondition: p4.InSnippetMode, handler: (e206) => e206.cancel(true), kbOpts: { weight: 130, kbExpr: $.textInputFocus, primary: 9, secondary: [1033] } })), K(new m4({ id: `acceptSnippet`, precondition: p4.InSnippetMode, handler: (e206) => e206.finish() }));
function h4(e206) {
  return new tDe(e206);
}
var tDe = class extends Hm {
  constructor(e206) {
    super(), this._textModel = e206;
  }
  getOffset(e206) {
    return this._textModel.getOffsetAt(e206);
  }
  getPosition(e206) {
    return this._textModel.getPositionAt(e206);
  }
}, nDe = [];
function rDe() {
  return nDe;
}
function g4(e206) {
  return iDe(e206).map((e207) => e207.getEndPosition());
}
function iDe(e206) {
  let t10 = ge.createSortPermutation(e206, ce((e207) => e207.range, M.compareRangesUsingStarts)), n10 = new Jm(t10.apply(e206)).getNewRanges();
  return t10.inverse().apply(n10);
}
function aDe(e206, t10) {
  let n10 = h4(t10), r10 = t10.getValue();
  return e206.map((e207) => n10.getStringReplacement(e207)).map((e207) => e207.removeCommonSuffixPrefix(r10)).map((e207) => n10.getTextReplacement(e207));
}
function oDe(e206, t10) {
  let n10 = Ic(`result`, []), r10 = [];
  return t10.add(hc((t11) => {
    let i10 = e206.read(t11);
    bc((e207) => {
      if (i10.length !== r10.length) {
        r10.length = i10.length;
        for (let e208 = 0; e208 < r10.length; e208++) r10[e208] || (r10[e208] = Ic(`item`, i10[e208]));
        n10.set([...r10], e207);
      }
      r10.forEach((t12, n11) => t12.set(i10[n11], e207));
    });
  })), n10;
}
var sDe = class {
  constructor(e206) {
    this._contextKeyService = e206;
  }
  bind(e206, t10) {
    return PG(e206, this._contextKeyService, t10 instanceof Function ? t10 : (e207) => t10.read(e207));
  }
};
function _4(e206, t10) {
  return new Promise((n10) => {
    let r10, i10 = setTimeout(() => {
      r10 && r10.dispose(), n10();
    }, e206);
    t10 && (r10 = t10.onCancellationRequested(() => {
      clearTimeout(i10), r10 && r10.dispose(), n10();
    }));
  });
}
var cDe = class {
  constructor(e206, t10, n10, r10 = lDe) {
    this.startValue = e206, this.endValue = t10, this.durationMs = n10, this._interpolationFunction = r10, this.startTimeMs = Date.now(), e206 === t10 && (this.durationMs = 0);
  }
  isFinished() {
    return Date.now() >= this.startTimeMs + this.durationMs;
  }
  getValue() {
    let e206 = Date.now() - this.startTimeMs;
    return e206 >= this.durationMs ? this.endValue : this._interpolationFunction(e206, this.startValue, this.endValue - this.startValue, this.durationMs);
  }
};
function lDe(e206, t10, n10, r10) {
  return e206 === r10 ? t10 + n10 : n10 * (-(2 ** (-10 * e206 / r10)) + 1) + t10;
}
function uDe(e206, t10, n10, r10) {
  return n10 * ((e206 = e206 / r10 - 1) * e206 * e206 + 1) + t10;
}
var dDe = class {
  constructor(e206) {
    this._value = Ic(this, e206);
  }
  getValue(e206) {
    let t10 = this._value.read(e206);
    return t10.isFinished() || v4.instance.invalidateOnNextAnimationFrame(e206), t10.getValue();
  }
}, v4 = (_ad = class {
  constructor() {
    this._counter = _D2(this), this._isScheduled = false;
  }
  invalidateOnNextAnimationFrame(e206) {
    this._counter.read(e206), this._isScheduled || (this._isScheduled = true, Nl().requestAnimationFrame(() => {
      this._isScheduled = false, this._update();
    }));
  }
  _update() {
    this._counter.trigger(void 0);
  }
}, _ad.instance = new _ad(), _ad), y4 = class {
  constructor(e206, t10) {
    this.lineNumber = e206, this.parts = t10, Ie(() => Le(t10, (e207, t11) => e207.column <= t11.column));
  }
  equals(e206) {
    return this.lineNumber === e206.lineNumber && this.parts.length === e206.parts.length && this.parts.every((t10, n10) => t10.equals(e206.parts[n10]));
  }
  renderForScreenReader(e206) {
    if (this.parts.length === 0) return ``;
    let t10 = this.parts[this.parts.length - 1], n10 = e206.substr(0, t10.column - 1);
    return new Jm([...this.parts.map((e207) => new Ym(M.fromPositions(new j(1, e207.column)), e207.lines.map((e208) => e208.line).join(`
`)))]).applyToString(n10).substring(this.parts[0].column - 1);
  }
  isEmpty() {
    return this.parts.every((e206) => e206.lines.length === 0);
  }
  get lineCount() {
    return 1 + this.parts.reduce((e206, t10) => e206 + t10.lines.length - 1, 0);
  }
}, b4 = class {
  constructor(e206, t10, n10, r10 = []) {
    this.column = e206, this.text = t10, this.preview = n10, this._inlineDecorations = r10, this.lines = Wa(this.text).map((e207, t11) => ({ line: e207, lineDecorations: og.filter(this._inlineDecorations, t11 + 1, 1, e207.length + 1) }));
  }
  equals(e206) {
    return this.column === e206.column && this.lines.length === e206.lines.length && this.lines.every((t10, n10) => t10.line === e206.lines[n10].line && og.equalsArr(t10.lineDecorations, e206.lines[n10].lineDecorations));
  }
}, x4 = class {
  constructor(e206, t10, n10, r10 = 0) {
    this.lineNumber = e206, this.columnRange = t10, this.text = n10, this.additionalReservedLineCount = r10, this.parts = [new b4(this.columnRange.endColumnExclusive, this.text, false)], this.newLines = Wa(this.text);
  }
  renderForScreenReader(e206) {
    return this.newLines.join(`
`);
  }
  get lineCount() {
    return this.newLines.length;
  }
  isEmpty() {
    return this.parts.every((e206) => e206.lines.length === 0);
  }
  equals(e206) {
    return this.lineNumber === e206.lineNumber && this.columnRange.equals(e206.columnRange) && this.newLines.length === e206.newLines.length && this.newLines.every((t10, n10) => t10 === e206.newLines[n10]) && this.additionalReservedLineCount === e206.additionalReservedLineCount;
  }
};
function S4(e206, t10) {
  return o(e206, t10, C4);
}
function C4(e206, t10) {
  return e206 === t10 ? true : !e206 || !t10 ? false : e206 instanceof y4 && t10 instanceof y4 || e206 instanceof x4 && t10 instanceof x4 ? e206.equals(t10) : false;
}
function w4(e206, t10, n10) {
  let r10 = n10 ? e206.range.intersectRanges(n10) : e206.range;
  if (!r10) return e206;
  let i10 = e206.text.replaceAll(`\r
`, `
`), a10 = t10.getValueInRange(r10, 1), o10 = ro(a10, i10), s10 = Vm.ofText(a10.substring(0, o10)).addToPosition(e206.range.getStartPosition()), c10 = i10.substring(o10);
  return new Ym(M.fromPositions(s10, e206.range.getEndPosition()), c10);
}
function T4(e206, t10) {
  return e206.text.startsWith(t10.text) && fDe(e206.range, t10.range);
}
function fDe(e206, t10) {
  return t10.getStartPosition().equals(e206.getStartPosition()) && t10.getEndPosition().isBeforeOrEqual(e206.getEndPosition());
}
function E4(e206, t10, n10, r10, i10 = 0) {
  let a10 = w4(e206, t10);
  if (a10.range.endLineNumber !== a10.range.startLineNumber) return;
  let o10 = t10.getLineContent(a10.range.startLineNumber), s10 = Ka(o10).length;
  if (a10.range.startColumn - 1 <= s10) {
    let e207 = Ka(a10.text).length, t11 = o10.substring(a10.range.startColumn - 1, s10), [n11, r11] = [a10.range.getStartPosition(), a10.range.getEndPosition()], i11 = n11.column + t11.length <= r11.column ? n11.delta(0, t11.length) : r11;
    a10 = new Ym(M.fromPositions(i11, r11), a10.text.startsWith(t11) ? a10.text.substring(t11.length) : a10.text.substring(e207));
  }
  let c10 = t10.getValueInRange(a10.range), l10 = pDe(c10, a10.text);
  if (!l10) return;
  let u10 = a10.range.startLineNumber, d10 = [];
  if (n10 === `prefix`) {
    let e207 = l10.filter((e208) => e208.originalLength === 0);
    if (e207.length > 1 || e207.length === 1 && e207[0].originalStart !== c10.length) return;
  }
  let f10 = a10.text.length - i10;
  for (let e207 of l10) {
    let t11 = a10.range.startColumn + e207.originalStart + e207.originalLength;
    if (n10 === `subwordSmart` && r10 && r10.lineNumber === a10.range.startLineNumber && t11 < r10.column || e207.originalLength > 0) return;
    if (e207.modifiedLength === 0) continue;
    let i11 = e207.modifiedStart + e207.modifiedLength, o11 = Math.max(e207.modifiedStart, Math.min(i11, f10)), s11 = a10.text.substring(e207.modifiedStart, o11), c11 = a10.text.substring(o11, Math.max(e207.modifiedStart, i11));
    s11.length > 0 && d10.push(new b4(t11, s11, false)), c11.length > 0 && d10.push(new b4(t11, c11, true));
  }
  return new y4(u10, d10);
}
var D4 = void 0;
function pDe(e206, t10) {
  if (D4?.originalValue === e206 && D4?.newValue === t10) return D4?.changes;
  {
    let n10 = k4(e206, t10, true);
    if (n10) {
      let r10 = O4(n10);
      if (r10 > 0) {
        let i10 = k4(e206, t10, false);
        i10 && O4(i10) < r10 && (n10 = i10);
      }
    }
    return D4 = { originalValue: e206, newValue: t10, changes: n10 }, n10;
  }
}
function O4(e206) {
  let t10 = 0;
  for (let n10 of e206) t10 += n10.originalLength;
  return t10;
}
function k4(e206, t10, n10) {
  if (e206.length > 5e3 || t10.length > 5e3) return;
  function r10(e207) {
    let t11 = 0;
    for (let n11 = 0, r11 = e207.length; n11 < r11; n11++) {
      let r12 = e207.charCodeAt(n11);
      r12 > t11 && (t11 = r12);
    }
    return t11;
  }
  let i10 = Math.max(r10(e206), r10(t10));
  function a10(e207) {
    if (e207 < 0) throw Error(`unexpected`);
    return i10 + e207 + 1;
  }
  function o10(e207) {
    let t11 = 0, r11 = 0, i11 = new Int32Array(e207.length);
    for (let o11 = 0, s11 = e207.length; o11 < s11; o11++) n10 && e207[o11] === `(` ? (i11[o11] = a10(2 * (r11 * 100 + t11)), t11++) : n10 && e207[o11] === `)` ? (t11 = Math.max(t11 - 1, 0), i11[o11] = a10(2 * (r11 * 100 + t11) + 1), t11 === 0 && r11++) : i11[o11] = e207.charCodeAt(o11);
    return i11;
  }
  let s10 = o10(e206), c10 = o10(t10);
  return new Pp({ getElements: () => s10 }, { getElements: () => c10 }).ComputeDiff(false).changes;
}
function mDe(e206, t10) {
  let n10, r10 = false, i10 = new lc(new Zs(e206, void 0, t10.update), (e207, i11) => {
    r10 || (r10 = (n10 = t10.initial instanceof Function ? t10.initial() : t10.initial, true));
    let a10 = t10.update(e207, n10, i11);
    return n10 = a10, a10;
  }, t10.changeTracker, () => {
    r10 && (r10 = (t10.disposeFinal?.(n10), false));
  }, t10.equalityComparer ?? Ks, (e207, t11, a10) => {
    if (!r10) throw new je(`Can only set when there is a listener! This is to prevent leaks.`);
    Cc(t11, (t12) => {
      n10 = e207, i10.setValue(e207, t12, a10);
    });
  }, Gs.ofCaller());
  return i10;
}
var hDe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, A4 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, gDe = class {
  constructor(e206, t10) {
    this._baseService = e206, this._intercept = t10;
  }
  publicLog2(e206, t10) {
    this._intercept(e206, t10), this._baseService.publicLog2(e206, t10);
  }
}, j4 = class extends gDe {
  constructor(e206, t10) {
    super(e206, (e207, n10) => {
      let r10 = true;
      n10 && M4 in n10 && (r10 = !!n10[M4]), r10 && t10.getDataChannel(`editTelemetry`).sendData({ eventName: e207, data: n10 ?? {} });
    });
  }
};
j4 = hDe([A4(0, bd), A4(1, $W)], j4);
var M4 = /* @__PURE__ */ Symbol(`shouldForwardToChannel`);
function _De(e206) {
  return { [M4]: e206 };
}
function N4(e206) {
  if (!e206) return false;
  let t10 = e206.toLowerCase();
  return t10 === `github.copilot` || t10 === `github.copilot-chat`;
}
function vDe(e206) {
  let t10 = e206.map((e207) => new Vw(Tm.ofStartAndLength(e207.rangeOffset, e207.rangeLength), e207.text));
  return t10.reverse(), new Bw(t10);
}
function yDe(e206, t10) {
  e206.publicLog2(`inlineCompletion.endOfLife`, t10);
}
var P4;
(function(e206) {
  function t10(e207, t11) {
    return !e207.isInlineEdit && !e207.uri ? bDe.create(e207, t11) : z4.create(e207, t11);
  }
  e206.create = t10;
})(P4 || (P4 = {}));
var F4 = class {
  constructor(e206, t10, n10) {
    this._data = e206, this.identity = t10, this.hint = n10;
  }
  get source() {
    return this._data.source;
  }
  get isFromExplicitRequest() {
    return this._data.context.triggerKind === gi.Explicit;
  }
  get forwardStable() {
    return this.source.inlineSuggestions.enableForwardStability ?? false;
  }
  get editRange() {
    return this.getSingleTextEdit().range;
  }
  get targetRange() {
    return this.hint?.range && !this.hint.jumpToEdit ? this.hint?.range : this.editRange;
  }
  get insertText() {
    return this.getSingleTextEdit().text;
  }
  get semanticId() {
    return this.hash;
  }
  get action() {
    return this._sourceInlineCompletion.gutterMenuLinkAction;
  }
  get command() {
    return this._sourceInlineCompletion.command;
  }
  get warning() {
    return this._sourceInlineCompletion.warning;
  }
  get showInlineEditMenu() {
    return !!this._sourceInlineCompletion.showInlineEditMenu;
  }
  get hash() {
    return JSON.stringify([this.getSingleTextEdit().text, this.getSingleTextEdit().range.getStartPosition().toString()]);
  }
  get requestUuid() {
    return this._data.context.requestUuid;
  }
  get partialAccepts() {
    return this._data.partialAccepts;
  }
  get _sourceInlineCompletion() {
    return this._data.sourceInlineCompletion;
  }
  addRef() {
    this.identity.addRef(), this.source.addRef();
  }
  removeRef() {
    this.identity.removeRef(), this.source.removeRef();
  }
  reportInlineEditShown(e206, t10, n10) {
    this._data.reportInlineEditShown(e206, this.insertText, t10, n10);
  }
  reportPartialAccept(e206, t10, n10) {
    this._data.reportPartialAccept(e206, t10, n10);
  }
  reportEndOfLife(e206) {
    this._data.reportEndOfLife(e206);
  }
  setEndOfLifeReason(e206) {
    this._data.setEndOfLifeReason(e206);
  }
  setIsPreceeded(e206) {
    this._data.setIsPreceeded(e206.partialAccepts);
  }
  setNotShownReasonIfNotSet(e206) {
    this._data.setNotShownReason(e206);
  }
  getSourceCompletion() {
    return this._sourceInlineCompletion;
  }
}, I4 = (_bd = class {
  constructor() {
    this._onDispose = _D2(this), this._jumpedTo = Ic(this, false), this._refCount = 1, this.id = `InlineCompletionIdentity` + _bd.idCounter++;
  }
  get jumpedTo() {
    return this._jumpedTo;
  }
  addRef() {
    this._refCount++;
  }
  removeRef() {
    this._refCount--, this._refCount === 0 && this._onDispose.trigger(void 0);
  }
  setJumpTo(e206) {
    this._jumpedTo.set(true, e206);
  }
}, _bd.idCounter = 0, _bd), L4 = class e189 {
  static create(t10) {
    return new e189(M.lift(t10.range), t10.content, t10.style, t10.jumpToEdit);
  }
  constructor(e206, t10, n10, r10) {
    this.range = e206, this.content = t10, this.style = n10, this.jumpToEdit = r10;
  }
  withEdit(t10, n10) {
    let r10 = Hw([new Tm(n10.getOffset(this.range.getStartPosition()), n10.getOffset(this.range.getEndPosition()))], t10)[0];
    if (r10) return new e189(n10.getRange(r10), this.content, this.style, this.jumpToEdit);
  }
}, bDe = class e190 extends F4 {
  static create(t10, n10) {
    let r10 = new I4(), i10 = h4(n10), a10 = t10.insertText.replace(/\r\n|\r|\n/g, n10.getEOL()), o10 = CDe(new Vw(i10.getOffsetRange(t10.range), a10), n10), s10 = o10.removeCommonSuffixAndPrefix(n10.getValue()), c10 = i10.getTextReplacement(o10), l10 = t10.hint ? L4.create(t10.hint) : void 0;
    return new e190(o10, s10, c10, c10.range, t10.snippetInfo, t10.additionalTextEdits, t10, r10, l10);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(o10, s10, c10), this._edit = e206, this._trimmedEdit = t10, this._textEdit = n10, this._originalRange = r10, this.snippetInfo = i10, this.additionalTextEdits = a10, this.isInlineEdit = false;
  }
  get hash() {
    return JSON.stringify(this._trimmedEdit.toJson());
  }
  getSingleTextEdit() {
    return this._textEdit;
  }
  withIdentity(t10) {
    return new e190(this._edit, this._trimmedEdit, this._textEdit, this._originalRange, this.snippetInfo, this.additionalTextEdits, this._data, t10, this.hint);
  }
  withEdit(t10, n10) {
    let r10 = Hw([this._edit.replaceRange], t10);
    if (r10.length === 0) return;
    let i10 = new Vw(r10[0], this._textEdit.text), a10 = h4(n10), o10 = a10.getTextReplacement(i10), s10 = this.hint;
    if (!(s10 && (s10 = s10.withEdit(t10, a10), !s10))) return new e190(i10, i10.removeCommonSuffixAndPrefix(n10.getValue()), o10, this._originalRange, this.snippetInfo, this.additionalTextEdits, this._data, this.identity, s10);
  }
  canBeReused(e206, t10) {
    let n10 = this._textEdit.range;
    return !!n10 && n10.containsPosition(t10) && this.isVisible(e206, t10) && Vm.ofRange(n10).isGreaterThanOrEqualTo(Vm.ofRange(this._originalRange));
  }
  isVisible(e206, t10) {
    return R4(this.getSingleTextEdit(), this._originalRange, e206, t10);
  }
};
function R4(e206, t10, n10, r10) {
  let i10 = w4(e206, n10), a10 = e206.range;
  if (!a10 || t10 && !t10.getStartPosition().equals(a10.getStartPosition()) || r10.lineNumber !== i10.range.startLineNumber || i10.isEmpty) return false;
  let o10 = n10.getValueInRange(i10.range, 1), s10 = i10.text, c10 = Math.max(0, r10.column - i10.range.startColumn), l10 = s10.substring(0, c10), u10 = s10.substring(c10), d10 = o10.substring(0, c10), f10 = o10.substring(c10), p10 = n10.getLineIndentColumn(i10.range.startLineNumber);
  return i10.range.startColumn <= p10 && (d10 = d10.trimStart(), d10.length === 0 && (f10 = f10.trimStart()), l10 = l10.trimStart(), l10.length === 0 && (u10 = u10.trimStart())), l10.startsWith(d10) && !!Fj(f10, u10);
}
var z4 = class e191 extends F4 {
  static create(t10, n10) {
    let r10 = xDe(n10, t10.range, t10.insertText), i10 = new aq(n10), a10 = Jm.fromStringEdit(r10, i10), o10 = r10.isEmpty() ? new Ym(new M(1, 1, 1, 1), ``) : a10.toReplacement(i10), s10 = new I4(), c10 = r10.replacements.map((e206) => {
      let t11 = M.fromPositions(n10.getPositionAt(e206.replaceRange.start), n10.getPositionAt(e206.replaceRange.endExclusive)), r11 = n10.getValueInRange(t11);
      return SDe.create(e206, r11);
    }), l10 = t10.hint ? L4.create(t10.hint) : void 0;
    return new e191(r10, o10, t10.uri, t10, s10, c10, l10, false, n10.getVersionId());
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10 = false, c10) {
    super(r10, i10, o10), this._edit = e206, this._textEdit = t10, this.uri = n10, this._edits = a10, this._lastChangePartOfInlineEdit = s10, this._inlineEditModelVersion = c10, this.snippetInfo = void 0, this.additionalTextEdits = [], this.isInlineEdit = true;
  }
  get updatedEditModelVersion() {
    return this._inlineEditModelVersion;
  }
  get updatedEdit() {
    return this._edit;
  }
  getSingleTextEdit() {
    return this._textEdit;
  }
  withIdentity(t10) {
    return new e191(this._edit, this._textEdit, this.uri, this._data, t10, this._edits, this.hint, this._lastChangePartOfInlineEdit, this._inlineEditModelVersion);
  }
  canBeReused(e206, t10) {
    return this._lastChangePartOfInlineEdit && this.updatedEditModelVersion === e206.getVersionId();
  }
  withEdit(e206, t10) {
    return this._applyTextModelChanges(e206, this._edits, t10);
  }
  _applyTextModelChanges(t10, n10, r10) {
    if (n10 = n10.map((e206) => e206.applyTextModelChanges(t10)), n10.some((e206) => e206.edit === void 0)) return;
    let i10 = r10.getVersionId(), a10 = this._inlineEditModelVersion, o10 = n10.some((e206) => e206.lastChangeUpdatedEdit);
    if (o10 && (a10 = i10 ?? -1), i10 === null || a10 + 20 < i10 || (n10 = n10.filter((e206) => !e206.edit.isEmpty), n10.length === 0)) return;
    let s10 = new Bw(n10.map((e206) => e206.edit)), c10 = h4(r10), l10 = c10.getTextEdit(s10).toReplacement(new aq(r10)), u10 = this.hint;
    if (!(u10 && (u10 = u10.withEdit(t10, c10), !u10))) return new e191(s10, l10, this.uri, this._data, this.identity, n10, u10, o10, a10);
  }
};
function xDe(e206, t10, n10) {
  let r10 = e206.getEOL(), i10 = e206.getValueInRange(t10), a10 = n10.replace(/\r\n|\r|\n/g, r10), o10 = jh.getDefault().computeDiff(Wa(i10), Wa(a10), { ignoreTrimWhitespace: false, computeMoves: false, extendToSubwords: true, maxComputationTimeMs: 500 }).changes.flatMap((e207) => e207.innerChanges ?? []);
  function s10(e207, t11) {
    let n11 = Vm.fromPosition(t11.getStartPosition());
    return Vm.ofRange(t11).createRange(n11.addToPosition(e207));
  }
  let c10 = new qm(a10);
  return new Bw(o10.map((n11) => {
    let r11 = s10(t10.getStartPosition(), n11.originalRange);
    return wDe(new Vw(h4(e206).getOffsetRange(r11), c10.getValueOfRange(n11.modifiedRange)), e206.getValueInRange(r11), o10.length, e206);
  }));
}
var SDe = class e192 {
  static create(t10, n10) {
    let r10 = ro(t10.newText, n10), i10 = io(t10.newText, n10);
    return new e192(t10, t10.newText.substring(r10, t10.newText.length - i10), r10, i10);
  }
  get edit() {
    return this._edit;
  }
  get lastChangeUpdatedEdit() {
    return this._lastChangeUpdatedEdit;
  }
  constructor(e206, t10, n10, r10, i10 = false) {
    this._edit = e206, this._trimmedNewText = t10, this._prefixLength = n10, this._suffixLength = r10, this._lastChangeUpdatedEdit = i10;
  }
  applyTextModelChanges(e206) {
    let t10 = this._clone();
    return t10._applyTextModelChanges(e206), t10;
  }
  _clone() {
    return new e192(this._edit, this._trimmedNewText, this._prefixLength, this._suffixLength, this._lastChangeUpdatedEdit);
  }
  _applyTextModelChanges(e206) {
    if (this._lastChangeUpdatedEdit = false, !this._edit) throw new je(`UpdatedInnerEdits: No edit to apply changes to`);
    let t10 = this._applyChanges(this._edit, e206);
    if (!t10) {
      this._edit = void 0;
      return;
    }
    this._edit = t10.edit, this._lastChangeUpdatedEdit = t10.editHasChanged;
  }
  _applyChanges(e206, t10) {
    let n10 = e206.replaceRange.start, r10 = e206.replaceRange.endExclusive, i10 = e206.newText, a10 = false, o10 = this._prefixLength > 0 || this._suffixLength > 0;
    for (let s10 = t10.replacements.length - 1; s10 >= 0; s10--) {
      let c10 = t10.replacements[s10], l10 = c10.newText.length > 0 && c10.replaceRange.isEmpty;
      if (l10 && !o10 && c10.replaceRange.start === n10 && i10.startsWith(c10.newText)) {
        n10 += c10.newText.length, i10 = i10.substring(c10.newText.length), r10 = Math.max(n10, r10), a10 = true;
        continue;
      }
      if (l10 && o10 && c10.replaceRange.start === n10 + this._prefixLength && this._trimmedNewText.startsWith(c10.newText)) {
        r10 += c10.newText.length, a10 = true, this._prefixLength += c10.newText.length, this._trimmedNewText = this._trimmedNewText.substring(c10.newText.length);
        continue;
      }
      if (c10.newText.length === 0 && c10.replaceRange.length > 0 && c10.replaceRange.start >= n10 + this._prefixLength && c10.replaceRange.endExclusive <= r10 - this._suffixLength) {
        r10 -= c10.replaceRange.length, a10 = true;
        continue;
      }
      if (c10.equals(e206)) {
        a10 = true, n10 = c10.replaceRange.endExclusive, i10 = ``;
        continue;
      }
      if (!(c10.replaceRange.start > r10)) {
        if (c10.replaceRange.endExclusive < n10) {
          n10 += c10.newText.length - c10.replaceRange.length, r10 += c10.newText.length - c10.replaceRange.length;
          continue;
        }
        return;
      }
    }
    return this._trimmedNewText.length === 0 && n10 + this._prefixLength === r10 - this._suffixLength ? { edit: new Vw(new Tm(n10 + this._prefixLength, n10 + this._prefixLength), ``), editHasChanged: true } : { edit: new Vw(new Tm(n10, r10), i10), editHasChanged: a10 };
  }
};
function CDe(e206, t10) {
  let n10 = t10.getEOL();
  return e206.replaceRange.isEmpty && e206.newText.includes(n10) && (e206 = B4(e206, t10)), e206;
}
function wDe(e206, t10, n10, r10) {
  let i10 = r10.getEOL();
  if (e206.newText.endsWith(i10) && t10.endsWith(i10) && (e206 = new Vw(e206.replaceRange.deltaEnd(-i10.length), e206.newText.slice(0, -i10.length))), n10 === 1 && e206.replaceRange.isEmpty && e206.newText.includes(i10)) {
    let t11 = r10.getPositionAt(e206.replaceRange.start);
    r10.getLineLength(t11.lineNumber) !== 0 && (e206 = B4(e206, r10));
  }
  if (n10 === 1) {
    let n11 = ro(t10, e206.newText), r11 = io(t10.slice(n11), e206.newText.slice(n11));
    if (n11 + r11 === t10.length) return new Vw(e206.replaceRange.deltaStart(n11).deltaEnd(-r11), e206.newText.substring(n11, e206.newText.length - r11));
    if (n11 + r11 === e206.newText.length) return new Vw(e206.replaceRange.deltaStart(n11).deltaEnd(-r11), ``);
  }
  return e206;
}
function B4(e206, t10) {
  if (!e206.replaceRange.isEmpty) throw new je(`Unexpected original range`);
  if (e206.replaceRange.start === 0) return e206;
  let n10 = t10.getEOL(), r10 = t10.getPositionAt(e206.replaceRange.start), i10 = r10.column, a10 = r10.lineNumber;
  return i10 === 1 && a10 > 1 && e206.newText.endsWith(n10) && !e206.newText.startsWith(n10) ? new Vw(e206.replaceRange.delta(-1), n10 + e206.newText.slice(0, -n10.length)) : e206;
}
function TDe(e206, t10) {
  let n10 = new UT(new MT(), (e207) => t10.getLanguageConfiguration(e207)), r10 = YT(new HT(new EDe([e206]), n10), [], void 0, true), i10 = ``, a10 = e206.getLineContent();
  function o10(e207, t11) {
    if (e207.kind === 2) if (o10(e207.openingBracket, t11), t11 = bT(t11, e207.openingBracket.length), e207.child && (o10(e207.child, t11), t11 = bT(t11, e207.child.length)), e207.closingBracket) o10(e207.closingBracket, t11), t11 = bT(t11, e207.closingBracket.length);
    else {
      let t12 = n10.getSingleLanguageBracketTokens(e207.openingBracket.languageId).findClosingTokenText(e207.openingBracket.bracketIds);
      i10 += t12;
    }
    else if (e207.kind !== 3) {
      if (e207.kind === 0 || e207.kind === 1) i10 += a10.substring(yT(t11), yT(bT(t11, e207.length)));
      else if (e207.kind === 4) for (let n11 of e207.children) o10(n11, t11), t11 = bT(t11, n11.length);
    }
  }
  return o10(r10, 0), i10;
}
var EDe = class {
  constructor(e206) {
    this.lines = e206, this.tokenization = { getLineTokens: (e207) => this.lines[e207 - 1] };
  }
  getLineCount() {
    return this.lines.length;
  }
  getLineLength(e206) {
    return this.lines[e206 - 1].getLineContent().length;
  }
}, DDe = class e193 {
  constructor() {
    this._nodes = /* @__PURE__ */ new Set(), this._outgoingEdges = /* @__PURE__ */ new Map();
  }
  static from(t10, n10) {
    let r10 = new e193();
    for (let e206 of t10) r10._nodes.add(e206);
    for (let e206 of t10) {
      let t11 = n10(e206);
      if (t11.length > 0) {
        let n11 = /* @__PURE__ */ new Set();
        for (let e207 of t11) n11.add(e207);
        r10._outgoingEdges.set(e206, n11);
      }
    }
    return r10;
  }
  removeCycles() {
    let e206 = [], t10 = /* @__PURE__ */ new Set(), n10 = /* @__PURE__ */ new Set(), r10 = [], i10 = (a10) => {
      t10.add(a10), n10.add(a10);
      let o10 = this._outgoingEdges.get(a10);
      if (o10) for (let s10 of o10) t10.has(s10) ? n10.has(s10) && (e206.push(s10), r10.push({ from: a10, to: s10 })) : i10(s10);
      n10.delete(a10);
    };
    for (let e207 of this._nodes) t10.has(e207) || i10(e207);
    for (let { from: e207, to: t11 } of r10) {
      let n11 = this._outgoingEdges.get(e207);
      n11 && n11.delete(t11);
    }
    return { foundCycles: e206 };
  }
  getOutgoing(e206) {
    let t10 = this._outgoingEdges.get(e206);
    return t10 ? Array.from(t10) : [];
  }
}, V4;
(function(e206) {
  e206.Jump = `jump`, e206.Accept = `accept`, e206.Inactive = `inactive`;
})(V4 || (V4 = {}));
var H4;
(function(e206) {
  e206.GhostText = `ghostText`, e206.Custom = `custom`, e206.SideBySide = `sideBySide`, e206.Deletion = `deletion`, e206.InsertionInline = `insertionInline`, e206.InsertionMultiLine = `insertionMultiLine`, e206.WordReplacements = `wordReplacements`, e206.LineReplacement = `lineReplacement`, e206.Collapsed = `collapsed`;
})(H4 || (H4 = {}));
function ODe(e206, t10, n10, r10, i10, a10) {
  let o10 = Ex(`icr`), s10 = new pr(), c10, l10 = { ...r10, requestUuid: o10 }, u10 = MDe(t10, n10), d10 = Nde(e206, (e207) => e207.groupId), f10 = DDe.from(e206, (e207) => e207.yieldsToGroupIds?.flatMap((e208) => d10.get(e208) ?? []) ?? []), { foundCycles: p10 } = f10.removeCycles();
  p10.length > 0 && xe(Error(`Inline completions: cyclic yield-to dependency detected. Path: ${p10.map((e207) => e207.toString ? e207.toString() : `` + e207).join(` -> `)}`));
  let m10 = 0, h10 = new Na(async (e207) => {
    try {
      if (m10++, s10.token.isCancellationRequested) return;
      let r11 = f10.getOutgoing(e207);
      for (let e208 of r11) {
        let r12 = await h10.get(e208);
        if (r12) {
          for (let e209 of r12.inlineSuggestions.items) if (e209.isInlineEdit || typeof e209.insertText != `string` && e209.insertText !== void 0 || e209.insertText !== void 0 && R4(new Ym(M.lift(e209.range) ?? u10, e209.insertText), void 0, n10, t10)) return;
        }
      }
      let o11, d11 = Date.now();
      try {
        o11 = await e207.provideInlineCompletions(n10, t10, l10, s10.token);
      } catch (e208) {
        xe(e208);
        return;
      }
      let p11 = Date.now();
      if (!o11) return;
      let g10 = [], _10 = new jDe(o11, g10, e207);
      if (_10.addRef(), U4(s10.token, () => _10.removeRef(c10)), s10.token.isCancellationRequested) return;
      for (let e208 of o11.items) g10.push(kDe(e208, _10, u10, n10, a10, l10, i10, { startTime: d11, endTime: p11 }));
      return _10;
    } finally {
      m10--;
    }
  });
  return { contextWithUuid: l10, get didAllProvidersReturn() {
    return m10 === 0;
  }, lists: ys.fromPromisesResolveOrder(e206.map((e207) => h10.get(e207))).filter(Ke), cancelAndDispose: (e207) => {
    c10 === void 0 && (c10 = e207, s10.dispose(true));
  } };
}
function U4(e206, t10) {
  if (e206.isCancellationRequested) return t10(), D.None;
  {
    let n10 = e206.onCancellationRequested(() => {
      n10.dispose(), t10();
    });
    return { dispose: () => n10.dispose() };
  }
}
function kDe(e206, t10, n10, r10, i10, a10, o10, s10) {
  let c10, l10, u10 = e206.range ? M.lift(e206.range) : n10;
  if (typeof e206.insertText == `string`) {
    if (c10 = e206.insertText, i10 && e206.completeBracketPairs) {
      c10 = G4(c10, u10.getStartPosition(), r10, i10);
      let t11 = c10.length - e206.insertText.length;
      t11 !== 0 && (u10 = new M(u10.startLineNumber, u10.startColumn, u10.endLineNumber, u10.endColumn + t11));
    }
    l10 = void 0;
  } else if (e206.insertText === void 0) c10 = ``, l10 = void 0, u10 = new M(1, 1, 1, 1);
  else if (`snippet` in e206.insertText) {
    let t11 = e206.insertText.snippet.length;
    if (i10 && e206.completeBracketPairs) {
      e206.insertText.snippet = G4(e206.insertText.snippet, u10.getStartPosition(), r10, i10);
      let n12 = e206.insertText.snippet.length - t11;
      n12 !== 0 && (u10 = new M(u10.startLineNumber, u10.startColumn, u10.endLineNumber, u10.endColumn + n12));
    }
    let n11 = new yY().parse(e206.insertText.snippet);
    n11.children.length === 1 && n11.children[0] instanceof dY ? (c10 = n11.children[0].value, l10 = void 0) : (c10 = n11.toString(), l10 = { snippet: e206.insertText.snippet, range: u10 });
  } else Ne(e206.insertText);
  return new ADe(u10, c10, l10, $r.revive(e206.uri), e206.hint, e206.additionalTextEdits || rDe(), e206, t10, a10, e206.isInlineEdit ?? false, o10, s10, e206.correlationId);
}
var ADe = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10) {
    this.range = e206, this.insertText = t10, this.snippetInfo = n10, this.uri = r10, this.hint = i10, this.additionalTextEdits = a10, this.sourceInlineCompletion = o10, this.source = s10, this.context = c10, this.isInlineEdit = l10, this._requestInfo = u10, this._providerRequestInfo = d10, this._correlationId = f10, this._didShow = false, this._timeUntilShown = void 0, this._showStartTime = void 0, this._shownDuration = 0, this._showUncollapsedStartTime = void 0, this._showUncollapsedDuration = 0, this._notShownReason = void 0, this._didReportEndOfLife = false, this._lastSetEndOfLifeReason = void 0, this._isPreceeded = false, this._partiallyAcceptedCount = 0, this._partiallyAcceptedSinceOriginal = { characters: 0, ratio: 0, count: 0 }, this._viewData = { editorType: u10.editorType };
  }
  get showInlineEditMenu() {
    return this.sourceInlineCompletion.showInlineEditMenu ?? false;
  }
  get partialAccepts() {
    return this._partiallyAcceptedSinceOriginal;
  }
  async reportInlineEditShown(e206, t10, n10, r10) {
    if (this.updateShownDuration(n10), this._didShow) return;
    this._didShow = true, this._viewData.viewKind = n10, this._viewData.renderData = r10, this._timeUntilShown = Date.now() - this._requestInfo.startTime;
    let i10 = new _E2(r10.lineCountModified, r10.lineCountOriginal, r10.characterCountModified, r10.characterCountOriginal);
    this.source.provider.handleItemDidShow?.(this.source.inlineSuggestions, this.sourceInlineCompletion, t10, i10), this.sourceInlineCompletion.shownCommand && await e206.executeCommand(this.sourceInlineCompletion.shownCommand.id, ...this.sourceInlineCompletion.shownCommand.arguments || []);
  }
  reportPartialAccept(e206, t10, n10) {
    this._partiallyAcceptedCount++, this._partiallyAcceptedSinceOriginal.characters += n10.characters, this._partiallyAcceptedSinceOriginal.ratio = Math.min(this._partiallyAcceptedSinceOriginal.ratio + (1 - this._partiallyAcceptedSinceOriginal.ratio) * n10.ratio, 1), this._partiallyAcceptedSinceOriginal.count += n10.count, this.source.provider.handlePartialAccept?.(this.source.inlineSuggestions, this.sourceInlineCompletion, e206, t10);
  }
  reportEndOfLife(e206) {
    if (!this._didReportEndOfLife && (this._didReportEndOfLife = true, this.reportInlineEditHidden(), e206 || (e206 = this._lastSetEndOfLifeReason ?? { kind: bi.Ignored, userTypingDisagreed: false, supersededBy: void 0 }), e206.kind === bi.Rejected && this.source.provider.handleRejection && this.source.provider.handleRejection(this.source.inlineSuggestions, this.sourceInlineCompletion), this.source.provider.handleEndOfLifetime)) {
      let t10 = { requestUuid: this.context.requestUuid, correlationId: this._correlationId, selectedSuggestionInfo: !!this.context.selectedSuggestionInfo, partiallyAccepted: this._partiallyAcceptedCount, partiallyAcceptedCountSinceOriginal: this._partiallyAcceptedSinceOriginal.count, partiallyAcceptedRatioSinceOriginal: this._partiallyAcceptedSinceOriginal.ratio, partiallyAcceptedCharactersSinceOriginal: this._partiallyAcceptedSinceOriginal.characters, shown: this._didShow, shownDuration: this._shownDuration, shownDurationUncollapsed: this._showUncollapsedDuration, preceeded: this._isPreceeded, timeUntilShown: this._timeUntilShown, timeUntilProviderRequest: this._providerRequestInfo.startTime - this._requestInfo.startTime, timeUntilProviderResponse: this._providerRequestInfo.endTime - this._requestInfo.startTime, editorType: this._viewData.editorType, languageId: this._requestInfo.languageId, requestReason: this._requestInfo.reason, viewKind: this._viewData.viewKind, notShownReason: this._notShownReason, typingInterval: this._requestInfo.typingInterval, typingIntervalCharacterCount: this._requestInfo.typingIntervalCharacterCount, availableProviders: this._requestInfo.availableProviders.map((e207) => e207.toString()).join(`,`), ...this._viewData.renderData };
      this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions, this.sourceInlineCompletion, e206, t10);
    }
  }
  setIsPreceeded(e206) {
    this._isPreceeded = true, (this._partiallyAcceptedSinceOriginal.characters !== 0 || this._partiallyAcceptedSinceOriginal.ratio !== 0 || this._partiallyAcceptedSinceOriginal.count !== 0) && console.warn(`Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded.`), this._partiallyAcceptedSinceOriginal = e206;
  }
  setNotShownReason(e206) {
    this._notShownReason ?? (this._notShownReason = e206);
  }
  setEndOfLifeReason(e206) {
    this.reportInlineEditHidden(), this._lastSetEndOfLifeReason = e206;
  }
  updateShownDuration(e206) {
    let t10 = Date.now();
    this._showStartTime || (this._showStartTime = t10);
    let n10 = e206 === H4.Collapsed;
    !n10 && this._showUncollapsedStartTime === void 0 && (this._showUncollapsedStartTime = t10), n10 && this._showUncollapsedStartTime !== void 0 && (this._showUncollapsedDuration += t10 - this._showUncollapsedStartTime);
  }
  reportInlineEditHidden() {
    if (this._showStartTime === void 0) return;
    let e206 = Date.now();
    this._shownDuration += e206 - this._showStartTime, this._showStartTime = void 0, this._showUncollapsedStartTime !== void 0 && (this._showUncollapsedDuration += e206 - this._showUncollapsedStartTime, this._showUncollapsedStartTime = void 0);
  }
}, W4;
(function(e206) {
  e206.TextEditor = `textEditor`, e206.DiffEditor = `diffEditor`, e206.Notebook = `notebook`;
})(W4 || (W4 = {}));
var jDe = class {
  constructor(e206, t10, n10) {
    this.inlineSuggestions = e206, this.inlineSuggestionsData = t10, this.provider = n10, this.refCount = 0;
  }
  addRef() {
    this.refCount++;
  }
  removeRef(e206 = { kind: `other` }) {
    if (this.refCount--, this.refCount === 0) {
      for (let e207 of this.inlineSuggestionsData) e207.reportEndOfLife();
      this.provider.disposeInlineCompletions(this.inlineSuggestions, e206);
    }
  }
};
function MDe(e206, t10) {
  let n10 = t10.getWordAtPosition(e206), r10 = t10.getLineMaxColumn(e206.lineNumber);
  return n10 ? new M(e206.lineNumber, n10.startColumn, e206.lineNumber, r10) : M.fromPositions(e206, e206.with(void 0, r10));
}
function G4(e206, t10, n10, r10) {
  let i10 = n10.getLineContent(t10.lineNumber), a10 = Vw.replace(new Tm(t10.column - 1, i10.length), e206), o10 = n10.tokenization.tokenizeLinesAt(t10.lineNumber, [a10.replace(i10)])?.[0].sliceZeroCopy(a10.getRangeAfterReplace());
  return o10 ? TDe(o10, r10) : e206;
}
var NDe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, K4 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, q4, J4 = (_cd = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    super(), this._textModel = e206, this._versionId = t10, this._debounceValue = n10, this._cursorPosition = r10, this._languageConfigurationService = i10, this._logService = a10, this._configurationService = o10, this._instantiationService = s10, this._contextKeyService = c10, this._updateOperation = this._register(new Jt()), this._state = mDe(this, { initial: () => ({ inlineCompletions: Y4.createEmpty(), suggestWidgetInlineCompletions: Y4.createEmpty() }), disposeFinal: (e207) => {
      e207.inlineCompletions.dispose(), e207.suggestWidgetInlineCompletions.dispose();
    }, changeTracker: tO(() => ({ versionId: this._versionId })), update: (e207, t11, n11) => {
      let r11 = Bw.compose(n11.changes.map((e208) => e208.change ? vDe(e208.change.changes) : Bw.empty).filter(Ke));
      if (r11.isEmpty()) return t11;
      try {
        return { inlineCompletions: t11.inlineCompletions.createStateWithAppliedEdit(r11, this._textModel), suggestWidgetInlineCompletions: t11.suggestWidgetInlineCompletions.createStateWithAppliedEdit(r11, this._textModel) };
      } finally {
        t11.inlineCompletions.dispose(), t11.suggestWidgetInlineCompletions.dispose();
      }
    } }), this.inlineCompletions = this._state.map(this, (e207) => e207.inlineCompletions), this.suggestWidgetInlineCompletions = this._state.map(this, (e207) => e207.suggestWidgetInlineCompletions), this._completionsEnabled = void 0, this.clearOperationOnTextModelChange = I(this, (e207) => {
      this._versionId.read(e207), this._updateOperation.clear();
    }), this._loadingCount = Ic(this, 0), this._loggingEnabled = NG(`editor.inlineSuggest.logFetch`, false, this._configurationService).recomputeInitiallyAndOnChange(this._store), this._sendRequestData = NG(`editor.inlineSuggest.emptyResponseInformation`, true, this._configurationService).recomputeInitiallyAndOnChange(this._store), this._structuredFetchLogger = this._register(this._instantiationService.createInstance(J2.cast(), `editor.inlineSuggest.logFetch.commandId`)), this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);
    let l10 = ap.defaultChatAgent?.completionsEnablementSetting ?? void 0;
    l10 && (this._updateCompletionsEnablement(l10), this._register(this._configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(l10) && this._updateCompletionsEnablement(l10);
    }))), this._state.recomputeInitiallyAndOnChange(this._store);
  }
  _updateCompletionsEnablement(e206) {
    let t10 = this._configurationService.getValue(e206);
    Be(t10) ? this._completionsEnabled = t10 : this._completionsEnabled = void 0;
  }
  _log(e206) {
    this._loggingEnabled.get() && this._logService.info(qEe(e206)), this._structuredFetchLogger.log(e206);
  }
  fetch(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = new PDe(this._cursorPosition.get(), n10, this._textModel.getVersionId(), new Set(e206)), c10 = n10.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();
    if (this._updateOperation.value?.request.satisfies(s10)) return this._updateOperation.value.promise;
    if (c10?.request?.satisfies(s10)) return Promise.resolve(true);
    let l10 = !!this._updateOperation.value;
    this._updateOperation.clear();
    let u10 = new pr(), d10 = (async () => {
      let c11 = new E();
      this._loadingCount.set(this._loadingCount.get() + 1, void 0);
      let d11 = false, f11 = () => {
        d11 || (d11 = true, this._loadingCount.set(this._loadingCount.get() - 1, void 0));
      };
      c11.add(new us(() => f11(), 10 * 1e3)).schedule();
      let p10 = new FDe(n10, o10, e206.filter((e207) => e207.providerId));
      try {
        let d12 = this._debounceValue.get(this._textModel), f12 = Fm(e206.map((e207) => e207.debounceDelayMs), pe(ue)) ?? d12;
        if ((l10 || i10 && n10.triggerKind === gi.Automatic) && await _4(f12, u10.token), u10.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== s10.versionId) return p10.setNoSuggestionReasonIfNotSet(`canceled:beforeFetch`), false;
        let m10 = q4._requestId++;
        (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) && this._log({ sourceId: `InlineCompletions.fetch`, kind: `start`, requestId: m10, modelUri: this._textModel.uri, modelVersion: this._textModel.getVersionId(), context: { triggerKind: n10.triggerKind, suggestInfo: n10.selectedSuggestionInfo ? true : void 0 }, time: Date.now(), provider: t10 });
        let h10 = /* @__PURE__ */ new Date(), g10 = ODe(e206, this._cursorPosition.get(), this._textModel, n10, o10, this._languageConfigurationService);
        U4(u10.token, () => g10.cancelAndDispose({ kind: `tokenCancellation` }));
        let _10 = false, v10 = false, y10 = [];
        for await (let e207 of g10.lists) if (e207) {
          e207.addRef(), c11.add(T(() => e207.removeRef(e207.inlineSuggestionsData.length === 0 ? { kind: `empty` } : { kind: `notTaken` })));
          for (let t11 of e207.inlineSuggestionsData) {
            if (v10 = true, !n10.includeInlineEdits && (t11.isInlineEdit || t11.showInlineEditMenu)) {
              t11.setNotShownReason(`notInlineEditRequested`);
              continue;
            }
            if (!n10.includeInlineCompletions && !(t11.isInlineEdit || t11.showInlineEditMenu)) {
              t11.setNotShownReason(`notInlineCompletionRequested`);
              continue;
            }
            let e208 = P4.create(t11, this._textModel);
            y10.push(e208), !e208.isInlineEdit && !e208.showInlineEditMenu && n10.triggerKind === gi.Automatic && e208.isVisible(this._textModel, this._cursorPosition.get()) && (_10 = true);
          }
          if (_10) break;
        }
        if (g10.cancelAndDispose({ kind: `lostRace` }), this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {
          let e207 = g10.didAllProvidersReturn, t11;
          (u10.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== s10.versionId) && (t11 = `canceled`);
          let n11 = y10.map((e208) => ({ range: e208.editRange.toString(), text: e208.insertText, hint: e208.hint, isInlineEdit: e208.isInlineEdit, showInlineEditMenu: e208.showInlineEditMenu, providerId: e208.source.provider.providerId?.toString() }));
          this._log({ sourceId: `InlineCompletions.fetch`, kind: `end`, requestId: m10, durationMs: Date.now() - h10.getTime(), error: t11, result: n11, time: Date.now(), didAllProvidersReturn: e207 });
        }
        if (p10.setRequestUuid(g10.contextWithUuid.requestUuid), v10) p10.setHasProducedSuggestion(), y10.length > 0 && u10.token.isCancellationRequested && y10.forEach((e207) => e207.setNotShownReasonIfNotSet(`canceled:whileAwaitingOtherProviders`));
        else if (u10.token.isCancellationRequested) p10.setNoSuggestionReasonIfNotSet(`canceled:whileFetching`);
        else {
          let e207 = this._contextKeyService.getContextKeyValue(`completionsQuotaExceeded`);
          p10.setNoSuggestionReasonIfNotSet(e207 ? `completionsQuotaExceeded` : `noSuggestion`);
        }
        let b10 = n10.earliestShownDateTime - Date.now();
        if (b10 > 0 && await _4(b10, u10.token), u10.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== s10.versionId || a10.get()) {
          let e207 = u10.token.isCancellationRequested ? `canceled:afterMinShowDelay` : this._store.isDisposed ? `canceled:disposed` : this._textModel.getVersionId() === s10.versionId ? a10.get() ? `canceled:userJumped` : `unknown` : `canceled:documentChanged`;
          return y10.forEach((t11) => t11.setNotShownReasonIfNotSet(e207)), false;
        }
        let x10 = /* @__PURE__ */ new Date();
        this._debounceValue.update(this._textModel, x10.getTime() - h10.getTime());
        let S10 = this._cursorPosition.get();
        this._updateOperation.clear(), bc((e207) => {
          let t11 = this._state.get();
          n10.selectedSuggestionInfo ? this._state.set({ inlineCompletions: Y4.createEmpty(), suggestWidgetInlineCompletions: t11.suggestWidgetInlineCompletions.createStateWithAppliedResults(y10, s10, this._textModel, S10, r10) }, e207) : this._state.set({ inlineCompletions: t11.inlineCompletions.createStateWithAppliedResults(y10, s10, this._textModel, S10, r10), suggestWidgetInlineCompletions: Y4.createEmpty() }, e207), t11.inlineCompletions.dispose(), t11.suggestWidgetInlineCompletions.dispose();
        });
      } finally {
        c11.dispose(), f11(), this.sendInlineCompletionsRequestTelemetry(p10);
      }
      return true;
    })(), f10 = new RDe(s10, u10, d10);
    return this._updateOperation.value = f10, d10;
  }
  clear(e206) {
    this._updateOperation.clear();
    let t10 = this._state.get();
    this._state.set({ inlineCompletions: Y4.createEmpty(), suggestWidgetInlineCompletions: Y4.createEmpty() }, e206), t10.inlineCompletions.dispose(), t10.suggestWidgetInlineCompletions.dispose();
  }
  seedInlineCompletionsWithSuggestWidget() {
    let e206 = this.inlineCompletions.get(), t10 = this.suggestWidgetInlineCompletions.get();
    t10 && bc((n10) => {
      if (!e206 || (t10.request?.versionId ?? -1) > (e206.request?.versionId ?? -1)) {
        e206?.dispose();
        let r10 = this._state.get();
        this._state.set({ inlineCompletions: t10.clone(), suggestWidgetInlineCompletions: Y4.createEmpty() }, n10), r10.inlineCompletions.dispose(), r10.suggestWidgetInlineCompletions.dispose();
      }
      this.clearSuggestWidgetInlineCompletions(n10);
    });
  }
  sendInlineCompletionsRequestTelemetry(e206) {
    if (!this._sendRequestData.get() && !this._contextKeyService.getContextKeyValue(`isRunningUnificationExperiment`) || e206.requestUuid === void 0 || e206.hasProducedSuggestion || !LDe(this._completionsEnabled, this._textModel.getLanguageId()) || !e206.providers.some((e207) => N4(e207.providerId?.extensionId))) return;
    let t10 = { opportunityId: e206.requestUuid, noSuggestionReason: e206.noSuggestionReason ?? `unknown`, extensionId: `vscode-core`, extensionVersion: `0.0.0`, groupId: `empty`, shown: false, editorType: e206.requestInfo.editorType, requestReason: e206.requestInfo.reason, typingInterval: e206.requestInfo.typingInterval, typingIntervalCharacterCount: e206.requestInfo.typingIntervalCharacterCount, languageId: e206.requestInfo.languageId, selectedSuggestionInfo: !!e206.context.selectedSuggestionInfo, availableProviders: e206.providers.map((e207) => e207.providerId?.toString()).filter(Ke).join(`,`), ..._De(e206.providers.some((e207) => N4(e207.providerId?.extensionId))), timeUntilProviderRequest: void 0, timeUntilProviderResponse: void 0, viewKind: void 0, preceeded: void 0, superseded: void 0, reason: void 0, correlationId: void 0, shownDuration: void 0, shownDurationUncollapsed: void 0, timeUntilShown: void 0, partiallyAccepted: void 0, partiallyAcceptedCountSinceOriginal: void 0, partiallyAcceptedRatioSinceOriginal: void 0, partiallyAcceptedCharactersSinceOriginal: void 0, cursorColumnDistance: void 0, cursorLineDistance: void 0, lineCountOriginal: void 0, lineCountModified: void 0, characterCountOriginal: void 0, characterCountModified: void 0, disjointReplacements: void 0, sameShapeReplacements: void 0, notShownReason: void 0 };
    yDe(this._instantiationService.createInstance(j4), t10);
  }
  clearSuggestWidgetInlineCompletions(e206) {
    this._updateOperation.value?.request.context.selectedSuggestionInfo && this._updateOperation.clear();
  }
  cancelUpdate() {
    this._updateOperation.clear();
  }
}, q4 = _cd, _cd._requestId = 0, _cd);
J4 = q4 = NDe([K4(4, bp), K4(5, Ud), K4(6, Uf), K4(7, V), K4(8, nd)], J4);
var PDe = class {
  constructor(e206, t10, n10, r10) {
    this.position = e206, this.context = t10, this.versionId = n10, this.providers = r10;
  }
  satisfies(e206) {
    return this.position.equals(e206.position) && Ys(this.context.selectedSuggestionInfo, e206.context.selectedSuggestionInfo, Js()) && (e206.context.triggerKind === gi.Automatic || this.context.triggerKind === gi.Explicit) && this.versionId === e206.versionId && IDe(e206.providers, this.providers);
  }
}, FDe = class {
  constructor(e206, t10, n10) {
    this.context = e206, this.requestInfo = t10, this.providers = n10, this.hasProducedSuggestion = false;
  }
  setRequestUuid(e206) {
    this.requestUuid = e206;
  }
  setNoSuggestionReasonIfNotSet(e206) {
    this.noSuggestionReason ?? (this.noSuggestionReason = e206);
  }
  setHasProducedSuggestion() {
    this.hasProducedSuggestion = true;
  }
};
function IDe(e206, t10) {
  return [...e206].every((e207) => t10.has(e207));
}
function LDe(e206, t10 = `*`) {
  return e206 === void 0 ? false : e206[t10] === void 0 ? !!e206[`*`] : !!e206[t10];
}
var RDe = class {
  constructor(e206, t10, n10) {
    this.request = e206, this.cancellationTokenSource = t10, this.promise = n10;
  }
  dispose() {
    this.cancellationTokenSource.cancel();
  }
}, Y4 = class e194 extends D {
  static createEmpty() {
    return new e194([], void 0);
  }
  constructor(e206, t10) {
    for (let t11 of e206) t11.addRef();
    super(), this.inlineCompletions = e206, this.request = t10, this._register({ dispose: () => {
      for (let e207 of this.inlineCompletions) e207.removeRef();
    } });
  }
  _findById(e206) {
    return this.inlineCompletions.find((t10) => t10.identity === e206);
  }
  _findByHash(e206) {
    return this.inlineCompletions.find((t10) => t10.hash === e206);
  }
  createStateWithAppliedEdit(t10, n10) {
    return new e194(this.inlineCompletions.map((e206) => e206.withEdit(t10, n10)).filter(Ke), this.request);
  }
  createStateWithAppliedResults(t10, n10, r10, i10, a10) {
    let o10;
    if (a10) {
      let e206 = this._findById(a10);
      if (e206 && e206.canBeReused(r10, n10.position)) {
        o10 = e206;
        let n11 = t10.find((t11) => t11.hash === e206.hash);
        t10 = n11 ? BDe(n11, t10) : [e206, ...t10];
      }
    }
    let s10 = o10 ? !o10.isInlineEdit : t10.some((e206) => !e206.isInlineEdit && e206.isVisible(r10, i10)), c10 = [];
    for (let e206 of t10) {
      let t11 = this._findByHash(e206.hash), n11;
      t11 && t11 !== e206 ? (n11 = e206.withIdentity(t11.identity), e206.setIsPreceeded(t11), t11.setEndOfLifeReason({ kind: bi.Ignored, userTypingDisagreed: false, supersededBy: e206.getSourceCompletion() })) : n11 = e206, s10 !== n11.isInlineEdit && c10.push(n11);
    }
    return c10.sort(ce((e206) => e206.showInlineEditMenu, de)), c10 = zDe(c10, (e206) => e206.semanticId), new e194(c10, n10);
  }
  clone() {
    return new e194(this.inlineCompletions, this.request);
  }
};
function zDe(e206, t10) {
  let n10 = /* @__PURE__ */ new Set();
  return e206.filter((e207) => {
    let r10 = t10(e207);
    return n10.has(r10) ? false : (n10.add(r10), true);
  });
}
function BDe(e206, t10) {
  let n10 = t10.indexOf(e206);
  return n10 > -1 ? [e206, ...t10.slice(0, n10), ...t10.slice(n10 + 1)] : t10;
}
var VDe = class {
  constructor(e206, t10, n10) {
    this.edit = e206, this.commands = t10, this.inlineCompletion = n10;
  }
  equals(e206) {
    return this.edit.equals(e206.edit) && this.inlineCompletion === e206.inlineCompletion;
  }
}, HDe = (_dd = class extends D {
  getTypingInterval() {
    return (this._cacheInvalidated || this._cachedTypingIntervalResult === null) && (this._cachedTypingIntervalResult = this._calculateTypingInterval(), this._cacheInvalidated = false), this._cachedTypingIntervalResult;
  }
  constructor(e206) {
    super(), this._textModel = e206, this._typingSessions = [], this._currentSession = null, this._lastChangeTime = 0, this._cachedTypingIntervalResult = null, this._cacheInvalidated = true, this._register(this._textModel.onDidChangeContent((e207) => this._updateTypingSpeed(e207)));
  }
  _updateTypingSpeed(t10) {
    let n10 = Date.now();
    if (!this._isUserTyping(t10)) {
      this._finalizeCurrentSession();
      return;
    }
    this._currentSession && n10 - this._lastChangeTime > _dd.MAX_SESSION_GAP_MS && this._finalizeCurrentSession(), this._currentSession || (this._currentSession = { startTime: n10, endTime: n10, characterCount: 0 }), this._currentSession.endTime = n10, this._currentSession.characterCount += this._getActualCharacterCount(t10), this._lastChangeTime = n10, this._cacheInvalidated = true;
  }
  _getActualCharacterCount(e206) {
    let t10 = 0;
    for (let n10 of e206.changes) t10 += Math.max(n10.text.length, n10.rangeLength);
    return t10;
  }
  _isUserTyping(e206) {
    if (!e206.detailedReasons || e206.detailedReasons.length === 0) return false;
    for (let t10 of e206.detailedReasons) if (this._isUserTypingReason(t10)) return true;
    return false;
  }
  _isUserTypingReason(e206) {
    if (e206.metadata.isUndoing || e206.metadata.isRedoing) return false;
    switch (e206.metadata.source) {
      case `cursor`: {
        let t10 = e206.metadata.kind;
        return t10 === `type` || t10 === `compositionType` || t10 === `compositionEnd`;
      }
      default:
        return false;
    }
  }
  _finalizeCurrentSession() {
    this._currentSession && (this._currentSession = (this._currentSession.endTime - this._currentSession.startTime >= _dd.MIN_SESSION_DURATION_MS && this._currentSession.characterCount > 0 && (this._typingSessions.push(this._currentSession), this._typingSessions.length > _dd.SESSION_HISTORY_LIMIT && this._typingSessions.shift()), null));
  }
  _calculateTypingInterval() {
    if (this._currentSession) {
      let t10 = { ...this._currentSession };
      if (t10.endTime - t10.startTime >= _dd.MIN_SESSION_DURATION_MS && t10.characterCount > 0) {
        let e206 = [...this._typingSessions, t10];
        return this._calculateSpeedFromSessions(e206);
      }
    }
    return this._calculateSpeedFromSessions(this._typingSessions);
  }
  _calculateSpeedFromSessions(t10) {
    if (t10.length === 0) return { averageInterval: 0, characterCount: 0 };
    let n10 = [...t10].sort((e206, t11) => t11.endTime - e206.endTime), r10 = Date.now() - _dd.TYPING_SPEED_WINDOW_MS, i10 = n10.filter((e206) => e206.endTime > r10), a10 = n10.splice(i10.length), o10 = _e(i10.map((e206) => e206.characterCount));
    for (let t11 = 0; t11 < a10.length && o10 < _dd.MIN_CHARS_FOR_RELIABLE_SPEED; t11++) i10.push(a10[t11]), o10 += a10[t11].characterCount;
    let s10 = _e(i10.map((e206) => e206.endTime - e206.startTime));
    if (s10 === 0 || o10 <= 1) return { averageInterval: 0, characterCount: o10 };
    let c10 = s10 / Math.max(1, o10 - 1);
    return { averageInterval: Math.round(c10), characterCount: o10 };
  }
  dispose() {
    this._finalizeCurrentSession(), super.dispose();
  }
}, _dd.MAX_SESSION_GAP_MS = 3e3, _dd.MIN_SESSION_DURATION_MS = 1e3, _dd.SESSION_HISTORY_LIMIT = 50, _dd.TYPING_SPEED_WINDOW_MS = 3e5, _dd.MIN_CHARS_FOR_RELIABLE_SPEED = 20, _dd), UDe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, X4 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Z4 = class extends D {
  get isAcceptingPartially() {
    return this._isAcceptingPartially;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10, u10, d10, f10, p10) {
    super(), this.textModel = e206, this._selectedSuggestItem = t10, this._textModelVersionId = n10, this._positions = r10, this._debounceValue = i10, this._enabled = a10, this._editor = o10, this._instantiationService = s10, this._commandService = c10, this._languageConfigurationService = l10, this._accessibilityService = u10, this._languageFeaturesService = d10, this._codeEditorService = f10, this._inlineCompletionsService = p10, this._isActive = Ic(this, false), this._onlyRequestInlineEditsSignal = _D2(this), this._forceUpdateExplicitlySignal = _D2(this), this._noDelaySignal = _D2(this), this._fetchSpecificProviderSignal = _D2(this), this._selectedInlineCompletionId = Ic(this, void 0), this.primaryPosition = I(this, (e207) => this._positions.read(e207)[0] ?? new j(1, 1)), this.allPositions = I(this, (e207) => this._positions.read(e207)), this._isAcceptingPartially = false, this._appearedInsideViewport = I(this, (e207) => {
      let t11 = this.state.read(e207);
      return !t11 || !t11.inlineCompletion ? false : GDe(this._editor, t11.inlineCompletion);
    }), this._onDidAccept = new k(), this.onDidAccept = this._onDidAccept.event, this._lastShownInlineCompletionInfo = void 0, this._lastAcceptedInlineCompletionInfo = void 0, this._didUndoInlineEdits = fc({ owner: this, changeTracker: { createChangeSummary: () => ({ didUndo: false }), handleChange: (e207, t11) => (t11.didUndo = e207.didChange(this._textModelVersionId) && !!e207.change?.isUndoing, true) } }, (e207, t11) => {
      let n11 = this._textModelVersionId.read(e207);
      return n11 !== null && this._lastAcceptedInlineCompletionInfo && this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === n11 - 1 && this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit && t11.didUndo ? (this._lastAcceptedInlineCompletionInfo = void 0, true) : false;
    }), this._preserveCurrentCompletionReasons = /* @__PURE__ */ new Set([Q4.Redo, Q4.Undo, Q4.AcceptWord]), this.dontRefetchSignal = _D2(this), this._fetchInlineCompletionsPromise = fc({ owner: this, changeTracker: { createChangeSummary: () => ({ dontRefetch: false, preserveCurrentCompletion: false, inlineCompletionTriggerKind: gi.Automatic, onlyRequestInlineEdits: false, shouldDebounce: true, provider: void 0, textChange: false, changeReason: `` }), handleChange: (e207, t11) => {
      if (e207.didChange(this._textModelVersionId)) {
        this._preserveCurrentCompletionReasons.has(this._getReason(e207.change)) && (t11.preserveCurrentCompletion = true);
        let n11 = e207.change?.detailedReasons ?? [];
        t11.changeReason = n11.length > 0 ? n11[0].getType() : ``, t11.textChange = true;
      } else e207.didChange(this._forceUpdateExplicitlySignal) ? (t11.preserveCurrentCompletion = true, t11.inlineCompletionTriggerKind = gi.Explicit) : e207.didChange(this.dontRefetchSignal) ? t11.dontRefetch = true : e207.didChange(this._onlyRequestInlineEditsSignal) ? t11.onlyRequestInlineEdits = true : e207.didChange(this._fetchSpecificProviderSignal) && (t11.provider = e207.change);
      return true;
    } } }, (e207, t11) => {
      if (this._source.clearOperationOnTextModelChange.read(e207), this._noDelaySignal.read(e207), this.dontRefetchSignal.read(e207), this._onlyRequestInlineEditsSignal.read(e207), this._forceUpdateExplicitlySignal.read(e207), this._fetchSpecificProviderSignal.read(e207), !((this._enabled.read(e207) && this._selectedSuggestItem.read(e207) || this._isActive.read(e207)) && (!this._inlineCompletionsService.isSnoozing() || t11.inlineCompletionTriggerKind === gi.Explicit))) {
        this._source.cancelUpdate();
        return;
      }
      this._textModelVersionId.read(e207);
      let n11 = this._source.suggestWidgetInlineCompletions.read(void 0), r11 = this._selectedSuggestItem.read(e207);
      if (this._shouldShowOnSuggestConflict.read(void 0) && (r11 = void 0), n11 && !r11 && this._source.seedInlineCompletionsWithSuggestWidget(), t11.dontRefetch) return Promise.resolve(true);
      if (this._didUndoInlineEdits.read(e207) && t11.inlineCompletionTriggerKind !== gi.Explicit) {
        bc((e208) => {
          this._source.clear(e208);
        });
        return;
      }
      let i11 = ``;
      t11.provider ? i11 += `providerOnDidChange` : t11.inlineCompletionTriggerKind === gi.Explicit && (i11 += `explicit`), t11.changeReason && (i11 += i11.length > 0 ? `:${t11.changeReason}` : t11.changeReason);
      let a11 = this._typing.getTypingInterval(), o11 = { editorType: this.editorType, startTime: Date.now(), languageId: this.textModel.getLanguageId(), reason: i11, typingInterval: a11.averageInterval, typingIntervalCharacterCount: a11.characterCount, availableProviders: [] }, s11 = { triggerKind: t11.inlineCompletionTriggerKind, selectedSuggestionInfo: r11?.toSelectedSuggestionInfo(), includeInlineCompletions: !t11.onlyRequestInlineEdits, includeInlineEdits: this._inlineEditsEnabled.read(e207), requestIssuedDateTime: o11.startTime, earliestShownDateTime: o11.startTime + (t11.inlineCompletionTriggerKind === gi.Explicit || this.inAcceptFlow.read(void 0) ? 0 : this._minShowDelay.read(void 0)) };
      s11.triggerKind === gi.Automatic && t11.textChange && this.textModel.getAlternativeVersionId() === this._lastShownInlineCompletionInfo?.alternateTextModelVersionId && (s11 = { ...s11, includeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit, includeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit });
      let c11 = this.selectedInlineCompletion.read(void 0) ?? this._inlineCompletionItems.read(void 0)?.inlineEdit, l11 = t11.preserveCurrentCompletion || c11?.forwardStable ? c11 : void 0, u11 = this._jumpedToId.map((e208) => !!e208 && e208 === this._inlineCompletionItems.read(void 0)?.inlineEdit?.semanticId), d11 = t11.provider ? { providers: [t11.provider], label: `single:` + t11.provider.providerId?.toString() } : { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: void 0 }, f11 = this.getAvailableProviders(d11.providers);
      return o11.availableProviders = f11.map((e208) => e208.providerId).filter(Ke), this._source.fetch(f11, d11.label, s11, l11?.identity, t11.shouldDebounce, u11, o11);
    }), this._inlineCompletionItems = dc({ owner: this }, (e207) => {
      let t11 = this._source.inlineCompletions.read(e207);
      if (!t11) return;
      let n11 = this.primaryPosition.read(e207), r11, i11 = [];
      for (let e208 of t11.inlineCompletions) e208.isInlineEdit ? r11 = e208 : e208.isVisible(this.textModel, n11) && i11.push(e208);
      return i11.length !== 0 && (r11 = void 0), { inlineCompletions: i11, inlineEdit: r11 };
    }), this._filteredInlineCompletionItems = dc({ owner: this, equalsFn: qs() }, (e207) => this._inlineCompletionItems.read(e207)?.inlineCompletions ?? []), this.selectedInlineCompletionIndex = I(this, (e207) => {
      let t11 = this._selectedInlineCompletionId.read(e207), n11 = this._filteredInlineCompletionItems.read(e207), r11 = this._selectedInlineCompletionId === void 0 ? -1 : n11.findIndex((e208) => e208.semanticId === t11);
      return r11 === -1 ? (this._selectedInlineCompletionId.set(void 0, void 0), 0) : r11;
    }), this.selectedInlineCompletion = I(this, (e207) => this._filteredInlineCompletionItems.read(e207)[this.selectedInlineCompletionIndex.read(e207)]), this.activeCommands = dc({ owner: this, equalsFn: qs() }, (e207) => this.selectedInlineCompletion.read(e207)?.source.inlineSuggestions.commands ?? []), this.inlineCompletionsCount = I(this, (e207) => {
      if (this.lastTriggerKind.read(e207) === gi.Explicit) return this._filteredInlineCompletionItems.read(e207).length;
    }), this._hasVisiblePeekWidgets = I(this, (e207) => this._editorObs.openedPeekWidgets.read(e207) > 0), this._shouldShowOnSuggestConflict = I(this, (e207) => {
      let t11 = this._showOnSuggestConflict.read(e207);
      if (t11 !== `never` && this.selectedInlineCompletion.read(e207)) {
        let n11 = this._selectedSuggestItem.read(e207);
        return n11 ? t11 === `whenSuggestListIsIncomplete` ? n11.listIncomplete : true : false;
      }
      return false;
    }), this.state = dc({ owner: this, equalsFn: (e207, t11) => !e207 || !t11 ? e207 === t11 : e207.kind === `ghostText` && t11.kind === `ghostText` ? S4(e207.ghostTexts, t11.ghostTexts) && e207.inlineCompletion === t11.inlineCompletion && e207.suggestItem === t11.suggestItem : e207.kind === `inlineEdit` && t11.kind === `inlineEdit` ? e207.inlineEdit.equals(t11.inlineEdit) : false }, (e207) => {
      let t11 = this.textModel;
      if (this._suppressInSnippetMode.read(e207) && this._isInSnippetMode.read(e207)) return;
      let n11 = this._inlineCompletionItems.read(e207), r11 = n11?.inlineEdit;
      if (r11) {
        if (this._hasVisiblePeekWidgets.read(e207)) return;
        let i12 = r11.getSingleTextEdit();
        i12 = w4(i12, t11);
        let a11 = this.primaryPosition.map((e208) => zm.fromRangeInclusive(r11.targetRange).addMargin(1, 1).contains(e208.lineNumber)), o11 = r11.source.inlineSuggestions.commands, s11 = new VDe(i12, o11 ?? [], r11), c11 = r11.updatedEdit;
        return { kind: `inlineEdit`, inlineEdit: s11, inlineCompletion: r11, edits: c11 ? Jm.fromStringEdit(c11, new aq(this.textModel)).replacements : [i12], cursorAtInlineEdit: a11, nextEditUri: (n11.inlineEdit?.command?.id === `vscode.open` || n11.inlineEdit?.command?.id === `_workbench.open`) && n11.inlineEdit?.command.arguments?.length ? $r.from(n11.inlineEdit?.command.arguments[0]) : void 0 };
      }
      let i11 = this._selectedSuggestItem.read(e207);
      if (!this._shouldShowOnSuggestConflict.read(e207) && i11) {
        let n12 = w4(i11.getSingleTextEdit(), t11), r12 = this._computeAugmentation(n12, e207);
        if (!this._suggestPreviewEnabled.read(e207) && !r12) return;
        let a11 = r12?.edit ?? n12, o11 = r12 ? r12.edit.text.length - n12.text.length : 0, s11 = this._suggestPreviewMode.read(e207), c11 = this._positions.read(e207), l11 = [a11, ...$4(this.textModel, c11, a11)].map((e208, n13) => ({ edit: e208, ghostText: e208 ? E4(e208, t11, s11, c11[n13], o11) : void 0 })).filter(({ edit: e208, ghostText: t12 }) => e208 !== void 0 && t12 !== void 0), u11 = l11.map(({ edit: e208 }) => e208), d11 = l11.map(({ ghostText: e208 }) => e208);
        return { kind: `ghostText`, edits: u11, primaryGhostText: d11[0] ?? new y4(a11.range.endLineNumber, []), ghostTexts: d11, inlineCompletion: r12?.completion, suggestItem: i11 };
      } else {
        if (!this._isActive.read(e207)) return;
        let n12 = this.selectedInlineCompletion.read(e207);
        if (!n12) return;
        let r12 = n12.getSingleTextEdit(), i12 = this._inlineSuggestMode.read(e207), a11 = this._positions.read(e207), o11 = [r12, ...$4(this.textModel, a11, r12)].map((e208, n13) => ({ edit: e208, ghostText: e208 ? E4(e208, t11, i12, a11[n13], 0) : void 0 })).filter(({ edit: e208, ghostText: t12 }) => e208 !== void 0 && t12 !== void 0), s11 = o11.map(({ edit: e208 }) => e208), c11 = o11.map(({ ghostText: e208 }) => e208);
        return c11[0] ? { kind: `ghostText`, edits: s11, primaryGhostText: c11[0], ghostTexts: c11, inlineCompletion: n12, suggestItem: void 0 } : void 0;
      }
    }), this.inlineCompletionState = I(this, (e207) => {
      let t11 = this.state.read(e207);
      if (!(!t11 || t11.kind !== `ghostText`) && !this._editorObs.inComposition.read(e207)) return t11;
    }), this.inlineEditState = I(this, (e207) => {
      let t11 = this.state.read(e207);
      if (!(!t11 || t11.kind !== `inlineEdit`)) return t11;
    }), this.inlineEditAvailable = I(this, (e207) => !!this.inlineEditState.read(e207)), this.warning = I(this, (e207) => this.inlineCompletionState.read(e207)?.inlineCompletion?.warning), this.ghostTexts = dc({ owner: this, equalsFn: S4 }, (e207) => {
      let t11 = this.inlineCompletionState.read(e207);
      if (t11) return t11.ghostTexts;
    }), this.primaryGhostText = dc({ owner: this, equalsFn: C4 }, (e207) => {
      let t11 = this.inlineCompletionState.read(e207);
      if (t11) return t11?.primaryGhostText;
    }), this.showCollapsed = I(this, (e207) => {
      let t11 = this.state.read(e207);
      if (!t11 || t11.kind !== `inlineEdit` || t11.inlineCompletion.hint) return false;
      let n11 = t11.inlineCompletion.updatedEditModelVersion === this._textModelVersionId.read(e207);
      return (this._inlineEditsShowCollapsedEnabled.read(e207) || !n11) && this._jumpedToId.read(e207) !== t11.inlineCompletion.semanticId && !this._inAcceptFlow.read(e207);
    }), this._tabShouldIndent = I(this, (e207) => {
      if (this._inAcceptFlow.read(e207)) return false;
      function t11(e208) {
        return e208.startLineNumber !== e208.endLineNumber;
      }
      function n11(e208, t12) {
        let n12 = e208.getLineIndentColumn(t12), r11 = e208.getLineLastNonWhitespaceColumn(t12);
        return new M(t12, n12, t12, Math.max(r11, n12));
      }
      return this._editorObs.selections.read(e207)?.some((e208) => e208.isEmpty() ? this.textModel.getLineLength(e208.startLineNumber) === 0 : t11(e208) || e208.containsRange(n11(this.textModel, e208.startLineNumber)));
    }), this.tabShouldJumpToInlineEdit = I(this, (e207) => {
      if (this._tabShouldIndent.read(e207)) return false;
      let t11 = this.inlineEditState.read(e207);
      return t11 ? this.showCollapsed.read(e207) ? true : this._inAcceptFlow.read(e207) && this._appearedInsideViewport.read(e207) && !t11.inlineCompletion.hint?.jumpToEdit ? false : !t11.cursorAtInlineEdit.read(e207) : false;
    }), this.tabShouldAcceptInlineEdit = I(this, (e207) => {
      let t11 = this.inlineEditState.read(e207);
      return !t11 || this.showCollapsed.read(e207) || this._tabShouldIndent.read(e207) ? false : this._inAcceptFlow.read(e207) && this._appearedInsideViewport.read(e207) && !t11.inlineCompletion.hint?.jumpToEdit || t11.inlineCompletion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(e207) || this._jumpedToId.read(e207) === t11.inlineCompletion.semanticId ? true : t11.cursorAtInlineEdit.read(e207);
    }), this._jumpedToId = Ic(this, void 0), this._inAcceptFlow = Ic(this, false), this.inAcceptFlow = this._inAcceptFlow, this._source = this._register(this._instantiationService.createInstance(J4, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition)), this.lastTriggerKind = this._source.inlineCompletions.map(this, (e207) => e207?.request?.context.triggerKind), this._editorObs = WK(this._editor);
    let m10 = this._editorObs.getOption(134);
    this._suggestPreviewEnabled = m10.map((e207) => e207.preview), this._suggestPreviewMode = m10.map((e207) => e207.previewMode);
    let h10 = this._editorObs.getOption(71);
    this._inlineSuggestMode = h10.map((e207) => e207.mode), this._suppressedInlineCompletionGroupIds = h10.map((e207) => new Set(e207.experimental.suppressInlineSuggestions.split(`,`))), this._inlineEditsEnabled = h10.map((e207) => !!e207.edits.enabled), this._inlineEditsShowCollapsedEnabled = h10.map((e207) => e207.edits.showCollapsed), this._triggerCommandOnProviderChange = h10.map((e207) => e207.triggerCommandOnProviderChange), this._minShowDelay = h10.map((e207) => e207.minShowDelay), this._showOnSuggestConflict = h10.map((e207) => e207.experimental.showOnSuggestConflict), this._suppressInSnippetMode = h10.map((e207) => e207.suppressInSnippetMode), this._isInSnippetMode = p4.get(this._editor)?.isInSnippetObservable ?? FI(false), this._typing = this._register(new HDe(this.textModel)), this._register(this._inlineCompletionsService.onDidChangeIsSnoozing((e207) => {
      e207 && this.stop();
    }));
    {
      let e207 = this.textModel.uri.scheme === `vscode-notebook-cell`, [t11] = this._codeEditorService.listDiffEditors().filter((e208) => e208.getOriginalEditor().getId() === this._editor.getId() || e208.getModifiedEditor().getId() === this._editor.getId());
      this.isInDiffEditor = !!t11, this.editorType = e207 ? W4.Notebook : this.isInDiffEditor ? W4.DiffEditor : W4.TextEditor;
    }
    this._register(kc(this.state, (e207) => {
      e207 && e207.inlineCompletion && this._inlineCompletionsService.reportNewCompletion(e207.inlineCompletion.requestUuid);
    })), this._register(kc(this._fetchInlineCompletionsPromise)), this._register(hc((e207) => {
      this._editorObs.versionId.read(e207), this._inAcceptFlow.set(false, void 0);
    })), this._register(hc((e207) => {
      this.state.map((e208, t11) => !e208 || e208.kind === `inlineEdit` && !e208.cursorAtInlineEdit.read(t11)).read(e207) && this._jumpedToId.set(void 0, void 0);
    }));
    let g10 = this.inlineEditState.map((e207) => e207?.inlineCompletion.semanticId);
    this._register(hc((e207) => {
      g10.read(e207) && (this._editor.pushUndoStop(), this._lastShownInlineCompletionInfo = { alternateTextModelVersionId: this.textModel.getAlternativeVersionId(), inlineCompletion: this.state.get().inlineCompletion });
    }));
    let _10 = Tc(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(e206));
    jc(this, _10, (e207, t11) => {
      e207.onDidChangeInlineCompletions && t11.add(e207.onDidChangeInlineCompletions(() => {
        if (!this._enabled.get() || (this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor()) !== this._editor) return;
        if (this._triggerCommandOnProviderChange.get()) {
          this.trigger(void 0, { onlyFetchInlineEdits: true });
          return;
        }
        let t12 = this.state.get();
        t12 && (t12.inlineCompletion || t12.edits) && t12.inlineCompletion?.source.provider !== e207 || bc((t13) => {
          this._fetchSpecificProviderSignal.trigger(t13, e207), this.trigger(t13);
        });
      }));
    }).recomputeInitiallyAndOnChange(this._store), this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store);
  }
  getIndentationInfo(e206) {
    let t10 = false, n10 = true, r10 = this?.primaryGhostText.read(e206);
    if (this?._selectedSuggestItem && r10 && r10.parts.length > 0) {
      let { column: e207, lines: i10 } = r10.parts[0], a10 = i10[0].line;
      if (e207 <= this.textModel.getLineIndentColumn(r10.lineNumber)) {
        let e208 = Ga(a10);
        e208 === -1 && (e208 = a10.length - 1), t10 = e208 > 0;
        let r11 = this.textModel.getOptions().tabSize;
        n10 = Ub.visibleColumnFromColumn(a10, e208 + 1, r11) < r11;
      }
    }
    return { startsWithIndentation: t10, startsWithIndentationLessThanTabSize: n10 };
  }
  _getReason(e206) {
    return e206?.isUndoing ? Q4.Undo : e206?.isRedoing ? Q4.Redo : this.isAcceptingPartially ? Q4.AcceptWord : Q4.Other;
  }
  getAvailableProviders(e206) {
    let t10 = this._suppressedInlineCompletionGroupIds.get(), n10 = e206.filter((e207) => !(e207.groupId && t10.has(e207.groupId))), r10 = /* @__PURE__ */ new Set();
    for (let e207 of n10) e207.excludesGroupIds?.forEach((e208) => r10.add(e208));
    let i10 = [];
    for (let e207 of n10) e207.groupId && r10.has(e207.groupId) || i10.push(e207);
    return i10;
  }
  async trigger(e206, t10 = {}) {
    Cc(e206, (e207) => {
      t10.onlyFetchInlineEdits && this._onlyRequestInlineEditsSignal.trigger(e207), t10.noDelay && this._noDelaySignal.trigger(e207), this._isActive.set(true, e207), t10.explicit && (this._inAcceptFlow.set(true, e207), this._forceUpdateExplicitlySignal.trigger(e207)), t10.provider && this._fetchSpecificProviderSignal.trigger(e207, t10.provider);
    }), await this._fetchInlineCompletionsPromise.get();
  }
  async triggerExplicitly(e206, t10 = false) {
    return this.trigger(e206, { onlyFetchInlineEdits: t10, explicit: true });
  }
  stop(e206 = `automatic`, t10) {
    Cc(t10, (t11) => {
      if (e206 === `explicitCancel`) {
        let e207 = this.state.get()?.inlineCompletion;
        e207 && e207.reportEndOfLife({ kind: bi.Rejected });
      }
      this._isActive.set(false, t11), this._source.clear(t11);
    });
  }
  _computeAugmentation(e206, t10) {
    let n10 = this.textModel, r10 = this._source.suggestWidgetInlineCompletions.read(t10);
    return Rm(r10 ? r10.inlineCompletions.filter((e207) => !e207.isInlineEdit) : [this.selectedInlineCompletion.read(t10)].filter(Ke), (t11) => {
      let r11 = t11.getSingleTextEdit();
      return r11 = w4(r11, n10, M.fromPositions(r11.range.getStartPosition(), e206.range.getEndPosition())), T4(r11, e206) ? { completion: t11, edit: r11 } : void 0;
    });
  }
  async _deltaSelectedInlineCompletionIndex(e206) {
    await this.triggerExplicitly();
    let t10 = this._filteredInlineCompletionItems.get() || [];
    if (t10.length > 0) {
      let n10 = (this.selectedInlineCompletionIndex.get() + e206 + t10.length) % t10.length;
      this._selectedInlineCompletionId.set(t10[n10].semanticId, void 0);
    } else this._selectedInlineCompletionId.set(void 0, void 0);
  }
  async next() {
    await this._deltaSelectedInlineCompletionIndex(1);
  }
  async previous() {
    await this._deltaSelectedInlineCompletionIndex(-1);
  }
  _getMetadata(e206, t10, n10 = void 0) {
    return n10 ? mE.inlineCompletionPartialAccept({ nes: e206.isInlineEdit, requestUuid: e206.requestUuid, providerId: e206.source.provider.providerId, languageId: t10, type: n10 }) : mE.inlineCompletionAccept({ nes: e206.isInlineEdit, requestUuid: e206.requestUuid, providerId: e206.source.provider.providerId, languageId: t10 });
  }
  async accept(e206 = this._editor) {
    if (e206.getModel() !== this.textModel) throw new je();
    let t10, n10 = false, r10 = this.state.get();
    if (r10?.kind === `ghostText`) {
      if (!r10 || r10.primaryGhostText.isEmpty() || !r10.inlineCompletion) return;
      t10 = r10.inlineCompletion;
    } else if (r10?.kind === `inlineEdit`) t10 = r10.inlineCompletion, n10 = !!r10.nextEditUri;
    else return;
    t10.addRef();
    try {
      if (e206.pushUndoStop(), !n10) if (t10.snippetInfo) {
        let n11 = Ym.delete(t10.editRange), r11 = t10.additionalTextEdits.map((e207) => new Ym(M.lift(e207.range), e207.text ?? ``)), i10 = Jm.fromParallelReplacementsUnsorted([n11, ...r11]);
        e206.edit(i10, this._getMetadata(t10, this.textModel.getLanguageId())), e206.setPosition(t10.snippetInfo.range.getStartPosition(), `inlineCompletionAccept`), p4.get(e206)?.insert(t10.snippetInfo.snippet, { undoStopBefore: false });
      } else {
        let n11 = r10.edits, i10 = n11;
        r10.kind === `ghostText` && (i10 = aDe(n11, this.textModel));
        let a10 = g4(i10).map((e207) => N.fromPositions(e207)), o10 = t10.additionalTextEdits.map((e207) => new Ym(M.lift(e207.range), e207.text ?? ``)), s10 = Jm.fromParallelReplacementsUnsorted([...n11, ...o10]);
        if (e206.edit(s10, this._getMetadata(t10, this.textModel.getLanguageId())), t10.hint === void 0 && e206.setSelections(r10.kind === `inlineEdit` ? a10.slice(-1) : a10, `inlineCompletionAccept`), r10.kind === `inlineEdit` && !this._accessibilityService.isMotionReduced()) {
          let t11 = s10.getNewRanges(), n12 = this._store.add(new WDe(e206, t11, () => {
            this._store.delete(n12);
          }));
        }
      }
      this._onDidAccept.fire(), this.stop(), t10.command && await this._commandService.executeCommand(t10.command.id, ...t10.command.arguments || []).then(void 0, xe), t10.reportEndOfLife({ kind: bi.Accepted });
    } finally {
      t10.removeRef(), this._inAcceptFlow.set(true, void 0), this._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: t10 };
    }
  }
  async acceptNextWord() {
    await this._acceptNext(this._editor, `word`, (e206, t10) => {
      let n10 = this.textModel.getLanguageIdAtPosition(e206.lineNumber, e206.column), r10 = this._languageConfigurationService.getLanguageConfiguration(n10), i10 = new RegExp(r10.wordDefinition.source, r10.wordDefinition.flags.replace(`g`, ``)), a10 = t10.match(i10), o10 = 0;
      o10 = a10 && a10.index !== void 0 ? a10.index === 0 ? a10[0].length : a10.index : t10.length;
      let s10 = /\s+/g.exec(t10);
      return s10 && s10.index !== void 0 && s10.index + s10[0].length < o10 && (o10 = s10.index + s10[0].length), o10;
    }, 0);
  }
  async acceptNextLine() {
    await this._acceptNext(this._editor, `line`, (e206, t10) => {
      let n10 = t10.match(/\n/);
      return n10 && n10.index !== void 0 ? n10.index + 1 : t10.length;
    }, 1);
  }
  async _acceptNext(e206, t10, n10, r10) {
    if (e206.getModel() !== this.textModel) throw new je();
    let i10 = this.inlineCompletionState.get();
    if (!i10 || i10.primaryGhostText.isEmpty() || !i10.inlineCompletion) return;
    let a10 = i10.primaryGhostText, o10 = i10.inlineCompletion;
    if (o10.snippetInfo) {
      await this.accept(e206);
      return;
    }
    let s10 = a10.parts[0], c10 = new j(a10.lineNumber, s10.column), l10 = s10.text, u10 = n10(c10, l10);
    if (u10 === l10.length && a10.parts.length === 1) {
      this.accept(e206);
      return;
    }
    let d10 = l10.substring(0, u10), f10 = this._positions.get(), p10 = f10[0];
    o10.addRef();
    try {
      this._isAcceptingPartially = true;
      try {
        e206.pushUndoStop();
        let n12 = M.fromPositions(p10, c10), r11 = new Ym(n12, e206.getModel().getValueInRange(n12) + d10), i12 = [r11, ...$4(this.textModel, f10, r11)].filter(Ke), a11 = g4(i12).map((e207) => N.fromPositions(e207));
        e206.edit(Jm.fromParallelReplacementsUnsorted(i12), this._getMetadata(o10, t10)), e206.setSelections(a11, `inlineCompletionPartialAccept`), e206.revealPositionInCenterIfOutsideViewport(e206.getPosition(), 1);
      } finally {
        this._isAcceptingPartially = false;
      }
      let n11 = M.fromPositions(o10.editRange.getStartPosition(), Vm.ofText(d10).addToPosition(c10)), i11 = e206.getModel().getValueInRange(n11, 1).length;
      o10.reportPartialAccept(i11, { kind: r10, acceptedLength: i11 }, { characters: u10, ratio: u10 / l10.length, count: 1 });
    } finally {
      o10.removeRef();
    }
  }
  handleSuggestAccepted(e206) {
    let t10 = w4(e206.getSingleTextEdit(), this.textModel), n10 = this._computeAugmentation(t10, void 0);
    if (!n10) return;
    let r10 = this.textModel.getValueInRange(n10.completion.editRange, 1).length + t10.text.length;
    n10.completion.reportPartialAccept(t10.text.length, { kind: 2, acceptedLength: r10 }, { characters: t10.text.length, count: 1, ratio: 1 });
  }
  extractReproSample() {
    return { documentValue: this.textModel.getValue(), inlineCompletion: this.state.get()?.inlineCompletion?.getSourceCompletion() };
  }
  jump() {
    let e206 = this.inlineEditState.get();
    e206 && bc((t10) => {
      this._jumpedToId.set(e206.inlineCompletion.semanticId, t10), this.dontRefetchSignal.trigger(t10);
      let n10 = e206.inlineCompletion.targetRange, r10 = n10.getStartPosition();
      if (this._editor.setPosition(r10, `inlineCompletions.jump`), n10.isSingleLine() && (e206.inlineCompletion.hint || !e206.inlineCompletion.insertText.includes(`
`))) this._editor.revealPosition(r10);
      else {
        let e207 = new M(n10.startLineNumber - 1, 1, n10.endLineNumber + 1, 1);
        this._editor.revealRange(e207, 1);
      }
      e206.inlineCompletion.identity.setJumpTo(t10), this._editor.focus();
    });
  }
  async handleInlineSuggestionShown(e206, t10, n10) {
    await e206.reportInlineEditShown(this._commandService, t10, n10);
  }
};
Z4 = UDe([X4(7, V), X4(8, Mu), X4(9, bp), X4(10, e_), X4(11, X), X4(12, Su), X4(13, mF)], Z4);
var Q4;
(function(e206) {
  e206[e206.Undo = 0] = `Undo`, e206[e206.Redo = 1] = `Redo`, e206[e206.AcceptWord = 2] = `AcceptWord`, e206[e206.Other = 3] = `Other`;
})(Q4 || (Q4 = {}));
function $4(e206, t10, n10) {
  if (t10.length === 1) return [];
  let r10 = new aq(e206), i10 = r10.getTransformer(), a10 = i10.getOffset(t10[0]), o10 = t10.slice(1).map((e207) => i10.getOffset(e207));
  n10 = n10.removeCommonPrefixAndSuffix(r10);
  let s10 = i10.getStringReplacement(n10), c10 = s10.replaceRange.start - a10, l10 = s10.replaceRange.join(Tm.emptyAt(a10)), u10 = r10.getValueOfOffsetRange(l10);
  return o10.map((e207) => {
    let t11 = e207 + c10, n11 = new Tm(t11, t11 + s10.replaceRange.length), a11 = n11.join(Tm.emptyAt(e207));
    if (r10.getValueOfOffsetRange(a11) !== u10) return;
    let o11 = new Vw(n11, s10.newText);
    return i10.getTextReplacement(o11);
  }).filter(Ke);
}
var WDe = class extends D {
  constructor(e206, t10, n10) {
    super(), n10 && this._register({ dispose: () => n10() }), this._register(WK(e206).setDecorations(FI(t10.map((e207) => ({ range: e207, options: { description: `animation`, className: `edits-fadeout-decoration`, zIndex: 1 } })))));
    let r10 = new cDe(1, 0, 1e3, uDe), i10 = new dDe(r10);
    this._register(hc((t11) => {
      let n11 = i10.getValue(t11);
      e206.getContainerDomNode().style.setProperty(`--animation-opacity`, n11.toString()), r10.isFinished() && this.dispose();
    }));
  }
};
function GDe(e206, t10) {
  let n10 = t10.targetRange, r10 = e206.getVisibleRanges();
  return r10.length < 1 ? false : new M(r10[0].startLineNumber, r10[0].startColumn, r10[r10.length - 1].endLineNumber, r10[r10.length - 1].endColumn).containsRange(n10);
}
var KDe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, e310 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, t3, n3 = class {
  constructor(e206) {
    this.name = e206;
  }
  select(e206, t10, n10) {
    if (n10.length === 0) return 0;
    let r10 = n10[0].score[0];
    for (let e207 = 0; e207 < n10.length; e207++) {
      let { score: t11, completion: i10 } = n10[e207];
      if (t11[0] !== r10) break;
      if (i10.preselect) return e207;
    }
    return 0;
  }
}, r3 = class extends n3 {
  constructor() {
    super(`first`);
  }
  memorize(e206, t10, n10) {
  }
  toJSON() {
  }
  fromJSON() {
  }
}, qDe = class extends n3 {
  constructor() {
    super(`recentlyUsed`), this._cache = new Td(300, 0.66), this._seq = 0;
  }
  memorize(e206, t10, n10) {
    let r10 = `${e206.getLanguageId()}/${n10.textLabel}`;
    this._cache.set(r10, { touch: this._seq++, type: n10.completion.kind, insertText: n10.completion.insertText });
  }
  select(e206, t10, n10) {
    if (n10.length === 0) return 0;
    let r10 = e206.getLineContent(t10.lineNumber).substr(t10.column - 10, t10.column - 1);
    if (/\s$/.test(r10)) return super.select(e206, t10, n10);
    let i10 = n10[0].score[0], a10 = -1, o10 = -1, s10 = -1;
    for (let t11 = 0; t11 < n10.length && n10[t11].score[0] === i10; t11++) {
      let r11 = `${e206.getLanguageId()}/${n10[t11].textLabel}`, i11 = this._cache.peek(r11);
      if (i11 && i11.touch > s10 && i11.type === n10[t11].completion.kind && i11.insertText === n10[t11].completion.insertText && (s10 = i11.touch, o10 = t11), n10[t11].completion.preselect && a10 === -1) return a10 = t11;
    }
    return o10 === -1 ? a10 === -1 ? 0 : a10 : o10;
  }
  toJSON() {
    return this._cache.toJSON();
  }
  fromJSON(e206) {
    this._cache.clear();
    for (let [t10, n10] of e206) n10.touch = 0, n10.type = typeof n10.type == `number` ? n10.type : hi.fromString(n10.type), this._cache.set(t10, n10);
    this._seq = this._cache.size;
  }
}, JDe = class extends n3 {
  constructor() {
    super(`recentlyUsedByPrefix`), this._trie = KF.forStrings(), this._seq = 0;
  }
  memorize(e206, t10, n10) {
    let { word: r10 } = e206.getWordUntilPosition(t10), i10 = `${e206.getLanguageId()}/${r10}`;
    this._trie.set(i10, { type: n10.completion.kind, insertText: n10.completion.insertText, touch: this._seq++ });
  }
  select(e206, t10, n10) {
    let { word: r10 } = e206.getWordUntilPosition(t10);
    if (!r10) return super.select(e206, t10, n10);
    let i10 = `${e206.getLanguageId()}/${r10}`, a10 = this._trie.get(i10);
    if (a10 || (a10 = this._trie.findSubstr(i10)), a10) for (let e207 = 0; e207 < n10.length; e207++) {
      let { kind: t11, insertText: r11 } = n10[e207].completion;
      if (t11 === a10.type && r11 === a10.insertText) return e207;
    }
    return super.select(e206, t10, n10);
  }
  toJSON() {
    let e206 = [];
    return this._trie.forEach((t10, n10) => e206.push([n10, t10])), e206.sort((e207, t10) => -(e207[1].touch - t10[1].touch)).forEach((e207, t10) => e207[1].touch = t10), e206.slice(0, 200);
  }
  fromJSON(e206) {
    if (this._trie.clear(), e206.length > 0) {
      this._seq = e206[0][1].touch + 1;
      for (let [t10, n10] of e206) n10.type = typeof n10.type == `number` ? n10.type : hi.fromString(n10.type), this._trie.set(t10, n10);
    }
  }
}, i3 = (_ed = class {
  constructor(e206, t10) {
    this._storageService = e206, this._configService = t10, this._disposables = new E(), this._persistSoon = new us(() => this._saveState(), 500), this._disposables.add(e206.onWillSaveState((e207) => {
      e207.reason === fF.SHUTDOWN && this._saveState();
    }));
  }
  dispose() {
    this._disposables.dispose(), this._persistSoon.dispose();
  }
  memorize(e206, t10, n10) {
    this._withStrategy(e206, t10).memorize(e206, t10, n10), this._persistSoon.schedule();
  }
  select(e206, t10, n10) {
    return this._withStrategy(e206, t10).select(e206, t10, n10);
  }
  _withStrategy(e206, t10) {
    let n10 = this._configService.getValue(`editor.suggestSelection`, { overrideIdentifier: e206.getLanguageIdAtPosition(t10.lineNumber, t10.column), resource: e206.uri });
    if (this._strategy?.name !== n10) {
      this._saveState(), this._strategy = new (t3._strategyCtors.get(n10) || r3)();
      try {
        let e207 = +!this._configService.getValue(`editor.suggest.shareSuggestSelections`), t11 = this._storageService.get(`${t3._storagePrefix}/${n10}`, e207);
        t11 && this._strategy.fromJSON(JSON.parse(t11));
      } catch {
      }
    }
    return this._strategy;
  }
  _saveState() {
    if (this._strategy) {
      let e206 = +!this._configService.getValue(`editor.suggest.shareSuggestSelections`), t10 = JSON.stringify(this._strategy);
      this._storageService.store(`${t3._storagePrefix}/${this._strategy.name}`, t10, e206, 1);
    }
  }
}, t3 = _ed, _ed._strategyCtors = /* @__PURE__ */ new Map([[`recentlyUsedByPrefix`, JDe], [`recentlyUsed`, qDe], [`first`, r3]]), _ed._storagePrefix = `suggest/memories`, _ed);
i3 = t3 = KDe([e310(0, dF), e310(1, Uf)], i3);
var a3 = xu(`ISuggestMemories`);
Zf(a3, i3, 1);
var YDe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, XDe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, o3, s3 = (_fd = class {
  constructor(e206, t10) {
    this._editor = e206, this._enabled = false, this._ckAtEnd = o3.AtEnd.bindTo(t10), this._configListener = this._editor.onDidChangeConfiguration((e207) => e207.hasChanged(139) && this._update()), this._update();
  }
  dispose() {
    this._configListener.dispose(), this._selectionListener?.dispose(), this._ckAtEnd.reset();
  }
  _update() {
    let e206 = this._editor.getOption(139) === `on`;
    if (this._enabled !== e206) if (this._enabled = e206, this._enabled) {
      let e207 = () => {
        if (!this._editor.hasModel()) {
          this._ckAtEnd.set(false);
          return;
        }
        let e208 = this._editor.getModel(), t10 = this._editor.getSelection(), n10 = e208.getWordAtPosition(t10.getStartPosition());
        if (!n10) {
          this._ckAtEnd.set(false);
          return;
        }
        this._ckAtEnd.set(n10.endColumn === t10.getStartPosition().column && t10.getStartPosition().lineNumber === t10.getEndPosition().lineNumber);
      };
      this._selectionListener = this._editor.onDidChangeCursorSelection(e207), e207();
    } else this._selectionListener && (this._selectionListener = (this._ckAtEnd.reset(), this._selectionListener.dispose(), void 0));
  }
}, o3 = _fd, _fd.AtEnd = new U(`atEndOfWord`, false, { type: `boolean`, description: C(1494, `A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled`) }), _fd);
s3 = o3 = YDe([XDe(1, nd)], s3);
var ZDe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, QDe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, c3, l3 = (_gd = class {
  constructor(e206, t10) {
    this._editor = e206, this._index = 0, this._ckOtherSuggestions = c3.OtherSuggestions.bindTo(t10);
  }
  dispose() {
    this.reset();
  }
  reset() {
    this._ckOtherSuggestions.reset(), this._listener?.dispose(), this._model = void 0, this._acceptNext = void 0, this._ignore = false;
  }
  set({ model: e206, index: t10 }, n10) {
    if (e206.items.length === 0) {
      this.reset();
      return;
    }
    if (c3._moveIndex(true, e206, t10) === t10) {
      this.reset();
      return;
    }
    this._acceptNext = n10, this._model = e206, this._index = t10, this._listener = this._editor.onDidChangeCursorPosition(() => {
      this._ignore || this.reset();
    }), this._ckOtherSuggestions.set(true);
  }
  static _moveIndex(e206, t10, n10) {
    let r10 = n10;
    for (let i10 = t10.items.length; i10 > 0 && (r10 = (r10 + t10.items.length + (e206 ? 1 : -1)) % t10.items.length, !(r10 === n10 || !t10.items[r10].completion.additionalTextEdits)); i10--) ;
    return r10;
  }
  next() {
    this._move(true);
  }
  prev() {
    this._move(false);
  }
  _move(e206) {
    if (this._model) try {
      this._ignore = true, this._index = c3._moveIndex(e206, this._model, this._index), this._acceptNext({ index: this._index, item: this._model.items[this._index], model: this._model });
    } finally {
      this._ignore = false;
    }
  }
}, c3 = _gd, _gd.OtherSuggestions = new U(`hasOtherSuggestions`, false), _gd);
l3 = c3 = ZDe([QDe(1, nd)], l3);
var $De = class {
  constructor(e206, t10, n10, r10) {
    this._disposables = new E(), this._disposables.add(n10.onDidSuggest((e207) => {
      e207.completionModel.items.length === 0 && this.reset();
    })), this._disposables.add(n10.onDidCancel((e207) => {
      this.reset();
    })), this._disposables.add(t10.onDidShow(() => this._onItem(t10.getFocusedItem()))), this._disposables.add(t10.onDidFocus(this._onItem, this)), this._disposables.add(t10.onDidHide(this.reset, this)), this._disposables.add(e206.onWillType((i10) => {
      if (this._active && !t10.isFrozen() && n10.state !== 0) {
        let t11 = i10.charCodeAt(i10.length - 1);
        this._active.acceptCharacters.has(t11) && e206.getOption(0) && r10(this._active.item);
      }
    }));
  }
  _onItem(e206) {
    if (!e206 || !v(e206.item.completion.commitCharacters)) {
      this.reset();
      return;
    }
    if (this._active && this._active.item.item === e206.item) return;
    let t10 = new Rp();
    for (let n10 of e206.item.completion.commitCharacters) n10.length > 0 && t10.add(n10.charCodeAt(0));
    this._active = { acceptCharacters: t10, item: e206 };
  }
  reset() {
    this._active = void 0;
  }
  dispose() {
    this._disposables.dispose();
  }
}, u3 = (_hd = class {
  async provideSelectionRanges(t10, n10) {
    let r10 = [];
    for (let i10 of n10) {
      let n11 = [];
      r10.push(n11);
      let a10 = /* @__PURE__ */ new Map();
      await new Promise((n12) => _hd._bracketsRightYield(n12, 0, t10, i10, a10)), await new Promise((r11) => _hd._bracketsLeftYield(r11, 0, t10, i10, a10, n11));
    }
    return r10;
  }
  static _bracketsRightYield(t10, n10, r10, i10, a10) {
    let o10 = /* @__PURE__ */ new Map(), s10 = Date.now();
    for (; ; ) {
      if (n10 >= _hd._maxRounds) {
        t10();
        break;
      }
      if (!i10) {
        t10();
        break;
      }
      let c10 = r10.bracketPairs.findNextBracket(i10);
      if (!c10) {
        t10();
        break;
      }
      if (Date.now() - s10 > _hd._maxDuration) {
        setTimeout(() => _hd._bracketsRightYield(t10, n10 + 1, r10, i10, a10));
        break;
      }
      if (c10.bracketInfo.isOpeningBracket) {
        let e206 = c10.bracketInfo.bracketText, t11 = o10.has(e206) ? o10.get(e206) : 0;
        o10.set(e206, t11 + 1);
      } else {
        let e206 = c10.bracketInfo.getOpeningBrackets()[0].bracketText, t11 = o10.has(e206) ? o10.get(e206) : 0;
        if (--t11, o10.set(e206, Math.max(0, t11)), t11 < 0) {
          let t12 = a10.get(e206);
          t12 || (t12 = new Qt(), a10.set(e206, t12)), t12.push(c10.range);
        }
      }
      i10 = c10.range.getEndPosition();
    }
  }
  static _bracketsLeftYield(t10, n10, r10, i10, a10, o10) {
    let s10 = /* @__PURE__ */ new Map(), c10 = Date.now();
    for (; ; ) {
      if (n10 >= _hd._maxRounds && a10.size === 0) {
        t10();
        break;
      }
      if (!i10) {
        t10();
        break;
      }
      let l10 = r10.bracketPairs.findPrevBracket(i10);
      if (!l10) {
        t10();
        break;
      }
      if (Date.now() - c10 > _hd._maxDuration) {
        setTimeout(() => _hd._bracketsLeftYield(t10, n10 + 1, r10, i10, a10, o10));
        break;
      }
      if (l10.bracketInfo.isOpeningBracket) {
        let t11 = l10.bracketInfo.bracketText, n11 = s10.has(t11) ? s10.get(t11) : 0;
        if (--n11, s10.set(t11, Math.max(0, n11)), n11 < 0) {
          let n12 = a10.get(t11);
          if (n12) {
            let i11 = n12.shift();
            n12.size === 0 && a10.delete(t11);
            let s11 = M.fromPositions(l10.range.getEndPosition(), i11.getStartPosition()), c11 = M.fromPositions(l10.range.getStartPosition(), i11.getEndPosition());
            o10.push({ range: s11 }), o10.push({ range: c11 }), _hd._addBracketLeading(r10, c11, o10);
          }
        }
      } else {
        let e206 = l10.bracketInfo.getOpeningBrackets()[0].bracketText, t11 = s10.has(e206) ? s10.get(e206) : 0;
        s10.set(e206, t11 + 1);
      }
      i10 = l10.range.getStartPosition();
    }
  }
  static _addBracketLeading(e206, t10, n10) {
    if (t10.startLineNumber === t10.endLineNumber) return;
    let r10 = t10.startLineNumber, i10 = e206.getLineFirstNonWhitespaceColumn(r10);
    i10 !== 0 && i10 !== t10.startColumn && (n10.push({ range: M.fromPositions(new j(r10, i10), t10.getEndPosition()) }), n10.push({ range: M.fromPositions(new j(r10, 1), t10.getEndPosition()) }));
    let a10 = r10 - 1;
    if (a10 > 0) {
      let r11 = e206.getLineFirstNonWhitespaceColumn(a10);
      r11 === t10.startColumn && r11 !== e206.getLineLastNonWhitespaceColumn(a10) && (n10.push({ range: M.fromPositions(new j(a10, r11), t10.getEndPosition()) }), n10.push({ range: M.fromPositions(new j(a10, 1), t10.getEndPosition()) }));
    }
  }
}, _hd._maxDuration = 30, _hd._maxRounds = 2, _hd), d3 = (_id = class {
  static async create(t10, n10) {
    if (!n10.getOption(134).localityBonus || !n10.hasModel()) return _id.None;
    let r10 = n10.getModel(), i10 = n10.getPosition();
    if (!t10.canComputeWordRanges(r10.uri)) return _id.None;
    let [a10] = await new u3().provideSelectionRanges(r10, [i10]);
    if (a10.length === 0) return _id.None;
    let o10 = await t10.computeWordRanges(r10.uri, a10[0].range);
    if (!o10) return _id.None;
    let s10 = r10.getWordUntilPosition(i10);
    return delete o10[s10.word], new class extends _id {
      distance(e206, t11) {
        if (!i10.equals(n10.getPosition())) return 0;
        if (t11.kind === 17) return 2 << 20;
        let r11 = o10[typeof t11.label == `string` ? t11.label : t11.label.label];
        if (_(r11)) return 2 << 20;
        let s11 = c(r11, M.fromPositions(e206), M.compareRangesUsingStarts), l10 = s11 >= 0 ? r11[s11] : r11[Math.max(0, ~s11 - 1)], u10 = a10.length;
        for (let e207 of a10) {
          if (!M.containsRange(e207.range, l10)) break;
          --u10;
        }
        return u10;
      }
    }();
  }
}, _id.None = new class extends _id {
  distance() {
    return 0;
  }
}(), _id), f3 = class {
  constructor(e206, t10) {
    this.leadingLineContent = e206, this.characterCountDelta = t10;
  }
}, p3 = class e195 {
  constructor(t10, n10, r10, i10, a10, o10, s10 = wM.default, c10 = void 0) {
    this.clipboardText = c10, this._snippetCompareFn = e195._compareCompletionItems, this._items = t10, this._column = n10, this._wordDistance = i10, this._options = a10, this._refilterKind = 1, this._lineContext = r10, this._fuzzyScoreOptions = s10, o10 === `top` ? this._snippetCompareFn = e195._compareCompletionItemsSnippetsUp : o10 === `bottom` && (this._snippetCompareFn = e195._compareCompletionItemsSnippetsDown);
  }
  get lineContext() {
    return this._lineContext;
  }
  set lineContext(e206) {
    (this._lineContext.leadingLineContent !== e206.leadingLineContent || this._lineContext.characterCountDelta !== e206.characterCountDelta) && (this._refilterKind = this._lineContext.characterCountDelta < e206.characterCountDelta && this._filteredItems ? 2 : 1, this._lineContext = e206);
  }
  get items() {
    return this._ensureCachedState(), this._filteredItems;
  }
  getItemsByProvider() {
    return this._ensureCachedState(), this._itemsByProvider;
  }
  getIncompleteProvider() {
    this._ensureCachedState();
    let e206 = /* @__PURE__ */ new Set();
    for (let [t10, n10] of this.getItemsByProvider()) n10.length > 0 && n10[0].container.incomplete && e206.add(t10);
    return e206;
  }
  get stats() {
    return this._ensureCachedState(), this._stats;
  }
  _ensureCachedState() {
    this._refilterKind !== 0 && this._createCachedState();
  }
  _createCachedState() {
    this._itemsByProvider = /* @__PURE__ */ new Map();
    let e206 = [], { leadingLineContent: t10, characterCountDelta: n10 } = this._lineContext, r10 = ``, i10 = ``, a10 = this._refilterKind === 1 ? this._items : this._filteredItems, o10 = [], s10 = !this._options.filterGraceful || a10.length > 2e3 ? TM : gpe;
    for (let c10 = 0; c10 < a10.length; c10++) {
      let l10 = a10[c10];
      if (l10.isInvalid) continue;
      let u10 = this._itemsByProvider.get(l10.provider);
      u10 ? u10.push(l10) : this._itemsByProvider.set(l10.provider, [l10]);
      let d10 = l10.position.column - l10.editStart.column, f10 = d10 + n10 - (l10.position.column - this._column);
      if (r10.length !== f10 && (r10 = f10 === 0 ? `` : t10.slice(-f10), i10 = r10.toLowerCase()), l10.word = r10, f10 === 0) l10.score = CM.Default;
      else {
        let e207 = 0;
        for (; e207 < d10; ) {
          let t11 = r10.charCodeAt(e207);
          if (t11 === 32 || t11 === 9) e207 += 1;
          else break;
        }
        if (e207 >= f10) l10.score = CM.Default;
        else if (typeof l10.completion.filterText == `string`) {
          let t11 = s10(r10, i10, e207, l10.completion.filterText, l10.filterTextLow, 0, this._fuzzyScoreOptions);
          if (!t11) continue;
          Xa(l10.completion.filterText, l10.textLabel) === 0 ? l10.score = t11 : (l10.score = lM(r10, i10, e207, l10.textLabel, l10.labelLow, 0), l10.score[0] = t11[0]);
        } else {
          let t11 = s10(r10, i10, e207, l10.textLabel, l10.labelLow, 0, this._fuzzyScoreOptions);
          if (!t11) continue;
          l10.score = t11;
        }
      }
      l10.idx = c10, l10.distance = this._wordDistance.distance(l10.position, l10.completion), o10.push(l10), e206.push(l10.textLabel.length);
    }
    this._filteredItems = o10.sort(this._snippetCompareFn), this._refilterKind = 0, this._stats = { pLabelLen: e206.length ? u(e206.length - 0.85, e206, (e207, t11) => e207 - t11) : 0 };
  }
  static _compareCompletionItems(e206, t10) {
    return e206.score[0] > t10.score[0] ? -1 : e206.score[0] < t10.score[0] ? 1 : e206.distance < t10.distance ? -1 : e206.distance > t10.distance ? 1 : e206.idx < t10.idx ? -1 : +(e206.idx > t10.idx);
  }
  static _compareCompletionItemsSnippetsDown(t10, n10) {
    if (t10.completion.kind !== n10.completion.kind) {
      if (t10.completion.kind === 28) return 1;
      if (n10.completion.kind === 28) return -1;
    }
    return e195._compareCompletionItems(t10, n10);
  }
  static _compareCompletionItemsSnippetsUp(t10, n10) {
    if (t10.completion.kind !== n10.completion.kind) {
      if (t10.completion.kind === 28) return -1;
      if (n10.completion.kind === 28) return 1;
    }
    return e195._compareCompletionItems(t10, n10);
  }
}, eOe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, m3 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, h3, g3 = class {
  static shouldAutoTrigger(e206) {
    if (!e206.hasModel()) return false;
    let t10 = e206.getModel(), n10 = e206.getPosition();
    t10.tokenization.tokenizeIfCheap(n10.lineNumber);
    let r10 = t10.getWordAtPosition(n10);
    return !(!r10 || r10.endColumn !== n10.column && r10.startColumn + 1 !== n10.column || !isNaN(Number(r10.word)));
  }
  constructor(e206, t10, n10) {
    this.leadingLineContent = e206.getLineContent(t10.lineNumber).substr(0, t10.column - 1), this.leadingWord = e206.getWordUntilPosition(t10), this.lineNumber = t10.lineNumber, this.column = t10.column, this.triggerOptions = n10;
  }
};
function tOe(e206, t10, n10) {
  if (!t10.getContextKeyValue(D2.inlineSuggestionVisible.key)) return true;
  let r10 = t10.getContextKeyValue(D2.suppressSuggestions.key);
  return r10 === void 0 ? !e206.getOption(71).suppressSuggestions : !r10;
}
function nOe(e206, t10, n10) {
  if (!t10.getContextKeyValue(`inlineSuggestionVisible`)) return true;
  let r10 = t10.getContextKeyValue(D2.suppressSuggestions.key);
  return r10 === void 0 ? !e206.getOption(71).suppressSuggestions : !r10;
}
var _3 = h3 = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10) {
    this._editor = e206, this._editorWorkerService = t10, this._clipboardService = n10, this._telemetryService = r10, this._logService = i10, this._contextKeyService = a10, this._configurationService = o10, this._languageFeaturesService = s10, this._envService = c10, this._toDispose = new E(), this._triggerCharacterListener = new E(), this._triggerQuickSuggest = new cs(), this._triggerState = void 0, this._completionDisposables = new E(), this._onDidCancel = new k(), this._onDidTrigger = new k(), this._onDidSuggest = new k(), this.onDidCancel = this._onDidCancel.event, this.onDidTrigger = this._onDidTrigger.event, this.onDidSuggest = this._onDidSuggest.event, this._currentSelection = this._editor.getSelection() || new N(1, 1, 1, 1), this._toDispose.add(this._editor.onDidChangeModel(() => {
      this._updateTriggerCharacters(), this.cancel();
    })), this._toDispose.add(this._editor.onDidChangeModelLanguage(() => {
      this._updateTriggerCharacters(), this.cancel();
    })), this._toDispose.add(this._editor.onDidChangeConfiguration(() => {
      this._updateTriggerCharacters();
    })), this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => {
      this._updateTriggerCharacters(), this._updateActiveSuggestSession();
    }));
    let l10 = false;
    this._toDispose.add(this._editor.onDidCompositionStart(() => {
      l10 = true;
    })), this._toDispose.add(this._editor.onDidCompositionEnd(() => {
      l10 = false, this._onCompositionEnd();
    })), this._toDispose.add(this._editor.onDidChangeCursorSelection((e207) => {
      l10 || this._onCursorChange(e207);
    })), this._toDispose.add(this._editor.onDidChangeModelContent(() => {
      !l10 && this._triggerState !== void 0 && this._refilterCompletionItems();
    })), this._updateTriggerCharacters();
  }
  dispose() {
    Kt(this._triggerCharacterListener), Kt([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]), this._toDispose.dispose(), this._completionDisposables.dispose(), this.cancel();
  }
  _updateTriggerCharacters() {
    if (this._triggerCharacterListener.clear(), this._editor.getOption(104) || !this._editor.hasModel() || !this._editor.getOption(137)) return;
    let e206 = /* @__PURE__ */ new Map();
    for (let t11 of this._languageFeaturesService.completionProvider.all(this._editor.getModel())) for (let n10 of t11.triggerCharacters || []) {
      let r10 = e206.get(n10);
      r10 || (r10 = /* @__PURE__ */ new Set(), e206.set(n10, r10)), r10.add(t11);
    }
    let t10 = (t11) => {
      if (!nOe(this._editor, this._contextKeyService, this._configurationService) || g3.shouldAutoTrigger(this._editor)) return;
      if (!t11) {
        let e207 = this._editor.getPosition();
        t11 = this._editor.getModel().getLineContent(e207.lineNumber).substr(0, e207.column - 1);
      }
      let n10 = ``;
      oo(t11.charCodeAt(t11.length - 1)) ? ao(t11.charCodeAt(t11.length - 2)) && (n10 = t11.substr(t11.length - 2)) : n10 = t11.charAt(t11.length - 1);
      let r10 = e206.get(n10);
      if (r10) {
        let e207 = /* @__PURE__ */ new Map();
        if (this._completionModel) for (let [t12, n11] of this._completionModel.getItemsByProvider()) r10.has(t12) || e207.set(t12, n11);
        this.trigger({ auto: true, triggerKind: 1, triggerCharacter: n10, retrigger: !!this._completionModel, clipboardText: this._completionModel?.clipboardText, completionOptions: { providerFilter: r10, providerItemsToReuse: e207 } });
      }
    };
    this._triggerCharacterListener.add(this._editor.onDidType(t10)), this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => t10()));
  }
  get state() {
    return this._triggerState ? this._triggerState.auto ? 2 : 1 : 0;
  }
  cancel(e206 = false) {
    this._triggerState !== void 0 && (this._triggerQuickSuggest.cancel(), this._requestToken?.cancel(), this._requestToken = void 0, this._triggerState = void 0, this._completionModel = void 0, this._context = void 0, this._onDidCancel.fire({ retrigger: e206 }));
  }
  clear() {
    this._completionDisposables.clear();
  }
  _updateActiveSuggestSession() {
    this._triggerState !== void 0 && (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel()) ? this.cancel() : this.trigger({ auto: this._triggerState.auto, retrigger: true }));
  }
  _onCursorChange(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._currentSelection;
    if (this._currentSelection = this._editor.getSelection(), !e206.selection.isEmpty() || e206.reason !== 0 && e206.reason !== 3 || e206.source !== `keyboard` && e206.source !== `deleteLeft`) {
      this.cancel();
      return;
    }
    this._triggerState === void 0 && e206.reason === 0 ? (t10.containsRange(this._currentSelection) || t10.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) && this._doTriggerQuickSuggest() : this._triggerState !== void 0 && e206.reason === 3 && this._refilterCompletionItems();
  }
  _onCompositionEnd() {
    this._triggerState === void 0 ? this._doTriggerQuickSuggest() : this._refilterCompletionItems();
  }
  _doTriggerQuickSuggest() {
    E2.isAllOff(this._editor.getOption(102)) || this._editor.getOption(134).snippetsPreventQuickSuggestions && p4.get(this._editor)?.isInSnippet() || (this.cancel(), this._triggerQuickSuggest.cancelAndSet(() => {
      if (this._triggerState !== void 0 || !g3.shouldAutoTrigger(this._editor) || !this._editor.hasModel() || !this._editor.hasWidgetFocus()) return;
      let e206 = this._editor.getModel(), t10 = this._editor.getPosition(), n10 = this._editor.getOption(102);
      if (!E2.isAllOff(n10)) {
        if (!E2.isAllOn(n10)) {
          e206.tokenization.tokenizeIfCheap(t10.lineNumber);
          let r10 = e206.tokenization.getLineTokens(t10.lineNumber), i10 = r10.getStandardTokenType(r10.findTokenIndexAtOffset(Math.max(t10.column - 1 - 1, 0)));
          if (E2.valueFor(n10, i10) !== `on`) return;
        }
        tOe(this._editor, this._contextKeyService, this._configurationService) && this._languageFeaturesService.completionProvider.has(e206) && this.trigger({ auto: true });
      }
    }, this._editor.getOption(103)));
  }
  _refilterCompletionItems() {
    Je(this._editor.hasModel()), Je(this._triggerState !== void 0);
    let e206 = new g3(this._editor.getModel(), this._editor.getPosition(), { ...this._triggerState, refilter: true });
    this._onNewContext(e206);
  }
  trigger(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._editor.getModel(), n10 = new g3(t10, this._editor.getPosition(), e206);
    this.cancel(e206.retrigger), this._triggerState = e206, this._onDidTrigger.fire({ auto: e206.auto, shy: e206.shy ?? false, position: this._editor.getPosition() }), this._context = n10;
    let r10 = { triggerKind: e206.triggerKind ?? 0 };
    e206.triggerCharacter && (r10 = { triggerKind: 1, triggerCharacter: e206.triggerCharacter }), this._requestToken = new pr();
    let i10 = this._editor.getOption(128), a10 = 1;
    switch (i10) {
      case `top`:
        a10 = 0;
        break;
      case `bottom`:
        a10 = 2;
        break;
    }
    let { itemKind: o10, showDeprecated: s10 } = h3.createSuggestFilter(this._editor), c10 = new S2(a10, e206.completionOptions?.kindFilter ?? o10, e206.completionOptions?.providerFilter, e206.completionOptions?.providerItemsToReuse, s10), l10 = d3.create(this._editorWorkerService, this._editor), u10 = C2(this._languageFeaturesService.completionProvider, t10, this._editor.getPosition(), c10, r10, this._requestToken.token);
    Promise.all([u10, l10]).then(async ([t11, n11]) => {
      if (this._requestToken?.dispose(), !this._editor.hasModel()) {
        t11.disposable.dispose();
        return;
      }
      let r11 = e206?.clipboardText;
      if (!r11 && t11.needsClipboard && (r11 = await this._clipboardService.readText()), this._triggerState === void 0) {
        t11.disposable.dispose();
        return;
      }
      let i11 = new g3(this._editor.getModel(), this._editor.getPosition(), e206), a11 = { ...wM.default, firstMatchCanBeWeak: !this._editor.getOption(134).matchOnWordStartOnly };
      if (this._completionModel = new p3(t11.items, this._context.column, { leadingLineContent: i11.leadingLineContent, characterCountDelta: i11.column - this._context.column }, n11, this._editor.getOption(134), this._editor.getOption(128), a11, r11), this._completionDisposables.add(t11.disposable), this._onNewContext(i11), this._reportDurationsTelemetry(t11.durations), !this._envService.isBuilt || this._envService.isExtensionDevelopment) for (let e207 of t11.items) e207.isInvalid && this._logService.warn(`[suggest] did IGNORE invalid completion item from ${e207.provider._debugDisplayName}`, e207.completion);
    }).catch(be);
  }
  _reportDurationsTelemetry(e206) {
    Math.random() > 1e-4 || setTimeout(() => {
      this._telemetryService.publicLog2(`suggest.durations.json`, { data: JSON.stringify(e206) }), this._logService.debug(`suggest.durations.json`, e206);
    });
  }
  static createSuggestFilter(e206) {
    let t10 = /* @__PURE__ */ new Set();
    e206.getOption(128) === `none` && t10.add(28);
    let n10 = e206.getOption(134);
    return n10.showMethods || t10.add(0), n10.showFunctions || t10.add(1), n10.showConstructors || t10.add(2), n10.showFields || t10.add(3), n10.showVariables || t10.add(4), n10.showClasses || t10.add(5), n10.showStructs || t10.add(6), n10.showInterfaces || t10.add(7), n10.showModules || t10.add(8), n10.showProperties || t10.add(9), n10.showEvents || t10.add(10), n10.showOperators || t10.add(11), n10.showUnits || t10.add(12), n10.showValues || t10.add(13), n10.showConstants || t10.add(14), n10.showEnums || t10.add(15), n10.showEnumMembers || t10.add(16), n10.showKeywords || t10.add(17), n10.showWords || t10.add(18), n10.showColors || t10.add(19), n10.showFiles || t10.add(20), n10.showReferences || t10.add(21), n10.showColors || t10.add(22), n10.showFolders || t10.add(23), n10.showTypeParameters || t10.add(24), n10.showSnippets || t10.add(28), n10.showUsers || t10.add(25), n10.showIssues || t10.add(26), { itemKind: t10, showDeprecated: n10.showDeprecated };
  }
  _onNewContext(e206) {
    if (this._context) {
      if (e206.lineNumber !== this._context.lineNumber) {
        this.cancel();
        return;
      }
      if (Ka(e206.leadingLineContent) !== Ka(this._context.leadingLineContent)) {
        this.cancel();
        return;
      }
      if (e206.column < this._context.column) {
        e206.leadingWord.word ? this.trigger({ auto: this._context.triggerOptions.auto, retrigger: true }) : this.cancel();
        return;
      }
      if (this._completionModel) {
        if (e206.leadingWord.word.length !== 0 && e206.leadingWord.startColumn > this._context.leadingWord.startColumn) {
          if (g3.shouldAutoTrigger(this._editor) && this._context) {
            let e207 = this._completionModel.getItemsByProvider();
            this.trigger({ auto: this._context.triggerOptions.auto, retrigger: true, clipboardText: this._completionModel.clipboardText, completionOptions: { providerItemsToReuse: e207 } });
          }
          return;
        }
        if (e206.column > this._context.column && this._completionModel.getIncompleteProvider().size > 0 && e206.leadingWord.word.length !== 0) {
          let e207 = /* @__PURE__ */ new Map(), t10 = /* @__PURE__ */ new Set();
          for (let [n10, r10] of this._completionModel.getItemsByProvider()) r10.length > 0 && r10[0].container.incomplete ? t10.add(n10) : e207.set(n10, r10);
          this.trigger({ auto: this._context.triggerOptions.auto, triggerKind: 2, retrigger: true, clipboardText: this._completionModel.clipboardText, completionOptions: { providerFilter: t10, providerItemsToReuse: e207 } });
        } else {
          let t10 = this._completionModel.lineContext, n10 = false;
          if (this._completionModel.lineContext = { leadingLineContent: e206.leadingLineContent, characterCountDelta: e206.column - this._context.column }, this._completionModel.items.length === 0) {
            let r10 = g3.shouldAutoTrigger(this._editor);
            if (!this._context) {
              this.cancel();
              return;
            }
            if (r10 && this._context.leadingWord.endColumn < e206.leadingWord.startColumn) {
              this.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });
              return;
            }
            if (this._context.triggerOptions.auto) {
              this.cancel();
              return;
            } else if (this._completionModel.lineContext = t10, n10 = this._completionModel.items.length > 0, n10 && e206.leadingWord.word.length === 0) {
              this.cancel();
              return;
            }
          }
          this._onDidSuggest.fire({ completionModel: this._completionModel, triggerOptions: e206.triggerOptions, isFrozen: n10 });
        }
      }
    }
  }
};
_3 = h3 = eOe([m3(1, HL), m3(2, hW), m3(3, bd), m3(4, Ud), m3(5, nd), m3(6, Uf), m3(7, X), m3(8, oA)], _3);
var rOe = (_jd = class {
  constructor(t10, n10) {
    this._disposables = new E(), this._lastOvertyped = [], this._locked = false, this._disposables.add(t10.onWillType(() => {
      if (this._locked || !t10.hasModel()) return;
      let n11 = t10.getSelections(), r10 = n11.length, i10 = false;
      for (let e206 = 0; e206 < r10; e206++) if (!n11[e206].isEmpty()) {
        i10 = true;
        break;
      }
      if (!i10) {
        this._lastOvertyped.length !== 0 && (this._lastOvertyped.length = 0);
        return;
      }
      this._lastOvertyped = [];
      let a10 = t10.getModel();
      for (let t11 = 0; t11 < r10; t11++) {
        let r11 = n11[t11];
        if (a10.getValueLengthInRange(r11) > _jd._maxSelectionLength) return;
        this._lastOvertyped[t11] = { value: a10.getValueInRange(r11), multiline: r11.startLineNumber !== r11.endLineNumber };
      }
    })), this._disposables.add(n10.onDidTrigger((e206) => {
      this._locked = true;
    })), this._disposables.add(n10.onDidCancel((e206) => {
      this._locked = false;
    }));
  }
  getLastOvertypedInfo(e206) {
    if (e206 >= 0 && e206 < this._lastOvertyped.length) return this._lastOvertyped[e206];
  }
  dispose() {
    this._disposables.dispose();
  }
}, _jd._maxSelectionLength = 51200, _jd), iOe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, v3 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, y3 = class {
  constructor(e206, t10, n10, r10, i10) {
    this._menuId = t10, this._menuService = r10, this._contextKeyService = i10, this._menuDisposables = new E(), this.element = z(e206, B(`.suggest-status-bar`));
    let a10 = ((e207) => e207 instanceof _d2 ? n10.createInstance(h_e, e207, { useComma: false }) : void 0);
    this._leftActions = new CL(this.element, { actionViewItemProvider: a10 }), this._rightActions = new CL(this.element, { actionViewItemProvider: a10 }), this._leftActions.domNode.classList.add(`left`), this._rightActions.domNode.classList.add(`right`);
  }
  dispose() {
    this._menuDisposables.dispose(), this._leftActions.dispose(), this._rightActions.dispose(), this.element.remove();
  }
  show() {
    let e206 = this._menuService.createMenu(this._menuId, this._contextKeyService), t10 = () => {
      let t11 = [], n10 = [];
      for (let [r10, i10] of e206.getActions()) r10 === `left` ? t11.push(...i10) : n10.push(...i10);
      this._leftActions.clear(), this._leftActions.push(t11), this._rightActions.clear(), this._rightActions.push(n10);
    };
    this._menuDisposables.add(e206.onDidChange(() => t10())), this._menuDisposables.add(e206);
  }
  hide() {
    this._menuDisposables.clear();
  }
};
y3 = iOe([v3(2, V), v3(3, pd), v3(4, nd)], y3);
var aOe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, b3 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
};
function x3(e206) {
  return !!e206 && !!(e206.completion.documentation || e206.completion.detail && e206.completion.detail !== e206.completion.label);
}
var S3 = class {
  constructor(e206, t10, n10) {
    this._editor = e206, this._themeService = t10, this._markdownRendererService = n10, this._onDidClose = new k(), this.onDidClose = this._onDidClose.event, this._onDidChangeContents = new k(), this.onDidChangeContents = this._onDidChangeContents.event, this._disposables = new E(), this._renderDisposeable = new E(), this._size = new ml(330, 0), this.domNode = B(`.suggest-details`), this.domNode.classList.add(`no-docs`), this._body = B(`.body`), this._scrollbar = new hx(this._body, { alwaysConsumeMouseWheel: true }), z(this.domNode, this._scrollbar.getDomNode()), this._disposables.add(this._scrollbar), this._header = z(this._body, B(`.header`)), this._close = z(this._header, B(`span` + ju.asCSSSelector(F.close))), this._close.title = C(1490, `Close`), this._close.role = `button`, this._close.tabIndex = -1, this._type = z(this._header, B(`p.type`)), this._docs = z(this._body, B(`p.docs`)), this._configureFont(), this._disposables.add(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(59) && this._configureFont();
    }));
  }
  dispose() {
    this._disposables.dispose(), this._renderDisposeable.dispose();
  }
  _configureFont() {
    let e206 = this._editor.getOptions(), t10 = e206.get(59), n10 = t10.getMassagedFontFamily(), r10 = e206.get(135) || t10.fontSize, i10 = e206.get(136) || t10.lineHeight, a10 = t10.fontWeight, o10 = `${r10}px`, s10 = `${i10}px`;
    this.domNode.style.fontSize = o10, this.domNode.style.lineHeight = `${i10 / r10}`, this.domNode.style.fontWeight = a10, this.domNode.style.fontFeatureSettings = t10.fontFeatureSettings, this._type.style.fontFamily = n10, this._close.style.height = s10, this._close.style.width = s10;
  }
  getLayoutInfo() {
    let e206 = this._editor.getOption(136) || this._editor.getOption(59).lineHeight, t10 = Fb(this._themeService.getColorTheme().type) ? 2 : 1;
    return { lineHeight: e206, borderWidth: t10, borderHeight: t10 * 2, verticalPadding: 22, horizontalPadding: 14 };
  }
  renderLoading() {
    this._type.textContent = C(1491, `Loading...`), this._docs.textContent = ``, this.domNode.classList.remove(`no-docs`, `no-type`), this.layout(this.size.width, this.getLayoutInfo().lineHeight * 2), this._onDidChangeContents.fire(this);
  }
  renderItem(e206, t10) {
    this._renderDisposeable.clear();
    let { detail: n10, documentation: r10 } = e206.completion;
    if (t10) {
      let t11 = ``;
      t11 += `score: ${e206.score[0]}
`, t11 += `prefix: ${e206.word ?? `(no prefix)`}
`, t11 += `word: ${e206.completion.filterText ? e206.completion.filterText + ` (filterText)` : e206.textLabel}
`, t11 += `distance: ${e206.distance} (localityBonus-setting)
`, t11 += `index: ${e206.idx}, based on ${e206.completion.sortText && `sortText: "${e206.completion.sortText}"` || `label`}
`, t11 += `commit_chars: ${e206.completion.commitCharacters?.join(``)}
`, r10 = new PM().appendCodeblock(`empty`, t11), n10 = `Provider: ${e206.provider._debugDisplayName}`;
    }
    if (!t10 && !x3(e206)) {
      this.clearContents();
      return;
    }
    if (this.domNode.classList.remove(`no-docs`, `no-type`), n10) {
      let e207 = n10.length > 1e5 ? `${n10.substr(0, 1e5)}\u2026` : n10;
      this._type.textContent = e207, this._type.title = e207, Zl(this._type), this._type.classList.toggle(`auto-wrap`, !/\r?\n^\s+/gim.test(e207));
    } else Xc(this._type), this._type.title = ``, Ql(this._type), this.domNode.classList.add(`no-type`);
    if (Xc(this._docs), typeof r10 == `string`) this._docs.classList.remove(`markdown-docs`), this._docs.textContent = r10;
    else if (r10) {
      this._docs.classList.add(`markdown-docs`), Xc(this._docs);
      let e207 = this._markdownRendererService.render(r10, { context: this._editor, asyncRenderCallback: () => {
        this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight), this._onDidChangeContents.fire(this);
      } });
      this._docs.appendChild(e207.element), this._renderDisposeable.add(e207);
    }
    this.domNode.classList.toggle(`detail-and-doc`, !!n10 && !!r10), this.domNode.style.userSelect = `text`, this.domNode.tabIndex = -1, this._close.onmousedown = (e207) => {
      e207.preventDefault(), e207.stopPropagation();
    }, this._close.onclick = (e207) => {
      e207.preventDefault(), e207.stopPropagation(), this._onDidClose.fire();
    }, this._body.scrollTop = 0, this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight), this._onDidChangeContents.fire(this);
  }
  clearContents() {
    this.domNode.classList.add(`no-docs`), this._type.textContent = ``, this._docs.textContent = ``;
  }
  get isEmpty() {
    return this.domNode.classList.contains(`no-docs`);
  }
  get size() {
    return this._size;
  }
  layout(e206, t10) {
    let n10 = new ml(e206, t10);
    ml.equals(n10, this._size) || (this._size = n10, gl(this.domNode, e206, t10)), this._scrollbar.scanDomNode();
  }
  scrollDown(e206 = 8) {
    this._body.scrollTop += e206;
  }
  scrollUp(e206 = 8) {
    this._body.scrollTop -= e206;
  }
  scrollTop() {
    this._body.scrollTop = 0;
  }
  scrollBottom() {
    this._body.scrollTop = this._body.scrollHeight;
  }
  pageDown() {
    this.scrollDown(80);
  }
  pageUp() {
    this.scrollUp(80);
  }
  focus() {
    this.domNode.focus();
  }
};
S3 = aOe([b3(1, US), b3(2, LP)], S3);
var oOe = class {
  constructor(e206, t10) {
    this.widget = e206, this._editor = t10, this.allowEditorOverflow = true, this._disposables = new E(), this._added = false, this._preferAlignAtTop = true, this._resizable = new CZ(), this._resizable.domNode.classList.add(`suggest-details-container`), this._resizable.domNode.appendChild(e206.domNode), this._resizable.enableSashes(false, true, true, false);
    let n10, r10, i10 = 0, a10 = 0;
    this._disposables.add(this._resizable.onDidWillResize(() => {
      n10 = this._topLeft, r10 = this._resizable.size;
    })), this._disposables.add(this._resizable.onDidResize((e207) => {
      if (n10 && r10) {
        this.widget.layout(e207.dimension.width, e207.dimension.height);
        let t11 = false;
        e207.west && (a10 = r10.width - e207.dimension.width, t11 = true), e207.north && (i10 = r10.height - e207.dimension.height, t11 = true), t11 && this._applyTopLeft({ top: n10.top + i10, left: n10.left + a10 });
      }
      e207.done && (n10 = void 0, r10 = void 0, i10 = 0, a10 = 0, this._userSize = e207.dimension);
    })), this._disposables.add(this.widget.onDidChangeContents(() => {
      this._anchorBox && this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, this._preferAlignAtTop);
    }));
  }
  dispose() {
    this._resizable.dispose(), this._disposables.dispose(), this.hide();
  }
  getId() {
    return `suggest.details`;
  }
  getDomNode() {
    return this._resizable.domNode;
  }
  getPosition() {
    return this._topLeft ? { preference: this._topLeft } : null;
  }
  show() {
    this._added || (this._added = (this._editor.addOverlayWidget(this), true));
  }
  hide(e206 = false) {
    this._resizable.clearSashHoverState(), this._added && (this._editor.removeOverlayWidget(this), this._added = false, this._anchorBox = void 0, this._topLeft = void 0), e206 && (this._userSize = void 0, this.widget.clearContents());
  }
  placeAtAnchor(e206, t10) {
    this._anchorBox = e206.getBoundingClientRect(), this._preferAlignAtTop = t10, this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, t10);
  }
  _placeAtAnchor(e206, t10, n10) {
    let r10 = fl(this.getDomNode().ownerDocument.body), i10 = this.widget.getLayoutInfo(), a10 = new ml(220, 2 * i10.lineHeight), o10 = e206.top, s10 = (function() {
      let n11 = r10.width - (e206.left + e206.width + i10.borderWidth + i10.horizontalPadding), s11 = -i10.borderWidth + e206.left + e206.width, c11 = new ml(n11, r10.height - e206.top - i10.borderHeight - i10.verticalPadding), l11 = c11.with(void 0, e206.top + e206.height - i10.borderHeight - i10.verticalPadding);
      return { top: o10, left: s11, fit: n11 - t10.width, maxSizeTop: c11, maxSizeBottom: l11, minSize: a10.with(Math.min(n11, a10.width)) };
    })(), c10 = [s10, (function() {
      let n11 = e206.left - i10.borderWidth - i10.horizontalPadding, s11 = Math.max(i10.horizontalPadding, e206.left - t10.width - i10.borderWidth), c11 = new ml(n11, r10.height - e206.top - i10.borderHeight - i10.verticalPadding), l11 = c11.with(void 0, e206.top + e206.height - i10.borderHeight - i10.verticalPadding);
      return { top: o10, left: s11, fit: n11 - t10.width, maxSizeTop: c11, maxSizeBottom: l11, minSize: a10.with(Math.min(n11, a10.width)) };
    })(), (function() {
      let n11 = e206.left, o11 = -i10.borderWidth + e206.top + e206.height, s11 = new ml(e206.width - i10.borderHeight, r10.height - e206.top - e206.height - i10.verticalPadding);
      return { top: o11, left: n11, fit: s11.height - t10.height, maxSizeBottom: s11, maxSizeTop: s11, minSize: a10.with(s11.width) };
    })()], l10 = c10.find((e207) => e207.fit >= 0) ?? c10.sort((e207, t11) => t11.fit - e207.fit)[0], u10 = e206.top + e206.height - i10.borderHeight, d10, f10 = t10.height, p10 = Math.max(l10.maxSizeTop.height, l10.maxSizeBottom.height);
    f10 > p10 && (f10 = p10);
    let m10;
    n10 ? f10 <= l10.maxSizeTop.height ? (d10 = true, m10 = l10.maxSizeTop) : (d10 = false, m10 = l10.maxSizeBottom) : f10 <= l10.maxSizeBottom.height ? (d10 = false, m10 = l10.maxSizeBottom) : (d10 = true, m10 = l10.maxSizeTop);
    let { top: h10, left: g10 } = l10;
    !d10 && f10 > e206.height && (h10 = u10 - f10);
    let _10 = this._editor.getDomNode();
    if (_10) {
      let e207 = _10.getBoundingClientRect();
      h10 -= e207.top, g10 -= e207.left;
    }
    this._applyTopLeft({ left: g10, top: h10 }), this._resizable.enableSashes(!d10, l10 === s10, d10, l10 !== s10), this._resizable.minSize = l10.minSize, this._resizable.maxSize = m10, this._resizable.layout(f10, Math.min(m10.width, t10.width)), this.widget.layout(this._resizable.size.width, this._resizable.size.height);
  }
  _applyTopLeft(e206) {
    this._topLeft = e206, this._editor.layoutOverlayWidget(this);
  }
}, C3 = xu(`fileService`), w3;
(function(e206) {
  e206[e206.FILE = 0] = `FILE`, e206[e206.FOLDER = 1] = `FOLDER`, e206[e206.ROOT_FOLDER = 2] = `ROOT_FOLDER`;
})(w3 || (w3 = {}));
var sOe = /(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;
function T3(e206, t10, n10, r10, i10) {
  if (ju.isThemeIcon(i10)) return [`codicon-${i10.id}`, `predefined-file-icon`];
  if ($r.isUri(i10)) return [];
  let a10 = r10 === w3.ROOT_FOLDER ? [`rootfolder-icon`] : r10 === w3.FOLDER ? [`folder-icon`] : [`file-icon`];
  if (n10) {
    let i11;
    if (n10.scheme === xs.data) i11 = Hd.parseMetaData(n10).get(Hd.META_DATA_LABEL);
    else {
      let e207 = n10.path.match(sOe);
      e207 ? (i11 = E3(e207[2].toLowerCase()), e207[1] && a10.push(`${E3(e207[1].toLowerCase())}-name-dir-icon`)) : i11 = E3(n10.authority.toLowerCase());
    }
    if (r10 === w3.ROOT_FOLDER) a10.push(`${i11}-root-name-folder-icon`);
    else if (r10 === w3.FOLDER) a10.push(`${i11}-name-folder-icon`);
    else {
      if (i11) {
        if (a10.push(`${i11}-name-file-icon`), a10.push(`name-file-icon`), i11.length <= 255) {
          let e207 = i11.split(`.`);
          for (let t11 = 1; t11 < e207.length; t11++) a10.push(`${e207.slice(t11).join(`.`)}-ext-file-icon`);
        }
        a10.push(`ext-file-icon`);
      }
      let r11 = cOe(e206, t10, n10);
      r11 && a10.push(`${E3(r11)}-lang-file-icon`);
    }
  }
  return a10;
}
function cOe(e206, t10, n10) {
  if (!n10) return null;
  let r10 = null;
  if (n10.scheme === xs.data) {
    let e207 = Hd.parseMetaData(n10).get(Hd.META_DATA_MIME);
    e207 && (r10 = t10.getLanguageIdByMimeType(e207));
  } else {
    let t11 = e206.getModel(n10);
    t11 && (r10 = t11.getLanguageId());
  }
  return r10 && r10 !== `plaintext` ? r10 : t10.guessLanguageIdByFilepathOrFirstLine(n10);
}
function E3(e206) {
  return e206.replace(/[\s]/g, `/`);
}
var lOe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, D3 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, uOe = AU(`suggest-more-info`, F.chevronRight, C(1492, `Icon for more information in the suggest widget.`)), dOe = new (_kd = class {
  extract(t10, n10) {
    if (t10.textLabel.match(_kd._regexStrict)) return n10[0] = t10.textLabel, true;
    if (t10.completion.detail && t10.completion.detail.match(_kd._regexStrict)) return n10[0] = t10.completion.detail, true;
    if (t10.completion.documentation) {
      let r10 = typeof t10.completion.documentation == `string` ? t10.completion.documentation : t10.completion.documentation.value, i10 = _kd._regexRelaxed.exec(r10);
      if (i10 && (i10.index === 0 || i10.index + i10[0].length === r10.length)) return n10[0] = i10[0], true;
    }
    return false;
  }
}, _kd._regexRelaxed = /(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/, _kd._regexStrict = RegExp(`^${_kd._regexRelaxed.source}$`, `i`), _kd)(), O3 = class {
  constructor(e206, t10, n10, r10) {
    this._editor = e206, this._modelService = t10, this._languageService = n10, this._themeService = r10, this._onDidToggleDetails = new k(), this.onDidToggleDetails = this._onDidToggleDetails.event, this.templateId = `suggestion`;
  }
  dispose() {
    this._onDidToggleDetails.dispose();
  }
  renderTemplate(e206) {
    let t10 = new E(), n10 = e206;
    n10.classList.add(`show-file-icons`);
    let r10 = z(e206, B(`.icon`)), i10 = z(r10, B(`span.colorspan`)), a10 = z(z(e206, B(`.contents`)), B(`.main`)), o10 = z(a10, B(`.icon-label.codicon`)), s10 = z(a10, B(`span.left`)), c10 = z(a10, B(`span.right`)), l10 = new KR(s10, { supportHighlights: true, supportIcons: true });
    t10.add(l10);
    let u10 = z(s10, B(`span.signature-label`)), d10 = z(s10, B(`span.qualifier-label`)), f10 = z(c10, B(`span.details-label`)), p10 = z(c10, B(`span.readMore` + ju.asCSSSelector(uOe)));
    return p10.title = C(1493, `Read More`), { root: n10, left: s10, right: c10, icon: r10, colorspan: i10, iconLabel: l10, iconContainer: o10, parametersLabel: u10, qualifierLabel: d10, detailsLabel: f10, readMore: p10, disposables: t10, configureFont: () => {
      let e207 = this._editor.getOptions(), t11 = e207.get(59), i11 = t11.getMassagedFontFamily(), o11 = t11.fontFeatureSettings, s11 = t11.fontVariationSettings, c11 = e207.get(135) || t11.fontSize, l11 = e207.get(136) || t11.lineHeight, u11 = t11.fontWeight, d11 = t11.letterSpacing, f11 = `${c11}px`, m10 = `${l11}px`, h10 = `${d11}px`;
      n10.style.fontSize = f11, n10.style.fontWeight = u11, n10.style.letterSpacing = h10, a10.style.fontFamily = i11, a10.style.fontFeatureSettings = o11, a10.style.fontVariationSettings = s11, a10.style.lineHeight = m10, r10.style.height = m10, r10.style.width = m10, p10.style.height = m10, p10.style.width = m10;
    } };
  }
  renderElement(e206, t10, n10) {
    n10.configureFont();
    let { completion: r10 } = e206;
    n10.colorspan.style.backgroundColor = ``;
    let i10 = { labelEscapeNewLines: true, matches: uM(e206.score) }, a10 = [];
    if (r10.kind === 19 && dOe.extract(e206, a10)) n10.icon.className = `icon customcolor`, n10.iconContainer.className = `icon hide`, n10.colorspan.style.backgroundColor = a10[0];
    else if (r10.kind === 20 && this._themeService.getFileIconTheme().hasFileIcons) {
      n10.icon.className = `icon hide`, n10.iconContainer.className = `icon hide`;
      let t11 = T3(this._modelService, this._languageService, $r.from({ scheme: `fake`, path: e206.textLabel }), w3.FILE), a11 = T3(this._modelService, this._languageService, $r.from({ scheme: `fake`, path: r10.detail }), w3.FILE);
      i10.extraClasses = t11.length > a11.length ? t11 : a11;
    } else r10.kind === 23 && this._themeService.getFileIconTheme().hasFolderIcons ? (n10.icon.className = `icon hide`, n10.iconContainer.className = `icon hide`, i10.extraClasses = [T3(this._modelService, this._languageService, $r.from({ scheme: `fake`, path: e206.textLabel }), w3.FOLDER), T3(this._modelService, this._languageService, $r.from({ scheme: `fake`, path: r10.detail }), w3.FOLDER)].flat()) : (n10.icon.className = `icon hide`, n10.iconContainer.className = ``, n10.iconContainer.classList.add(`suggest-icon`, ...ju.asClassNameArray(hi.toIcon(r10.kind))));
    r10.tags && r10.tags.indexOf(1) >= 0 && (i10.extraClasses = (i10.extraClasses || []).concat([`deprecated`]), i10.matches = []), n10.iconLabel.setLabel(e206.textLabel, void 0, i10), typeof r10.label == `string` ? (n10.parametersLabel.textContent = ``, n10.detailsLabel.textContent = k3(r10.detail || ``), n10.root.classList.add(`string-label`)) : (n10.parametersLabel.textContent = k3(r10.label.detail || ``), n10.detailsLabel.textContent = k3(r10.label.description || ``), n10.root.classList.remove(`string-label`)), this._editor.getOption(134).showInlineDetails ? Zl(n10.detailsLabel) : Ql(n10.detailsLabel), x3(e206) ? (n10.right.classList.add(`can-expand-details`), Zl(n10.readMore), n10.readMore.onmousedown = (e207) => {
      e207.stopPropagation(), e207.preventDefault();
    }, n10.readMore.onclick = (e207) => {
      e207.stopPropagation(), e207.preventDefault(), this._onDidToggleDetails.fire();
    }) : (n10.right.classList.remove(`can-expand-details`), Ql(n10.readMore), n10.readMore.onmousedown = null, n10.readMore.onclick = null);
  }
  disposeTemplate(e206) {
    e206.disposables.dispose();
  }
};
O3 = lOe([D3(1, Cu), D3(2, Jf), D3(3, US)], O3);
function k3(e206) {
  return e206.replace(/\r\n|\r|\n/g, ``);
}
var fOe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, A3 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, j3;
Q(`editorSuggestWidget.background`, av, C(1473, `Background color of the suggest widget.`)), Q(`editorSuggestWidget.border`, sv, C(1474, `Border color of the suggest widget.`));
var pOe = Q(`editorSuggestWidget.foreground`, iv, C(1475, `Foreground color of the suggest widget.`));
Q(`editorSuggestWidget.selectedForeground`, hb, C(1476, `Foreground color of the selected entry in the suggest widget.`)), Q(`editorSuggestWidget.selectedIconForeground`, gb, C(1477, `Icon foreground color of the selected entry in the suggest widget.`));
var mOe = Q(`editorSuggestWidget.selectedBackground`, _b2, C(1478, `Background color of the selected entry in the suggest widget.`));
Q(`editorSuggestWidget.highlightForeground`, ub, C(1479, `Color of the match highlights in the suggest widget.`)), Q(`editorSuggestWidget.focusHighlightForeground`, Zae, C(1480, `Color of the match highlights in the suggest widget when an item is focused.`)), Q(`editorSuggestWidgetStatus.foreground`, F_(pOe, 0.5), C(1481, `Foreground color of the suggest widget status.`));
var hOe = class {
  constructor(e206, t10) {
    this._service = e206, this._key = `suggestWidget.size/${t10.getEditorType()}/${t10 instanceof qQ}`;
  }
  restore() {
    let e206 = this._service.get(this._key, 0) ?? ``;
    try {
      let t10 = JSON.parse(e206);
      if (ml.is(t10)) return ml.lift(t10);
    } catch {
    }
  }
  store(e206) {
    this._service.store(this._key, JSON.stringify(e206), 0, 1);
  }
  reset() {
    this._service.remove(this._key, 0);
  }
}, M3 = (_ld = class {
  constructor(e206, t10, n10, r10, i10) {
    this.editor = e206, this._storageService = t10, this._state = 0, this._isAuto = false, this._pendingLayout = new Jt(), this._pendingShowDetails = new Jt(), this._ignoreFocusEvents = false, this._forceRenderingAbove = false, this._explainMode = false, this._showTimeout = new cs(), this._disposables = new E(), this._onDidSelect = new ln(), this._onDidFocus = new ln(), this._onDidHide = new k(), this._onDidShow = new k(), this.onDidSelect = this._onDidSelect.event, this.onDidFocus = this._onDidFocus.event, this.onDidHide = this._onDidHide.event, this.onDidShow = this._onDidShow.event, this._onDetailsKeydown = new k(), this.onDetailsKeyDown = this._onDetailsKeydown.event, this.element = new CZ(), this.element.domNode.classList.add(`editor-widget`, `suggest-widget`), this._contentWidget = new gOe(this, e206), this._persistedSize = new hOe(t10, e206);
    class a10 {
      constructor(e207, t11, n11 = false, r11 = false) {
        this.persistedSize = e207, this.currentSize = t11, this.persistHeight = n11, this.persistWidth = r11;
      }
    }
    let o10;
    this._disposables.add(this.element.onDidWillResize(() => {
      this._contentWidget.lockPreference(), o10 = new a10(this._persistedSize.restore(), this.element.size);
    })), this._disposables.add(this.element.onDidResize((e207) => {
      if (this._resize(e207.dimension.width, e207.dimension.height), o10 && (o10.persistHeight = o10.persistHeight || !!e207.north || !!e207.south, o10.persistWidth = o10.persistWidth || !!e207.east || !!e207.west), e207.done) {
        if (o10) {
          let { itemHeight: e208, defaultSize: t11 } = this.getLayoutInfo(), n11 = Math.round(e208 / 2), { width: r11, height: i11 } = this.element.size;
          (!o10.persistHeight || Math.abs(o10.currentSize.height - i11) <= n11) && (i11 = o10.persistedSize?.height ?? t11.height), (!o10.persistWidth || Math.abs(o10.currentSize.width - r11) <= n11) && (r11 = o10.persistedSize?.width ?? t11.width), this._persistedSize.store(new ml(r11, i11));
        }
        this._contentWidget.unlockPreference(), o10 = void 0;
      }
    })), this._messageElement = z(this.element.domNode, B(`.message`)), this._listElement = z(this.element.domNode, B(`.tree`));
    let s10 = this._disposables.add(i10.createInstance(S3, this.editor));
    s10.onDidClose(() => this.toggleDetails(), this, this._disposables), this._details = new oOe(s10, this.editor);
    let c10 = () => this.element.domNode.classList.toggle(`no-icons`, !this.editor.getOption(134).showIcons);
    c10();
    let l10 = i10.createInstance(O3, this.editor);
    this._disposables.add(l10), this._disposables.add(l10.onDidToggleDetails(() => this.toggleDetails())), this._list = new $I(`SuggestWidget`, this._listElement, { getHeight: (e207) => this.getLayoutInfo().itemHeight, getTemplateId: (e207) => `suggestion` }, [l10], { alwaysConsumeMouseWheel: true, useShadows: false, mouseSupport: false, multipleSelectionSupport: false, accessibilityProvider: { getRole: () => wt ? `listitem` : `option`, getWidgetAriaLabel: () => C(1484, `Suggest`), getWidgetRole: () => `listbox`, getAriaLabel: (e207) => {
      let t11 = e207.textLabel, n11 = hi.toLabel(e207.completion.kind);
      if (typeof e207.completion.label != `string`) {
        let { detail: r12, description: i12 } = e207.completion.label;
        r12 && i12 ? t11 = C(1485, `{0} {1}, {2}, {3}`, t11, r12, i12, n11) : r12 ? t11 = C(1486, `{0} {1}, {2}`, t11, r12, n11) : i12 && (t11 = C(1487, `{0}, {1}, {2}`, t11, i12, n11));
      } else t11 = C(1488, `{0}, {1}`, t11, n11);
      if (!e207.isResolved || !this._isDetailsVisible()) return t11;
      let { documentation: r11, detail: i11 } = e207.completion, a11 = La(`{0}{1}`, i11 || ``, r11 ? typeof r11 == `string` ? r11 : r11.value : ``);
      return C(1489, `{0}, docs: {1}`, t11, a11);
    } } }), this._list.style(dL({ listInactiveFocusBackground: mOe, listInactiveFocusOutline: J_ })), this._status = i10.createInstance(y3, this.element.domNode, x2);
    let u10 = () => this.element.domNode.classList.toggle(`with-status-bar`, this.editor.getOption(134).showStatusBar);
    u10(), this._disposables.add(this._list.onMouseDown((e207) => this._onListMouseDownOrTap(e207))), this._disposables.add(this._list.onTap((e207) => this._onListMouseDownOrTap(e207))), this._disposables.add(this._list.onDidChangeSelection((e207) => this._onListSelection(e207))), this._disposables.add(this._list.onDidChangeFocus((e207) => this._onListFocus(e207))), this._disposables.add(this.editor.onDidChangeCursorSelection(() => this._onCursorSelectionChanged())), this._disposables.add(this.editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(134) && (u10(), c10()), this._completionModel && (e207.hasChanged(59) || e207.hasChanged(135) || e207.hasChanged(136)) && this._list.splice(0, this._list.length, this._completionModel.items);
    })), this._ctxSuggestWidgetVisible = b2.Visible.bindTo(n10), this._ctxSuggestWidgetDetailsVisible = b2.DetailsVisible.bindTo(n10), this._ctxSuggestWidgetMultipleSuggestions = b2.MultipleSuggestions.bindTo(n10), this._ctxSuggestWidgetHasFocusedSuggestion = b2.HasFocusedSuggestion.bindTo(n10), this._disposables.add(el(this._details.widget.domNode, `keydown`, (e207) => {
      this._onDetailsKeydown.fire(e207);
    })), this._disposables.add(this.editor.onMouseDown((e207) => this._onEditorMouseDown(e207)));
  }
  dispose() {
    this._details.widget.dispose(), this._details.dispose(), this._list.dispose(), this._status.dispose(), this._disposables.dispose(), this._loadingTimeout?.dispose(), this._pendingLayout.dispose(), this._pendingShowDetails.dispose(), this._showTimeout.dispose(), this._contentWidget.dispose(), this.element.dispose();
  }
  _onEditorMouseDown(e206) {
    this._details.widget.domNode.contains(e206.target.element) ? this._details.widget.domNode.focus() : this.element.domNode.contains(e206.target.element) && this.editor.focus();
  }
  _onCursorSelectionChanged() {
    this._state !== 0 && this._contentWidget.layout();
  }
  _onListMouseDownOrTap(e206) {
    e206.element === void 0 || e206.index === void 0 || (e206.browserEvent.preventDefault(), e206.browserEvent.stopPropagation(), this._select(e206.element, e206.index));
  }
  _onListSelection(e206) {
    e206.elements.length && this._select(e206.elements[0], e206.indexes[0]);
  }
  _select(e206, t10) {
    let n10 = this._completionModel;
    n10 && (this._onDidSelect.fire({ item: e206, index: t10, model: n10 }), this.editor.focus());
  }
  _onListFocus(e206) {
    if (this._ignoreFocusEvents) return;
    if (this._state === 5 && this._setState(3), !e206.elements.length) {
      this._currentSuggestionDetails && (this._currentSuggestionDetails.cancel(), this._currentSuggestionDetails = void 0, this._focusedItem = void 0), this.editor.setAriaOptions({ activeDescendant: void 0 }), this._ctxSuggestWidgetHasFocusedSuggestion.set(false);
      return;
    }
    if (!this._completionModel) return;
    this._ctxSuggestWidgetHasFocusedSuggestion.set(true);
    let t10 = e206.elements[0], n10 = e206.indexes[0];
    t10 !== this._focusedItem && (this._currentSuggestionDetails?.cancel(), this._currentSuggestionDetails = void 0, this._focusedItem = t10, this._list.reveal(n10), this._currentSuggestionDetails = es(async (e207) => {
      let n11 = as(() => {
        this._isDetailsVisible() && this._showDetails(true, false);
      }, 250), r10 = e207.onCancellationRequested(() => n11.dispose());
      try {
        return await t10.resolve(e207);
      } finally {
        n11.dispose(), r10.dispose();
      }
    }), this._currentSuggestionDetails.then(() => {
      n10 >= this._list.length || t10 !== this._list.element(n10) || (this._ignoreFocusEvents = true, this._list.splice(n10, 1, [t10]), this._list.setFocus([n10]), this._ignoreFocusEvents = false, this._isDetailsVisible() ? this._showDetails(false, false) : this.element.domNode.classList.remove(`docs-side`), this.editor.setAriaOptions({ activeDescendant: this._list.getElementID(n10) }));
    }).catch(be)), this._onDidFocus.fire({ item: t10, index: n10, model: this._completionModel });
  }
  _setState(e206) {
    if (this._state !== e206) switch (this._state = e206, this.element.domNode.classList.toggle(`frozen`, e206 === 4), this.element.domNode.classList.remove(`message`), e206) {
      case 0:
        Ql(this._messageElement, this._listElement, this._status.element), this._details.hide(true), this._status.hide(), this._contentWidget.hide(), this._ctxSuggestWidgetVisible.reset(), this._ctxSuggestWidgetMultipleSuggestions.reset(), this._ctxSuggestWidgetHasFocusedSuggestion.reset(), this._showTimeout.cancel(), this.element.domNode.classList.remove(`visible`), this._list.splice(0, this._list.length), this._focusedItem = void 0, this._cappedHeight = void 0, this._explainMode = false;
        break;
      case 1:
        this.element.domNode.classList.add(`message`), this._messageElement.textContent = j3.LOADING_MESSAGE, Ql(this._listElement, this._status.element), Zl(this._messageElement), this._details.hide(), this._show(), this._focusedItem = void 0, Gg(j3.LOADING_MESSAGE);
        break;
      case 2:
        this.element.domNode.classList.add(`message`), this._messageElement.textContent = j3.NO_SUGGESTIONS_MESSAGE, Ql(this._listElement, this._status.element), Zl(this._messageElement), this._details.hide(), this._show(), this._focusedItem = void 0, Gg(j3.NO_SUGGESTIONS_MESSAGE);
        break;
      case 3:
        Ql(this._messageElement), Zl(this._listElement, this._status.element), this._show();
        break;
      case 4:
        Ql(this._messageElement), Zl(this._listElement, this._status.element), this._show();
        break;
      case 5:
        Ql(this._messageElement), Zl(this._listElement, this._status.element), this._details.show(), this._show(), this._details.widget.focus();
        break;
    }
  }
  _show() {
    this._status.show(), this._contentWidget.show(), this._layout(this._persistedSize.restore()), this._ctxSuggestWidgetVisible.set(true), this._showTimeout.cancelAndSet(() => {
      this.element.domNode.classList.add(`visible`), this._onDidShow.fire(this);
    }, 100);
  }
  showTriggered(e206, t10) {
    this._state === 0 && (this._contentWidget.setPosition(this.editor.getPosition()), this._isAuto = !!e206, this._isAuto || (this._loadingTimeout = as(() => this._setState(1), t10)));
  }
  showSuggestions(e206, t10, n10, r10, i10) {
    if (this._contentWidget.setPosition(this.editor.getPosition()), this._loadingTimeout?.dispose(), this._currentSuggestionDetails?.cancel(), this._currentSuggestionDetails = void 0, this._completionModel !== e206 && (this._completionModel = e206), n10 && this._state !== 2 && this._state !== 0) {
      this._setState(4);
      return;
    }
    let a10 = this._completionModel.items.length, o10 = a10 === 0;
    if (this._ctxSuggestWidgetMultipleSuggestions.set(a10 > 1), o10) {
      this._setState(r10 ? 0 : 2), this._completionModel = void 0;
      return;
    }
    this._focusedItem = void 0, this._onDidFocus.pause(), this._onDidSelect.pause();
    try {
      this._list.splice(0, this._list.length, this._completionModel.items), this._setState(n10 ? 4 : 3), this._list.reveal(t10, 0, t10 === 0 ? 0 : this.getLayoutInfo().itemHeight * 0.33), this._list.setFocus(i10 ? [] : [t10]);
    } finally {
      this._onDidFocus.resume(), this._onDidSelect.resume();
    }
    this._pendingLayout.value = sl(Vc(this.element.domNode), () => {
      this._pendingLayout.clear(), this._layout(this.element.size), this._details.widget.domNode.classList.remove(`focused`);
    });
  }
  focusSelected() {
    this._list.length > 0 && this._list.setFocus([0]);
  }
  selectNextPage() {
    switch (this._state) {
      case 0:
        return false;
      case 5:
        return this._details.widget.pageDown(), true;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusNextPage(), true;
    }
  }
  selectNext() {
    switch (this._state) {
      case 0:
        return false;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusNext(1, true), true;
    }
  }
  selectLast() {
    switch (this._state) {
      case 0:
        return false;
      case 5:
        return this._details.widget.scrollBottom(), true;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusLast(), true;
    }
  }
  selectPreviousPage() {
    switch (this._state) {
      case 0:
        return false;
      case 5:
        return this._details.widget.pageUp(), true;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusPreviousPage(), true;
    }
  }
  selectPrevious() {
    switch (this._state) {
      case 0:
        return false;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusPrevious(1, true), false;
    }
  }
  selectFirst() {
    switch (this._state) {
      case 0:
        return false;
      case 5:
        return this._details.widget.scrollTop(), true;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusFirst(), true;
    }
  }
  getFocusedItem() {
    if (this._state !== 0 && this._state !== 2 && this._state !== 1 && this._completionModel && this._list.getFocus().length > 0) return { item: this._list.getFocusedElements()[0], index: this._list.getFocus()[0], model: this._completionModel };
  }
  toggleDetailsFocus() {
    this._state === 5 ? (this._list.setFocus(this._list.getFocus()), this._setState(3)) : this._state === 3 && (this._setState(5), this._isDetailsVisible() ? this._details.widget.focus() : this.toggleDetails(true));
  }
  toggleDetails(e206 = false) {
    this._isDetailsVisible() ? (this._pendingShowDetails.clear(), this._ctxSuggestWidgetDetailsVisible.set(false), this._setDetailsVisible(false), this._details.hide(), this.element.domNode.classList.remove(`shows-details`)) : (x3(this._list.getFocusedElements()[0]) || this._explainMode) && (this._state === 3 || this._state === 5 || this._state === 4) && (this._ctxSuggestWidgetDetailsVisible.set(true), this._setDetailsVisible(true), this._showDetails(false, e206));
  }
  _showDetails(e206, t10) {
    this._pendingShowDetails.value = sl(Vc(this.element.domNode), () => {
      this._pendingShowDetails.clear(), this._details.show();
      let n10 = false;
      e206 ? this._details.widget.renderLoading() : this._details.widget.renderItem(this._list.getFocusedElements()[0], this._explainMode), this._details.widget.isEmpty ? this._details.hide() : (this._positionDetails(), this.element.domNode.classList.add(`shows-details`), t10 && (this._details.widget.focus(), n10 = true)), n10 || this.editor.focus();
    });
  }
  toggleExplainMode() {
    this._list.getFocusedElements()[0] && (this._explainMode = !this._explainMode, this._isDetailsVisible() ? this._showDetails(false, false) : this.toggleDetails());
  }
  resetPersistedSize() {
    this._persistedSize.reset();
  }
  hideWidget() {
    this._pendingLayout.clear(), this._pendingShowDetails.clear(), this._loadingTimeout?.dispose(), this._setState(0), this._onDidHide.fire(this), this.element.clearSashHoverState();
    let e206 = this._persistedSize.restore(), t10 = Math.ceil(this.getLayoutInfo().itemHeight * 4.3);
    e206 && e206.height < t10 && this._persistedSize.store(e206.with(void 0, t10));
  }
  isFrozen() {
    return this._state === 4;
  }
  _afterRender(e206) {
    if (e206 === null) {
      this._isDetailsVisible() && this._details.hide();
      return;
    }
    this._state === 2 || this._state === 1 || (this._isDetailsVisible() && !this._details.widget.isEmpty && this._details.show(), this._positionDetails());
  }
  _layout(e206) {
    if (!this.editor.hasModel() || !this.editor.getDomNode()) return;
    let t10 = fl(this.element.domNode.ownerDocument.body), n10 = this.getLayoutInfo();
    e206 || (e206 = n10.defaultSize);
    let r10 = e206.height, i10 = e206.width;
    if (this._status.element.style.height = `${n10.itemHeight}px`, this._state === 2 || this._state === 1) r10 = n10.itemHeight + n10.borderHeight, i10 = n10.defaultSize.width / 2, this.element.enableSashes(false, false, false, false), this.element.minSize = this.element.maxSize = new ml(i10, r10), this._contentWidget.setPreference(2);
    else {
      let a10 = t10.width - n10.borderHeight - 2 * n10.horizontalPadding;
      i10 > a10 && (i10 = a10);
      let o10 = this._completionModel ? this._completionModel.stats.pLabelLen * n10.typicalHalfwidthCharacterWidth : i10, s10 = n10.statusBarHeight + this._list.contentHeight + n10.borderHeight, c10 = n10.itemHeight + n10.statusBarHeight, l10 = _l2(this.editor.getDomNode()), u10 = this.editor.getScrolledVisiblePosition(this.editor.getPosition()), d10 = l10.top + u10.top + u10.height, f10 = Math.min(t10.height - d10 - n10.verticalPadding, s10), p10 = l10.top + u10.top - n10.verticalPadding, m10 = Math.min(p10, s10), h10 = Math.min(Math.max(m10, f10) + n10.borderHeight, s10);
      r10 === this._cappedHeight?.capped && (r10 = this._cappedHeight.wanted), r10 < c10 && (r10 = c10), r10 > h10 && (r10 = h10), r10 > f10 && m10 > f10 || this._forceRenderingAbove && p10 > 150 ? (this._contentWidget.setPreference(1), this.element.enableSashes(true, true, false, false), h10 = m10) : (this._contentWidget.setPreference(2), this.element.enableSashes(false, true, true, false), h10 = f10), this.element.preferredSize = new ml(o10, n10.defaultSize.height), this.element.maxSize = new ml(a10, h10), this.element.minSize = new ml(220, c10), this._cappedHeight = r10 === s10 ? { wanted: this._cappedHeight?.wanted ?? e206.height, capped: r10 } : void 0;
    }
    this._resize(i10, r10);
  }
  _resize(e206, t10) {
    let { width: n10, height: r10 } = this.element.maxSize;
    e206 = Math.min(n10, e206), t10 = Math.min(r10, t10);
    let { statusBarHeight: i10 } = this.getLayoutInfo();
    this._list.layout(t10 - i10, e206), this._listElement.style.height = `${t10 - i10}px`, this.element.layout(t10, e206), this._contentWidget.layout(), this._positionDetails();
  }
  _positionDetails() {
    this._isDetailsVisible() && this._details.placeAtAnchor(this.element.domNode, this._contentWidget.getPosition()?.preference[0] === 2);
  }
  getLayoutInfo() {
    let e206 = this.editor.getOption(59), t10 = rA(this.editor.getOption(136) || e206.lineHeight, 8, 1e3), n10 = !this.editor.getOption(134).showStatusBar || this._state === 2 || this._state === 1 ? 0 : t10, r10 = this._details.widget.getLayoutInfo().borderWidth;
    return { itemHeight: t10, statusBarHeight: n10, borderWidth: r10, borderHeight: 2 * r10, typicalHalfwidthCharacterWidth: e206.typicalHalfwidthCharacterWidth, verticalPadding: 22, horizontalPadding: 14, defaultSize: new ml(430, n10 + 12 * t10) };
  }
  _isDetailsVisible() {
    return this._storageService.getBoolean(`expandSuggestionDocs`, 0, false);
  }
  _setDetailsVisible(e206) {
    this._storageService.store(`expandSuggestionDocs`, e206, 0, 0);
  }
  forceRenderingAbove() {
    this._forceRenderingAbove || (this._forceRenderingAbove = true, this._layout(this._persistedSize.restore()));
  }
  stopForceRenderingAbove() {
    this._forceRenderingAbove = false;
  }
}, j3 = _ld, _ld.LOADING_MESSAGE = C(1482, `Loading...`), _ld.NO_SUGGESTIONS_MESSAGE = C(1483, `No suggestions.`), _ld);
M3 = j3 = fOe([A3(1, dF), A3(2, nd), A3(3, US), A3(4, V)], M3);
var gOe = class {
  constructor(e206, t10) {
    this._widget = e206, this._editor = t10, this.allowEditorOverflow = true, this.suppressMouseDown = false, this._preferenceLocked = false, this._added = false, this._hidden = false;
  }
  dispose() {
    this._added && (this._added = false, this._editor.removeContentWidget(this));
  }
  getId() {
    return `editor.widget.suggestWidget`;
  }
  getDomNode() {
    return this._widget.element.domNode;
  }
  show() {
    this._hidden = false, this._added || (this._added = true, this._editor.addContentWidget(this));
  }
  hide() {
    this._hidden || (this._hidden = true, this.layout());
  }
  layout() {
    this._editor.layoutContentWidget(this);
  }
  getPosition() {
    return this._hidden || !this._position || !this._preference ? null : { position: this._position, preference: [this._preference] };
  }
  beforeRender() {
    let { height: e206, width: t10 } = this._widget.element.size, { borderWidth: n10, horizontalPadding: r10 } = this._widget.getLayoutInfo();
    return new ml(t10 + 2 * n10 + r10, e206 + 2 * n10);
  }
  afterRender(e206) {
    this._widget._afterRender(e206);
  }
  setPreference(e206) {
    this._preferenceLocked || (this._preference = e206);
  }
  lockPreference() {
    this._preferenceLocked = true;
  }
  unlockPreference() {
    this._preferenceLocked = false;
  }
  setPosition(e206) {
    this._position = e206;
  }
}, _Oe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, N3 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, P3, vOe = class {
  constructor(e206, t10) {
    if (this._model = e206, this._position = t10, this._decorationOptions = UO.register({ description: `suggest-line-suffix`, stickiness: 1 }), e206.getLineMaxColumn(t10.lineNumber) !== t10.column) {
      let n10 = e206.getOffsetAt(t10), r10 = e206.getPositionAt(n10 + 1);
      e206.changeDecorations((e207) => {
        this._marker && e207.removeDecoration(this._marker), this._marker = e207.addDecoration(M.fromPositions(t10, r10), this._decorationOptions);
      });
    }
  }
  dispose() {
    this._marker && !this._model.isDisposed() && this._model.changeDecorations((e206) => {
      e206.removeDecoration(this._marker), this._marker = void 0;
    });
  }
  delta(e206) {
    if (this._model.isDisposed() || this._position.lineNumber !== e206.lineNumber) return 0;
    if (this._marker) {
      let t10 = this._model.getDecorationRange(this._marker);
      return this._model.getOffsetAt(t10.getStartPosition()) - this._model.getOffsetAt(e206);
    } else return this._model.getLineMaxColumn(e206.lineNumber) - e206.column;
  }
}, F3 = (_md = class {
  static get(e206) {
    return e206.getContribution(P3.ID);
  }
  get onWillInsertSuggestItem() {
    return this._onWillInsertSuggestItem.event;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this._memoryService = t10, this._commandService = n10, this._contextKeyService = r10, this._instantiationService = i10, this._logService = a10, this._telemetryService = o10, this._lineSuffix = new Jt(), this._toDispose = new E(), this._selectors = new yOe((e207) => e207.priority), this._onWillInsertSuggestItem = new k(), this._wantsForceRenderingAbove = false, this.editor = e206, this.model = i10.createInstance(_3, this.editor), this._selectors.register({ priority: 0, select: (e207, t11, n11) => this._memoryService.select(e207, t11, n11) });
    let s10 = b2.InsertMode.bindTo(r10);
    s10.set(e206.getOption(134).insertMode), this._toDispose.add(this.model.onDidTrigger(() => s10.set(e206.getOption(134).insertMode))), this.widget = this._toDispose.add(new ol(Vc(e206.getDomNode()), () => {
      let e207 = this._instantiationService.createInstance(M3, this.editor);
      this._toDispose.add(e207), this._toDispose.add(e207.onDidSelect((e208) => this._insertSuggestion(e208, 0), this));
      let t11 = new $De(this.editor, e207, this.model, (e208) => this._insertSuggestion(e208, 2));
      this._toDispose.add(t11);
      let n11 = b2.MakesTextEdit.bindTo(this._contextKeyService), r11 = b2.HasInsertAndReplaceRange.bindTo(this._contextKeyService), i11 = b2.CanResolve.bindTo(this._contextKeyService);
      return this._toDispose.add(T(() => {
        n11.reset(), r11.reset(), i11.reset();
      })), this._toDispose.add(e207.onDidFocus(({ item: e208 }) => {
        let t12 = this.editor.getPosition(), a11 = e208.editStart.column, o11 = t12.column, s11 = true;
        this.editor.getOption(1) === `smart` && this.model.state === 2 && !e208.completion.additionalTextEdits && !(e208.completion.insertTextRules & 4) && o11 - a11 === e208.completion.insertText.length && (s11 = this.editor.getModel().getValueInRange({ startLineNumber: t12.lineNumber, startColumn: a11, endLineNumber: t12.lineNumber, endColumn: o11 }) !== e208.completion.insertText), n11.set(s11), r11.set(!j.equals(e208.editInsertEnd, e208.editReplaceEnd)), i11.set(!!e208.provider.resolveCompletionItem || !!e208.completion.documentation || e208.completion.detail !== e208.completion.label);
      })), this._toDispose.add(e207.onDetailsKeyDown((e208) => {
        if (e208.toKeyCodeChord().equals(new Uo(true, false, false, false, 33)) || Tt && e208.toKeyCodeChord().equals(new Uo(false, false, false, true, 33))) {
          e208.stopPropagation();
          return;
        }
        e208.toKeyCodeChord().isModifierKey() || this.editor.focus();
      })), this._wantsForceRenderingAbove && e207.forceRenderingAbove(), e207;
    })), this._overtypingCapturer = this._toDispose.add(new ol(Vc(e206.getDomNode()), () => this._toDispose.add(new rOe(this.editor, this.model)))), this._alternatives = this._toDispose.add(new ol(Vc(e206.getDomNode()), () => this._toDispose.add(new l3(this.editor, this._contextKeyService)))), this._toDispose.add(i10.createInstance(s3, e206)), this._toDispose.add(this.model.onDidTrigger((e207) => {
      this.widget.value.showTriggered(e207.auto, e207.shy ? 250 : 50), this._lineSuffix.value = new vOe(this.editor.getModel(), e207.position);
    })), this._toDispose.add(this.model.onDidSuggest((e207) => {
      if (e207.triggerOptions.shy) return;
      let t11 = -1;
      for (let n12 of this._selectors.itemsOrderedByPriorityDesc) if (t11 = n12.select(this.editor.getModel(), this.editor.getPosition(), e207.completionModel.items), t11 !== -1) break;
      if (t11 === -1 && (t11 = 0), this.model.state === 0) return;
      let n11 = false;
      if (e207.triggerOptions.auto) {
        let t12 = this.editor.getOption(134);
        t12.selectionMode === `never` || t12.selectionMode === `always` ? n11 = t12.selectionMode === `never` : t12.selectionMode === `whenTriggerCharacter` ? n11 = e207.triggerOptions.triggerKind !== 1 : t12.selectionMode === `whenQuickSuggestion` && (n11 = e207.triggerOptions.triggerKind === 1 && !e207.triggerOptions.refilter);
      }
      this.widget.value.showSuggestions(e207.completionModel, t11, e207.isFrozen, e207.triggerOptions.auto, n11);
    })), this._toDispose.add(this.model.onDidCancel((e207) => {
      e207.retrigger || this.widget.value.hideWidget();
    })), this._toDispose.add(this.editor.onDidBlurEditorWidget(() => {
      this.model.cancel(), this.model.clear();
    }));
    let c10 = b2.AcceptSuggestionsOnEnter.bindTo(r10), l10 = () => {
      let e207 = this.editor.getOption(1);
      c10.set(e207 === `on` || e207 === `smart`);
    };
    this._toDispose.add(this.editor.onDidChangeConfiguration(() => l10())), l10();
  }
  dispose() {
    this._alternatives.dispose(), this._toDispose.dispose(), this.widget.dispose(), this.model.dispose(), this._lineSuffix.dispose(), this._onWillInsertSuggestItem.dispose();
  }
  _insertSuggestion(e206, t10) {
    if (!e206 || !e206.item) {
      this._alternatives.value.reset(), this.model.cancel(), this.model.clear();
      return;
    }
    if (!this.editor.hasModel()) return;
    let n10 = p4.get(this.editor);
    if (!n10) return;
    this._onWillInsertSuggestItem.fire({ item: e206.item });
    let r10 = this.editor.getModel(), i10 = r10.getAlternativeVersionId(), { item: a10 } = e206, o10 = [], s10 = new pr();
    t10 & 1 || this.editor.pushUndoStop();
    let c10 = this.getOverwriteInfo(a10, !!(t10 & 8));
    this._memoryService.memorize(r10, this.editor.getPosition(), a10);
    let l10 = a10.isResolved, u10 = -1, d10 = -1;
    if (Array.isArray(a10.completion.additionalTextEdits)) {
      this.model.cancel();
      let e207 = FG.capture(this.editor);
      this.editor.executeEdits(`suggestController.additionalTextEdits.sync`, a10.completion.additionalTextEdits.map((e208) => {
        let t11 = M.lift(e208.range);
        if (t11.startLineNumber === a10.position.lineNumber && t11.startColumn > a10.position.column) {
          let e209 = this.editor.getPosition().column - a10.position.column, n11 = e209, r11 = M.spansMultipleLines(t11) ? 0 : e209;
          t11 = new M(t11.startLineNumber, t11.startColumn + n11, t11.endLineNumber, t11.endColumn + r11);
        }
        return DF.replaceMove(t11, e208.text);
      })), e207.restoreRelativeVerticalPositionOfCursor(this.editor);
    } else if (!l10) {
      let e207 = new $t(), n11, i11 = r10.onDidChangeContent((e208) => {
        if (e208.isFlush) {
          s10.cancel(), i11.dispose();
          return;
        }
        for (let t11 of e208.changes) {
          let e209 = M.getEndPosition(t11.range);
          (!n11 || j.isBefore(e209, n11)) && (n11 = e209);
        }
      }), c11 = t10;
      t10 |= 2;
      let l11 = false, u11 = this.editor.onWillType(() => {
        u11.dispose(), l11 = true, c11 & 2 || this.editor.pushUndoStop();
      });
      o10.push(a10.resolve(s10.token).then(() => {
        if (!a10.completion.additionalTextEdits || s10.token.isCancellationRequested) return;
        if (n11 && a10.completion.additionalTextEdits.some((e209) => j.isBefore(n11, M.getStartPosition(e209.range)))) return false;
        l11 && this.editor.pushUndoStop();
        let e208 = FG.capture(this.editor);
        return this.editor.executeEdits(`suggestController.additionalTextEdits.async`, a10.completion.additionalTextEdits.map((e209) => DF.replaceMove(M.lift(e209.range), e209.text))), e208.restoreRelativeVerticalPositionOfCursor(this.editor), (l11 || !(c11 & 2)) && this.editor.pushUndoStop(), true;
      }).then((t11) => {
        this._logService.trace(`[suggest] async resolving of edits DONE (ms, applied?)`, e207.elapsed(), t11), d10 = t11 === true ? 1 : t11 === false ? 0 : -2;
      }).finally(() => {
        i11.dispose(), u11.dispose();
      }));
    }
    let { insertText: f10 } = a10.completion;
    if (a10.completion.insertTextRules & 4 || (f10 = yY.escape(f10)), this.model.cancel(), n10.insert(f10, { overwriteBefore: c10.overwriteBefore, overwriteAfter: c10.overwriteAfter, undoStopBefore: false, undoStopAfter: false, adjustWhitespace: !(a10.completion.insertTextRules & 1), clipboardText: e206.model.clipboardText, overtypingCapturer: this._overtypingCapturer.value, reason: mE.suggest({ providerId: yi.fromExtensionId(a10.extensionId?.value) }) }), t10 & 2 || this.editor.pushUndoStop(), a10.completion.command) if (a10.completion.command.id === I3.id) this.model.trigger({ auto: true, retrigger: true });
    else {
      let e207 = new $t();
      o10.push(this._commandService.executeCommand(a10.completion.command.id, ...a10.completion.command.arguments ? [...a10.completion.command.arguments] : []).catch((e208) => {
        a10.completion.extensionId ? xe(e208) : be(e208);
      }).finally(() => {
        u10 = e207.elapsed();
      }));
    }
    t10 & 4 && this._alternatives.value.set(e206, (e207) => {
      for (s10.cancel(); r10.canUndo(); ) {
        i10 !== r10.getAlternativeVersionId() && r10.undo(), this._insertSuggestion(e207, 3 | (t10 & 8 ? 8 : 0));
        break;
      }
    }), this._alertCompletionItem(a10), Promise.all(o10).finally(() => {
      this._reportSuggestionAcceptedTelemetry(a10, r10, l10, u10, d10, e206.index, e206.model.items), this.model.clear(), s10.dispose();
    });
  }
  _reportSuggestionAcceptedTelemetry(e206, t10, n10, r10, i10, a10, o10) {
    if (Math.random() > 1e-4) return;
    let s10 = /* @__PURE__ */ new Map();
    for (let e207 = 0; e207 < Math.min(30, o10.length); e207++) {
      let t11 = o10[e207].textLabel;
      s10.has(t11) ? s10.get(t11).push(e207) : s10.set(t11, [e207]);
    }
    let c10 = s10.get(e206.textLabel), l10 = c10 && c10.length > 1 ? c10[0] : -1;
    this._telemetryService.publicLog2(`suggest.acceptedSuggestion`, { extensionId: e206.extensionId?.value ?? `unknown`, providerId: e206.provider._debugDisplayName ?? `unknown`, kind: e206.completion.kind, basenameHash: Is(Id(t10.uri)).toString(16), languageId: t10.getLanguageId(), fileExtension: ire(t10.uri), resolveInfo: e206.provider.resolveCompletionItem ? +!!n10 : -1, resolveDuration: e206.resolveDuration, commandDuration: r10, additionalEditsAsync: i10, index: a10, firstIndex: l10 });
  }
  getOverwriteInfo(e206, t10) {
    Je(this.editor.hasModel());
    let n10 = this.editor.getOption(134).insertMode === `replace`;
    t10 && (n10 = !n10);
    let r10 = e206.position.column - e206.editStart.column, i10 = (n10 ? e206.editReplaceEnd.column : e206.editInsertEnd.column) - e206.position.column, a10 = this.editor.getPosition().column - e206.position.column, o10 = this._lineSuffix.value ? this._lineSuffix.value.delta(this.editor.getPosition()) : 0;
    return { overwriteBefore: r10 + a10, overwriteAfter: i10 + o10 };
  }
  _alertCompletionItem(e206) {
    v(e206.completion.additionalTextEdits) && Wg(C(1463, `Accepting '{0}' made {1} additional edits`, e206.textLabel, e206.completion.additionalTextEdits.length));
  }
  triggerSuggest(e206, t10, n10) {
    this.editor.hasModel() && (this.model.trigger({ auto: t10 ?? false, completionOptions: { providerFilter: e206, kindFilter: n10 ? /* @__PURE__ */ new Set() : void 0 } }), this.editor.revealPosition(this.editor.getPosition(), 0), this.editor.focus());
  }
  triggerSuggestAndAcceptBest(e206) {
    if (!this.editor.hasModel()) return;
    let t10 = this.editor.getPosition(), n10 = () => {
      t10.equals(this.editor.getPosition()) && this._commandService.executeCommand(e206.fallback);
    }, r10 = (e207) => {
      if (e207.completion.insertTextRules & 4 || e207.completion.additionalTextEdits) return true;
      let t11 = this.editor.getPosition(), n11 = e207.editStart.column, r11 = t11.column;
      return r11 - n11 === e207.completion.insertText.length ? this.editor.getModel().getValueInRange({ startLineNumber: t11.lineNumber, startColumn: n11, endLineNumber: t11.lineNumber, endColumn: r11 }) !== e207.completion.insertText : true;
    };
    O.once(this.model.onDidTrigger)((e207) => {
      let t11 = [];
      O.any(this.model.onDidTrigger, this.model.onDidCancel)(() => {
        Kt(t11), n10();
      }, void 0, t11), this.model.onDidSuggest(({ completionModel: e208 }) => {
        if (Kt(t11), e208.items.length === 0) {
          n10();
          return;
        }
        let i10 = this._memoryService.select(this.editor.getModel(), this.editor.getPosition(), e208.items), a10 = e208.items[i10];
        if (!r10(a10)) {
          n10();
          return;
        }
        this.editor.pushUndoStop(), this._insertSuggestion({ index: i10, item: a10, model: e208 }, 7);
      }, void 0, t11);
    }), this.model.trigger({ auto: false, shy: true }), this.editor.revealPosition(t10, 0), this.editor.focus();
  }
  acceptSelectedSuggestion(e206, t10) {
    let n10 = this.widget.value.getFocusedItem(), r10 = 0;
    e206 && (r10 |= 4), t10 && (r10 |= 8), this._insertSuggestion(n10, r10);
  }
  acceptNextSuggestion() {
    this._alternatives.value.next();
  }
  acceptPrevSuggestion() {
    this._alternatives.value.prev();
  }
  cancelSuggestWidget() {
    this.model.cancel(), this.model.clear(), this.widget.value.hideWidget();
  }
  focusSuggestion() {
    this.widget.value.focusSelected();
  }
  selectNextSuggestion() {
    this.widget.value.selectNext();
  }
  selectNextPageSuggestion() {
    this.widget.value.selectNextPage();
  }
  selectLastSuggestion() {
    this.widget.value.selectLast();
  }
  selectPrevSuggestion() {
    this.widget.value.selectPrevious();
  }
  selectPrevPageSuggestion() {
    this.widget.value.selectPreviousPage();
  }
  selectFirstSuggestion() {
    this.widget.value.selectFirst();
  }
  toggleSuggestionDetails() {
    this.widget.value.toggleDetails();
  }
  toggleExplainMode() {
    this.widget.value.toggleExplainMode();
  }
  toggleSuggestionFocus() {
    this.widget.value.toggleDetailsFocus();
  }
  resetWidgetSize() {
    this.widget.value.resetPersistedSize();
  }
  forceRenderingAbove() {
    this.widget.isInitialized ? this.widget.value.forceRenderingAbove() : this._wantsForceRenderingAbove = true;
  }
  stopForceRenderingAbove() {
    this.widget.isInitialized ? this.widget.value.stopForceRenderingAbove() : this._wantsForceRenderingAbove = false;
  }
  registerSelector(e206) {
    return this._selectors.register(e206);
  }
}, P3 = _md, _md.ID = `editor.contrib.suggestController`, _md);
F3 = P3 = _Oe([N3(1, a3), N3(2, Mu), N3(3, nd), N3(4, V), N3(5, Ud), N3(6, bd)], F3);
var yOe = class {
  constructor(e206) {
    this.prioritySelector = e206, this._items = [];
  }
  register(e206) {
    if (this._items.indexOf(e206) !== -1) throw Error(`Value is already registered`);
    return this._items.push(e206), this._items.sort((e207, t10) => this.prioritySelector(t10) - this.prioritySelector(e207)), { dispose: () => {
      let t10 = this._items.indexOf(e206);
      t10 >= 0 && this._items.splice(t10, 1);
    } };
  }
  get itemsOrderedByPriorityDesc() {
    return this._items;
  }
}, I3 = (_nd = class extends G {
  constructor() {
    super({ id: _nd.id, label: w(1471, `Trigger Suggest`), precondition: H.and($.writable, $.hasCompletionItemProvider, b2.Visible.toNegated()), kbOpts: { kbExpr: $.textInputFocus, primary: 2058, secondary: [2087], mac: { primary: 266, secondary: [521, 2087] }, weight: 100 } });
  }
  run(e206, t10, n10) {
    let r10 = F3.get(t10);
    if (!r10) return;
    let i10;
    n10 && typeof n10 == `object` && n10.auto === true && (i10 = true), r10.triggerSuggest(void 0, i10, void 0);
  }
}, _nd.id = `editor.action.triggerSuggest`, _nd);
af(F3.ID, F3, 2), q(I3);
var L3 = 190, R3 = $d.bindToContribution(F3.get);
K(new R3({ id: `acceptSelectedSuggestion`, precondition: H.and(b2.Visible, b2.HasFocusedSuggestion), handler(e206) {
  e206.acceptSelectedSuggestion(true, false);
}, kbOpts: [{ primary: 2, kbExpr: H.and(b2.Visible, $.textInputFocus), weight: L3 }, { primary: 3, kbExpr: H.and(b2.Visible, $.textInputFocus, b2.AcceptSuggestionsOnEnter, b2.MakesTextEdit), weight: L3 }], menuOpts: [{ menuId: x2, title: C(1464, `Insert`), group: `left`, order: 1, when: b2.HasInsertAndReplaceRange.toNegated() }, { menuId: x2, title: C(1465, `Insert`), group: `left`, order: 1, when: H.and(b2.HasInsertAndReplaceRange, b2.InsertMode.isEqualTo(`insert`)) }, { menuId: x2, title: C(1466, `Replace`), group: `left`, order: 1, when: H.and(b2.HasInsertAndReplaceRange, b2.InsertMode.isEqualTo(`replace`)) }] })), K(new R3({ id: `acceptAlternativeSelectedSuggestion`, precondition: H.and(b2.Visible, $.textInputFocus, b2.HasFocusedSuggestion), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 1027, secondary: [1026] }, handler(e206) {
  e206.acceptSelectedSuggestion(false, true);
}, menuOpts: [{ menuId: x2, group: `left`, order: 2, when: H.and(b2.HasInsertAndReplaceRange, b2.InsertMode.isEqualTo(`insert`)), title: C(1467, `Replace`) }, { menuId: x2, group: `left`, order: 2, when: H.and(b2.HasInsertAndReplaceRange, b2.InsertMode.isEqualTo(`replace`)), title: C(1468, `Insert`) }] })), Nu.registerCommandAlias(`acceptSelectedSuggestionOnEnter`, `acceptSelectedSuggestion`), K(new R3({ id: `hideSuggestWidget`, precondition: b2.Visible, handler: (e206) => e206.cancelSuggestWidget(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 9, secondary: [1033] } })), K(new R3({ id: `selectNextSuggestion`, precondition: H.and(b2.Visible, H.or(b2.MultipleSuggestions, b2.HasFocusedSuggestion.negate())), handler: (e206) => e206.selectNextSuggestion(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 18, secondary: [2066], mac: { primary: 18, secondary: [2066, 300] } } })), K(new R3({ id: `selectNextPageSuggestion`, precondition: H.and(b2.Visible, H.or(b2.MultipleSuggestions, b2.HasFocusedSuggestion.negate())), handler: (e206) => e206.selectNextPageSuggestion(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 12, secondary: [2060] } })), K(new R3({ id: `selectLastSuggestion`, precondition: H.and(b2.Visible, H.or(b2.MultipleSuggestions, b2.HasFocusedSuggestion.negate())), handler: (e206) => e206.selectLastSuggestion() })), K(new R3({ id: `selectPrevSuggestion`, precondition: H.and(b2.Visible, H.or(b2.MultipleSuggestions, b2.HasFocusedSuggestion.negate())), handler: (e206) => e206.selectPrevSuggestion(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 16, secondary: [2064], mac: { primary: 16, secondary: [2064, 302] } } })), K(new R3({ id: `selectPrevPageSuggestion`, precondition: H.and(b2.Visible, H.or(b2.MultipleSuggestions, b2.HasFocusedSuggestion.negate())), handler: (e206) => e206.selectPrevPageSuggestion(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 11, secondary: [2059] } })), K(new R3({ id: `selectFirstSuggestion`, precondition: H.and(b2.Visible, H.or(b2.MultipleSuggestions, b2.HasFocusedSuggestion.negate())), handler: (e206) => e206.selectFirstSuggestion() })), K(new R3({ id: `focusSuggestion`, precondition: H.and(b2.Visible, b2.HasFocusedSuggestion.negate()), handler: (e206) => e206.focusSuggestion(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 2058, secondary: [2087], mac: { primary: 266, secondary: [2087] } } })), K(new R3({ id: `focusAndAcceptSuggestion`, precondition: H.and(b2.Visible, b2.HasFocusedSuggestion.negate()), handler: (e206) => {
  e206.focusSuggestion(), e206.acceptSelectedSuggestion(true, false);
} })), K(new R3({ id: `toggleSuggestionDetails`, precondition: H.and(b2.Visible, b2.HasFocusedSuggestion), handler: (e206) => e206.toggleSuggestionDetails(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 2058, secondary: [2087], mac: { primary: 266, secondary: [2087] } }, menuOpts: [{ menuId: x2, group: `right`, order: 1, when: H.and(b2.DetailsVisible, b2.CanResolve), title: C(1469, `Show Less`) }, { menuId: x2, group: `right`, order: 1, when: H.and(b2.DetailsVisible.toNegated(), b2.CanResolve), title: C(1470, `Show More`) }] })), K(new R3({ id: `toggleExplainMode`, precondition: b2.Visible, handler: (e206) => e206.toggleExplainMode(), kbOpts: { weight: 100, primary: 2138 } })), K(new R3({ id: `toggleSuggestionFocus`, precondition: b2.Visible, handler: (e206) => e206.toggleSuggestionFocus(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 2570, mac: { primary: 778 } } })), K(new R3({ id: `insertBestCompletion`, precondition: H.and($.textInputFocus, H.equals(`config.editor.tabCompletion`, `on`), s3.AtEnd, b2.Visible.toNegated(), l3.OtherSuggestions.toNegated(), p4.InSnippetMode.toNegated()), handler: (e206, t10) => {
  e206.triggerSuggestAndAcceptBest(Be(t10) ? { fallback: `tab`, ...t10 } : { fallback: `tab` });
}, kbOpts: { weight: L3, primary: 2 } })), K(new R3({ id: `insertNextSuggestion`, precondition: H.and($.textInputFocus, H.equals(`config.editor.tabCompletion`, `on`), l3.OtherSuggestions, b2.Visible.toNegated(), p4.InSnippetMode.toNegated()), handler: (e206) => e206.acceptNextSuggestion(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 2 } })), K(new R3({ id: `insertPrevSuggestion`, precondition: H.and($.textInputFocus, H.equals(`config.editor.tabCompletion`, `on`), l3.OtherSuggestions, b2.Visible.toNegated(), p4.InSnippetMode.toNegated()), handler: (e206) => e206.acceptPrevSuggestion(), kbOpts: { weight: L3, kbExpr: $.textInputFocus, primary: 1026 } })), q(class extends G {
  constructor() {
    super({ id: `editor.action.resetSuggestSize`, label: w(1472, `Reset Suggest Widget Size`), precondition: void 0 });
  }
  run(e206, t10) {
    F3.get(t10)?.resetWidgetSize();
  }
});
var bOe = class extends D {
  get selectedItem() {
    return this._currentSuggestItemInfo;
  }
  constructor(e206, t10, n10) {
    super(), this.editor = e206, this.suggestControllerPreselector = t10, this.onWillAccept = n10, this.isSuggestWidgetVisible = false, this.isShiftKeyPressed = false, this._isActive = false, this._currentSuggestItemInfo = void 0, this._onDidSelectedItemChange = this._register(new k()), this.onDidSelectedItemChange = this._onDidSelectedItemChange.event, this._register(e206.onKeyDown((e207) => {
      e207.shiftKey && !this.isShiftKeyPressed && (this.isShiftKeyPressed = true, this.update(this._isActive));
    })), this._register(e206.onKeyUp((e207) => {
      e207.shiftKey && this.isShiftKeyPressed && (this.isShiftKeyPressed = false, this.update(this._isActive));
    }));
    let r10 = F3.get(this.editor);
    if (r10) {
      this._register(r10.registerSelector({ priority: 100, select: (e208, t12, n11) => {
        let i10 = this.editor.getModel();
        if (!i10) return -1;
        let a10 = this.suggestControllerPreselector(), o10 = a10 ? w4(a10, i10) : void 0;
        if (!o10) return -1;
        let s10 = j.lift(t12), c10 = Pm(n11.map((e209, t13) => {
          let n12 = w4(z3.fromSuggestion(r10, i10, s10, e209, this.isShiftKeyPressed).getSingleTextEdit(), i10);
          return { index: t13, valid: T4(o10, n12), prefixLength: n12.text.length, suggestItem: e209 };
        }).filter((e209) => e209 && e209.valid && e209.prefixLength > 0), ce((e209) => e209.prefixLength, ue));
        return c10 ? c10.index : -1;
      } }));
      let e207 = false, t11 = () => {
        e207 || (e207 = true, this._register(r10.widget.value.onDidShow(() => {
          this.isSuggestWidgetVisible = true, this.update(true);
        })), this._register(r10.widget.value.onDidHide(() => {
          this.isSuggestWidgetVisible = false, this.update(false);
        })), this._register(r10.widget.value.onDidFocus(() => {
          this.isSuggestWidgetVisible = true, this.update(true);
        })));
      };
      this._register(O.once(r10.model.onDidTrigger)((e208) => {
        t11();
      })), this._register(r10.onWillInsertSuggestItem((e208) => {
        let t12 = this.editor.getPosition(), n11 = this.editor.getModel();
        if (!t12 || !n11) return;
        let i10 = z3.fromSuggestion(r10, n11, t12, e208.item, this.isShiftKeyPressed);
        this.onWillAccept(i10);
      }));
    }
    this.update(this._isActive);
  }
  update(e206) {
    let t10 = this.getSuggestItemInfo();
    (this._isActive !== e206 || !xOe(this._currentSuggestItemInfo, t10)) && (this._isActive = e206, this._currentSuggestItemInfo = t10, this._onDidSelectedItemChange.fire());
  }
  getSuggestItemInfo() {
    let e206 = F3.get(this.editor);
    if (!e206 || !this.isSuggestWidgetVisible) return;
    let t10 = e206.widget.value.getFocusedItem(), n10 = this.editor.getPosition(), r10 = this.editor.getModel();
    if (!(!t10 || !n10 || !r10)) return z3.fromSuggestion(e206, r10, n10, t10.item, this.isShiftKeyPressed);
  }
  stopForceRenderingAbove() {
    F3.get(this.editor)?.stopForceRenderingAbove();
  }
  forceRenderingAbove() {
    F3.get(this.editor)?.forceRenderingAbove();
  }
}, z3 = class e196 {
  static fromSuggestion(t10, n10, r10, i10, a10) {
    let { insertText: o10 } = i10.completion, s10 = false;
    if (i10.completion.insertTextRules & 4) {
      let e206 = new yY().parse(o10);
      e206.children.length < 100 && l4.adjustWhitespace(n10, r10, true, e206), o10 = e206.toString(), s10 = true;
    }
    let c10 = t10.getOverwriteInfo(i10, a10);
    return new e196(M.fromPositions(r10.delta(0, -c10.overwriteBefore), r10.delta(0, Math.max(c10.overwriteAfter, 0))), o10, i10.completion.kind, s10, i10.container.incomplete ?? false);
  }
  constructor(e206, t10, n10, r10, i10) {
    this.range = e206, this.insertText = t10, this.completionItemKind = n10, this.isSnippetText = r10, this.listIncomplete = i10;
  }
  equals(e206) {
    return this.range.equalsRange(e206.range) && this.insertText === e206.insertText && this.completionItemKind === e206.completionItemKind && this.isSnippetText === e206.isSnippetText;
  }
  toSelectedSuggestionInfo() {
    return new _i2(this.range, this.insertText, this.completionItemKind, this.isSnippetText);
  }
  getSingleTextEdit() {
    return new Ym(this.range, this.insertText);
  }
};
function xOe(e206, t10) {
  return e206 === t10 ? true : !e206 || !t10 ? false : e206.equals(t10);
}
var SOe = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editorObs = e206, this._handleSuggestAccepted = t10, this._suggestControllerPreselector = n10, this._suggestWidgetAdaptor = this._register(new bOe(this._editorObs.editor, () => (this._editorObs.forceUpdate(), this._suggestControllerPreselector()), (e207) => this._editorObs.forceUpdate((t11) => {
      this._handleSuggestAccepted(e207);
    }))), this.selectedItem = Tc(this, (e207) => this._suggestWidgetAdaptor.onDidSelectedItemChange(() => {
      this._editorObs.forceUpdate((t11) => e207(void 0));
    }), () => this._suggestWidgetAdaptor.selectedItem);
  }
  stopForceRenderingAbove() {
    this._suggestWidgetAdaptor.stopForceRenderingAbove();
  }
  forceRenderingAbove() {
    this._suggestWidgetAdaptor.forceRenderingAbove();
  }
}, COe = class {
  constructor(e206, t10) {
    this.lineNumber = e206, this.columnRange = t10;
  }
}, B3 = class {
  constructor(e206, t10) {
    if (this.startColumn = e206, this.endColumnExclusive = t10, e206 > t10) throw new je(`startColumn ${e206} cannot be after endColumnExclusive ${t10}`);
  }
  toRange(e206) {
    return new M(e206, this.startColumn, e206, this.endColumnExclusive);
  }
  equals(e206) {
    return this.startColumn === e206.startColumn && this.endColumnExclusive === e206.endColumnExclusive;
  }
  toZeroBasedOffsetRange() {
    return new Tm(this.startColumn - 1, this.endColumnExclusive - 1);
  }
}, V3 = class e197 {
  static fromLineTokens(t10) {
    let n10 = [];
    for (let e206 = 0; e206 < t10.getCount(); e206++) n10.push(new H3(t10.getTokenText(e206), t10.getMetadata(e206)));
    return e197.create(n10);
  }
  static create(t10) {
    return new e197(t10);
  }
  constructor(e206) {
    this._tokenInfo = e206;
  }
  toLineTokens(e206) {
    return rg.createFromTextAndMetadata(this.map((e207, t10) => ({ text: t10.text, metadata: t10.metadata })), e206);
  }
  map(e206) {
    let t10 = [], n10 = 0;
    for (let r10 of this._tokenInfo) {
      let i10 = new Tm(n10, n10 + r10.text.length);
      t10.push(e206(i10, r10)), n10 += r10.text.length;
    }
    return t10;
  }
  slice(t10) {
    let n10 = [], r10 = 0;
    for (let e206 of this._tokenInfo) {
      let i10 = r10, a10 = i10 + e206.text.length;
      if (a10 > t10.start) {
        if (i10 >= t10.endExclusive) break;
        let r11 = Math.max(0, t10.start - i10), o10 = Math.max(0, a10 - t10.endExclusive);
        n10.push(new H3(e206.text.slice(r11, e206.text.length - o10), e206.metadata));
      }
      r10 += e206.text.length;
    }
    return e197.create(n10);
  }
  append(t10) {
    let n10 = this._tokenInfo.concat(t10._tokenInfo);
    return e197.create(n10);
  }
}, H3 = class {
  constructor(e206, t10) {
    this.text = e206, this.metadata = t10;
  }
}, wOe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, TOe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, U3 = `ghost-text`, W3 = (_od = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._editor = e206, this._model = t10, this._options = n10, this._shouldKeepCursorStable = r10, this._isClickable = i10, this._languageService = a10, this._isDisposed = Ic(this, false), this._editorObs = WK(this._editor), this._warningState = I((e207) => {
      let t11 = this._model.ghostText.read(e207);
      if (!t11) return;
      let n11 = this._model.warning.read(e207);
      if (n11) return { lineNumber: t11.lineNumber, position: new j(t11.lineNumber, t11.parts[0].column), icon: n11.icon };
    }), this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._useSyntaxHighlighting = this._options.map((e207) => e207.syntaxHighlightingEnabled), this._extraClassNames = I(this, (e207) => {
      let t11 = [...this._options.read(e207).extraClasses ?? []];
      return this._useSyntaxHighlighting.read(e207) && t11.push(`syntax-highlighted`), this._warningState.read(e207) && t11.push(`warning`), t11.map((e208) => ` ${e208}`).join(``);
    }), this.uiState = I(this, (e207) => {
      if (this._isDisposed.read(e207)) return;
      let t11 = this._editorObs.model.read(e207);
      if (t11 !== this._model.targetTextModel.read(e207)) return;
      let n11 = this._model.ghostText.read(e207);
      if (!n11) return;
      let r11 = n11 instanceof x4 ? n11.columnRange : void 0, i11 = this._useSyntaxHighlighting.read(e207), { inlineTexts: a11, additionalLines: o10, hiddenRange: s10, additionalLinesOriginalSuffix: c10 } = EOe(n11, t11, U3 + this._extraClassNames.read(e207)), l10 = t11.getLineContent(n11.lineNumber), u10 = new Bw(a11.map((e208) => Vw.insert(e208.column - 1, e208.text))), d10 = i11 ? t11.tokenization.tokenizeLinesAt(n11.lineNumber, [u10.apply(l10), ...o10.map((e208) => e208.content)]) : void 0, f10 = u10.getNewRanges(), p10 = a11.map((e208, t12) => ({ ...e208, tokens: d10?.[0]?.getTokensInRange(f10[t12]) })), m10 = o10.map((e208, n12) => {
        let r12 = d10?.[n12 + 1] ?? rg.createEmpty(e208.content, this._languageService.languageIdCodec);
        if (n12 === o10.length - 1 && c10) {
          let e209 = V3.fromLineTokens(t11.tokenization.getLineTokens(c10.lineNumber)).slice(c10.columnRange.toZeroBasedOffsetRange());
          r12 = V3.fromLineTokens(r12).append(e209).toLineTokens(r12.languageIdCodec);
        }
        return { content: r12, decorations: e208.decorations };
      }), h10 = this._editor.getSelection()?.getStartPosition().column, g10 = p10.filter((e208) => e208.text !== ``), _10 = g10.length !== 0, v10 = { cursorColumnDistance: (_10 ? g10[0].column : 1) - h10, cursorLineDistance: _10 ? 0 : o10.findIndex((e208) => e208.content !== ``) + 1, lineCountOriginal: +!!_10, lineCountModified: o10.length + +!!_10, characterCountOriginal: 0, characterCountModified: _e(g10.map((e208) => e208.text.length)) + _e(m10.map((e208) => e208.content.getTextLength())), disjointReplacements: g10.length + +(o10.length > 0), sameShapeReplacements: g10.length > 1 && m10.length === 0 ? g10.every((e208) => e208.text === g10[0].text) : void 0 };
      return this._model.handleInlineCompletionShown.read(e207)?.(v10), { replacedRange: r11, inlineTexts: p10, additionalLines: m10, hiddenRange: s10, lineNumber: n11.lineNumber, additionalReservedLineCount: this._model.minReservedLineCount.read(e207), targetTextModel: t11, syntaxHighlightingEnabled: i11 };
    }), this.decorations = I(this, (e207) => {
      let t11 = this.uiState.read(e207);
      if (!t11) return [];
      let n11 = [], r11 = this._extraClassNames.read(e207);
      t11.replacedRange && n11.push({ range: t11.replacedRange.toRange(t11.lineNumber), options: { inlineClassName: `inline-completion-text-to-replace` + r11, description: `GhostTextReplacement` } }), t11.hiddenRange && n11.push({ range: t11.hiddenRange.toRange(t11.lineNumber), options: { inlineClassName: `ghost-text-hidden`, description: `ghost-text-hidden` } });
      for (let e208 of t11.inlineTexts) n11.push({ range: M.fromPositions(new j(t11.lineNumber, e208.column)), options: { description: `ghost-text-decoration`, after: { content: e208.text, tokens: e208.tokens, inlineClassName: (e208.preview ? `ghost-text-decoration-preview` : `ghost-text-decoration`) + (this._isClickable ? ` clickable` : ``) + r11 + e208.lineDecorations.map((e209) => ` ` + e209.className).join(` `), cursorStops: tm.Left, attachedData: new G3(this) }, showIfCollapsed: true } });
      return n11;
    }), this._additionalLinesWidget = this._register(new DOe(this._editor, I((e207) => {
      let t11 = this.uiState.read(e207);
      return t11 ? { lineNumber: t11.lineNumber, additionalLines: t11.additionalLines, minReservedLineCount: t11.additionalReservedLineCount, targetTextModel: t11.targetTextModel } : void 0;
    }), this._shouldKeepCursorStable, this._isClickable)), this._isInlineTextHovered = this._editorObs.isTargetHovered((e207) => e207.target.type === 6 && e207.target.detail.injectedText?.options.attachedData instanceof G3 && e207.target.detail.injectedText.options.attachedData.owner === this, this._store), this.isHovered = I(this, (e207) => this._isDisposed.read(e207) ? false : this._isInlineTextHovered.read(e207) || this._additionalLinesWidget.isHovered.read(e207)), this.height = I(this, (e207) => this._editorObs.getOption(75).read(e207) + (this._additionalLinesWidget.viewZoneHeight.read(e207) ?? 0)), this._register(T(() => {
      this._isDisposed.set(true, void 0);
    })), this._register(this._editorObs.setDecorations(this.decorations)), this._isClickable && (this._register(this._additionalLinesWidget.onDidClick((e207) => this._onDidClick.fire(e207))), this._register(this._editor.onMouseUp((e207) => {
      if (e207.target.type !== 6) return;
      let t11 = e207.target.detail.injectedText?.options.attachedData;
      t11 instanceof G3 && t11.owner === this && this._onDidClick.fire(e207.event);
    }))), this._register(vc((e207, t11) => {
    }));
  }
  static getWarningWidgetContext(e206) {
    let t10 = e206.ghostTextViewWarningWidgetData;
    if (t10) return t10;
    if (e206.parentElement) return this.getWarningWidgetContext(e206.parentElement);
  }
  ownsViewZone(e206) {
    return this._additionalLinesWidget.viewZoneId === e206;
  }
}, _od.hot = MG(_od), _od);
W3 = wOe([TOe(5, Jf)], W3);
var G3 = class {
  constructor(e206) {
    this.owner = e206;
  }
};
function EOe(e206, t10, n10) {
  let r10 = [], i10 = [];
  function a10(e207, t11) {
    if (i10.length > 0) {
      let n11 = i10[i10.length - 1];
      t11 && n11.decorations.push(new og(n11.content.length + 1, n11.content.length + 1 + e207[0].line.length, t11, 0)), n11.content += e207[0].line, e207 = e207.slice(1);
    }
    for (let n11 of e207) i10.push({ content: n11.line, decorations: t11 ? [new og(1, n11.line.length + 1, t11, 0), ...n11.lineDecorations] : [...n11.lineDecorations] });
  }
  let o10 = t10.getLineContent(e206.lineNumber), s10, c10 = 0;
  for (let t11 of e206.parts) {
    let e207 = t11.lines;
    s10 === void 0 ? (r10.push({ column: t11.column, text: e207[0].line, preview: t11.preview, lineDecorations: e207[0].lineDecorations }), e207 = e207.slice(1)) : a10([{ line: o10.substring(c10, t11.column - 1), lineDecorations: [] }], void 0), e207.length > 0 && (a10(e207, n10), s10 === void 0 && t11.column <= o10.length && (s10 = t11.column)), c10 = t11.column - 1;
  }
  let l10;
  return s10 !== void 0 && (l10 = new COe(e206.lineNumber, new B3(c10 + 1, o10.length + 1))), { inlineTexts: r10, additionalLines: i10, hiddenRange: s10 === void 0 ? void 0 : new B3(s10, o10.length + 1), additionalLinesOriginalSuffix: l10 };
}
var DOe = class extends D {
  get viewZoneId() {
    return this._viewZoneInfo?.viewZoneId;
  }
  get viewZoneHeight() {
    return this._viewZoneHeight;
  }
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._lines = t10, this._shouldKeepCursorStable = n10, this._isClickable = r10, this._viewZoneHeight = Ic(`viewZoneHeight`, void 0), this.editorOptionsChanged = TK(`editorOptionChanged`, O.filter(this._editor.onDidChangeConfiguration, (e207) => e207.hasChanged(40) || e207.hasChanged(133) || e207.hasChanged(113) || e207.hasChanged(108) || e207.hasChanged(60) || e207.hasChanged(59) || e207.hasChanged(75))), this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._viewZoneListener = this._register(new Jt()), this.isHovered = WK(this._editor).isTargetHovered((e207) => K3(e207.target.element), this._store), this.hasBeenAccepted = false, this._editor instanceof Mk && this._shouldKeepCursorStable && this._register(this._editor.onBeforeExecuteEdit((e207) => this.hasBeenAccepted = e207.source === `inlineSuggestion.accept`)), this._register(hc((e207) => {
      let t11 = this._lines.read(e207);
      this.editorOptionsChanged.read(e207), t11 ? (this.hasBeenAccepted = false, this.updateLines(t11.lineNumber, t11.additionalLines, t11.minReservedLineCount)) : this.clear();
    }));
  }
  dispose() {
    super.dispose(), this.clear();
  }
  clear() {
    this._viewZoneListener.clear(), this._editor.changeViewZones((e206) => {
      this.removeActiveViewZone(e206);
    });
  }
  updateLines(e206, t10, n10) {
    let r10 = this._editor.getModel();
    if (!r10) return;
    let { tabSize: i10 } = r10.getOptions();
    this._editor.changeViewZones((r11) => {
      let a10 = new E();
      this.removeActiveViewZone(r11);
      let o10 = Math.max(t10.length, n10);
      if (o10 > 0) {
        let n11 = document.createElement(`div`);
        OOe(n11, i10, t10, this._editor.getOptions(), this._isClickable), this._isClickable && (a10.add(L(n11, `mousedown`, (e207) => {
          e207.preventDefault();
        })), a10.add(L(n11, `click`, (e207) => {
          K3(e207.target) && this._onDidClick.fire(new Xo(Vc(e207), e207));
        }))), this.addViewZone(r11, e206, o10, n11);
      }
      this._viewZoneListener.value = a10;
    });
  }
  addViewZone(e206, t10, n10, r10) {
    let i10 = e206.addZone({ afterLineNumber: t10, heightInLines: n10, domNode: r10, afterColumnAffinity: 1, onComputedHeight: (e207) => {
      this._viewZoneHeight.set(e207, void 0);
    } });
    this.keepCursorStable(t10, n10), this._viewZoneInfo = { viewZoneId: i10, heightInLines: n10, lineNumber: t10 };
  }
  removeActiveViewZone(e206) {
    this._viewZoneInfo && (e206.removeZone(this._viewZoneInfo.viewZoneId), this.hasBeenAccepted || this.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines), this._viewZoneInfo = void 0, this._viewZoneHeight.set(void 0, void 0));
  }
  keepCursorStable(e206, t10) {
    if (!this._shouldKeepCursorStable) return;
    let n10 = this._editor.getSelection()?.getStartPosition()?.lineNumber;
    n10 !== void 0 && e206 < n10 && this._editor.setScrollTop(this._editor.getScrollTop() + t10 * this._editor.getOption(75));
  }
};
function K3(e206) {
  return Fl(e206) && e206.classList.contains(U3);
}
function OOe(e206, t10, n10, r10, i10) {
  let a10 = r10.get(40), o10 = r10.get(133), s10 = r10.get(108), c10 = r10.get(60), l10 = r10.get(59), u10 = r10.get(75), d10 = `suggest-preview-text`;
  i10 && (d10 += ` clickable`);
  let f10 = new Ff(1e4);
  f10.appendString(`<div class="${d10}">`);
  for (let e207 = 0, r11 = n10.length; e207 < r11; e207++) {
    let r12 = n10[e207], i11 = r12.content;
    f10.appendString(`<div class="view-line`), f10.appendString(`" style="top:`), f10.appendString(String(e207 * u10)), f10.appendString(`px;width:1000000px;">`);
    let d11 = i11.getLineContent(), p11 = go(d11), m10 = ho(d11);
    pg(new lg(l10.isMonospace && !a10, l10.canUseHalfwidthRightwardsArrow, d11, false, p11, m10, 0, i11, r12.decorations, t10, 0, l10.spaceWidth, l10.middotWidth, l10.wsmiddotWidth, o10, `none`, s10, c10 !== Gn.OFF, null, null, 0), f10), f10.appendString(`</div>`);
  }
  f10.appendString(`</div>`), vu(e206, l10);
  let p10 = f10.build();
  e206.innerHTML = q3 ? q3.createHTML(p10) : p10;
}
var q3 = _f2(`editorGhostText`, { createHTML: (e206) => e206 }), kOe = (_pd = class {
  constructor(e206) {
    this.replacements = e206, Pe(Le(e206, (e207, t10) => e207.lineRange.endLineNumberExclusive <= t10.lineRange.startLineNumber));
  }
  toString() {
    return this.replacements.map((e206) => e206.toString()).join(`,`);
  }
  getNewLineRanges() {
    let e206 = [], t10 = 0;
    for (let n10 of this.replacements) e206.push(zm.ofLength(n10.lineRange.startLineNumber + t10, n10.newLines.length)), t10 += n10.newLines.length - n10.lineRange.length;
    return e206;
  }
}, _pd.empty = new _pd([]), _pd), J3 = class e198 {
  static fromSingleTextEdit(t10, n10) {
    let r10 = Wa(t10.text), i10 = t10.range.startLineNumber, a10 = n10.getValueOfRange(M.fromPositions(new j(t10.range.startLineNumber, 1), t10.range.getStartPosition()));
    r10[0] = a10 + r10[0];
    let o10 = t10.range.endLineNumber + 1, s10 = n10.getTransformer().getLineLength(t10.range.endLineNumber) + 1, c10 = n10.getValueOfRange(M.fromPositions(t10.range.getEndPosition(), new j(t10.range.endLineNumber, s10)));
    r10[r10.length - 1] = r10[r10.length - 1] + c10;
    let l10 = t10.range.startColumn === n10.getTransformer().getLineLength(t10.range.startLineNumber) + 1, u10 = t10.range.endColumn === 1;
    return l10 && r10[0].length === a10.length && (i10++, r10.shift()), r10.length > 0 && i10 < o10 && u10 && r10[r10.length - 1].length === c10.length && (o10--, r10.pop()), new e198(new zm(i10, o10), r10);
  }
  constructor(e206, t10) {
    this.lineRange = e206, this.newLines = t10;
  }
  toString() {
    return `${this.lineRange}->${JSON.stringify(this.newLines)}`;
  }
  toLineEdit() {
    return new kOe([this]);
  }
}, Y3 = class {
  get lineEdit() {
    return this.edit.replacements.length === 0 ? new J3(new zm(1, 1), []) : J3.fromSingleTextEdit(this.edit.toReplacement(this.originalText), this.originalText);
  }
  get originalLineRange() {
    return this.lineEdit.lineRange;
  }
  get modifiedLineRange() {
    return this.lineEdit.toLineEdit().getNewLineRanges()[0];
  }
  get displayRange() {
    return this.originalText.lineRange.intersect(this.originalLineRange.join(zm.ofLength(this.originalLineRange.startLineNumber, this.lineEdit.newLines.length)));
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    this.originalText = e206, this.edit = t10, this.cursorPosition = n10, this.multiCursorPositions = r10, this.commands = i10, this.inlineCompletion = a10;
  }
}, X3 = class {
  constructor(e206, t10, n10) {
    this._model = e206, this.inlineEdit = t10, this.tabAction = n10, this.action = this.inlineEdit.inlineCompletion.action, this.displayName = this.inlineEdit.inlineCompletion.source.provider.displayName ?? C(1219, `Inline Edit`), this.extensionCommands = this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands ?? [], this.isInDiffEditor = this._model.isInDiffEditor, this.displayLocation = this.inlineEdit.inlineCompletion.hint, this.showCollapsed = this._model.showCollapsed;
  }
  accept() {
    this._model.accept();
  }
  jump() {
    this._model.jump();
  }
  handleInlineEditShown(e206, t10) {
    this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion, e206, t10);
  }
}, AOe = class {
  constructor(e206) {
    this._model = e206, this.onDidAccept = this._model.onDidAccept, this.inAcceptFlow = this._model.inAcceptFlow;
  }
}, jOe = class {
  constructor(e206, t10, n10, r10) {
    this.lineRange = n10;
    let i10 = WK(e206), a10 = I(this, (e207) => i10.isFocused.read(e207) && r10.showInlineEditMenu ? V4.Accept : V4.Inactive);
    this.model = new X3(t10, new Y3(new qm(``), new Jm([r10.getSingleTextEdit()]), t10.primaryPosition.get(), t10.allPositions.get(), r10.source.inlineSuggestions.commands ?? [], r10), a10);
  }
}, Z3 = class e199 {
  static fromPoints(t10, n10) {
    return new e199(t10.x, t10.y, n10.x, n10.y);
  }
  static fromPointSize(t10, n10) {
    return new e199(t10.x, t10.y, t10.x + n10.x, t10.y + n10.y);
  }
  static fromLeftTopRightBottom(t10, n10, r10, i10) {
    return new e199(t10, n10, r10, i10);
  }
  static fromLeftTopWidthHeight(t10, n10, r10, i10) {
    return new e199(t10, n10, t10 + r10, n10 + i10);
  }
  static fromRanges(t10, n10) {
    return new e199(t10.start, n10.start, t10.endExclusive, n10.endExclusive);
  }
  static hull(t10) {
    let n10 = 2 ** 53 - 1, r10 = 2 ** 53 - 1, i10 = -(2 ** 53 - 1), a10 = -(2 ** 53 - 1);
    for (let e206 of t10) n10 = Math.min(n10, e206.left), r10 = Math.min(r10, e206.top), i10 = Math.max(i10, e206.right), a10 = Math.max(a10, e206.bottom);
    return new e199(n10, r10, i10, a10);
  }
  get width() {
    return this.right - this.left;
  }
  get height() {
    return this.bottom - this.top;
  }
  constructor(e206, t10, n10, r10) {
    if (this.left = e206, this.top = t10, this.right = n10, this.bottom = r10, e206 > n10) throw new je(`Invalid arguments: Horizontally offset by ` + (e206 - n10));
    if (t10 > r10) throw new je(`Invalid arguments: Vertically offset by ` + (t10 - r10));
  }
  withMargin(t10, n10, r10, i10) {
    let a10, o10, s10, c10;
    return n10 === void 0 && r10 === void 0 && i10 === void 0 ? a10 = o10 = s10 = c10 = t10 : r10 === void 0 && i10 === void 0 ? (a10 = o10 = n10, s10 = c10 = t10) : (a10 = i10, o10 = n10, s10 = t10, c10 = r10), new e199(this.left - a10, this.top - s10, this.right + o10, this.bottom + c10);
  }
  intersectVertical(t10) {
    let n10 = Math.max(this.top, t10.start), r10 = Math.min(this.bottom, t10.endExclusive);
    return new e199(this.left, n10, this.right, Math.max(n10, r10));
  }
  intersectHorizontal(t10) {
    let n10 = Math.max(this.left, t10.start), r10 = Math.min(this.right, t10.endExclusive);
    return new e199(n10, this.top, Math.max(n10, r10), this.bottom);
  }
  toString() {
    return `Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`;
  }
  intersect(t10) {
    let n10 = Math.max(this.left, t10.left), r10 = Math.min(this.right, t10.right), i10 = Math.max(this.top, t10.top), a10 = Math.min(this.bottom, t10.bottom);
    if (!(n10 > r10 || i10 > a10)) return new e199(n10, i10, r10, a10);
  }
  containsRect(e206) {
    return this.left <= e206.left && this.top <= e206.top && this.right >= e206.right && this.bottom >= e206.bottom;
  }
  containsPoint(e206) {
    return this.left <= e206.x && this.top <= e206.y && this.right >= e206.x && this.bottom >= e206.y;
  }
  moveToBeContainedIn(t10) {
    let n10 = this.width, r10 = this.height, i10 = this.left, a10 = this.top;
    return i10 < t10.left ? i10 = t10.left : i10 + n10 > t10.right && (i10 = t10.right - n10), a10 < t10.top ? a10 = t10.top : a10 + r10 > t10.bottom && (a10 = t10.bottom - r10), new e199(i10, a10, i10 + n10, a10 + r10);
  }
  withWidth(t10) {
    return new e199(this.left, this.top, this.left + t10, this.bottom);
  }
  withHeight(t10) {
    return new e199(this.left, this.top, this.right, this.top + t10);
  }
  withTop(t10) {
    return new e199(this.left, t10, this.right, this.bottom);
  }
  withLeft(t10) {
    return new e199(t10, this.top, this.right, this.bottom);
  }
  translateX(t10) {
    return new e199(this.left + t10, this.top, this.right + t10, this.bottom);
  }
  translateY(t10) {
    return new e199(this.left, this.top + t10, this.right, this.bottom + t10);
  }
  getLeftBottom() {
    return new UK(this.left, this.bottom);
  }
  getRightBottom() {
    return new UK(this.right, this.bottom);
  }
  getRightTop() {
    return new UK(this.right, this.top);
  }
  toStyles() {
    return { position: `absolute`, left: `${this.left}px`, top: `${this.top}px`, width: `${this.width}px`, height: `${this.height}px` };
  }
}, Q3 = class e200 {
  constructor(e206, t10, n10, r10 = null) {
    this.startLineNumbers = e206, this.endLineNumbers = t10, this.lastLineRelativePosition = n10, this.showEndForLine = r10;
  }
  equals(e206) {
    return !!e206 && this.lastLineRelativePosition === e206.lastLineRelativePosition && this.showEndForLine === e206.showEndForLine && o(this.startLineNumbers, e206.startLineNumbers) && o(this.endLineNumbers, e206.endLineNumbers);
  }
  static get Empty() {
    return new e200([], [], 0);
  }
}, $3 = _f2(`stickyScrollViewLayer`, { createHTML: (e206) => e206 }), e610 = `data-sticky-line-index`, t6 = `data-sticky-is-line`, MOe = `data-sticky-is-line-number`, n6 = `data-sticky-is-folding-icon`, NOe = class extends D {
  get height() {
    return this._height;
  }
  constructor(e206) {
    super(), this._foldingIconStore = this._register(new E()), this._rootDomNode = document.createElement(`div`), this._lineNumbersDomNode = document.createElement(`div`), this._linesDomNodeScrollable = document.createElement(`div`), this._linesDomNode = document.createElement(`div`), this._renderedStickyLines = [], this._lineNumbers = [], this._lastLineRelativePosition = 0, this._minContentWidthInPx = 0, this._isOnGlyphMargin = false, this._height = -1, this._onDidChangeStickyScrollHeight = this._register(new k()), this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event, this._editor = e206, this._lineHeight = e206.getOption(75), this._lineNumbersDomNode.className = `sticky-widget-line-numbers`, this._lineNumbersDomNode.setAttribute(`role`, `none`), this._linesDomNode.className = `sticky-widget-lines`, this._linesDomNode.setAttribute(`role`, `list`), this._linesDomNodeScrollable.className = `sticky-widget-lines-scrollable`, this._linesDomNodeScrollable.appendChild(this._linesDomNode), this._rootDomNode.className = `sticky-widget`, this._rootDomNode.classList.toggle(`peek`, e206 instanceof qQ), this._rootDomNode.appendChild(this._lineNumbersDomNode), this._rootDomNode.appendChild(this._linesDomNodeScrollable), this._setHeight(0);
    let t10 = () => {
      this._linesDomNode.style.left = this._editor.getOption(131).scrollWithEditor ? `-${this._editor.getScrollLeft()}px` : `0px`;
    };
    this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(131) && t10(), e207.hasChanged(75) && (this._lineHeight = this._editor.getOption(75));
    })), this._register(this._editor.onDidScrollChange((e207) => {
      e207.scrollLeftChanged && t10(), e207.scrollWidthChanged && this._updateWidgetWidth();
    })), this._register(this._editor.onDidChangeModel(() => {
      t10(), this._updateWidgetWidth();
    })), t10(), this._register(this._editor.onDidLayoutChange((e207) => {
      this._updateWidgetWidth();
    })), this._updateWidgetWidth();
  }
  get lineNumbers() {
    return this._lineNumbers;
  }
  get lineNumberCount() {
    return this._lineNumbers.length;
  }
  getRenderedStickyLine(e206) {
    return this._renderedStickyLines.find((t10) => t10.lineNumber === e206);
  }
  getCurrentLines() {
    return this._lineNumbers;
  }
  setState(e206, t10, n10) {
    let r10 = !this._state && !e206, i10 = this._state && this._state.equals(e206);
    if (n10 === void 0 && (r10 || i10)) return;
    let a10 = this._findRenderingData(e206), o10 = this._lineNumbers;
    this._lineNumbers = a10.lineNumbers, this._lastLineRelativePosition = a10.lastLineRelativePosition;
    let s10 = this._findIndexToRebuildFrom(o10, this._lineNumbers, n10);
    this._renderRootNode(this._lineNumbers, this._lastLineRelativePosition, t10, s10), this._state = e206;
  }
  _findRenderingData(e206) {
    if (!e206) return { lineNumbers: [], lastLineRelativePosition: 0 };
    let t10 = [...e206.startLineNumbers];
    e206.showEndForLine !== null && (t10[e206.showEndForLine] = e206.endLineNumbers[e206.showEndForLine]);
    let n10 = 0;
    for (let e207 = 0; e207 < t10.length; e207++) n10 += this._editor.getLineHeightForPosition(new j(t10[e207], 1));
    return n10 === 0 ? { lineNumbers: [], lastLineRelativePosition: 0 } : { lineNumbers: t10, lastLineRelativePosition: e206.lastLineRelativePosition };
  }
  _findIndexToRebuildFrom(e206, t10, n10) {
    if (t10.length === 0) return 0;
    if (n10 !== void 0) return n10;
    let r10 = t10.findIndex((t11) => !e206.includes(t11));
    return r10 === -1 ? 0 : r10;
  }
  _updateWidgetWidth() {
    let e206 = this._editor.getLayoutInfo(), t10 = e206.contentLeft;
    this._lineNumbersDomNode.style.width = `${t10}px`, this._linesDomNodeScrollable.style.setProperty(`--vscode-editorStickyScroll-scrollableWidth`, `${this._editor.getScrollWidth() - e206.verticalScrollbarWidth}px`), this._rootDomNode.style.width = `${e206.width - e206.verticalScrollbarWidth}px`;
  }
  _useFoldingOpacityTransition(e206) {
    this._lineNumbersDomNode.style.setProperty(`--vscode-editorStickyScroll-foldingOpacityTransition`, `opacity ${e206 ? 0.5 : 0}s`);
  }
  _setFoldingIconsVisibility(e206) {
    for (let t10 of this._renderedStickyLines) {
      let n10 = t10.foldingIcon;
      n10 && n10.setVisible(e206 ? true : n10.isCollapsed);
    }
  }
  async _renderRootNode(e206, t10, n10, r10) {
    let i10 = this._editor._getViewModel();
    if (!i10) {
      this._clearWidget();
      return;
    }
    if (e206.length === 0) {
      this._clearWidget();
      return;
    }
    let a10 = [], o10 = e206[e206.length - 1], s10 = 0;
    for (let e207 = 0; e207 < this._renderedStickyLines.length; e207++) if (e207 < r10) {
      let t11 = this._renderedStickyLines[e207];
      a10.push(this._updatePosition(t11, s10, t11.lineNumber === o10)), s10 += t11.height;
    } else {
      let t11 = this._renderedStickyLines[e207];
      t11.lineNumberDomNode.remove(), t11.lineDomNode.remove();
    }
    let c10 = this._editor.getLayoutInfo();
    for (let t11 = r10; t11 < e206.length; t11++) {
      let r11 = this._renderChildNode(i10, t11, e206[t11], s10, o10 === e206[t11], n10, c10);
      s10 += r11.height, this._linesDomNode.appendChild(r11.lineDomNode), this._lineNumbersDomNode.appendChild(r11.lineNumberDomNode), a10.push(r11);
    }
    n10 && (this._setFoldingHoverListeners(), this._useFoldingOpacityTransition(!this._isOnGlyphMargin)), this._minContentWidthInPx = Math.max(...this._renderedStickyLines.map((e207) => e207.scrollWidth)) + c10.verticalScrollbarWidth, this._renderedStickyLines = a10, this._setHeight(s10 + t10), this._editor.layoutOverlayWidget(this);
  }
  _clearWidget() {
    for (let e206 = 0; e206 < this._renderedStickyLines.length; e206++) {
      let t10 = this._renderedStickyLines[e206];
      t10.lineNumberDomNode.remove(), t10.lineDomNode.remove();
    }
    this._setHeight(0);
  }
  _setHeight(e206) {
    this._height !== e206 && (this._height = e206, this._height === 0 ? this._rootDomNode.style.display = `none` : (this._rootDomNode.style.display = `block`, this._lineNumbersDomNode.style.height = `${this._height}px`, this._linesDomNodeScrollable.style.height = `${this._height}px`, this._rootDomNode.style.height = `${this._height}px`), this._onDidChangeStickyScrollHeight.fire({ height: this._height }));
  }
  _setFoldingHoverListeners() {
    this._editor.getOption(126) === `mouseover` && (this._foldingIconStore.clear(), this._foldingIconStore.add(L(this._lineNumbersDomNode, R.MOUSE_ENTER, () => {
      this._isOnGlyphMargin = true, this._setFoldingIconsVisibility(true);
    })), this._foldingIconStore.add(L(this._lineNumbersDomNode, R.MOUSE_LEAVE, () => {
      this._isOnGlyphMargin = false, this._useFoldingOpacityTransition(true), this._setFoldingIconsVisibility(false);
    })));
  }
  _renderChildNode(e206, t10, n10, r10, i10, a10, o10) {
    let s10 = e206.coordinatesConverter.convertModelPositionToViewPosition(new j(n10, 1)).lineNumber, c10 = e206.getViewLineRenderingData(s10), l10 = this._editor.getOption(76), u10 = this._editor.getOption(117).verticalScrollbarSize, d10;
    try {
      d10 = og.filter(c10.inlineDecorations, s10, c10.minColumn, c10.maxColumn);
    } catch {
      d10 = [];
    }
    let f10 = this._editor.getLineHeightForPosition(new j(n10, 1)), p10 = e206.getTextDirection(n10), m10 = new lg(true, true, c10.content, c10.continuesWithWrappedLine, c10.isBasicASCII, c10.containsRTL, 0, c10.tokens, d10, c10.tabSize, c10.startVisibleColumn, 1, 1, 1, 500, `none`, true, true, null, p10, u10), h10 = new Ff(2e3), g10 = pg(m10, h10), _10;
    _10 = $3 ? $3.createHTML(h10.build()) : h10.build();
    let v10 = document.createElement(`span`);
    v10.setAttribute(e610, String(t10)), v10.setAttribute(t6, ``), v10.setAttribute(`role`, `listitem`), v10.tabIndex = 0, v10.className = `sticky-line-content`, v10.classList.add(`stickyLine${n10}`), v10.style.lineHeight = `${f10}px`, v10.innerHTML = _10;
    let y10 = document.createElement(`span`);
    y10.setAttribute(e610, String(t10)), y10.setAttribute(MOe, ``), y10.className = `sticky-line-number`, y10.style.lineHeight = `${f10}px`;
    let b10 = o10.contentLeft;
    y10.style.width = `${b10}px`;
    let x10 = document.createElement(`span`);
    l10.renderType === 1 || l10.renderType === 3 && n10 % 10 == 0 ? x10.innerText = n10.toString() : l10.renderType === 2 && (x10.innerText = Math.abs(n10 - this._editor.getPosition().lineNumber).toString()), x10.className = `sticky-line-number-inner`, x10.style.width = `${o10.lineNumbersWidth}px`, x10.style.paddingLeft = `${o10.lineNumbersLeft}px`, y10.appendChild(x10);
    let S10 = this._renderFoldingIconForLine(a10, n10);
    S10 && (y10.appendChild(S10.domNode), S10.domNode.style.left = `${o10.lineNumbersWidth + o10.lineNumbersLeft}px`, S10.domNode.style.lineHeight = `${f10}px`), this._editor.applyFontInfo(v10), this._editor.applyFontInfo(y10), y10.style.lineHeight = `${f10}px`, v10.style.lineHeight = `${f10}px`, y10.style.height = `${f10}px`, v10.style.height = `${f10}px`;
    let ee2 = new POe(t10, n10, v10, y10, S10, g10.characterMapping, v10.scrollWidth, f10);
    return this._updatePosition(ee2, r10, i10);
  }
  _updatePosition(e206, t10, n10) {
    let r10 = e206.lineDomNode, i10 = e206.lineNumberDomNode;
    if (n10) {
      r10.style.zIndex = `0`, i10.style.zIndex = `0`;
      let n11 = `${t10 + this._lastLineRelativePosition + +!!e206.foldingIcon?.isCollapsed}px`;
      r10.style.top = n11, i10.style.top = n11;
    } else r10.style.zIndex = `1`, i10.style.zIndex = `1`, r10.style.top = `${t10}px`, i10.style.top = `${t10}px`;
    return e206;
  }
  _renderFoldingIconForLine(e206, t10) {
    let n10 = this._editor.getOption(126);
    if (!e206 || n10 === `never`) return;
    let r10 = e206.regions, i10 = r10.findRange(t10), a10 = r10.getStartLineNumber(i10);
    if (t10 !== a10) return;
    let o10 = r10.isCollapsed(i10), s10 = new FOe(o10, a10, r10.getEndLineNumber(i10), this._lineHeight);
    return s10.setVisible(this._isOnGlyphMargin ? true : o10 || n10 === `always`), s10.domNode.setAttribute(n6, ``), s10;
  }
  getId() {
    return `editor.contrib.stickyScrollWidget`;
  }
  getDomNode() {
    return this._rootDomNode;
  }
  getPosition() {
    return { preference: 2, stackOridinal: 10 };
  }
  getMinContentWidthInPx() {
    return this._minContentWidthInPx;
  }
  focusLineWithIndex(e206) {
    0 <= e206 && e206 < this._renderedStickyLines.length && this._renderedStickyLines[e206].lineDomNode.focus();
  }
  getEditorPositionFromNode(e206) {
    if (!e206 || e206.children.length > 0) return null;
    let t10 = this._getRenderedStickyLineFromChildDomNode(e206);
    if (!t10) return null;
    let n10 = Hb(t10.characterMapping, e206, 0);
    return new j(t10.lineNumber, n10);
  }
  getLineNumberFromChildDomNode(e206) {
    return this._getRenderedStickyLineFromChildDomNode(e206)?.lineNumber ?? null;
  }
  _getRenderedStickyLineFromChildDomNode(e206) {
    let t10 = this.getLineIndexFromChildDomNode(e206);
    return t10 === null || t10 < 0 || t10 >= this._renderedStickyLines.length ? null : this._renderedStickyLines[t10];
  }
  getLineIndexFromChildDomNode(e206) {
    let t10 = this._getAttributeValue(e206, e610);
    return t10 ? parseInt(t10, 10) : null;
  }
  isInStickyLine(e206) {
    return this._getAttributeValue(e206, t6) !== void 0;
  }
  isInFoldingIconDomNode(e206) {
    return this._getAttributeValue(e206, n6) !== void 0;
  }
  _getAttributeValue(e206, t10) {
    for (; e206 && e206 !== this._rootDomNode; ) {
      let n10 = e206.getAttribute(t10);
      if (n10 !== null) return n10;
      e206 = e206.parentElement;
    }
  }
}, POe = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this.index = e206, this.lineNumber = t10, this.lineDomNode = n10, this.lineNumberDomNode = r10, this.foldingIcon = i10, this.characterMapping = a10, this.scrollWidth = o10, this.height = s10;
  }
}, FOe = class {
  constructor(e206, t10, n10, r10) {
    this.isCollapsed = e206, this.foldingStartLine = t10, this.foldingEndLine = n10, this.dimension = r10, this.domNode = document.createElement(`div`), this.domNode.style.width = `26px`, this.domNode.style.height = `${r10}px`, this.domNode.style.lineHeight = `${r10}px`, this.domNode.className = ju.asClassName(e206 ? z0 : R0);
  }
  setVisible(e206) {
    this.domNode.style.cursor = e206 ? `pointer` : `default`, this.domNode.style.opacity = e206 ? `1` : `0`;
  }
}, r6 = class {
  constructor(e206, t10) {
    this.startLineNumber = e206, this.endLineNumber = t10;
  }
}, i6 = class {
  constructor(e206, t10, n10) {
    this.range = e206, this.children = t10, this.parent = n10;
  }
}, a6 = class {
  constructor(e206, t10, n10, r10) {
    this.uri = e206, this.version = t10, this.element = n10, this.outlineProviderId = r10;
  }
}, o6 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, s6 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, c6;
(function(e206) {
  e206.OUTLINE_MODEL = `outlineModel`, e206.FOLDING_PROVIDER_MODEL = `foldingProviderModel`, e206.INDENTATION_MODEL = `indentationModel`;
})(c6 || (c6 = {}));
var l6;
(function(e206) {
  e206[e206.VALID = 0] = `VALID`, e206[e206.INVALID = 1] = `INVALID`, e206[e206.CANCELED = 2] = `CANCELED`;
})(l6 || (l6 = {}));
var u6 = class extends D {
  constructor(e206, t10, n10, r10) {
    switch (super(), this._editor = e206, this._modelProviders = [], this._modelPromise = null, this._updateScheduler = this._register(new ns(300)), this._updateOperation = this._register(new E()), this._editor.getOption(131).defaultModel) {
      case c6.OUTLINE_MODEL:
        this._modelProviders.push(new f6(this._editor, r10));
      case c6.FOLDING_PROVIDER_MODEL:
        this._modelProviders.push(new h6(this._editor, t10, r10));
      case c6.INDENTATION_MODEL:
        this._modelProviders.push(new m6(this._editor, n10));
        break;
    }
  }
  dispose() {
    this._modelProviders.forEach((e206) => e206.dispose()), this._updateOperation.clear(), this._cancelModelPromise(), super.dispose();
  }
  _cancelModelPromise() {
    this._modelPromise && (this._modelPromise = (this._modelPromise.cancel(), null));
  }
  async update(e206) {
    return this._updateOperation.clear(), this._updateOperation.add({ dispose: () => {
      this._cancelModelPromise(), this._updateScheduler.cancel();
    } }), this._cancelModelPromise(), await this._updateScheduler.trigger(async () => {
      for (let t10 of this._modelProviders) {
        let { statusPromise: n10, modelPromise: r10 } = t10.computeStickyModel(e206);
        this._modelPromise = r10;
        let i10 = await n10;
        if (this._modelPromise !== r10) return null;
        switch (i10) {
          case l6.CANCELED:
            return this._updateOperation.clear(), null;
          case l6.VALID:
            return t10.stickyModel;
        }
      }
      return null;
    }).catch((e207) => (be(e207), null));
  }
};
u6 = o6([s6(2, V), s6(3, X)], u6);
var d6 = class extends D {
  constructor(e206) {
    super(), this._editor = e206, this._stickyModel = null;
  }
  get stickyModel() {
    return this._stickyModel;
  }
  _invalid() {
    return this._stickyModel = null, l6.INVALID;
  }
  computeStickyModel(e206) {
    if (e206.isCancellationRequested || !this.isProviderValid()) return { statusPromise: this._invalid(), modelPromise: null };
    let t10 = es((e207) => this.createModelFromProvider(e207));
    return { statusPromise: t10.then((t11) => this.isModelValid(t11) ? e206.isCancellationRequested ? l6.CANCELED : (this._stickyModel = this.createStickyModel(e206, t11), l6.VALID) : this._invalid()).then(void 0, (e207) => (be(e207), l6.CANCELED)), modelPromise: t10 };
  }
  isModelValid(e206) {
    return true;
  }
  isProviderValid() {
    return true;
  }
}, f6 = class extends d6 {
  constructor(e206, t10) {
    super(e206), this._languageFeaturesService = t10;
  }
  createModelFromProvider(e206) {
    return c2.create(this._languageFeaturesService.documentSymbolProvider, this._editor.getModel(), e206);
  }
  createStickyModel(e206, t10) {
    let { stickyOutlineElement: n10, providerID: r10 } = this._stickyModelFromOutlineModel(t10, this._stickyModel?.outlineProviderId), i10 = this._editor.getModel();
    return new a6(i10.uri, i10.getVersionId(), n10, r10);
  }
  isModelValid(e206) {
    return e206 && e206.children.size > 0;
  }
  _stickyModelFromOutlineModel(e206, t10) {
    let n10;
    if (Ut.first(e206.children.values()) instanceof s2) {
      let r11 = Ut.find(e206.children.values(), (e207) => e207.id === t10);
      if (r11) n10 = r11.children;
      else {
        let r12 = ``, i11 = -1, a10;
        for (let [t11, n11] of e206.children.entries()) {
          let e207 = this._findSumOfRangesOfGroup(n11);
          e207 > i11 && (a10 = n11, i11 = e207, r12 = n11.id);
        }
        t10 = r12, n10 = a10.children;
      }
    } else n10 = e206.children;
    let r10 = [], i10 = Array.from(n10.values()).sort((e207, t11) => {
      let n11 = new r6(e207.symbol.range.startLineNumber, e207.symbol.range.endLineNumber), r11 = new r6(t11.symbol.range.startLineNumber, t11.symbol.range.endLineNumber);
      return this._comparator(n11, r11);
    });
    for (let e207 of i10) r10.push(this._stickyModelFromOutlineElement(e207, e207.symbol.selectionRange.startLineNumber));
    return { stickyOutlineElement: new i6(void 0, r10, void 0), providerID: t10 };
  }
  _stickyModelFromOutlineElement(e206, t10) {
    let n10 = [];
    for (let r10 of e206.children.values()) if (r10.symbol.selectionRange.startLineNumber !== r10.symbol.range.endLineNumber) if (r10.symbol.selectionRange.startLineNumber !== t10) n10.push(this._stickyModelFromOutlineElement(r10, r10.symbol.selectionRange.startLineNumber));
    else for (let e207 of r10.children.values()) n10.push(this._stickyModelFromOutlineElement(e207, r10.symbol.selectionRange.startLineNumber));
    return n10.sort((e207, t11) => this._comparator(e207.range, t11.range)), new i6(new r6(e206.symbol.selectionRange.startLineNumber, e206.symbol.range.endLineNumber), n10, void 0);
  }
  _comparator(e206, t10) {
    return e206.startLineNumber === t10.startLineNumber ? t10.endLineNumber - e206.endLineNumber : e206.startLineNumber - t10.startLineNumber;
  }
  _findSumOfRangesOfGroup(e206) {
    let t10 = 0;
    for (let n10 of e206.children.values()) t10 += this._findSumOfRangesOfGroup(n10);
    return e206 instanceof o2 ? t10 + e206.symbol.range.endLineNumber - e206.symbol.selectionRange.startLineNumber : t10;
  }
};
f6 = o6([s6(1, X)], f6);
var p6 = class extends d6 {
  constructor(e206) {
    super(e206), this._foldingLimitReporter = this._register(new X0(e206));
  }
  createStickyModel(e206, t10) {
    let n10 = this._fromFoldingRegions(t10), r10 = this._editor.getModel();
    return new a6(r10.uri, r10.getVersionId(), n10, void 0);
  }
  isModelValid(e206) {
    return e206 !== null;
  }
  _fromFoldingRegions(e206) {
    let t10 = e206.length, n10 = [], r10 = new i6(void 0, [], void 0);
    for (let i10 = 0; i10 < t10; i10++) {
      let t11 = e206.getParentIndex(i10), a10;
      a10 = t11 === -1 ? r10 : n10[t11];
      let o10 = new i6(new r6(e206.getStartLineNumber(i10), e206.getEndLineNumber(i10) + 1), [], a10);
      a10.children.push(o10), n10.push(o10);
    }
    return r10;
  }
}, m6 = class extends p6 {
  constructor(e206, t10) {
    super(e206), this._languageConfigurationService = t10, this.provider = this._register(new L0(e206.getModel(), this._languageConfigurationService, this._foldingLimitReporter));
  }
  async createModelFromProvider(e206) {
    return this.provider.compute(e206);
  }
};
m6 = o6([s6(1, bp)], m6);
var h6 = class extends p6 {
  constructor(e206, t10, n10) {
    super(e206), this._languageFeaturesService = n10, this.provider = this._register(new Jt()), this._register(this._languageFeaturesService.foldingRangeProvider.onDidChange(() => {
      this._updateProvider(e206, t10);
    })), this._updateProvider(e206, t10);
  }
  _updateProvider(e206, t10) {
    let n10 = Y0.getFoldingRangeProviders(this._languageFeaturesService, e206.getModel());
    n10.length !== 0 && (this.provider.value = new G0(e206.getModel(), n10, t10, this._foldingLimitReporter, void 0));
  }
  isProviderValid() {
    return this.provider !== void 0;
  }
  async createModelFromProvider(e206) {
    return this.provider.value?.compute(e206) ?? null;
  }
};
h6 = o6([s6(2, X)], h6);
var IOe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, g6 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, LOe = class {
  constructor(e206, t10, n10, r10) {
    this.startLineNumber = e206, this.endLineNumber = t10, this.top = n10, this.height = r10;
  }
}, _6 = class extends D {
  constructor(e206, t10, n10) {
    super(), this._languageFeaturesService = t10, this._languageConfigurationService = n10, this._onDidChangeStickyScroll = this._register(new k()), this.onDidChangeStickyScroll = this._onDidChangeStickyScroll.event, this._model = null, this._cts = null, this._stickyModelProvider = null, this._editor = e206, this._sessionStore = this._register(new E()), this._updateSoon = this._register(new us(() => this.update(), 50)), this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(131) && this.readConfiguration();
    })), this.readConfiguration();
  }
  readConfiguration() {
    this._sessionStore.clear(), this._editor.getOption(131).enabled && (this._sessionStore.add(this._editor.onDidChangeModel(() => {
      this._model = null, this.updateStickyModelProvider(), this._onDidChangeStickyScroll.fire(), this.update();
    })), this._sessionStore.add(this._editor.onDidChangeHiddenAreas(() => this.update())), this._sessionStore.add(this._editor.onDidChangeModelContent(() => this._updateSoon.schedule())), this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(() => this.update())), this._sessionStore.add(T(() => {
      this._stickyModelProvider?.dispose(), this._stickyModelProvider = null;
    })), this.updateStickyModelProvider(), this.update());
  }
  getVersionId() {
    return this._model?.version;
  }
  updateStickyModelProvider() {
    this._stickyModelProvider?.dispose(), this._stickyModelProvider = null, this._editor.hasModel() && (this._stickyModelProvider = new u6(this._editor, () => this._updateSoon.schedule(), this._languageConfigurationService, this._languageFeaturesService));
  }
  async update() {
    this._cts?.dispose(true), this._cts = new pr(), await this.updateStickyModel(this._cts.token), this._onDidChangeStickyScroll.fire();
  }
  async updateStickyModel(e206) {
    if (!this._editor.hasModel() || !this._stickyModelProvider || this._editor.getModel().isTooLargeForTokenization()) {
      this._model = null;
      return;
    }
    let t10 = await this._stickyModelProvider.update(e206);
    e206.isCancellationRequested || (this._model = t10);
  }
  getCandidateStickyLinesIntersecting(e206) {
    if (!this._model?.element) return [];
    let t10 = [];
    return this.getCandidateStickyLinesIntersectingFromStickyModel(e206, this._model.element, t10, 0, 0, -1), this.filterHiddenRanges(t10);
  }
  getCandidateStickyLinesIntersectingFromStickyModel(e206, t10, n10, r10, i10, a10) {
    let o10 = this._editor.getModel();
    if (!o10 || t10.children.length === 0) return;
    let s10 = a10, l10 = [];
    for (let e207 = 0; e207 < t10.children.length; e207++) {
      let n11 = t10.children[e207];
      n11.range && l10.push(n11.range.startLineNumber);
    }
    let u10 = this.updateIndex(c(l10, e206.startLineNumber, (e207, t11) => e207 - t11)), d10 = this.updateIndex(c(l10, e206.endLineNumber, (e207, t11) => e207 - t11));
    for (let a11 = u10; a11 <= d10; a11++) {
      let c10 = t10.children[a11];
      if (!c10 || !c10.range) continue;
      let { startLineNumber: l11, endLineNumber: u11 } = c10.range;
      if (u11 > l11 + 1 && e206.startLineNumber <= u11 + 1 && l11 - 1 <= e206.endLineNumber && l11 !== s10 && o10.isValidRange(new M(l11, 1, u11, 1))) {
        s10 = l11;
        let t11 = this._editor.getLineHeightForPosition(new j(l11, 1));
        n10.push(new LOe(l11, u11 - 1, i10, t11)), this.getCandidateStickyLinesIntersectingFromStickyModel(e206, c10, n10, r10 + 1, i10 + t11, l11);
      }
    }
  }
  filterHiddenRanges(e206) {
    let t10 = this._editor._getViewModel()?.getHiddenAreas();
    return t10 ? e206.filter((e207) => !t10.some((t11) => e207.startLineNumber >= t11.startLineNumber && e207.endLineNumber <= t11.endLineNumber + 1)) : e206;
  }
  updateIndex(e206) {
    return e206 === -1 ? 0 : e206 < 0 ? -e206 - 2 : e206;
  }
};
_6 = IOe([g6(1, X), g6(2, bp)], _6);
var ROe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, v6 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, y6, b6 = (_qd = class extends D {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this._editor = e206, this._contextMenuService = t10, this._languageFeaturesService = n10, this._instaService = r10, this._contextKeyService = o10, this._sessionStore = new E(), this._maxStickyLines = 2 ** 53 - 1, this._candidateDefinitionsLength = -1, this._focusedStickyElementIndex = -1, this._enabled = false, this._focused = false, this._positionRevealed = false, this._onMouseDown = false, this._endLineNumbers = [], this._mouseTarget = null, this._onDidChangeStickyScrollHeight = this._register(new k()), this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event, this._stickyScrollWidget = new NOe(this._editor), this._stickyLineCandidateProvider = new _6(this._editor, n10, i10), this._register(this._stickyScrollWidget), this._register(this._stickyLineCandidateProvider), this._widgetState = Q3.Empty;
    let s10 = this._stickyScrollWidget.getDomNode();
    this._register(this._editor.onDidChangeLineHeight((e207) => {
      e207.changes.forEach((e208) => {
        let t11 = e208.lineNumber;
        this._widgetState.startLineNumbers.includes(t11) && this._renderStickyScroll(t11);
      });
    })), this._register(this._editor.onDidChangeFont((e207) => {
      e207.changes.forEach((e208) => {
        let t11 = e208.lineNumber;
        this._widgetState.startLineNumbers.includes(t11) && this._renderStickyScroll(t11);
      });
    })), this._register(this._editor.onDidChangeConfiguration((e207) => {
      this._readConfigurationChange(e207);
    })), this._register(L(s10, R.CONTEXT_MENU, async (e207) => {
      this._onContextMenu(Vc(s10), e207);
    })), this._stickyScrollFocusedContextKey = $.stickyScrollFocused.bindTo(this._contextKeyService), this._stickyScrollVisibleContextKey = $.stickyScrollVisible.bindTo(this._contextKeyService);
    let c10 = this._register(Gl(s10));
    this._register(c10.onDidBlur((e207) => {
      this._positionRevealed === false && s10.clientHeight === 0 ? (this._focusedStickyElementIndex = -1, this.focus()) : this._disposeFocusStickyScrollStore();
    })), this._register(c10.onDidFocus((e207) => {
      this.focus();
    })), this._registerMouseListeners(), this._register(L(s10, R.MOUSE_DOWN, (e207) => {
      this._onMouseDown = true;
    })), this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight((e207) => {
      this._onDidChangeStickyScrollHeight.fire(e207);
    })), this._onDidResize(), this._readConfiguration();
  }
  get stickyScrollWidgetHeight() {
    return this._stickyScrollWidget.height;
  }
  static get(e206) {
    return e206.getContribution(y6.ID);
  }
  _disposeFocusStickyScrollStore() {
    this._stickyScrollFocusedContextKey.set(false), this._focusDisposableStore?.dispose(), this._focused = false, this._positionRevealed = false, this._onMouseDown = false;
  }
  isFocused() {
    return this._focused;
  }
  focus() {
    if (this._onMouseDown) {
      this._onMouseDown = false, this._editor.focus();
      return;
    }
    this._stickyScrollFocusedContextKey.get() !== true && (this._focused = true, this._focusDisposableStore = new E(), this._stickyScrollFocusedContextKey.set(true), this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumbers.length - 1, this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
  }
  focusNext() {
    this._focusedStickyElementIndex < this._stickyScrollWidget.lineNumberCount - 1 && this._focusNav(true);
  }
  focusPrevious() {
    this._focusedStickyElementIndex > 0 && this._focusNav(false);
  }
  selectEditor() {
    this._editor.focus();
  }
  _focusNav(e206) {
    this._focusedStickyElementIndex = e206 ? this._focusedStickyElementIndex + 1 : this._focusedStickyElementIndex - 1, this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);
  }
  goToFocused() {
    let e206 = this._stickyScrollWidget.lineNumbers;
    this._disposeFocusStickyScrollStore(), this._revealPosition({ lineNumber: e206[this._focusedStickyElementIndex], column: 1 });
  }
  _revealPosition(e206) {
    this._reveaInEditor(e206, () => this._editor.revealPosition(e206));
  }
  _revealLineInCenterIfOutsideViewport(e206) {
    this._reveaInEditor(e206, () => this._editor.revealLineInCenterIfOutsideViewport(e206.lineNumber, 0));
  }
  _reveaInEditor(e206, t10) {
    this._focused && this._disposeFocusStickyScrollStore(), this._positionRevealed = true, t10(), this._editor.setSelection(M.fromPositions(e206)), this._editor.focus();
  }
  _registerMouseListeners() {
    let e206 = this._register(new E()), t10 = this._register(new UQ(this._editor, { extractLineNumberFromMouseEvent: (e207) => {
      let t11 = this._stickyScrollWidget.getEditorPositionFromNode(e207.target.element);
      return t11 ? t11.lineNumber : 0;
    } })), n10 = (e207) => {
      if (!this._editor.hasModel() || e207.target.type !== 12 || e207.target.detail !== this._stickyScrollWidget.getId()) return null;
      let t11 = e207.target.element;
      if (!t11 || t11.innerText !== t11.innerHTML) return null;
      let n11 = this._stickyScrollWidget.getEditorPositionFromNode(t11);
      return n11 ? { range: new M(n11.lineNumber, n11.column, n11.lineNumber, n11.column + t11.innerText.length), textElement: t11 } : null;
    }, r10 = this._stickyScrollWidget.getDomNode();
    this._register(el(r10, R.CLICK, (e207) => {
      if (e207.ctrlKey || e207.altKey || e207.metaKey || !e207.leftButton) return;
      if (e207.shiftKey) {
        let t12 = this._stickyScrollWidget.getLineIndexFromChildDomNode(e207.target);
        if (t12 === null) return;
        let n11 = new j(this._endLineNumbers[t12], 1);
        this._revealLineInCenterIfOutsideViewport(n11);
        return;
      }
      if (this._stickyScrollWidget.isInFoldingIconDomNode(e207.target)) {
        let t12 = this._stickyScrollWidget.getLineNumberFromChildDomNode(e207.target);
        this._toggleFoldingRegionForLine(t12);
        return;
      }
      if (!this._stickyScrollWidget.isInStickyLine(e207.target)) return;
      let t11 = this._stickyScrollWidget.getEditorPositionFromNode(e207.target);
      if (!t11) {
        let n11 = this._stickyScrollWidget.getLineNumberFromChildDomNode(e207.target);
        if (n11 === null) return;
        t11 = new j(n11, 1);
      }
      this._revealPosition(t11);
    })), this._register(L(Aa, R.MOUSE_MOVE, (e207) => {
      this._mouseTarget = e207.target, this._onMouseMoveOrKeyDown(e207);
    })), this._register(L(Aa, R.KEY_DOWN, (e207) => {
      this._onMouseMoveOrKeyDown(e207);
    })), this._register(L(Aa, R.KEY_UP, () => {
      this._showEndForLine !== void 0 && (this._showEndForLine = void 0, this._renderStickyScroll());
    })), this._register(t10.onMouseMoveOrRelevantKeyDown(([t11, r11]) => {
      let i10 = n10(t11);
      if (!i10 || !t11.hasTriggerModifier || !this._editor.hasModel()) {
        e206.clear();
        return;
      }
      let { range: a10, textElement: o10 } = i10;
      if (!a10.equalsRange(this._stickyRangeProjectedOnEditor)) this._stickyRangeProjectedOnEditor = a10, e206.clear();
      else if (o10.style.textDecoration === `underline`) return;
      let s10 = new pr();
      e206.add(T(() => s10.dispose(true)));
      let c10;
      N$(this._languageFeaturesService.definitionProvider, this._editor.getModel(), new j(a10.startLineNumber, a10.startColumn + 1), false, s10.token).then(((t12) => {
        if (!s10.token.isCancellationRequested) if (t12.length !== 0) {
          this._candidateDefinitionsLength = t12.length;
          let n11 = o10;
          c10 === n11 ? c10 || (c10 = n11, c10.style.textDecoration = `underline`, e206.add(T(() => {
            c10.style.textDecoration = `none`;
          }))) : (e206.clear(), c10 = n11, c10.style.textDecoration = `underline`, e206.add(T(() => {
            c10.style.textDecoration = `none`;
          })));
        } else e206.clear();
      }));
    })), this._register(t10.onCancel(() => {
      e206.clear();
    })), this._register(t10.onExecute(async (e207) => {
      if (e207.target.type !== 12 || e207.target.detail !== this._stickyScrollWidget.getId()) return;
      let t11 = this._stickyScrollWidget.getEditorPositionFromNode(e207.target.element);
      t11 && (!this._editor.hasModel() || !this._stickyRangeProjectedOnEditor || (this._candidateDefinitionsLength > 1 && (this._focused && this._disposeFocusStickyScrollStore(), this._revealPosition({ lineNumber: t11.lineNumber, column: 1 })), this._instaService.invokeFunction(K$, e207, this._editor, { uri: this._editor.getModel().uri, range: this._stickyRangeProjectedOnEditor })));
    }));
  }
  _onContextMenu(e206, t10) {
    let n10 = new Xo(e206, t10);
    this._contextMenuService.showContextMenu({ menuId: W.StickyScrollContext, getAnchor: () => n10 });
  }
  _onMouseMoveOrKeyDown(e206) {
    if (!e206.shiftKey || !this._mouseTarget || !Fl(this._mouseTarget)) return;
    let t10 = this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);
    t10 === null || this._showEndForLine === t10 || (this._showEndForLine = t10, this._renderStickyScroll());
  }
  _toggleFoldingRegionForLine(e206) {
    if (!this._foldingModel || e206 === null) return;
    let t10 = this._stickyScrollWidget.getRenderedStickyLine(e206), n10 = t10?.foldingIcon;
    if (!n10) return;
    A0(this._foldingModel, 1, [e206]), n10.isCollapsed = !n10.isCollapsed;
    let r10 = (n10.isCollapsed ? this._editor.getTopForLineNumber(n10.foldingEndLine) : this._editor.getTopForLineNumber(n10.foldingStartLine)) - this._editor.getOption(75) * t10.index + 1;
    this._editor.setScrollTop(r10), this._renderStickyScroll(e206);
  }
  _readConfiguration() {
    let e206 = this._editor.getOption(131);
    if (e206.enabled === false) {
      this._editor.removeOverlayWidget(this._stickyScrollWidget), this._resetState(), this._sessionStore.clear(), this._enabled = false;
      return;
    } else e206.enabled && !this._enabled && (this._editor.addOverlayWidget(this._stickyScrollWidget), this._sessionStore.add(this._editor.onDidScrollChange((e207) => {
      e207.scrollTopChanged && (this._showEndForLine = void 0, this._renderStickyScroll());
    })), this._sessionStore.add(this._editor.onDidLayoutChange(() => this._onDidResize())), this._sessionStore.add(this._editor.onDidChangeModelTokens((e207) => this._onTokensChange(e207))), this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(() => {
      this._showEndForLine = void 0, this._renderStickyScroll();
    })), this._enabled = true);
    this._editor.getOption(76).renderType === 2 && this._sessionStore.add(this._editor.onDidChangeCursorPosition(() => {
      this._showEndForLine = void 0, this._renderStickyScroll(0);
    }));
  }
  _readConfigurationChange(e206) {
    (e206.hasChanged(131) || e206.hasChanged(81) || e206.hasChanged(75) || e206.hasChanged(126) || e206.hasChanged(76)) && this._readConfiguration(), (e206.hasChanged(76) || e206.hasChanged(52) || e206.hasChanged(126)) && this._renderStickyScroll(0);
  }
  _needsUpdate(e206) {
    let t10 = this._stickyScrollWidget.getCurrentLines();
    for (let n10 of t10) for (let t11 of e206.ranges) if (n10 >= t11.fromLineNumber && n10 <= t11.toLineNumber) return true;
    return false;
  }
  _onTokensChange(e206) {
    this._needsUpdate(e206) && this._renderStickyScroll(0);
  }
  _onDidResize() {
    let e206 = this._editor.getLayoutInfo().height / this._editor.getOption(75);
    this._maxStickyLines = Math.round(e206 * 0.25), this._renderStickyScroll(0);
  }
  async _renderStickyScroll(e206) {
    let t10 = this._editor.getModel();
    if (!t10 || t10.isTooLargeForTokenization()) {
      this._resetState();
      return;
    }
    let n10 = this._updateAndGetMinRebuildFromLine(e206), r10 = this._stickyLineCandidateProvider.getVersionId();
    if (r10 === void 0 || r10 === t10.getVersionId()) if (!this._focused) await this._updateState(n10);
    else if (this._focusedStickyElementIndex === -1) await this._updateState(n10), this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1, this._focusedStickyElementIndex !== -1 && this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);
    else {
      let e207 = this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];
      await this._updateState(n10), this._stickyScrollWidget.lineNumberCount === 0 ? this._focusedStickyElementIndex = -1 : (this._stickyScrollWidget.lineNumbers.includes(e207) || (this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1), this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
    }
  }
  _updateAndGetMinRebuildFromLine(e206) {
    if (e206 !== void 0) {
      let t10 = this._minRebuildFromLine === void 0 ? 1 / 0 : this._minRebuildFromLine;
      this._minRebuildFromLine = Math.min(e206, t10);
    }
    return this._minRebuildFromLine;
  }
  async _updateState(e206) {
    this._minRebuildFromLine = void 0, this._foldingModel = await Y0.get(this._editor)?.getFoldingModel() ?? void 0, this._widgetState = this.findScrollWidgetState();
    let t10 = this._widgetState.startLineNumbers.length > 0;
    this._stickyScrollVisibleContextKey.set(t10), this._stickyScrollWidget.setState(this._widgetState, this._foldingModel, e206);
  }
  async _resetState() {
    this._minRebuildFromLine = void 0, this._foldingModel = void 0, this._widgetState = Q3.Empty, this._stickyScrollVisibleContextKey.set(false), this._stickyScrollWidget.setState(void 0, void 0);
  }
  findScrollWidgetState() {
    let e206 = Math.min(this._maxStickyLines, this._editor.getOption(131).maxLineCount), t10 = this._editor.getScrollTop(), n10 = 0, r10 = [], i10 = [], a10 = this._editor.getVisibleRanges();
    if (a10.length !== 0) {
      let o10 = new r6(a10[0].startLineNumber, a10[a10.length - 1].endLineNumber), s10 = this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(o10);
      for (let a11 of s10) {
        let o11 = a11.startLineNumber, s11 = a11.endLineNumber, c10 = a11.top, l10 = c10 + a11.height, u10 = this._editor.getTopForLineNumber(o11) - t10, d10 = this._editor.getBottomForLineNumber(s11) - t10;
        if (c10 > u10 && c10 <= d10 && (r10.push(o11), i10.push(s11 + 1), l10 > d10 && (n10 = d10 - l10)), r10.length === e206) break;
      }
    }
    return this._endLineNumbers = i10, new Q3(r10, i10, n10, this._showEndForLine);
  }
  dispose() {
    super.dispose(), this._sessionStore.dispose();
  }
}, y6 = _qd, _qd.ID = `store.contrib.stickyScrollController`, _qd);
b6 = y6 = ROe([v6(1, mj), v6(2, X), v6(3, V), v6(4, bp), v6(5, lA), v6(6, nd)], b6);
var x6 = Q(`inlineEdit.originalBackground`, F_(zv, 0.2), C(1220, `Background color for the original text in inline edits.`), true), S6 = Q(`inlineEdit.modifiedBackground`, F_(Rv, 0.3), C(1221, `Background color for the modified text in inline edits.`), true);
Q(`inlineEdit.originalChangedLineBackground`, F_(zv, 0.8), C(1222, `Background color for the changed lines in the original text of inline edits.`), true);
var zOe = Q(`inlineEdit.originalChangedTextBackground`, F_(zv, 0.8), C(1223, `Overlay color for the changed text in the original text of inline edits.`), true), BOe = Q(`inlineEdit.modifiedChangedLineBackground`, { light: F_(Bv, 0.7), dark: F_(Bv, 0.7), hcDark: Bv, hcLight: Bv }, C(1224, `Background color for the changed lines in the modified text of inline edits.`), true), VOe = Q(`inlineEdit.modifiedChangedTextBackground`, F_(Rv, 0.7), C(1225, `Overlay color for the changed text in the modified text of inline edits.`), true), HOe = Q(`inlineEdit.gutterIndicator.primaryForeground`, zy, C(1226, `Foreground color for the primary inline edit gutter indicator.`)), C6 = Q(`inlineEdit.gutterIndicator.primaryBorder`, Vy, C(1227, `Border color for the primary inline edit gutter indicator.`)), w6 = Q(`inlineEdit.gutterIndicator.primaryBackground`, { light: F_(C6, 0.5), dark: F_(C6, 0.4), hcDark: F_(C6, 0.4), hcLight: F_(C6, 0.5) }, C(1228, `Background color for the primary inline edit gutter indicator.`)), UOe = Q(`inlineEdit.gutterIndicator.secondaryForeground`, Wy, C(1229, `Foreground color for the secondary inline edit gutter indicator.`)), T6 = Q(`inlineEdit.gutterIndicator.secondaryBorder`, Gy, C(1230, `Border color for the secondary inline edit gutter indicator.`)), E6 = Q(`inlineEdit.gutterIndicator.secondaryBackground`, T6, C(1231, `Background color for the secondary inline edit gutter indicator.`)), WOe = Q(`inlineEdit.gutterIndicator.successfulForeground`, zy, C(1232, `Foreground color for the successful inline edit gutter indicator.`)), D6 = Q(`inlineEdit.gutterIndicator.successfulBorder`, Vy, C(1233, `Border color for the successful inline edit gutter indicator.`)), O6 = Q(`inlineEdit.gutterIndicator.successfulBackground`, D6, C(1234, `Background color for the successful inline edit gutter indicator.`)), GOe = Q(`inlineEdit.gutterIndicator.background`, { hcDark: F_(`tab.inactiveBackground`, 0.5), hcLight: F_(`tab.inactiveBackground`, 0.5), dark: F_(`tab.inactiveBackground`, 0.5), light: `#5f5f5f18` }, C(1235, `Background color for the inline edit gutter indicator.`)), k6 = Q(`inlineEdit.originalBorder`, { light: zv, dark: zv, hcDark: zv, hcLight: zv }, C(1236, `Border color for the original text in inline edits.`)), A6 = Q(`inlineEdit.modifiedBorder`, { light: N_(Rv, 0.6), dark: Rv, hcDark: Rv, hcLight: Rv }, C(1237, `Border color for the modified text in inline edits.`)), KOe = Q(`inlineEdit.tabWillAcceptModifiedBorder`, { light: N_(A6, 0), dark: N_(A6, 0), hcDark: N_(A6, 0), hcLight: N_(A6, 0) }, C(1238, `Modified border color for the inline edits widget when tab will accept it.`)), qOe = Q(`inlineEdit.tabWillAcceptOriginalBorder`, { light: N_(k6, 0), dark: N_(k6, 0), hcDark: N_(k6, 0), hcLight: N_(k6, 0) }, C(1239, `Original border color for the inline edits widget over the original text when tab will accept it.`));
function j6(e206) {
  return e206.map((e207) => e207 === V4.Accept ? KOe : A6);
}
function M6(e206) {
  return e206.map((e207) => e207 === V4.Accept ? qOe : k6);
}
function N6(e206, t10) {
  let n10;
  n10 = typeof e206 == `string` ? P6(e206, t10) : e206.map((e207, n11) => P6(e207, t10).read(n11));
  let r10 = P6(rv, t10);
  return n10.map((e207, t11) => e207.makeOpaque(r10.read(t11)));
}
function P6(e206, t10) {
  return Ec({ owner: { observeColor: e206 }, equalsFn: (e207, t11) => e207.equals(t11), debugName: () => `observeColor(${e206})` }, t10.onDidColorThemeChange, () => {
    let n10 = t10.getColorTheme().getColor(e206);
    if (!n10) throw new je(`Missing color: ${e206}`);
    return n10;
  });
}
function F6(e206, t10, n10) {
  e206.layoutInfo.read(n10), e206.value.read(n10);
  let r10 = e206.model.read(n10);
  if (!r10) return 0;
  let i10 = 0;
  e206.scrollTop.read(n10);
  for (let n11 = t10.startLineNumber; n11 < t10.endLineNumberExclusive; n11++) {
    let t11 = r10.getLineMaxColumn(n11), a11 = e206.editor.getOffsetForColumn(n11, t11);
    a11 === -1 && (a11 = t11 * e206.editor.getOption(59).typicalHalfwidthCharacterWidth), i10 = Math.max(i10, a11);
  }
  let a10 = t10.mapToLineArray((e207) => r10.getLineContent(e207));
  return i10 < 5 && a10.some((e207) => e207.length > 0) && r10.uri.scheme !== `file` && console.error(`unexpected width`), i10;
}
function JOe(e206, t10, n10) {
  return e206.layoutInfo.read(n10), e206.value.read(n10), e206.model.read(n10) ? (e206.scrollTop.read(n10), e206.editor.getOffsetForColumn(t10.lineNumber, t10.column)) : 0;
}
function I6(e206, t10, n10, r10, i10 = void 0) {
  let a10 = r10.getModel();
  if (!a10) return { prefixTrim: 0, prefixLeftOffset: 0 };
  let o10 = e206.map((e207) => e207.isSingleLine() ? e207.startColumn - 1 : 0), s10 = t10.mapToLineArray((e207) => IO(a10.getLineContent(e207))), c10 = n10.filter((e207) => e207 !== ``).map((e207) => IO(e207)), l10 = Math.min(...o10, ...s10, ...c10), u10;
  if (a10.getLineIndentColumn(t10.startLineNumber) >= l10 + 1) WK(r10).scrollTop.read(i10), u10 = r10.getOffsetForColumn(t10.startLineNumber, l10 + 1);
  else if (n10.length > 0) u10 = L6(n10[0].slice(0, l10), r10, a10);
  else return { prefixTrim: 0, prefixLeftOffset: 0 };
  return { prefixTrim: l10, prefixLeftOffset: u10 };
}
function L6(e206, t10, n10) {
  let r10 = t10.getOption(59).typicalHalfwidthCharacterWidth, i10 = n10.getOptions().tabSize * r10, a10 = e206.split(`	`).length - 1;
  return (e206.length - a10) * r10 + a10 * i10;
}
function R6(e206) {
  let t10 = e206.layoutInfoContentLeft, n10 = I({ name: `editor.validOverlay.width` }, (n11) => {
    let r11 = e206.layoutInfoMinimap.read(n11).minimapLeft !== 0, i10 = e206.layoutInfoWidth.read(n11) - t10.read(n11);
    return r11 ? i10 - (e206.layoutInfoMinimap.read(n11).minimapWidth + e206.layoutInfoVerticalScrollbarWidth.read(n11)) : i10;
  }), r10 = I({ name: `editor.validOverlay.height` }, (t11) => e206.layoutInfoHeight.read(t11) + e206.contentHeight.read(t11));
  return I({ name: `editor.validOverlay` }, (e207) => Z3.fromLeftTopWidthHeight(t10.read(e207), 0, n10.read(e207), r10.read(e207)));
}
function YOe(e206, t10) {
  let n10 = [];
  for (let r10 of e206) {
    let e207 = t10.mapRange(r10.modifiedRange);
    n10.push(new th(r10.originalRange, e207));
  }
  return n10;
}
function z6(...e206) {
  return e206.filter((e207) => typeof e207 == `string`).join(` `);
}
function XOe(e206, t10) {
  return new M(t10.lineNumber, t10.column + e206.start, t10.lineNumber, t10.column + e206.endExclusive);
}
function ZOe(e206, t10) {
  let n10 = 0;
  loop: for (let r10 = 0, i10 = e206.length; r10 < i10; r10++) switch (e206.charCodeAt(r10)) {
    case 9:
      n10 += t10;
      break;
    case 32:
      n10++;
      break;
    default:
      break loop;
  }
  return n10 - n10 % t10;
}
function QOe(e206, t10, n10) {
  let r10 = t10 - t10 % n10, i10 = 0;
  for (; i10 < e206.length && r10 !== 0; i10++) switch (e206.charCodeAt(i10)) {
    case 9:
      r10 -= n10;
      break;
    case 32:
      r10--;
      break;
    default:
      throw new je(`Unexpected character found while calculating indent length`);
  }
  return i10;
}
function $Oe(e206, t10, n10) {
  let r10 = Wa(e206), i10 = [], a10 = Im(t10.mapToLineArray((e207) => ZOe(r10[e207 - 1], n10)), ue);
  return t10.forEach((e207) => {
    let t11 = QOe(r10[e207 - 1], a10, n10);
    i10.push(new Ym(XOe(new Tm(0, t11), new j(e207, 1)), ``));
  }), new Jm(i10);
}
var B6 = class {
  constructor() {
    this._data = ``;
  }
  moveTo(e206) {
    return this._data += `M ${e206.x} ${e206.y} `, this;
  }
  lineTo(e206) {
    return this._data += `L ${e206.x} ${e206.y} `, this;
  }
  build() {
    return this._data;
  }
};
function V6(e206) {
  let t10 = Ac(void 0, (t11, n10) => e206.read(t11) || n10);
  return dc({ debugName: () => `${e206.debugName}.mapOutFalsy` }, (n10) => {
    if (t10.read(n10), e206.read(n10)) return t10;
  });
}
function H6(e206, t10 = Gs.ofCaller()) {
  return { left: I({ name: `editor.validOverlay.left` }, (t11) => e206(t11).left, t10), top: I({ name: `editor.validOverlay.top` }, (t11) => e206(t11).top, t10), width: I({ name: `editor.validOverlay.width` }, (t11) => e206(t11).right - e206(t11).left, t10), height: I({ name: `editor.validOverlay.height` }, (t11) => e206(t11).bottom - e206(t11).top, t10) };
}
var eke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, U6 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, W6 = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._model = e206, this._close = t10, this._editorObs = n10, this._contextKeyService = r10, this._keybindingService = i10, this._commandService = a10, this._inlineEditsShowCollapsed = this._editorObs.getOption(71).map((e207) => e207.edits.showCollapsed);
  }
  toDisposableLiveElement() {
    return this._createHoverContent().toDisposableLiveElement();
  }
  _createHoverContent() {
    let e206 = Ic(`active`, void 0), t10 = (t11) => ({ title: t11.title, icon: t11.icon, keybinding: typeof t11.commandId == `string` ? this._getKeybinding(t11.commandArgs ? void 0 : t11.commandId) : I(this, (e207) => typeof t11.commandId == `string` ? void 0 : this._getKeybinding(t11.commandArgs ? void 0 : t11.commandId.read(e207)).read(e207)), isActive: e206.map((e207) => e207 === t11.id), onHoverChange: (n11) => e206.set(n11 ? t11.id : void 0, void 0), onAction: () => (this._close(true), this._commandService.executeCommand(typeof t11.commandId == `string` ? t11.commandId : t11.commandId.get(), ...t11.commandArgs ?? [])) }), n10 = nke(this._model.displayName), r10 = G6(t10({ id: `gotoAndAccept`, title: `${C(1212, `Go To`)} / ${C(1213, `Accept`)}`, icon: F.check, commandId: lZ })), i10 = G6(t10({ id: `reject`, title: C(1214, `Reject`), icon: F.close, commandId: fZ })), a10 = this._model.extensionCommands.map((e207, n11) => G6(t10({ id: e207.command.id + `_` + n11, title: e207.command.title, icon: e207.icon ?? F.symbolEvent, commandId: e207.command.id, commandArgs: e207.command.arguments }))), o10 = this._inlineEditsShowCollapsed.map((e207) => G6(t10(e207 ? { id: `showExpanded`, title: C(1215, `Show Expanded`), icon: F.expandAll, commandId: pZ } : { id: `showCollapsed`, title: C(1216, `Show Collapsed`), icon: F.collapseAll, commandId: pZ }))), s10 = G6(t10({ id: `snooze`, title: C(1217, `Snooze`), icon: F.bellSlash, commandId: `editor.action.inlineSuggest.snooze` })), c10 = G6(t10({ id: `settings`, title: C(1218, `Settings`), icon: F.gear, commandId: `workbench.action.openSettings`, commandArgs: [`@tag:nextEditSuggestions`] })), l10 = this._model.action ? [this._model.action] : [], u10 = l10.length > 0 ? rke(l10.map((e207) => ({ id: e207.id, label: e207.title + `...`, enabled: true, run: () => this._commandService.executeCommand(e207.id, ...e207.arguments ?? []), class: void 0, tooltip: e207.tooltip ?? e207.title })), { hoverDelegate: fj }) : void 0;
    return tke([n10, r10, i10, o10, a10.length ? K6() : void 0, s10, c10, ...a10, u10 ? K6() : void 0, u10]);
  }
  _getKeybinding(e206) {
    return e206 ? Tc(this._contextKeyService.onDidChangeContext, () => this._keybindingService.lookupKeybinding(e206)) : FI(void 0);
  }
};
W6 = eke([U6(3, nd), U6(4, Dw), U6(5, Mu)], W6);
function tke(e206) {
  return au.div({ class: `content`, style: { margin: 4, minWidth: 180 } }, e206);
}
function nke(e206) {
  return au.div({ class: `header`, style: { color: Z(W_), fontSize: `13px`, fontWeight: `600`, padding: `0 4px`, lineHeight: 28 } }, [e206]);
}
function G6(e206) {
  return I({ name: `inlineEdits.option` }, (t10) => au.div({ class: [`monaco-menu-option`, e206.isActive?.map((e207) => e207 && `active`)], onmouseenter: () => e206.onHoverChange?.(true), onmouseleave: () => e206.onHoverChange?.(false), onclick: e206.onAction, onkeydown: (t11) => {
    t11.key === `Enter` && e206.onAction?.();
  }, tabIndex: 0, style: { borderRadius: 3 } }, [au.elem(`span`, { style: { fontSize: 16, display: `flex` } }, [ju.isThemeIcon(e206.icon) ? wP(e206.icon) : e206.icon.map((e207) => wP(e207))]), au.elem(`span`, {}, [e206.title]), au.div({ style: { marginLeft: `auto` }, ref: (n10) => {
    let r10 = t10.store.add(new QR(n10, Pt, { disableTitle: true, ...aL, keybindingLabelShadow: void 0, keybindingLabelForeground: Z(W_), keybindingLabelBackground: `transparent`, keybindingLabelBorder: `transparent`, keybindingLabelBottomBorder: void 0 }));
    t10.store.add(hc((t11) => {
      r10.set(e206.keybinding.read(t11));
    }));
  } })]));
}
function rke(e206, t10) {
  return I({ name: `inlineEdits.actionBar` }, (n10) => au.div({ class: [`action-widget-action-bar`], style: { padding: `3px 24px` } }, [au.div({ ref: (r10) => {
    n10.store.add(new CL(r10, t10)).push(e206, { icon: false, label: true });
  } })]));
}
function K6() {
  return au.div({ id: `inline-edit-gutter-indicator-menu-separator`, class: `menu-separator`, style: { color: Z(aoe), padding: `2px 0` } }, au.div({ style: { borderBottom: `1px solid ${Z(Ov)}` } }));
}
var ike = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, q6 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, J6 = class extends D {
  get model() {
    let e206 = this._model.get();
    if (!e206) throw new je(`Inline Edit Model not available`);
    return e206;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    super(), this._editorObs = e206, this._originalRange = t10, this._verticalOffset = n10, this._model = r10, this._isHoveringOverInlineEdit = i10, this._focusIsInMenu = a10, this._hoverService = o10, this._instantiationService = s10, this._accessibilityService = c10, this._tabAction = I(this, (e207) => {
      let t11 = this._model.read(e207);
      return t11 ? t11.tabAction.read(e207) : V4.Inactive;
    }), this._hoverVisible = Ic(this, false), this.isHoverVisible = this._hoverVisible, this._isHoveredOverIcon = Ic(this, false), this._isHoveredOverIconDebounced = Oc(this._isHoveredOverIcon, 100), this.isHoveredOverIcon = this._isHoveredOverIconDebounced, this._isHoveredOverInlineEditDebounced = Oc(this._isHoveringOverInlineEdit, 100), this._gutterIndicatorStyles = this._tabAction.map(this, (e207, t11) => {
      switch (e207) {
        case V4.Inactive:
          return { background: N6(E6, l10).read(t11).toString(), foreground: N6(UOe, l10).read(t11).toString(), border: N6(T6, l10).read(t11).toString() };
        case V4.Jump:
          return { background: N6(w6, l10).read(t11).toString(), foreground: N6(HOe, l10).read(t11).toString(), border: N6(C6, l10).read(t11).toString() };
        case V4.Accept:
          return { background: N6(O6, l10).read(t11).toString(), foreground: N6(WOe, l10).read(t11).toString(), border: N6(D6, l10).read(t11).toString() };
        default:
          Ne();
      }
    }), this._originalRangeObs = V6(this._originalRange), this._state = I(this, (e207) => {
      let t11 = this._originalRangeObs.read(e207);
      if (t11) return { range: t11, lineOffsetRange: this._editorObs.observeLineOffsetRange(t11, e207.store) };
    }), this._stickyScrollController = b6.get(this._editorObs.editor), this._stickyScrollHeight = this._stickyScrollController ? Tc(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController.stickyScrollWidgetHeight) : FI(0), this._lineNumberToRender = I(this, (e207) => {
      if (this._verticalOffset.read(e207) !== 0) return ``;
      let t11 = this._originalRange.read(e207)?.startLineNumber, n11 = this._editorObs.getOption(76).read(e207);
      if (t11 === void 0 || n11.renderType === 0) return ``;
      if (n11.renderType === 3) {
        let n12 = this._editorObs.cursorPosition.read(e207);
        return t11 % 10 == 0 || n12 && n12.lineNumber === t11 ? t11.toString() : ``;
      }
      if (n11.renderType === 2) {
        let n12 = this._editorObs.cursorPosition.read(e207);
        if (!n12) return ``;
        let r11 = Math.abs(t11 - n12.lineNumber);
        return r11 === 0 ? t11.toString() : r11.toString();
      }
      return n11.renderType === 4 ? n11.renderFn ? n11.renderFn(t11) : `` : t11.toString();
    }), this._availableWidthForIcon = I(this, (e207) => {
      let t11 = this._editorObs.editor.getModel(), n11 = this._editorObs.editor, r11 = this._editorObs.layoutInfo.read(e207), i11 = r11.decorationsLeft + r11.decorationsWidth - r11.glyphMarginLeft;
      if (!t11 || i11 <= 0) return () => 0;
      if (r11.lineNumbersLeft === 0) return () => i11;
      let a11 = this._editorObs.getOption(76).read(e207);
      if (a11.renderType === 2 || a11.renderType === 0) return () => i11;
      let o11 = n11.getOption(59).typicalHalfwidthCharacterWidth, s11 = r11.lineNumbersLeft + r11.lineNumbersWidth, c11 = (t11.getLineCount() + 1).toString().length, l11 = [];
      for (let e208 = 1; e208 <= c11; e208++) {
        let t12 = 10 ** (e208 - 1), a12 = n11.getTopForLineNumber(t12), c12 = e208 * o11, u10 = Math.min(i11, Math.max(0, s11 - c12 - r11.glyphMarginLeft));
        l11.push({ firstLineNumberWithDigitCount: t12, topOfLineNumber: a12, usableWidthLeftOfLineNumber: u10 });
      }
      return (e208) => {
        for (let t12 = l11.length - 1; t12 >= 0; t12--) if (e208 >= l11[t12].topOfLineNumber) return l11[t12].usableWidthLeftOfLineNumber;
        throw new je(`Could not find avilable width for icon`);
      };
    }), this._layout = I(this, (e207) => {
      let t11 = this._state.read(e207);
      if (!t11) return;
      let n11 = this._editorObs.layoutInfo.read(e207), r11 = this._editorObs.observeLineHeightForLine(t11.range.map((e208) => e208.startLineNumber)).read(e207), i11 = n11.decorationsLeft + n11.decorationsWidth - n11.glyphMarginLeft - 4, a11 = n11.height - 4, o11 = Z3.fromLeftTopWidthHeight(2, 2, i11, a11), s11 = o11.withTop(this._stickyScrollHeight.read(e207)), c11 = o11.withTop(s11.top + 2), l11 = t11.lineOffsetRange.read(e207), u10 = Z3.fromRanges(Tm.fromTo(c11.left, c11.right), l11), d10 = r11, f10 = this._verticalOffset.read(e207), p10 = u10.withHeight(d10).translateY(f10), m10 = s11.containsRect(p10), h10 = this._tabAction.map((e208) => e208 === V4.Accept ? F.keyboardTab : F.arrowRight), g10 = I(this, (e208) => this._isHoveredOverIconDebounced.read(e208) || this._isHoveredOverInlineEditDebounced.read(e208) ? F.check : this._tabAction.read(e208) === V4.Accept ? F.keyboardTab : (this._editorObs.cursorLineNumber.read(e208) ?? 0) <= t11.range.read(e208).startLineNumber ? F.keyboardTabAbove : F.keyboardTabBelow), _10 = (e208) => {
        let t12 = this._availableWidthForIcon.read(void 0)(e208.bottom + this._editorObs.editor.getScrollTop()) - 2;
        return Math.max(Math.min(t12, 22), 16);
      };
      if (m10) {
        let e208 = p10, t12;
        t12 = n11.lineNumbersWidth === 0 ? Math.min(Math.max(n11.lineNumbersLeft - o11.left, 0), e208.width - 22) : Math.max(n11.lineNumbersLeft + n11.lineNumbersWidth - o11.left, 0);
        let r12 = e208.withWidth(t12), i12 = Math.max(Math.min(n11.decorationsWidth, 22), 16);
        return { gutterEditArea: u10, icon: g10, iconDirection: `right`, iconRect: e208.withWidth(i12).translateX(t12), pillRect: e208, lineNumberRect: r12 };
      }
      let v10 = o11.intersect(u10);
      if (v10 && v10.height >= d10) {
        let e208 = p10.moveToBeContainedIn(c11).moveToBeContainedIn(v10), t12 = e208.withWidth(_10(e208));
        return { gutterEditArea: u10, icon: g10, iconDirection: `right`, iconRect: t12, pillRect: t12 };
      }
      let y10 = p10.moveToBeContainedIn(o11), b10 = y10.withWidth(_10(y10)), x10 = b10;
      return { gutterEditArea: u10, icon: h10, iconDirection: b10.top < p10.top ? `top` : `bottom`, iconRect: x10, pillRect: b10 };
    }), this._iconRef = au.ref(), this.isVisible = this._layout.map((e207) => !!e207), this._indicator = au.div({ class: `inline-edits-view-gutter-indicator`, onclick: () => {
      let e207 = this._layout.get()?.icon.get() === F.check;
      this._editorObs.editor.focus(), e207 ? this.model.accept() : this.model.jump();
    }, tabIndex: 0, style: { position: `absolute`, overflow: `visible` } }, V6(this._layout).map((e207) => e207 ? [au.div({ style: { position: `absolute`, background: Z(GOe), borderRadius: `4px`, ...H6((t11) => e207.read(t11).gutterEditArea) } }), au.div({ class: `icon`, ref: this._iconRef, onmouseenter: () => {
      this._showHover();
    }, style: { cursor: `pointer`, zIndex: `20`, position: `absolute`, backgroundColor: this._gutterIndicatorStyles.map((e208) => e208.background), "--vscodeIconForeground": this._gutterIndicatorStyles.map((e208) => e208.foreground), border: this._gutterIndicatorStyles.map((e208) => `1px solid ${e208.border}`), boxSizing: `border-box`, borderRadius: `4px`, display: `flex`, justifyContent: `flex-end`, transition: `background-color 0.2s ease-in-out, width 0.2s ease-in-out`, ...H6((t11) => e207.read(t11).pillRect) } }, [au.div({ className: `line-number`, style: { lineHeight: e207.map((e208) => e208.lineNumberRect ? e208.lineNumberRect.height : 0), display: e207.map((e208) => e208.lineNumberRect ? `flex` : `none`), alignItems: `center`, justifyContent: `flex-end`, width: e207.map((e208) => e208.lineNumberRect ? e208.lineNumberRect.width : 0), height: `100%`, color: this._gutterIndicatorStyles.map((e208) => e208.foreground) } }, this._lineNumberToRender), au.div({ style: { rotate: e207.map((e208) => `${ake(e208.iconDirection)}deg`), transition: `rotate 0.2s ease-in-out`, display: `flex`, alignItems: `center`, justifyContent: `center`, height: `100%`, marginRight: e207.map((e208) => e208.pillRect.width - e208.iconRect.width - (e208.lineNumberRect?.width ?? 0)), width: e207.map((e208) => e208.iconRect.width) } }, [e207.map((e208, t11) => wP(e208.icon.read(t11)))])])] : [])).keepUpdated(this._store), this._register(this._editorObs.createOverlayWidget({ domNode: this._indicator.element, position: FI(null), allowEditorOverflow: false, minContentWidthInPx: FI(0) })), this._register(this._editorObs.editor.onMouseMove((e207) => {
      if (this._state.get() === void 0) return;
      let t11 = this._iconRef.element.getBoundingClientRect(), n11 = Z3.fromLeftTopWidthHeight(t11.left, t11.top, t11.width, t11.height), r11 = new UK(e207.event.posx, e207.event.posy);
      this._isHoveredOverIcon.set(n11.containsPoint(r11), void 0);
    })), this._register(this._editorObs.editor.onDidScrollChange(() => {
      this._isHoveredOverIcon.set(false, void 0);
    })), this._register(mw(this._isHoveredOverInlineEditDebounced, (e207) => {
      e207 && this.triggerAnimation();
    })), this._register(hc((e207) => {
      this._indicator.readEffect(e207), this._indicator.element && this._editorObs.editor.applyFontInfo(this._indicator.element);
    }));
  }
  triggerAnimation() {
    return this._accessibilityService.isMotionReduced() ? new Animation(null, null).finished : this._iconRef.element.animate([{ outline: `2px solid ${this._gutterIndicatorStyles.map((e206) => e206.border).get()}`, outlineOffset: `-1px`, offset: 0 }, { outline: `2px solid transparent`, outlineOffset: `10px`, offset: 1 }], { duration: 500 }).finished;
  }
  _showHover() {
    if (this._hoverVisible.get()) return;
    let e206 = new E(), t10 = e206.add(this._instantiationService.createInstance(W6, this.model, (e207) => {
      e207 && this._editorObs.editor.focus(), r10?.dispose();
    }, this._editorObs).toDisposableLiveElement()), n10 = e206.add(Gl(t10.element));
    e206.add(n10.onDidBlur(() => this._focusIsInMenu.set(false, void 0))), e206.add(n10.onDidFocus(() => this._focusIsInMenu.set(true, void 0))), e206.add(T(() => this._focusIsInMenu.set(false, void 0)));
    let r10 = this._hoverService.showInstantHover({ target: this._iconRef.element, content: t10.element });
    r10 ? (this._hoverVisible.set(true, void 0), e206.add(this._editorObs.editor.onDidScrollChange(() => r10.dispose())), e206.add(r10.onDispose(() => {
      this._hoverVisible.set(false, void 0), e206.dispose();
    }))) : e206.dispose();
  }
};
J6 = ike([q6(6, uj), q6(7, V), q6(8, e_), q6(9, US)], J6);
function ake(e206) {
  switch (e206) {
    case `top`:
      return 90;
    case `bottom`:
      return -90;
    case `right`:
      return 0;
  }
}
var oke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Y6 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, X6;
(function(e206) {
  e206.FirstTime = `firstTime`, e206.SecondTime = `secondTime`, e206.Active = `active`;
})(X6 || (X6 = {}));
var Z6 = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._host = e206, this._model = t10, this._indicator = n10, this._collapsedView = r10, this._storageService = i10, this._configurationService = a10, this._disposables = this._register(new Jt()), this._setupDone = Ic({ name: `setupDone` }, false), this._activeCompletionId = I((e207) => {
      let t11 = this._model.read(e207);
      if (!t11 || !this._setupDone.read(e207)) return;
      let n11 = this._indicator.read(e207);
      if (!(!n11 || !n11.isVisible.read(e207))) return t11.inlineEdit.inlineCompletion.identity.id;
    }), this._register(this._initializeDebugSetting()), this._disposables.value = this.setupNewUserExperience(), this._setupDone.set(true, void 0);
  }
  setupNewUserExperience() {
    if (this.getNewUserType() === X6.Active) return;
    let e206 = new E(), t10 = false, n10 = false, r10 = 0, i10 = 0;
    return e206.add(Vle(this._activeCompletionId, async (e207, a10, o10, s10) => {
      if (e207 === void 0) return;
      let c10 = this.getNewUserType();
      switch (c10) {
        case X6.FirstTime:
          (r10++ >= 5 || t10) && (c10 = X6.SecondTime, this.setNewUserType(c10));
          break;
        case X6.SecondTime:
          i10++ >= 3 && n10 && (c10 = X6.Active, this.setNewUserType(c10));
          break;
      }
      switch (c10) {
        case X6.FirstTime:
          for (let e208 = 0; e208 < 3 && !s10.isCancellationRequested; e208++) await this._indicator.get()?.triggerAnimation(), await is(500);
          break;
        case X6.SecondTime:
          this._indicator.get()?.triggerAnimation();
          break;
      }
    })), e206.add(hc((e207) => {
      this._collapsedView.isVisible.read(e207) && this.getNewUserType() !== X6.Active && this._collapsedView.triggerAnimation();
    })), e206.add(vc((e207, n11) => {
      let r11 = this._indicator.read(e207);
      r11 && n11.add(mw(r11.isHoveredOverIcon, async (e208) => {
        e208 && (t10 = true);
      }));
    })), e206.add(vc((e207, t11) => {
      let r11 = this._host.read(e207);
      r11 && t11.add(r11.onDidAccept(() => {
        n10 = true;
      }));
    })), e206;
  }
  getNewUserType() {
    return this._storageService.get(`inlineEditsGutterIndicatorUserKind`, -1, X6.FirstTime);
  }
  setNewUserType(e206) {
    switch (e206) {
      case X6.FirstTime:
        throw new je(`UserKind should not be set to first time`);
      case X6.SecondTime:
        break;
      case X6.Active:
        this._disposables.clear();
        break;
    }
    this._storageService.store(`inlineEditsGutterIndicatorUserKind`, e206, -1, 0);
  }
  _initializeDebugSetting() {
    let e206 = `editor.inlineSuggest.edits.resetNewUserExperience`;
    return this._configurationService.getValue(e206) && this._storageService.remove(`inlineEditsGutterIndicatorUserKind`, -1), this._configurationService.onDidChangeConfiguration((t10) => {
      t10.affectsConfiguration(e206) && this._configurationService.getValue(e206) && (this._storageService.remove(`inlineEditsGutterIndicatorUserKind`, -1), this._disposables.value = this.setupNewUserExperience());
    });
  }
};
Z6 = oke([Y6(4, dF), Y6(5, Uf)], Z6);
var ske = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, cke = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Q6 = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._edit = t10, this._accessibilityService = n10, this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._iconRef = au.ref(), this.isHovered = FI(false), this._editorObs = WK(this._editor);
    let r10 = this._edit.map((e207) => e207?.edit.replacements[0] ?? null).map((e207) => e207 ? w4(e207, this._editor.getModel()).range.getStartPosition() : null), i10 = this._editorObs.observePosition(r10, this._store), a10 = I((e207) => {
      let t11 = i10.read(e207);
      if (!t11) return null;
      let n11 = this._editorObs.layoutInfoContentLeft.read(e207), r11 = this._editorObs.scrollLeft.read(e207);
      return new UK(n11 + t11.x - r11, t11.y);
    }), o10 = au.div({ class: `inline-edits-collapsed-view`, style: { position: `absolute`, overflow: `visible`, top: `0px`, left: `0px`, display: `block` } }, [[this.getCollapsedIndicator(a10)]]).keepUpdated(this._store).element;
    this._register(this._editorObs.createOverlayWidget({ domNode: o10, position: FI(null), allowEditorOverflow: false, minContentWidthInPx: FI(0) })), this.isVisible = this._edit.map((e207, t11) => !!e207 && a10.read(t11) !== null);
  }
  triggerAnimation() {
    return this._accessibilityService.isMotionReduced() ? new Animation(null, null).finished : this._iconRef.element.animate([{ offset: 0, transform: `translateY(-3px)` }, { offset: 0.2, transform: `translateY(1px)` }, { offset: 0.36, transform: `translateY(-1px)` }, { offset: 0.52, transform: `translateY(1px)` }, { offset: 0.68, transform: `translateY(-1px)` }, { offset: 0.84, transform: `translateY(1px)` }, { offset: 1, transform: `translateY(0px)` }], { duration: 2e3 }).finished;
  }
  getCollapsedIndicator(e206) {
    let t10 = this._editorObs.layoutInfoContentLeft, n10 = e206.map((e207, n11) => e207 ? e207.deltaX(-t10.read(n11)) : null), r10 = this.createIconPath(n10);
    return au.svg({ class: `collapsedView`, ref: this._iconRef, style: { position: `absolute`, ...H6((e207) => R6(this._editorObs).read(e207)), overflow: `hidden`, pointerEvents: `none` } }, [au.svgElem(`path`, { class: `collapsedViewPath`, d: r10, fill: Z(C6) })]);
  }
  createIconPath(e206) {
    return e206.map((e207) => {
      if (!e207) return new B6().build();
      let t10 = e207.deltaX(-6 / 2).deltaY(-1), n10 = t10.deltaX(6), r10 = t10.deltaY(1), i10 = n10.deltaY(1), a10 = r10.deltaX(6 / 2).deltaY(3);
      return new B6().moveTo(t10).lineTo(n10).lineTo(i10).lineTo(a10).lineTo(r10).lineTo(t10).build();
    });
  }
};
Q6 = ske([cke(2, e_)], Q6);
var lke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, $6 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, e810 = 14, t8 = 0, n8 = 4, r8 = 4, i8 = 2, a8 = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._editor = e206, this._languageService = i10, this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._isHovered = Ic(this, false), this.isHovered = this._isHovered, this._viewRef = au.ref(), this._editorObs = WK(this._editor);
    let a10 = n10.map((e207, t11) => {
      let n11;
      switch (e207) {
        case V4.Inactive:
          n11 = E6;
          break;
        case V4.Jump:
          n11 = w6;
          break;
        case V4.Accept:
          n11 = O6;
          break;
      }
      return { border: N6(n11, r10).read(t11).toString(), background: Z(rv) };
    }), o10 = t10.map((e207) => e207 ? this.getState(e207) : void 0), s10 = o10.map((e207) => e207 ? this.getRendering(e207, a10) : void 0);
    this.minEditorScrollHeight = I(this, (e207) => {
      let t11 = o10.read(e207);
      return t11 ? t11.rect.read(e207).bottom + this._editor.getScrollTop() : 0;
    });
    let c10 = au.div({ class: `inline-edits-custom-view`, style: { position: `absolute`, overflow: `visible`, top: `0px`, left: `0px`, display: `block` } }, [s10]).keepUpdated(this._store);
    this._register(this._editorObs.createOverlayWidget({ domNode: c10.element, position: FI(null), allowEditorOverflow: false, minContentWidthInPx: Ac(this, (e207, t11) => {
      let n11 = o10.read(e207);
      if (!n11) return t11 ?? 0;
      let r11 = n11.rect.map((e208) => e208.right).read(e207) + this._editorObs.layoutInfoVerticalScrollbarWidth.read(e207) + n8 - this._editorObs.layoutInfoContentLeft.read(e207);
      return Math.max(t11 ?? 0, r11);
    }).recomputeInitiallyAndOnChange(this._store) })), this._register(hc((e207) => {
      if (!s10.read(e207)) {
        this._isHovered.set(false, void 0);
        return;
      }
      this._isHovered.set(c10.isHovered.read(e207), void 0);
    }));
  }
  fitsInsideViewport(e206, t10, n10) {
    let r10 = this._editorObs.layoutInfoWidth.read(n10), i10 = this._editorObs.layoutInfoContentLeft.read(n10), a10 = this._editor.getLayoutInfo().verticalScrollbarWidth, o10 = this._editorObs.layoutInfoMinimap.read(n10).minimapLeft === 0 ? 0 : this._editorObs.layoutInfoMinimap.read(n10).minimapWidth, s10 = F6(this._editorObs, e206, void 0), c10 = L6(t10, this._editor, this._editor.getModel()), l10 = n8 + e810;
    return s10 + c10 + l10 < r10 - i10 - a10 - o10;
  }
  getState(e206) {
    let t10 = I(this, (t11) => {
      let n11 = e206.range.startLineNumber, r11 = e206.range.endLineNumber, i11 = e206.range.startColumn, a10 = e206.range.endColumn, o10 = this._editor.getModel()?.getLineCount() ?? 0;
      return { lineWidth: F6(this._editorObs, new zm(n11, n11 + 1), t11), lineWidthBelow: n11 + 1 <= o10 ? F6(this._editorObs, new zm(n11 + 1, n11 + 2), t11) : void 0, lineWidthAbove: n11 - 1 >= 1 ? F6(this._editorObs, new zm(n11 - 1, n11), t11) : void 0, startContentLeftOffset: this._editor.getOffsetForColumn(n11, i11), endContentLeftOffset: this._editor.getOffsetForColumn(r11, a10) };
    }), n10 = e206.range.startLineNumber, r10 = e206.range.endLineNumber, i10 = this.fitsInsideViewport(new zm(n10, r10 + 1), e206.content, void 0);
    return { rect: I(this, (a10) => {
      let o10 = this._editorObs.getOption(59).read(a10).typicalHalfwidthCharacterWidth, { lineWidth: s10, lineWidthBelow: c10, lineWidthAbove: l10, startContentLeftOffset: u10, endContentLeftOffset: d10 } = t10.read(a10), f10 = this._editorObs.layoutInfoContentLeft.read(a10), p10 = this._editorObs.observeLineHeightForLine(n10).recomputeInitiallyAndOnChange(a10.store).read(a10), m10 = this._editorObs.scrollTop.read(a10), h10 = this._editorObs.scrollLeft.read(a10), g10;
      g10 = n10 === r10 && d10 + 5 * o10 >= s10 && i10 ? `end` : c10 !== void 0 && c10 + e810 - r8 - n8 < u10 ? `below` : l10 !== void 0 && l10 + e810 - r8 - n8 < u10 ? `above` : `end`;
      let _10, v10, y10 = 0, b10 = 0;
      switch (g10) {
        case `end`:
          _10 = this._editorObs.editor.getTopForLineNumber(n10), v10 = s10, y10 = n8 + e810;
          break;
        case `below`:
          _10 = this._editorObs.editor.getTopForLineNumber(n10 + 1), v10 = u10, y10 = n8 + r8, b10 = t8 + i8;
          break;
        case `above`:
          _10 = this._editorObs.editor.getTopForLineNumber(n10 - 1), v10 = u10, y10 = n8 + r8, b10 = -t8 + i8;
          break;
      }
      return Z3.fromLeftTopWidthHeight(f10 + v10 - h10, _10 - m10, o10 * e206.content.length, p10).withMargin(t8, n8).translateX(y10).translateY(b10);
    }), label: e206.content, kind: e206.style };
  }
  getRendering(e206, t10) {
    let n10 = document.createElement(`div`), r10 = this._editor.getModel().tokenization.tokenizeLinesAt(1, [e206.label])?.[0], i10;
    i10 = r10 && e206.kind === vi.Code ? ig.fromLineTokens(r10).toLineTokens(e206.label, this._languageService.languageIdCodec) : rg.createEmpty(e206.label, this._languageService.languageIdCodec);
    let a10 = AK(new jK([i10]), MK.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0), [], n10, true);
    n10.style.width = `${a10.minWidthInPx}px`;
    let o10 = e206.rect.map((e207) => e207.withMargin(0, n8));
    return au.div({ class: `collapsedView`, ref: this._viewRef, style: { position: `absolute`, ...H6((e207) => o10.read(e207)), overflow: `hidden`, boxSizing: `border-box`, cursor: `pointer`, border: t10.map((e207) => `1px solid ${e207.border}`), borderRadius: `4px`, backgroundColor: t10.map((e207) => e207.background), display: `flex`, alignItems: `center`, justifyContent: `center`, whiteSpace: `nowrap` }, onmousedown: (e207) => {
      e207.preventDefault();
    }, onclick: (e207) => {
      this._onDidClick.fire(new Xo(Vc(e207), e207));
    } }, [n10]);
  }
};
a8 = lke([$6(3, US), $6(4, Jf)], a8);
var uke = 0, dke = 0, o8 = 1, fke = 1, pke = 3, s8 = 4, mke = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._edit = t10, this._uiState = n10, this._tabAction = r10, this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._display = I(this, (e207) => this._uiState.read(e207) ? `block` : `none`), this._editorMaxContentWidthInRange = I(this, (e207) => {
      let t11 = this._originalDisplayRange.read(e207);
      return t11 ? (this._editorObs.versionId.read(e207), Ac(this, (e208, n11) => {
        let r11 = F6(this._editorObs, t11, e208);
        return Math.max(r11, n11 ?? 0);
      })) : FI(0);
    }).map((e207, t11) => e207.read(t11)), this._maxPrefixTrim = I(this, (e207) => {
      let t11 = this._uiState.read(e207);
      return t11 ? I6(t11.deletions, t11.originalRange, [], this._editor) : { prefixTrim: 0, prefixLeftOffset: 0 };
    }), this._editorLayoutInfo = I(this, (e207) => {
      let t11 = this._edit.read(e207);
      if (!t11 || !this._uiState.read(e207)) return null;
      let n11 = this._editorObs.layoutInfo.read(e207), r11 = this._editorObs.scrollLeft.read(e207), i11 = this._editorObs.getOption(59).map((e208) => e208.typicalHalfwidthCharacterWidth).read(e207), a11 = n11.contentLeft + Math.max(this._editorMaxContentWidthInRange.read(e207), i11) - r11, o10 = t11.originalLineRange, s10 = this._originalVerticalStartPosition.read(e207) ?? this._editor.getTopForLineNumber(o10.startLineNumber) - this._editorObs.scrollTop.read(e207), c10 = this._originalVerticalEndPosition.read(e207) ?? this._editor.getTopForLineNumber(o10.endLineNumberExclusive) - this._editorObs.scrollTop.read(e207), l10 = n11.contentLeft + this._maxPrefixTrim.read(e207).prefixLeftOffset - r11;
      return a11 <= l10 ? null : { codeRect: Z3.fromLeftTopRightBottom(l10, s10, a11, c10).withMargin(dke, uke), contentLeft: n11.contentLeft };
    }).recomputeInitiallyAndOnChange(this._store), this._originalOverlay = au.div({ style: { pointerEvents: `none` } }, I(this, (e207) => {
      let t11 = V6(this._editorLayoutInfo).read(e207);
      if (!t11) return;
      let n11 = t11.map((e208) => Z3.fromLeftTopRightBottom(e208.contentLeft - s8 - o8, e208.codeRect.top, e208.contentLeft, e208.codeRect.bottom)), r11 = I(this, (e208) => {
        let r12 = t11.read(e208).codeRect, i12 = n11.read(e208);
        return r12.intersectHorizontal(new Tm(i12.left, 2 ** 53 - 1));
      }), i11 = this._uiState.map((e208) => e208?.inDiffEditor ? pke : fke).read(e207), a11 = r11.map((e208) => e208.withMargin(i11, i11));
      return [au.div({ class: `originalSeparatorDeletion`, style: { ...a11.read(e207).toStyles(), borderRadius: `${s8}px`, border: `${o8 + i11}px solid ${Z(rv)}`, boxSizing: `border-box` } }), au.div({ class: `originalOverlayDeletion`, style: { ...r11.read(e207).toStyles(), borderRadius: `${s8}px`, border: M6(this._tabAction).map((e208) => `${o8}px solid ${Z(e208)}`), boxSizing: `border-box`, backgroundColor: Z(x6) } }), au.div({ class: `originalOverlayHiderDeletion`, style: { ...n11.read(e207).toStyles(), backgroundColor: Z(rv) } })];
    })).keepUpdated(this._store), this._nonOverflowView = au.div({ class: `inline-edits-view`, style: { position: `absolute`, overflow: `visible`, top: `0px`, left: `0px`, display: this._display } }, [[this._originalOverlay]]).keepUpdated(this._store), this.isHovered = FI(false), this._editorObs = WK(this._editor);
    let i10 = I(this, (e207) => {
      let t11 = this._edit.read(e207);
      return t11 ? new j(t11.originalLineRange.startLineNumber, 1) : null;
    }), a10 = I(this, (e207) => {
      let t11 = this._edit.read(e207);
      return t11 ? new j(t11.originalLineRange.endLineNumberExclusive, 1) : null;
    });
    this._originalDisplayRange = this._uiState.map((e207) => e207?.originalRange), this._originalVerticalStartPosition = this._editorObs.observePosition(i10, this._store).map((e207) => e207?.y), this._originalVerticalEndPosition = this._editorObs.observePosition(a10, this._store).map((e207) => e207?.y), this._register(this._editorObs.createOverlayWidget({ domNode: this._nonOverflowView.element, position: FI(null), allowEditorOverflow: false, minContentWidthInPx: I(this, (e207) => {
      let t11 = this._editorLayoutInfo.read(e207);
      return t11 === null ? 0 : t11.codeRect.width;
    }) }));
  }
}, hke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, c8 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, l8 = 1, gke = 1, _ke = 3, u8 = 4, d8 = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._editor = e206, this._input = t10, this._tabAction = n10, this._languageService = i10, this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._state = I(this, (e207) => {
      let t11 = this._input.read(e207);
      if (!t11) return;
      let n11 = this._editor.getModel(), r11 = n11.getEOL();
      if (t11.startColumn === 1 && t11.lineNumber > 1 && n11.getLineLength(t11.lineNumber) !== 0 && t11.text.endsWith(r11) && !t11.text.startsWith(r11)) {
        let e208 = n11.getLineLength(t11.lineNumber - 1) + 1;
        return { lineNumber: t11.lineNumber - 1, column: e208, text: r11 + t11.text.slice(0, -r11.length) };
      }
      return { lineNumber: t11.lineNumber, column: t11.startColumn, text: t11.text };
    }), this._trimVertically = I(this, (e207) => {
      let t11 = this._state.read(e207), n11 = t11?.text;
      if (!n11 || n11.trim() === ``) return { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 };
      let r11 = this._editor.getLineHeightForPosition(new j(t11.lineNumber, 1)), i11 = this._editor.getModel().getEOL(), a10 = 0, o10 = 0, s10 = 0;
      for (; s10 < n11.length && n11.startsWith(i11, s10); s10 += i11.length) a10 += 1;
      for (let e208 = n11.length; e208 > s10 && n11.endsWith(i11, e208); e208 -= i11.length) o10 += 1;
      return { topOffset: a10 * r11, bottomOffset: o10 * r11, linesTop: a10, linesBottom: o10 };
    }), this._maxPrefixTrim = I(this, (e207) => {
      let t11 = this._state.read(e207);
      if (!t11) return { prefixLeftOffset: 0, prefixTrim: 0 };
      let n11 = this._editor.getModel(), r11 = n11.getEOL(), i11 = this._trimVertically.read(e207), a10 = t11.text.split(r11), o10 = a10.slice(i11.linesTop, a10.length - i11.linesBottom);
      return i11.linesTop === 0 && (o10[0] = n11.getLineContent(t11.lineNumber) + o10[0]), I6([], new zm(t11.lineNumber, t11.lineNumber + (i11.linesTop > 0 ? 0 : 1)), o10, this._editor);
    }), this._ghostText = I((e207) => {
      let t11 = this._state.read(e207), n11 = this._maxPrefixTrim.read(e207);
      if (!t11) return;
      let r11 = this._editor.getModel().getEOL(), i11 = t11.text.split(r11).map((e208, t12) => new vk(new M(t12 + 1, t12 === 0 ? 1 : n11.prefixTrim + 1, t12 + 1, e208.length + 1), `modified-background`, 0));
      return new y4(t11.lineNumber, [new b4(t11.column, t11.text, false, i11)]);
    }), this._display = I(this, (e207) => this._state.read(e207) ? `block` : `none`), this._editorMaxContentWidthInRange = I(this, (e207) => {
      let t11 = this._state.read(e207);
      if (!t11) return 0;
      this._editorObs.versionId.read(e207);
      let n11 = this._editor.getModel(), r11 = n11.getEOL(), i11 = t11.text.startsWith(r11) ? `` : n11.getValueInRange(new M(t11.lineNumber, 1, t11.lineNumber, t11.column)), a10 = n11.getValueInRange(new M(t11.lineNumber, t11.column, t11.lineNumber, n11.getLineLength(t11.lineNumber) + 1)), o10 = (i11 + t11.text + a10).split(r11), s10 = MK.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0), c10 = o10.map((e208) => {
        let r12 = n11.tokenization.tokenizeLinesAt(t11.lineNumber, [e208])?.[0], i12;
        return i12 = r12 ? ig.fromLineTokens(r12).toLineTokens(e208, this._languageService.languageIdCodec) : rg.createEmpty(e208, this._languageService.languageIdCodec), AK(new jK([i12]), s10, [], B(`div`), true).minWidthInPx;
      });
      return Math.max(...c10);
    }), this.startLineOffset = this._trimVertically.map((e207) => e207.topOffset), this.originalLines = this._state.map((e207) => e207 ? new zm(e207.lineNumber, Math.min(e207.lineNumber + 2, this._editor.getModel().getLineCount() + 1)) : void 0), this._overlayLayout = I(this, (e207) => {
      this._ghostText.read(e207);
      let t11 = this._state.read(e207);
      if (!t11) return null;
      this._editorObs.observePosition(Ic(this, new j(t11.lineNumber, t11.column)), e207.store).read(e207);
      let n11 = this._editorObs.layoutInfo.read(e207), r11 = this._editorObs.scrollLeft.read(e207), i11 = this._editorObs.layoutInfoVerticalScrollbarWidth.read(e207), a10 = n11.contentLeft + this._editorMaxContentWidthInRange.read(e207) - r11, o10 = this._maxPrefixTrim.read(e207).prefixLeftOffset ?? 0, s10 = n11.contentLeft + o10 - r11;
      if (a10 <= s10) return null;
      let { topOffset: c10, bottomOffset: l10 } = this._trimVertically.read(e207), u10 = this._editorObs.scrollTop.read(e207), d10 = this._ghostTextView.height.read(e207) - c10 - l10, f10 = this._editor.getTopForLineNumber(t11.lineNumber) - u10 + c10, p10 = new Z3(s10, f10, a10, f10 + d10);
      return { overlay: p10, startsAtContentLeft: o10 === 0, contentLeft: n11.contentLeft, minContentWidthRequired: o10 + p10.width + i11 };
    }).recomputeInitiallyAndOnChange(this._store), this._modifiedOverlay = au.div({ style: { pointerEvents: `none` } }, I(this, (e207) => {
      let t11 = V6(this._overlayLayout).read(e207);
      if (!t11) return;
      let n11 = t11.map((e208) => Z3.fromLeftTopRightBottom(e208.contentLeft - u8 - l8, e208.overlay.top, e208.contentLeft, e208.overlay.bottom)).read(e207), r11 = this._input.map((e208) => e208?.inDiffEditor ? _ke : gke).read(e207), i11 = t11.map((e208) => e208.overlay.withMargin(0, l8, 0, e208.startsAtContentLeft ? 0 : l8).intersectHorizontal(new Tm(n11.left, 2 ** 53 - 1))), a10 = i11.map((e208) => e208.withMargin(r11, r11));
      return [au.div({ class: `originalUnderlayInsertion`, style: { ...a10.read(e207).toStyles(), borderRadius: u8, border: `${l8 + r11}px solid ${Z(rv)}`, boxSizing: `border-box` } }), au.div({ class: `originalOverlayInsertion`, style: { ...i11.read(e207).toStyles(), borderRadius: u8, border: j6(this._tabAction).map((e208) => `${l8}px solid ${Z(e208)}`), boxSizing: `border-box`, backgroundColor: Z(S6) } }), au.div({ class: `originalOverlayHiderInsertion`, style: { ...n11.toStyles(), backgroundColor: Z(rv) } })];
    })).keepUpdated(this._store), this._view = au.div({ class: `inline-edits-view`, style: { position: `absolute`, overflow: `visible`, top: `0px`, left: `0px`, display: this._display } }, [[this._modifiedOverlay]]).keepUpdated(this._store), this._editorObs = WK(this._editor), this._ghostTextView = this._register(r10.createInstance(W3, this._editor, { ghostText: this._ghostText, minReservedLineCount: FI(0), targetTextModel: this._editorObs.model.map((e207) => e207 ?? void 0), warning: FI(void 0), handleInlineCompletionShown: FI(() => {
    }) }, Ic(this, { syntaxHighlightingEnabled: true, extraClasses: [`inline-edit`] }), true, true)), this.isHovered = this._ghostTextView.isHovered, this._register(this._ghostTextView.onDidClick((e207) => {
      this._onDidClick.fire(e207);
    })), this._register(this._editorObs.createOverlayWidget({ domNode: this._view.element, position: FI(null), allowEditorOverflow: false, minContentWidthInPx: I(this, (e207) => {
      let t11 = this._overlayLayout.read(e207);
      return t11 === null ? 0 : t11.minContentWidthRequired;
    }) }));
  }
};
d8 = hke([c8(3, V), c8(4, Jf)], d8);
var vke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, f8 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, p8 = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._editor = e206, this._edit = t10, this._isInDiffEditor = n10, this._tabAction = r10, this._languageService = i10, this._themeService = a10, this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._maxPrefixTrim = this._edit.map((e207, t11) => e207 ? I6(e207.replacements.flatMap((e208) => [e208.originalRange, e208.modifiedRange]), e207.originalRange, e207.modifiedLines, this._editor.editor, t11) : void 0), this._modifiedLineElements = I(this, (e207) => {
      let t11 = [], n11 = 0, r11 = this._maxPrefixTrim.read(e207), i11 = this._edit.read(e207);
      if (!i11 || !r11) return;
      let a11 = r11.prefixTrim, o10 = yke(i11.replacements.map((e208) => e208.modifiedRange)).map((e208) => new M(e208.startLineNumber, e208.startColumn - a11, e208.endLineNumber, e208.endColumn - a11)), s10 = this._editor.model.get(), c10 = i11.modifiedRange.startLineNumber;
      for (let r12 = 0; r12 < i11.modifiedRange.length; r12++) {
        let l10 = document.createElement(`div`), u10 = c10 + r12, d10 = i11.modifiedLines[r12].slice(a11), f10 = s10.tokenization.tokenizeLinesAt(u10, [d10])?.[0], p10;
        p10 = f10 ? ig.fromLineTokens(f10).toLineTokens(d10, this._languageService.languageIdCodec) : rg.createEmpty(d10, this._languageService.languageIdCodec);
        let m10 = [];
        for (let e208 of o10.filter((e209) => e209.startLineNumber === u10)) {
          let t12 = Math.min(e208.endColumn, d10.length + 1);
          m10.push(new vk(new M(1, e208.startColumn, 1, t12), `inlineCompletions-modified-bubble`, 0));
        }
        let h10 = AK(new jK([p10]), MK.fromEditor(this._editor.editor).withSetWidth(false).withScrollBeyondLastColumn(0), m10, l10, true);
        this._editor.getOption(59).read(e207), n11 = Math.max(n11, h10.minWidthInPx), t11.push(l10);
      }
      return { lines: t11, requiredWidth: n11 };
    }), this._layout = I(this, (e207) => {
      let t11 = this._modifiedLineElements.read(e207), n11 = this._maxPrefixTrim.read(e207), r11 = this._edit.read(e207);
      if (!t11 || !n11 || !r11) return;
      let { prefixLeftOffset: i11 } = n11, { requiredWidth: a11 } = t11, o10 = this._editor.observeLineHeightsForLineRange(r11.originalRange).read(e207), s10 = (() => {
        let e208 = o10.slice(0, r11.modifiedRange.length);
        for (; e208.length < r11.modifiedRange.length; ) e208.push(o10[o10.length - 1]);
        return e208;
      })(), c10 = this._editor.layoutInfoContentLeft.read(e207), l10 = this._editor.layoutInfoVerticalScrollbarWidth.read(e207), u10 = this._editor.scrollLeft.read(e207), d10 = this._editor.scrollTop.read(e207), f10 = c10 - u10, p10 = this._editor.editor.getModel(), m10 = r11.originalRange.mapToLineArray((e208) => this._editor.editor.getOffsetForColumn(e208, p10.getLineMaxColumn(e208)) - i11), h10 = Math.max(...m10, a11), g10 = r11.originalRange.startLineNumber, _10 = r11.originalRange.endLineNumberExclusive - 1, v10 = this._editor.editor.getTopForLineNumber(g10) - d10, y10 = this._editor.editor.getBottomForLineNumber(_10) - d10, b10 = Z3.fromLeftTopWidthHeight(f10 + i11, v10, h10, y10 - v10), x10 = Z3.fromLeftTopWidthHeight(b10.left, b10.bottom, b10.width, s10.reduce((e208, t12) => e208 + t12, 0)), S10 = Z3.hull([b10, x10]), ee2 = S10.intersectVertical(new Tm(b10.bottom, 2 ** 53 - 1));
      return { originalLinesOverlay: b10, modifiedLinesOverlay: x10, background: S10, lowerBackground: ee2, lowerText: new Z3(ee2.left, ee2.top, ee2.right, ee2.bottom), modifiedLineHeights: s10, minContentWidthRequired: i11 + h10 + l10 };
    }), this._viewZoneInfo = I((e207) => {
      if (!this._editor.getOption(71).map((e208) => e208.edits.allowCodeShifting === `always`).read(e207)) return;
      let t11 = this._layout.read(e207), n11 = this._edit.read(e207);
      if (!(!t11 || !n11)) return { height: t11.lowerBackground.height, lineNumber: n11.originalRange.endLineNumberExclusive };
    }), this.minEditorScrollHeight = I(this, (e207) => {
      let t11 = V6(this._layout).read(e207);
      return !t11 || this._viewZoneInfo.read(e207) !== void 0 ? 0 : t11.read(e207).lowerText.bottom + this._editor.editor.getScrollTop();
    }), this._div = au.div({ class: `line-replacement` }, [I(this, (e207) => {
      let t11 = V6(this._layout).read(e207), n11 = this._modifiedLineElements.read(e207);
      if (!t11 || !n11) return [];
      let r11 = t11.read(e207), i11 = this._editor.layoutInfoContentLeft.read(e207), a11 = this._isInDiffEditor.read(e207) ? 3 : 1;
      n11.lines.forEach((e208, t12) => {
        e208.style.width = `${r11.lowerText.width}px`, e208.style.height = `${r11.modifiedLineHeights[t12]}px`, e208.style.position = `relative`;
      });
      let o10 = j6(this._tabAction).read(e207), s10 = M6(this._tabAction).read(e207);
      return [au.div({ style: { position: `absolute`, ...H6((e208) => R6(this._editor).read(e208)), overflow: `hidden`, pointerEvents: `none` } }, [au.div({ class: `borderAroundLineReplacement`, style: { position: `absolute`, ...H6((e208) => t11.read(e208).background.translateX(-i11).withMargin(a11)), borderRadius: `4px`, border: `${a11 + 1}px solid ${Z(rv)}`, boxSizing: `border-box`, pointerEvents: `none` } }), au.div({ class: `originalOverlayLineReplacement`, style: { position: `absolute`, ...H6((e208) => t11.read(e208).background.translateX(-i11)), borderRadius: `4px`, border: N6(s10, this._themeService).map((e208) => `1px solid ${e208.toString()}`), pointerEvents: `none`, boxSizing: `border-box`, background: Z(x6) } }), au.div({ class: `modifiedOverlayLineReplacement`, style: { position: `absolute`, ...H6((e208) => t11.read(e208).lowerBackground.translateX(-i11)), borderRadius: `0 0 4px 4px`, background: Z(rv), boxShadow: `${Z(Q_)} 0 6px 6px -6px`, border: `1px solid ${Z(o10)}`, boxSizing: `border-box`, overflow: `hidden`, cursor: `pointer`, pointerEvents: `auto` }, onmousedown: (e208) => {
        e208.preventDefault();
      }, onclick: (e208) => this._onDidClick.fire(new Xo(Vc(e208), e208)) }, [au.div({ style: { position: `absolute`, top: 0, left: 0, width: `100%`, height: `100%`, background: Z(BOe) } })]), au.div({ class: `modifiedLinesLineReplacement`, style: { position: `absolute`, boxSizing: `border-box`, ...H6((e208) => t11.read(e208).lowerText.translateX(-i11)), fontFamily: this._editor.getOption(58), fontSize: this._editor.getOption(61), fontWeight: this._editor.getOption(62), pointerEvents: `none`, whiteSpace: `nowrap`, borderRadius: `0 0 4px 4px`, overflow: `hidden` } }, [...n11.lines])])];
    })]).keepUpdated(this._store), this.isHovered = this._editor.isTargetHovered((e207) => this._isMouseOverWidget(e207), this._store), this._previousViewZoneInfo = void 0, this._register(T(() => this._editor.editor.changeViewZones((e207) => this.removePreviousViewZone(e207)))), this._register(one(this._viewZoneInfo, ({ lastValue: e207, newValue: t11 }) => {
      e207 === t11 || e207?.height === t11?.height && e207?.lineNumber === t11?.lineNumber || this._editor.editor.changeViewZones((e208) => {
        this.removePreviousViewZone(e208), t11 && this.addViewZone(t11, e208);
      });
    })), this._register(this._editor.createOverlayWidget({ domNode: this._div.element, minContentWidthInPx: I(this, (e207) => this._layout.read(e207)?.minContentWidthRequired ?? 0), position: FI({ preference: { top: 0, left: 0 } }), allowEditorOverflow: false }));
  }
  _isMouseOverWidget(e206) {
    let t10 = this._layout.get();
    return !t10 || !(e206.event instanceof Sb) ? false : t10.lowerBackground.containsPoint(new UK(e206.event.relativePos.x, e206.event.relativePos.y));
  }
  removePreviousViewZone(e206) {
    if (!this._previousViewZoneInfo) return;
    e206.removeZone(this._previousViewZoneInfo.id);
    let t10 = this._editor.cursorLineNumber.get();
    t10 !== null && t10 >= this._previousViewZoneInfo.lineNumber && this._editor.editor.setScrollTop(this._editor.scrollTop.get() - this._previousViewZoneInfo.height), this._previousViewZoneInfo = void 0;
  }
  addViewZone(e206, t10) {
    let n10 = t10.addZone({ afterLineNumber: e206.lineNumber - 1, heightInPx: e206.height, domNode: B(`div`) });
    this._previousViewZoneInfo = { height: e206.height, lineNumber: e206.lineNumber, id: n10 };
    let r10 = this._editor.cursorLineNumber.get();
    r10 !== null && r10 >= e206.lineNumber && this._editor.editor.setScrollTop(this._editor.scrollTop.get() + e206.height);
  }
};
p8 = vke([f8(4, Jf), f8(5, US)], p8);
function yke(e206) {
  let t10 = [];
  for (; e206.length; ) {
    let n10 = e206.shift();
    n10.startLineNumber !== n10.endLineNumber && (e206.push(new M(n10.startLineNumber + 1, 1, n10.endLineNumber, n10.endColumn)), n10 = new M(n10.startLineNumber, n10.startColumn, n10.startLineNumber, 2 ** 53 - 1)), t10.push(n10);
  }
  return t10;
}
var bke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, m8 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, h8 = 0, g8 = 0, _8 = 1, xke = 1, Ske = 3, v8 = 4, y8 = 20, b8 = 12, x8 = class extends D {
  static fitsInsideViewport(e206, t10, n10, r10) {
    let i10 = WK(e206), a10 = i10.layoutInfoWidth.read(r10), o10 = i10.layoutInfoContentLeft.read(r10), s10 = e206.getLayoutInfo().verticalScrollbarWidth, c10 = i10.layoutInfoMinimap.read(r10).minimapLeft === 0 ? 0 : i10.layoutInfoMinimap.read(r10).minimapWidth, l10 = F6(i10, n10.displayRange, void 0), u10 = n10.lineEdit.newLines.reduce((n11, r11) => Math.max(n11, L6(r11, e206, t10)), 0), d10 = y8, f10 = b8 + 2 * _8;
    return l10 + u10 + d10 + f10 < a10 - o10 - s10 - c10;
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this._editor = e206, this._edit = t10, this._previewTextModel = n10, this._uiState = r10, this._tabAction = i10, this._instantiationService = a10, this._themeService = o10, this._editorObs = WK(this._editor), this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._display = I(this, (e207) => this._uiState.read(e207) ? `block` : `none`), this.previewRef = au.ref();
    let s10 = this._uiState.map((e207) => e207?.isInDiffEditor ? Ske : xke);
    this._editorContainer = au.div({ class: [`editorContainer`], style: { position: `absolute`, overflow: `hidden`, cursor: `pointer` }, onmousedown: (e207) => {
      e207.preventDefault();
    }, onclick: (e207) => {
      this._onDidClick.fire(new Xo(Vc(e207), e207));
    } }, [au.div({ class: `preview`, style: { pointerEvents: `none` }, ref: this.previewRef })]).keepUpdated(this._store), this.isHovered = this._editorContainer.didMouseMoveDuringHover, this.previewEditor = this._register(this._instantiationService.createInstance(qQ, this.previewRef.element, { glyphMargin: false, lineNumbers: `off`, minimap: { enabled: false }, guides: { indentation: false, bracketPairs: false, bracketPairsHorizontal: false, highlightActiveIndentation: false }, rulers: [], padding: { top: 0, bottom: 0 }, folding: false, selectOnLineNumbers: false, selectionHighlight: false, columnSelection: false, overviewRulerBorder: false, overviewRulerLanes: 0, lineDecorationsWidth: 0, lineNumbersMinChars: 0, revealHorizontalRightPadding: 0, bracketPairColorization: { enabled: true, independentColorPoolPerBracketType: false }, scrollBeyondLastLine: false, scrollbar: { vertical: `hidden`, horizontal: `hidden`, handleMouseWheel: false }, readOnly: true, wordWrap: `off`, wordWrapOverride1: `off`, wordWrapOverride2: `off` }, { contextKeyValues: { [D2.inInlineEditsPreviewEditor.key]: true }, contributions: [] }, this._editor)), this._previewEditorObs = WK(this.previewEditor), this._activeViewZones = [], this._updatePreviewEditor = I(this, (e207) => {
      this._editorContainer.readEffect(e207), this._previewEditorObs.model.read(e207), this._display.read(e207), this._nonOverflowView && (this._nonOverflowView.element.style.display = this._display.read(e207));
      let t11 = this._uiState.read(e207), n11 = this._edit.read(e207);
      if (!t11 || !n11) return;
      let r11 = n11.originalLineRange, i11 = [];
      r11.startLineNumber > 1 && i11.push(new M(1, 1, r11.startLineNumber - 1, 1)), r11.startLineNumber + t11.newTextLineCount < this._previewTextModel.getLineCount() + 1 && i11.push(new M(r11.startLineNumber + t11.newTextLineCount, 1, this._previewTextModel.getLineCount() + 1, 1)), this.previewEditor.setHiddenAreas(i11, void 0, true);
      let a11 = [...this._activeViewZones];
      this._activeViewZones = [];
      let o11 = r11.endLineNumberExclusive - r11.startLineNumber - t11.newTextLineCount;
      this.previewEditor.changeViewZones((e208) => {
        a11.forEach((t12) => e208.removeZone(t12)), o11 > 0 && this._activeViewZones.push(e208.addZone({ afterLineNumber: r11.startLineNumber + t11.newTextLineCount - 1, heightInLines: o11, showInHiddenAreas: true, domNode: B(`div.diagonal-fill.inline-edits-view-zone`) }));
      });
    }), this._previewEditorWidth = I(this, (e207) => {
      let t11 = this._edit.read(e207);
      return t11 ? (this._updatePreviewEditor.read(e207), F6(this._previewEditorObs, t11.modifiedLineRange, e207)) : 0;
    }), this._cursorPosIfTouchesEdit = I(this, (e207) => {
      let t11 = this._editorObs.cursorPosition.read(e207), n11 = this._edit.read(e207);
      if (!(!n11 || !t11)) return n11.modifiedLineRange.contains(t11.lineNumber) ? t11 : void 0;
    }), this._originalStartPosition = I(this, (e207) => {
      let t11 = this._edit.read(e207);
      return t11 ? new j(t11.originalLineRange.startLineNumber, 1) : null;
    }), this._originalEndPosition = I(this, (e207) => {
      let t11 = this._edit.read(e207);
      return t11 ? new j(t11.originalLineRange.endLineNumberExclusive, 1) : null;
    }), this._originalVerticalStartPosition = this._editorObs.observePosition(this._originalStartPosition, this._store).map((e207) => e207?.y), this._originalVerticalEndPosition = this._editorObs.observePosition(this._originalEndPosition, this._store).map((e207) => e207?.y), this._originalDisplayRange = this._edit.map((e207) => e207?.displayRange), this._editorMaxContentWidthInRange = I(this, (e207) => {
      let t11 = this._originalDisplayRange.read(e207);
      return t11 ? (this._editorObs.versionId.read(e207), Ac(this, (e208, n11) => {
        let r11 = F6(this._editorObs, t11, e208);
        return Math.max(r11, n11 ?? 0);
      })) : FI(0);
    }).map((e207, t11) => e207.read(t11)), this._previewEditorLayoutInfo = I(this, (e207) => {
      let t11 = this._edit.read(e207);
      if (!t11 || !this._uiState.read(e207)) return null;
      let n11 = t11.originalLineRange, r11 = this._editorObs.scrollLeft.read(e207), i11 = this._editorMaxContentWidthInRange.read(e207), a11 = this._editorObs.layoutInfo.read(e207), o11 = this._previewEditorWidth.read(e207), s11 = a11.contentWidth - a11.verticalScrollbarWidth, c10 = this._editor.getContainerDomNode().getBoundingClientRect(), l10 = a11.contentLeft + a11.contentWidth + c10.left, u10 = Vc(this._editor.getContainerDomNode()).innerWidth - l10, d10 = Vc(this._editor.getContainerDomNode()).innerWidth - c10.right, f10 = Math.min(a11.contentWidth * 0.3, o11, 100), p10 = 0 + u10, m10 = this._cursorPosIfTouchesEdit.read(e207), h10 = Math.max(s11 + r11 - 0 - Math.max(0, f10 - p10), Math.min(m10 ? JOe(this._editorObs, m10, e207) + 50 : 0, s11 + r11)), g10 = Math.min(i11 + y8, h10), _10 = i11 + y8 + o11 + 70, v10 = h10 - g10, y10, b10;
      g10 > r11 ? (y10 = 0, b10 = a11.contentLeft + g10 - r11) : (y10 = r11 - g10, b10 = a11.contentLeft);
      let x10 = this._originalVerticalStartPosition.read(e207) ?? this._editor.getTopForLineNumber(n11.startLineNumber) - this._editorObs.scrollTop.read(e207), S10 = this._originalVerticalEndPosition.read(e207) ?? this._editor.getBottomForLineNumber(n11.endLineNumberExclusive - 1) - this._editorObs.scrollTop.read(e207), ee2 = a11.contentLeft - r11, te2 = Z3.fromLeftTopRightBottom(ee2, x10, b10, S10), ne2 = te2.height === 0;
      ne2 || (te2 = te2.withMargin(g8, h8));
      let re2 = this._previewEditorObs.observeLineHeightsForLineRange(t11.modifiedLineRange).read(e207).reduce((e208, t12) => e208 + t12, 0), ie2 = S10 - x10, ae2 = Math.max(ie2, re2), oe2 = v10 === 0, se2 = Math.min(o11 + b8, d10 + a11.width - a11.contentLeft - 0), ce2 = Z3.fromLeftTopWidthHeight(te2.right + 0, x10, se2, ae2);
      return ce2 = ne2 ? ce2.withMargin(g8, h8).translateY(g8) : ce2.withMargin(g8, h8).translateX(h8 + _8), { codeRect: te2, editRect: ce2, codeScrollLeft: r11, contentLeft: a11.contentLeft, isInsertion: ne2, maxContentWidth: _10, shouldShowShadow: oe2, desiredPreviewEditorScrollLeft: y10, previewEditorWidth: se2 };
    }), this._stickyScrollController = b6.get(this._editorObs.editor), this._stickyScrollHeight = this._stickyScrollController ? Tc(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController.stickyScrollWidgetHeight) : FI(0), this._shouldOverflow = I(this, (e207) => false), this._originalBackgroundColor = Tc(this, this._themeService.onDidColorThemeChange, () => this._themeService.getColorTheme().getColor(x6) ?? Y.transparent), this._backgroundSvg = au.svg({ transform: `translate(-0.5 -0.5)`, style: { overflow: `visible`, pointerEvents: `none`, position: `absolute` } }, [au.svgElem(`path`, { class: `rightOfModifiedBackgroundCoverUp`, d: I(this, (e207) => {
      let t11 = this._previewEditorLayoutInfo.read(e207);
      if (t11 && !this._originalBackgroundColor.read(e207).isTransparent()) return new B6().moveTo(t11.codeRect.getRightTop()).lineTo(t11.codeRect.getRightTop().deltaX(1e3)).lineTo(t11.codeRect.getRightBottom().deltaX(1e3)).lineTo(t11.codeRect.getRightBottom()).build();
    }), style: { fill: D_(rv, `transparent`) } })]).keepUpdated(this._store), this._originalOverlay = au.div({ style: { pointerEvents: `none`, display: this._previewEditorLayoutInfo.map((e207) => e207?.isInsertion ? `none` : `block`) } }, I(this, (e207) => {
      let t11 = V6(this._previewEditorLayoutInfo).read(e207);
      if (!t11) return;
      let n11 = s10.read(e207), r11 = M6(this._tabAction).map((e208) => `${_8}px solid ${Z(e208)}`), i11 = `${_8 + n11}px solid ${Z(rv)}`, a11 = t11.read(e207).codeScrollLeft !== 0, o11 = t11.map((e208) => e208.codeRect.bottom < e208.editRect.bottom), c10 = v8 * 2 + _8 * 2, l10 = t11.map((e208) => Z3.fromLeftTopRightBottom(e208.contentLeft - v8 - _8, e208.codeRect.top, e208.contentLeft, e208.codeRect.bottom + c10)).read(e207), u10 = new Tm(l10.left, 2 ** 53 - 1), d10 = t11.map((e208) => e208.codeRect.intersectHorizontal(u10)), f10 = d10.map((e208) => e208.withMargin(n11, 0, n11, n11).intersectHorizontal(u10)), p10 = d10.map((e208) => Z3.fromLeftTopWidthHeight(e208.right - c10 + _8, e208.bottom - _8, c10, c10).intersectHorizontal(u10));
      return [au.div({ class: `originalSeparatorSideBySide`, style: { ...f10.read(e207).toStyles(), boxSizing: `border-box`, borderRadius: `${v8}px 0 0 ${v8}px`, borderTop: i11, borderBottom: i11, borderLeft: a11 ? `none` : i11 } }), au.div({ class: `originalOverlaySideBySide`, style: { ...d10.read(e207).toStyles(), boxSizing: `border-box`, borderRadius: `${v8}px 0 0 ${v8}px`, borderTop: r11, borderBottom: r11, borderLeft: a11 ? `none` : r11, backgroundColor: Z(x6) } }), au.div({ class: `originalCornerCutoutSideBySide`, style: { pointerEvents: `none`, display: o11.map((e208) => e208 ? `block` : `none`), ...p10.read(e207).toStyles() } }, [au.div({ class: `originalCornerCutoutBackground`, style: { position: `absolute`, top: `0px`, left: `0px`, width: `100%`, height: `100%`, backgroundColor: N6(x6, this._themeService).map((e208) => e208.toString()) } }), au.div({ class: `originalCornerCutoutBorder`, style: { position: `absolute`, top: `0px`, left: `0px`, width: `100%`, height: `100%`, boxSizing: `border-box`, borderTop: r11, borderRight: r11, borderRadius: `0 100% 0 0`, backgroundColor: Z(rv) } })]), au.div({ class: `originalOverlaySideBySideHider`, style: { ...l10.toStyles(), backgroundColor: Z(rv) } })];
    })).keepUpdated(this._store), this._modifiedOverlay = au.div({ style: { pointerEvents: `none` } }, I(this, (e207) => {
      let t11 = V6(this._previewEditorLayoutInfo).read(e207);
      if (!t11) return;
      let n11 = t11.map((e208) => e208.codeRect.bottom < e208.editRect.bottom), r11 = s10.read(e207), i11 = n11.map((e208) => `0 ${v8}px ${v8}px ${e208 ? v8 : 0}px`), a11 = N6(j6(this._tabAction), this._themeService).map((e208) => `1px solid ${e208.toString()}`), o11 = `${_8 + r11}px solid ${Z(rv)}`, c10 = t11.map((e208) => e208.editRect.withMargin(0, _8)), l10 = c10.map((e208) => e208.withMargin(r11, r11, r11, 0)), u10 = I(this, (e208) => {
        let n12 = c10.read(e208), r12 = t11.read(e208);
        return !r12.isInsertion || r12.contentLeft >= n12.left ? Z3.fromLeftTopWidthHeight(n12.left, n12.top, 0, 0) : new Z3(r12.contentLeft, n12.top, n12.left, n12.top + _8 * 2);
      });
      return [au.div({ class: `modifiedInsertionSideBySide`, style: { ...u10.read(e207).toStyles(), backgroundColor: j6(this._tabAction).map((e208) => Z(e208)) } }), au.div({ class: `modifiedSeparatorSideBySide`, style: { ...l10.read(e207).toStyles(), borderRadius: i11, borderTop: o11, borderBottom: o11, borderRight: o11, boxSizing: `border-box` } }), au.div({ class: `modifiedOverlaySideBySide`, style: { ...c10.read(e207).toStyles(), borderRadius: i11, border: a11, boxSizing: `border-box`, backgroundColor: Z(S6) } })];
    })).keepUpdated(this._store), this._nonOverflowView = au.div({ class: `inline-edits-view`, style: { position: `absolute`, overflow: `visible`, top: `0px`, left: `0px`, display: this._display } }, [this._backgroundSvg, I(this, (e207) => this._shouldOverflow.read(e207) ? [] : [this._editorContainer, this._originalOverlay, this._modifiedOverlay])]).keepUpdated(this._store), this._register(this._editorObs.createOverlayWidget({ domNode: this._nonOverflowView.element, position: FI(null), allowEditorOverflow: false, minContentWidthInPx: I(this, (e207) => {
      let t11 = this._previewEditorLayoutInfo.read(e207)?.maxContentWidth;
      return t11 === void 0 ? 0 : t11;
    }) })), this.previewEditor.setModel(this._previewTextModel), this._register(hc((e207) => {
      let t11 = this._previewEditorLayoutInfo.read(e207);
      if (!t11) return;
      let n11 = t11.editRect.withMargin(-g8, -h8);
      this.previewEditor.layout({ height: n11.height, width: t11.previewEditorWidth + 15 }), this._editorContainer.element.style.top = `${n11.top}px`, this._editorContainer.element.style.left = `${n11.left}px`, this._editorContainer.element.style.width = `${t11.previewEditorWidth + h8}px`;
    })), this._register(hc((e207) => {
      let t11 = this._previewEditorLayoutInfo.read(e207);
      t11 && this._previewEditorObs.editor.setScrollLeft(t11.desiredPreviewEditorScrollLeft);
    })), this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store);
  }
};
x8 = bke([m8(5, V), m8(6, US)], x8);
var Cke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, wke = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, S8 = 1, C8 = (_rd = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._edit = t10, this._tabAction = n10, this._languageService = r10, this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this._start = this._editor.observePosition(FI(this._edit.range.getStartPosition()), this._store), this._end = this._editor.observePosition(FI(this._edit.range.getEndPosition()), this._store), this._line = document.createElement(`div`), this._hoverableElement = Ic(this, null), this.isHovered = this._hoverableElement.map((e207, t11) => e207?.didMouseMoveDuringHover.read(t11) ?? false), this._renderTextEffect = I(this, (e207) => {
      let t11 = this._editor.model.get(), n11 = t11.getLineContent(this._edit.range.startLineNumber), r11 = Vw.replace(new Tm(this._edit.range.startColumn - 1, this._edit.range.endColumn - 1), this._edit.text), i11 = r11.replace(n11), a10 = t11.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber, [i11])?.[0], o10;
      o10 = a10 ? ig.fromLineTokens(a10).slice(r11.getRangeAfterReplace()).toLineTokens(this._edit.text, this._languageService.languageIdCodec) : rg.createEmpty(this._edit.text, this._languageService.languageIdCodec);
      let s10 = AK(new jK([o10]), MK.fromEditor(this._editor.editor).withSetWidth(false).withScrollBeyondLastColumn(0), [], this._line, true);
      this._line.style.width = `${s10.minWidthInPx}px`;
    });
    let i10 = this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());
    this._layout = I(this, (e207) => {
      this._renderTextEffect.read(e207);
      let t11 = this._start.read(e207), n11 = this._end.read(e207);
      if (!t11 || !n11 || t11.x > n11.x || t11.y > n11.y) return;
      let r11 = i10.read(e207), a10 = this._editor.scrollLeft.read(e207), o10 = this._editor.getOption(59).read(e207).typicalHalfwidthCharacterWidth, s10 = new UK(3 * o10, 4), c10 = Z3.fromPoints(t11, n11).withHeight(r11).translateX(-a10), l10 = Z3.fromPointSize(c10.getLeftBottom().add(s10), new UK(this._edit.text.length * o10, c10.height));
      return { originalLine: c10, modifiedLine: l10, lowerBackground: l10.withLeft(c10.left), lineHeight: r11 };
    }), this.minEditorScrollHeight = I(this, (e207) => {
      let t11 = V6(this._layout).read(e207);
      return t11 ? t11.read(e207).modifiedLine.bottom + S8 + this._editor.editor.getScrollTop() : 0;
    }), this._root = au.div({ class: `word-replacement` }, [I(this, (e207) => {
      let t11 = V6(this._layout).read(e207);
      if (!t11) return [];
      let n11 = M6(this._tabAction).map((e208) => Z(e208)).read(e207), r11 = j6(this._tabAction).map((e208) => Z(e208)).read(e207);
      return [au.div({ style: { position: `absolute`, ...H6((e208) => R6(this._editor).read(e208)), overflow: `hidden`, pointerEvents: `none` } }, [au.div({ style: { position: `absolute`, ...H6((e208) => t11.read(e208).lowerBackground.withMargin(S8, 2 * S8, S8, 0)), background: Z(rv), cursor: `pointer`, pointerEvents: `auto` }, onmousedown: (e208) => {
        e208.preventDefault();
      }, onmouseup: (e208) => this._onDidClick.fire(new Xo(Vc(e208), e208)), obsRef: (e208) => {
        this._hoverableElement.set(e208, void 0);
      } }), au.div({ style: { position: `absolute`, ...H6((e208) => t11.read(e208).modifiedLine.withMargin(S8, 2 * S8)), fontFamily: this._editor.getOption(58), fontSize: this._editor.getOption(61), fontWeight: this._editor.getOption(62), pointerEvents: `none`, boxSizing: `border-box`, borderRadius: `4px`, border: `${S8}px solid ${r11}`, background: Z(VOe), display: `flex`, justifyContent: `center`, alignItems: `center`, outline: `2px solid ${Z(rv)}` } }, [this._line]), au.div({ style: { position: `absolute`, ...H6((e208) => t11.read(e208).originalLine.withMargin(S8)), boxSizing: `border-box`, borderRadius: `4px`, border: `${S8}px solid ${n11}`, background: Z(zOe), pointerEvents: `none` } }, []), au.svg({ width: 11, height: 14, viewBox: `0 0 11 14`, fill: `none`, style: { position: `absolute`, left: t11.map((e208) => e208.modifiedLine.left - 16), top: t11.map((e208) => e208.modifiedLine.top + Math.round((e208.lineHeight - 14 - 5) / 2)) } }, [au.svgElem(`path`, { d: `M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5`, stroke: Z(Dv) }), au.svgElem(`path`, { d: `M6 7.5L9.99999 10.49998L6 13.5`, stroke: Z(Dv) })])])];
    })]).keepUpdated(this._store), this._register(this._editor.createOverlayWidget({ domNode: this._root.element, minContentWidthInPx: FI(0), position: FI({ preference: { top: 0, left: 0 } }), allowEditorOverflow: false }));
  }
}, _rd.MAX_LENGTH = 100, _rd);
C8 = Cke([wke(3, Jf)], C8);
var Tke = class extends D {
  constructor(e206, t10, n10) {
    super(), this._originalEditor = e206, this._state = t10, this._modifiedTextModel = n10, this._onDidClick = this._register(new k()), this.onDidClick = this._onDidClick.event, this.isHovered = WK(this._originalEditor).isTargetHovered((e207) => e207.target.type === 6 && e207.target.detail.injectedText?.options.attachedData instanceof w8 && e207.target.detail.injectedText.options.attachedData.owner === this, this._store), this._tokenizationFinished = Oke(this._modifiedTextModel), this._decorations = I(this, (e207) => {
      let t11 = this._state.read(e207);
      if (!t11) return;
      let n11 = t11.modifiedText, r11 = t11.mode === `insertionInline`, i10 = t11.diff.length === 1 && t11.diff[0].innerChanges?.length === 1, a10 = [], o10 = [], s10 = UO.register({ className: `inlineCompletions-line-insert`, description: `line-insert`, isWholeLine: true, marginClassName: `gutter-insert` }), c10 = UO.register({ className: `inlineCompletions-line-delete`, description: `line-delete`, isWholeLine: true, marginClassName: `gutter-delete` }), l10 = UO.register({ className: `inlineCompletions-char-delete`, description: `char-delete`, isWholeLine: false, zIndex: 1 }), u10 = UO.register({ className: `inlineCompletions-char-insert`, description: `char-insert`, isWholeLine: true }), d10 = UO.register({ className: `inlineCompletions-char-insert`, description: `char-insert`, shouldFillLineOnLineBreak: true }), f10 = UO.register({ className: `inlineCompletions-char-insert diff-range-empty`, description: `char-insert diff-range-empty` }), p10 = UO.register({ className: `inlineCompletions-original-lines`, description: `inlineCompletions-original-lines`, isWholeLine: false, shouldFillLineOnLineBreak: true }), m10 = t11.mode !== `sideBySide` && t11.mode !== `deletion` && t11.mode !== `insertionInline` && t11.mode !== `lineReplacement`, h10 = t11.mode === `lineReplacement`;
      for (let p11 of t11.diff) if (m10 && (p11.original.isEmpty || a10.push({ range: p11.original.toInclusiveRange(), options: c10 }), p11.modified.isEmpty || o10.push({ range: p11.modified.toInclusiveRange(), options: s10 })), p11.modified.isEmpty || p11.original.isEmpty) p11.original.isEmpty || a10.push({ range: p11.original.toInclusiveRange(), options: l10 }), p11.modified.isEmpty || o10.push({ range: p11.modified.toInclusiveRange(), options: u10 });
      else {
        let s11 = r11 && Eke(p11);
        for (let r12 of p11.innerChanges || []) {
          if (p11.original.contains(r12.originalRange.startLineNumber) && !(h10 && r12.originalRange.isEmpty())) {
            let e208 = this._originalEditor.getModel()?.getValueInRange(r12.originalRange, 1);
            a10.push({ range: r12.originalRange, options: { description: `char-delete`, shouldFillLineOnLineBreak: false, className: z6(`inlineCompletions-char-delete`, r12.originalRange.isSingleLine() && t11.mode === `insertionInline` && `single-line-inline`, r12.originalRange.isEmpty() && `empty`, (r12.originalRange.isEmpty() && i10 || t11.mode === `deletion` && e208 === `
`) && !s11 && `diff-range-empty`), inlineClassName: s11 ? z6(`strike-through`, `inlineCompletions`) : null, zIndex: 1 } });
          }
          if (p11.modified.contains(r12.modifiedRange.startLineNumber) && o10.push({ range: r12.modifiedRange, options: r12.modifiedRange.isEmpty() && !s11 && i10 ? f10 : d10 }), s11) {
            let i11 = n11.getValueOfRange(r12.modifiedRange), o11 = i11.length > 3 ? [{ text: i11.slice(0, 1), extraClasses: [`start`], offsetRange: new Tm(r12.modifiedRange.startColumn - 1, r12.modifiedRange.startColumn) }, { text: i11.slice(1, -1), extraClasses: [], offsetRange: new Tm(r12.modifiedRange.startColumn, r12.modifiedRange.endColumn - 2) }, { text: i11.slice(-1), extraClasses: [`end`], offsetRange: new Tm(r12.modifiedRange.endColumn - 2, r12.modifiedRange.endColumn - 1) }] : [{ text: i11, extraClasses: [`start`, `end`], offsetRange: new Tm(r12.modifiedRange.startColumn - 1, r12.modifiedRange.endColumn) }];
            this._tokenizationFinished.read(e207);
            let s12 = this._modifiedTextModel.tokenization.getLineTokens(r12.modifiedRange.startLineNumber);
            for (let { text: e208, extraClasses: n12, offsetRange: i12 } of o11) a10.push({ range: M.fromPositions(r12.originalRange.getEndPosition()), options: { description: `inserted-text`, before: { tokens: s12.getTokensInRange(i12), content: e208, inlineClassName: z6(`inlineCompletions-char-insert`, r12.modifiedRange.isSingleLine() && t11.mode === `insertionInline` && `single-line-inline`, ...n12), cursorStops: tm.None, attachedData: new w8(this) }, zIndex: 2, showIfCollapsed: true } });
          }
        }
      }
      if (t11.isInDiffEditor) for (let e208 of t11.diff) e208.original.isEmpty || a10.push({ range: e208.original.toExclusiveRange(), options: p10 });
      return { originalDecorations: a10, modifiedDecorations: o10 };
    }), this._register(WK(this._originalEditor).setDecorations(this._decorations.map((e207) => e207?.originalDecorations ?? [])));
    let r10 = this._state.map((e207) => e207?.modifiedCodeEditor);
    this._register(vc((e207, t11) => {
      let n11 = r10.read(e207);
      n11 && t11.add(WK(n11).setDecorations(this._decorations.map((e208) => e208?.modifiedDecorations ?? [])));
    })), this._register(this._originalEditor.onMouseUp((e207) => {
      if (e207.target.type !== 6) return;
      let t11 = e207.target.detail.injectedText?.options.attachedData;
      t11 instanceof w8 && t11.owner === this && this._onDidClick.fire(e207.event);
    }));
  }
}, w8 = class {
  constructor(e206) {
    this.owner = e206;
  }
};
function Eke(e206) {
  return e206.innerChanges ? e206.innerChanges.every((e207) => BK(e207.modifiedRange) && BK(e207.originalRange)) : false;
}
var Dke = 0;
function Oke(e206) {
  return Tc(e206.onDidChangeTokens, () => Dke++);
}
var kke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Ake = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, T8 = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._editor = e206, this._host = t10, this._model = n10, this._ghostTextIndicator = r10, this._focusIsInMenu = i10, this._instantiationService = a10, this._editorObs = WK(this._editor), this._tabAction = I((e207) => this._model.read(e207)?.tabAction.read(e207) ?? V4.Inactive), this._constructorDone = Ic(this, false), this._uiState = I(this, (e207) => {
      let t11 = this._model.read(e207);
      if (!t11 || !this._constructorDone.read(e207)) return;
      let n11 = t11.inlineEdit, r11 = th.fromEdit(n11.edit), i11 = n11.edit.apply(n11.originalText), a11 = nh(r11, n11.originalText, new qm(i11)), o11 = this.determineRenderState(t11, e207, a11, new qm(i11));
      if (!o11) {
        be(Error(`unable to determine view: tried to render ${this._previousView?.view}`));
        return;
      }
      if (o11.kind === H4.SideBySide) {
        let e208 = $Oe(i11, n11.modifiedLineRange, s10.getOptions().tabSize);
        i11 = e208.applyToString(i11), r11 = YOe(r11, e208), a11 = nh(r11, n11.originalText, new qm(i11));
      }
      return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()), this._previewTextModel.getValue() !== i11 && this._previewTextModel.setValue(i11), t11.showCollapsed.read(e207) && !this._indicator.read(e207)?.isHoverVisible.read(e207) && (o11 = { kind: H4.Collapsed, viewData: o11.viewData }), t11.handleInlineEditShown(o11.kind, o11.viewData), { state: o11, diff: a11, edit: n11, newText: i11, newTextLineCount: n11.modifiedLineRange.length, isInDiffEditor: t11.isInDiffEditor };
    }), this._previewTextModel = this._register(this._instantiationService.createInstance(FO, ``, this._editor.getModel().getLanguageId(), { ...FO.DEFAULT_CREATION_OPTIONS, bracketPairColorizationOptions: { enabled: true, independentColorPoolPerBracketType: false } }, null)), this._indicatorCyclicDependencyCircuitBreaker = Ic(this, false), this._indicator = I(this, (e207) => {
      if (!this._indicatorCyclicDependencyCircuitBreaker.read(e207)) return;
      let t11 = dc({ owner: this, equalsFn: Ys(Js()) }, (e208) => {
        let t12 = this._ghostTextIndicator.read(e208);
        if (t12) return t12.lineRange;
        let n12 = this._uiState.read(e208);
        if (n12) {
          if (n12.state?.kind === `custom`) {
            let e209 = n12.state.displayLocation?.range;
            if (!e209) throw new je(`custom view should have a range`);
            return new zm(e209.startLineNumber, e209.endLineNumber);
          }
          return n12.state?.kind === `insertionMultiLine` ? this._insertion.originalLines.read(e208) : n12.edit.displayRange;
        }
      }), n11 = I(this, (e208) => {
        let t12 = this._model.read(e208);
        if (t12) return t12;
        let n12 = this._ghostTextIndicator.read(e208);
        return n12 ? n12.model : t12;
      });
      return e207.store.add(this._instantiationService.createInstance(J6, this._editorObs, t11, this._gutterIndicatorOffset, n11, this._inlineEditsIsHovered, this._focusIsInMenu));
    }), this._inlineEditsIsHovered = I(this, (e207) => this._sideBySide.isHovered.read(e207) || this._wordReplacementViews.read(e207).some((t11) => t11.isHovered.read(e207)) || this._deletion.isHovered.read(e207) || this._inlineDiffView.isHovered.read(e207) || this._lineReplacementView.isHovered.read(e207) || this._insertion.isHovered.read(e207) || this._customView.isHovered.read(e207)), this._gutterIndicatorOffset = I(this, (e207) => {
      if (this._uiState.read(e207)?.state?.kind === `insertionMultiLine`) return this._insertion.startLineOffset.read(e207);
      let t11 = this._ghostTextIndicator.read(e207);
      return t11 ? Nke(t11, this._editor) : 0;
    }), this._sideBySide = this._register(this._instantiationService.createInstance(x8, this._editor, this._model.map((e207) => e207?.inlineEdit), this._previewTextModel, this._uiState.map((e207) => e207 && e207.state?.kind === H4.SideBySide ? { newTextLineCount: e207.newTextLineCount, isInDiffEditor: e207.isInDiffEditor } : void 0), this._tabAction)), this._deletion = this._register(this._instantiationService.createInstance(mke, this._editor, this._model.map((e207) => e207?.inlineEdit), this._uiState.map((e207) => e207 && e207.state?.kind === H4.Deletion ? { originalRange: e207.state.originalRange, deletions: e207.state.deletions, inDiffEditor: e207.isInDiffEditor } : void 0), this._tabAction)), this._insertion = this._register(this._instantiationService.createInstance(d8, this._editor, this._uiState.map((e207) => e207 && e207.state?.kind === H4.InsertionMultiLine ? { lineNumber: e207.state.lineNumber, startColumn: e207.state.column, text: e207.state.text, inDiffEditor: e207.isInDiffEditor } : void 0), this._tabAction)), this._inlineDiffViewState = I(this, (e207) => {
      let t11 = this._uiState.read(e207);
      if (!(!t11 || !t11.state) && !(t11.state.kind === `wordReplacements` || t11.state.kind === `insertionMultiLine` || t11.state.kind === `collapsed` || t11.state.kind === `custom`)) return { modifiedText: new qm(t11.newText), diff: t11.diff, mode: t11.state.kind, modifiedCodeEditor: this._sideBySide.previewEditor, isInDiffEditor: t11.isInDiffEditor };
    }), this._inlineCollapsedView = this._register(this._instantiationService.createInstance(Q6, this._editor, this._model.map((e207, t11) => this._uiState.read(t11)?.state?.kind === `collapsed` ? e207?.inlineEdit : void 0))), this._customView = this._register(this._instantiationService.createInstance(a8, this._editor, this._model.map((e207, t11) => this._uiState.read(t11)?.state?.kind === `custom` ? e207?.displayLocation : void 0), this._tabAction)), this._inlineDiffView = this._register(new Tke(this._editor, this._inlineDiffViewState, this._previewTextModel)), this._wordReplacementViews = jc(this, this._uiState.map((e207) => e207?.state?.kind === `wordReplacements` ? e207.state.replacements : []), (e207, t11) => t11.add(this._instantiationService.createInstance(C8, this._editorObs, e207, this._tabAction))), this._lineReplacementView = this._register(this._instantiationService.createInstance(p8, this._editorObs, this._uiState.map((e207) => e207?.state?.kind === H4.LineReplacement ? { originalRange: e207.state.originalRange, modifiedRange: e207.state.modifiedRange, modifiedLines: e207.state.modifiedLines, replacements: e207.state.replacements } : void 0), this._uiState.map((e207) => e207?.isInDiffEditor ?? false), this._tabAction)), this._useCodeShifting = this._editorObs.getOption(71).map((e207) => e207.edits.allowCodeShifting), this._renderSideBySide = this._editorObs.getOption(71).map((e207) => e207.edits.renderSideBySide), this._register(vc((e207, t11) => {
      let n11 = this._model.read(e207);
      n11 && t11.add(O.any(this._sideBySide.onDidClick, this._deletion.onDidClick, this._lineReplacementView.onDidClick, this._insertion.onDidClick, ...this._wordReplacementViews.read(e207).map((e208) => e208.onDidClick), this._inlineDiffView.onDidClick, this._customView.onDidClick)((e208) => {
        this._viewHasBeenShownLongerThan(350) && (e208.preventDefault(), n11.accept());
      }));
    })), this._indicator.recomputeInitiallyAndOnChange(this._store), this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store), this._indicatorCyclicDependencyCircuitBreaker.set(true, void 0), this._register(this._instantiationService.createInstance(Z6, this._host, this._model, this._indicator, this._inlineCollapsedView));
    let o10 = I(this, (e207) => Math.max(...this._wordReplacementViews.read(e207).map((t11) => t11.minEditorScrollHeight.read(e207)), this._lineReplacementView.minEditorScrollHeight.read(e207), this._customView.minEditorScrollHeight.read(e207))).recomputeInitiallyAndOnChange(this._store), s10 = this._editor.getModel(), c10;
    this._register(hc((e207) => {
      let t11 = o10.read(e207);
      this._editor.changeViewZones((e208) => {
        let n11 = t11 - this._editor.getScrollHeight() + 1;
        n11 !== 0 && c10 && (e208.removeZone(c10), c10 = void 0), !(n11 <= 0) && (c10 = e208.addZone({ afterLineNumber: s10.getLineCount(), heightInPx: n11, domNode: B(`div.minScrollHeightViewZone`) }));
      });
    })), this._constructorDone.set(true, void 0);
  }
  getCacheId(e206) {
    return e206.inlineEdit.inlineCompletion.identity.id;
  }
  determineView(e206, t10, n10, r10) {
    let i10 = e206.inlineEdit, a10 = this._previousView?.id === this.getCacheId(e206) && !e206.displayLocation?.jumpToEdit, o10 = this._previousView?.editorWidth !== this._editorObs.layoutInfoWidth.read(t10) && (this._previousView?.view === H4.SideBySide || this._previousView?.view === H4.LineReplacement);
    if (a10 && !o10) return this._previousView.view;
    if (e206.inlineEdit.inlineCompletion instanceof z4 && e206.inlineEdit.inlineCompletion.uri || e206.displayLocation && !e206.inlineEdit.inlineCompletion.identity.jumpedTo.read(t10)) return H4.Custom;
    let s10 = i10.originalLineRange.length, c10 = i10.modifiedLineRange.length, l10 = n10.flatMap((e207) => e207.innerChanges ?? []), u10 = l10.length === 1;
    if (!e206.isInDiffEditor) {
      if (u10 && this._useCodeShifting.read(t10) !== `never` && E8(n10)) return jke(n10, i10.cursorPosition) ? H4.InsertionInline : H4.LineReplacement;
      if (O8(l10, i10, r10)) return H4.Deletion;
      if (D8(n10) && this._useCodeShifting.read(t10) === `always`) return H4.InsertionMultiLine;
      if (l10.every((e207) => Vm.ofRange(e207.originalRange).columnCount < C8.MAX_LENGTH && Vm.ofRange(e207.modifiedRange).columnCount < C8.MAX_LENGTH) && u10 && s10 === 1 && c10 === 1) {
        let t11 = l10.map((e207) => r10.getValueOfRange(e207.modifiedRange)), n11 = l10.map((t12) => e206.inlineEdit.originalText.getValueOfRange(t12.originalRange));
        if (!t11.some((e207) => e207.includes(`	`)) && !n11.some((e207) => e207.includes(`	`)) && (!l10.some((e207) => e207.originalRange.isEmpty()) || !k8(l10.map((e207) => new Ym(e207.originalRange, ``)), i10.originalText).some((e207) => e207.range.isEmpty() && Vm.ofRange(e207.range).columnCount < C8.MAX_LENGTH))) return H4.WordReplacements;
      }
    }
    if (s10 > 0 && c10 > 0) return s10 === 1 && c10 === 1 && !e206.isInDiffEditor ? H4.LineReplacement : this._renderSideBySide.read(t10) !== `never` && x8.fitsInsideViewport(this._editor, this._previewTextModel, i10, t10) ? H4.SideBySide : H4.LineReplacement;
    if (e206.isInDiffEditor) {
      if (O8(l10, i10, r10)) return H4.Deletion;
      if (D8(n10) && this._useCodeShifting.read(t10) === `always`) return H4.InsertionMultiLine;
    }
    return H4.SideBySide;
  }
  determineRenderState(e206, t10, n10, r10) {
    let i10 = e206.inlineEdit, a10 = this.determineView(e206, t10, n10, r10);
    if (this._willRenderAboveCursor(t10, i10, a10)) switch (a10) {
      case H4.LineReplacement:
      case H4.WordReplacements:
        a10 = H4.SideBySide;
        break;
    }
    this._previousView = { id: this.getCacheId(e206), view: a10, editorWidth: this._editor.getLayoutInfo().width, timestamp: Date.now() };
    let o10 = n10.flatMap((e207) => e207.innerChanges ?? []), s10 = this._editor.getModel(), c10 = o10.map((e207) => ({ originalRange: e207.originalRange, modifiedRange: e207.modifiedRange, original: s10.getValueInRange(e207.originalRange), modified: r10.getValueOfRange(e207.modifiedRange) })), l10 = i10.cursorPosition, u10 = c10.length === 0 ? false : c10[0].modified.startsWith(s10.getEOL()), d10 = { cursorColumnDistance: i10.edit.replacements.length === 0 ? 0 : i10.edit.replacements[0].range.getStartPosition().column - l10.column, cursorLineDistance: i10.lineEdit.lineRange.startLineNumber - l10.lineNumber + (u10 && i10.lineEdit.lineRange.startLineNumber >= l10.lineNumber ? 1 : 0), lineCountOriginal: i10.lineEdit.lineRange.length, lineCountModified: i10.lineEdit.newLines.length, characterCountOriginal: c10.reduce((e207, t11) => e207 + t11.original.length, 0), characterCountModified: c10.reduce((e207, t11) => e207 + t11.modified.length, 0), disjointReplacements: c10.length, sameShapeReplacements: c10.every((e207) => e207.original === c10[0].original && e207.modified === c10[0].modified) };
    switch (a10) {
      case H4.InsertionInline:
        return { kind: H4.InsertionInline, viewData: d10 };
      case H4.SideBySide:
        return { kind: H4.SideBySide, viewData: d10 };
      case H4.Collapsed:
        return { kind: H4.Collapsed, viewData: d10 };
      case H4.Custom:
        return { kind: H4.Custom, displayLocation: e206.displayLocation, viewData: d10 };
    }
    if (a10 === H4.Deletion) return { kind: H4.Deletion, originalRange: i10.originalLineRange, deletions: o10.map((e207) => e207.originalRange), viewData: d10 };
    if (a10 === H4.InsertionMultiLine) {
      let e207 = o10[0];
      return { kind: H4.InsertionMultiLine, lineNumber: e207.originalRange.startLineNumber, column: e207.originalRange.startColumn, text: r10.getValueOfRange(e207.modifiedRange), viewData: d10 };
    }
    let f10 = c10.map((e207) => new Ym(e207.originalRange, e207.modified));
    if (f10.length !== 0) {
      if (a10 === H4.WordReplacements) {
        let e207 = Mke(f10, i10.originalText);
        return e207.some((e208) => e208.range.isEmpty()) && (e207 = k8(f10, i10.originalText)), { kind: H4.WordReplacements, replacements: e207, viewData: d10 };
      }
      if (a10 === H4.LineReplacement) return { kind: H4.LineReplacement, originalRange: i10.originalLineRange, modifiedRange: i10.modifiedLineRange, modifiedLines: i10.modifiedLineRange.mapToLineArray((e207) => r10.getLineAt(e207)), replacements: o10.map((e207) => ({ originalRange: e207.originalRange, modifiedRange: e207.modifiedRange })), viewData: d10 };
    }
  }
  _willRenderAboveCursor(e206, t10, n10) {
    if (this._useCodeShifting.read(e206) === `always`) return false;
    for (let e207 of t10.multiCursorPositions) if (n10 === H4.WordReplacements && e207.lineNumber === t10.originalLineRange.startLineNumber + 1 || n10 === H4.LineReplacement && e207.lineNumber >= t10.originalLineRange.endLineNumberExclusive && e207.lineNumber < t10.modifiedLineRange.endLineNumberExclusive + t10.modifiedLineRange.length) return true;
    return false;
  }
  _viewHasBeenShownLongerThan(e206) {
    let t10 = this._previousView?.timestamp;
    if (!t10) throw new je(`viewHasBeenShownLongThan called before a view has been shown`);
    return Date.now() - t10 >= e206;
  }
};
T8 = kke([Ake(5, V)], T8);
function E8(e206) {
  return e206.every((e207) => e207.innerChanges.every((e208) => t10(e208)));
  function t10(e207) {
    return !(!e207.originalRange.isEmpty() || e207.modifiedRange.startLineNumber !== e207.modifiedRange.endLineNumber);
  }
}
function jke(e206, t10) {
  if (!t10 || !E8(e206)) return false;
  let n10 = t10;
  return e206.every((e207) => e207.innerChanges.every((e208) => r10(e208)));
  function r10(e207) {
    let t11 = e207.originalRange.getStartPosition();
    return !!(n10.isBeforeOrEqual(t11) || t11.lineNumber < n10.lineNumber);
  }
}
function D8(e206) {
  let t10 = e206.flatMap((e207) => e207.innerChanges ?? []);
  if (t10.length !== 1) return false;
  let n10 = t10[0];
  return !(!n10.originalRange.isEmpty() || n10.modifiedRange.startLineNumber === n10.modifiedRange.endLineNumber);
}
function O8(e206, t10, n10) {
  return e206.map((e207) => ({ original: t10.originalText.getValueOfRange(e207.originalRange), modified: n10.getValueOfRange(e207.modifiedRange) })).every(({ original: e207, modified: t11 }) => t11.trim() === `` && e207.length > 0 && (e207.length > t11.length || e207.trim() !== ``));
}
function Mke(e206, t10) {
  return A8(e206, t10, (e207) => /^[a-zA-Z]$/.test(e207));
}
function k8(e206, t10) {
  return A8(e206, t10, (e207) => !/^\s$/.test(e207));
}
function A8(e206, t10, n10) {
  let r10 = [];
  e206.sort((e207, t11) => M.compareRangesUsingStarts(e207.range, t11.range));
  for (let n11 of e206) {
    let e207 = n11.range.startColumn - 1, a10 = n11.range.endColumn - 2, o10 = ``, s10 = ``, c10 = t10.getLineAt(n11.range.startLineNumber), l10 = t10.getLineAt(n11.range.endLineNumber);
    if (i10(c10[e207])) for (; i10(c10[e207 - 1]); ) o10 = c10[e207 - 1] + o10, e207--;
    if (i10(l10[a10]) || a10 < e207) for (; i10(l10[a10 + 1]); ) s10 += l10[a10 + 1], a10++;
    let u10 = new Ym(new M(n11.range.startLineNumber, e207 + 1, n11.range.endLineNumber, a10 + 2), o10 + n11.text + s10);
    r10.length > 0 && M.areIntersectingOrTouching(r10[r10.length - 1].range, u10.range) && (u10 = Ym.joinReplacements([r10.pop(), u10], t10)), r10.push(u10);
  }
  function i10(e207) {
    return e207 === void 0 ? false : n10(e207);
  }
  return r10;
}
function Nke(e206, t10) {
  let n10 = e206.model.inlineEdit.edit.replacements;
  if (n10.length !== 1) return 0;
  let r10 = t10.getModel();
  if (!r10) return 0;
  let i10 = r10.getEOL(), a10 = n10[0];
  if (a10.range.isEmpty() && a10.text.startsWith(i10)) {
    let e207 = t10.getLineHeightForPosition(a10.range.getStartPosition());
    return Pke(a10.text, i10) * e207;
  }
  return 0;
}
function Pke(e206, t10) {
  if (!t10.length) return 0;
  let n10 = 0, r10 = 0;
  for (; e206.startsWith(t10, r10); ) n10++, r10 += t10.length;
  return n10;
}
var Fke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Ike = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, j8 = (_sd = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._editor = e206, this._edit = t10, this._model = n10, this._focusIsInMenu = r10, this._inlineEdit = I(this, (e207) => {
      let t11 = this._model.read(e207);
      if (!t11) return;
      let n11 = this._edit.read(e207);
      if (!n11) return;
      let r11 = this._editor.getModel();
      if (!r11) return;
      let i11 = t11.inlineEditState.read(void 0)?.inlineCompletion.updatedEdit;
      if (!i11) return;
      let a10 = new Jm(i11.replacements.map((e208) => new Ym(M.fromPositions(r11.getPositionAt(e208.replaceRange.start), r11.getPositionAt(e208.replaceRange.endExclusive)), e208.newText)));
      return new Y3(new aq(r11), a10, t11.primaryPosition.read(void 0), t11.allPositions.read(void 0), n11.commands, n11.inlineCompletion);
    }), this._inlineEditModel = I(this, (e207) => {
      let t11 = this._model.read(e207);
      if (!t11) return;
      let n11 = this._inlineEdit.read(e207);
      if (n11) return new X3(t11, n11, I(this, (e208) => {
        if (this._editorObs.isFocused.read(e208)) {
          if (t11.tabShouldJumpToInlineEdit.read(e208)) return V4.Jump;
          if (t11.tabShouldAcceptInlineEdit.read(e208)) return V4.Accept;
        }
        return V4.Inactive;
      }));
    }), this._inlineEditHost = I(this, (e207) => {
      let t11 = this._model.read(e207);
      if (t11) return new AOe(t11);
    }), this._ghostTextIndicator = I(this, (e207) => {
      let t11 = this._model.read(e207);
      if (!t11) return;
      let n11 = t11.inlineCompletionState.read(e207);
      if (!n11) return;
      let r11 = n11.inlineCompletion;
      if (!r11 || !r11.showInlineEditMenu) return;
      let i11 = zm.ofLength(n11.primaryGhostText.lineNumber, 1);
      return new jOe(this._editor, t11, i11, r11);
    }), this._editorObs = WK(this._editor), this._register(i10.createInstance(T8, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));
  }
}, _sd.hot = MG(_sd), _sd);
j8 = Fke([Ike(4, V)], j8);
var Lke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Rke = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, M8 = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._model = t10, this._focusIsInMenu = n10, this._instantiationService = r10, this._ghostTexts = I(this, (e207) => this._model.read(e207)?.ghostTexts.read(e207) ?? []), this._stablizedGhostTexts = oDe(this._ghostTexts, this._store), this._editorObs = WK(this._editor), this._ghostTextWidgets = jc(this, this._stablizedGhostTexts, (e207, t11) => pc((t12) => this._instantiationService.createInstance(W3.hot.read(t12), this._editor, { ghostText: e207, warning: this._model.map((e208, t13) => {
      let n11 = e208?.warning?.read(t13);
      return n11 ? { icon: n11.icon } : void 0;
    }), minReservedLineCount: FI(0), targetTextModel: this._model.map((e208) => e208?.textModel), handleInlineCompletionShown: this._model.map((e208, t13) => {
      let n11 = e208?.inlineCompletionState.read(t13)?.inlineCompletion;
      return n11 ? (t14) => e208.handleInlineSuggestionShown(n11, H4.GhostText, t14) : () => {
      };
    }) }, this._editorObs.getOption(71).map((e208) => ({ syntaxHighlightingEnabled: e208.syntaxHighlightingEnabled })), false, false)).recomputeInitiallyAndOnChange(t11)).recomputeInitiallyAndOnChange(this._store), this._inlineEdit = I(this, (e207) => this._model.read(e207)?.inlineEditState.read(e207)?.inlineEdit), this._everHadInlineEdit = Ac(this, (e207, t11) => t11 || !!this._inlineEdit.read(e207) || !!this._model.read(e207)?.inlineCompletionState.read(e207)?.inlineCompletion?.showInlineEditMenu), this._inlineEditWidget = pc((e207) => {
      if (this._everHadInlineEdit.read(e207)) return this._instantiationService.createInstance(j8.hot.read(e207), this._editor, this._inlineEdit, this._model, this._focusIsInMenu);
    }).recomputeInitiallyAndOnChange(this._store), this._fontFamily = this._editorObs.getOption(71).map((e207) => e207.fontFamily), this._register(w_(I((e207) => `
.monaco-editor .ghost-text-decoration,
.monaco-editor .ghost-text-decoration-preview,
.monaco-editor .ghost-text {
	font-family: ${this._fontFamily.read(e207)};
}`))), this._register(new _Z2(this._editor, this._model, this._instantiationService));
  }
  shouldShowHoverAtViewZone(e206) {
    return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(e206) ?? false;
  }
};
M8 = Lke([Rke(3, V)], M8);
var zke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, N8 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, P8, F8 = (_td = class extends D {
  static getInFocusedEditorOrParent(e206) {
    let t10 = JQ(e206);
    return t10 ? P8.get(t10) : null;
  }
  static get(e206) {
    return iEe(e206.getContribution(P8.ID));
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10, c10, l10) {
    super(), this.editor = e206, this._instantiationService = t10, this._contextKeyService = n10, this._configurationService = r10, this._commandService = i10, this._debounceService = a10, this._languageFeaturesService = o10, this._accessibilitySignalService = s10, this._keybindingService = c10, this._accessibilityService = l10, this._editorObs = WK(this.editor), this._positions = I(this, (e207) => this._editorObs.selections.read(e207)?.map((e208) => e208.getEndPosition()) ?? [new j(1, 1)]), this._suggestWidgetAdapter = this._register(new SOe(this._editorObs, (e207) => this.model.get()?.handleSuggestAccepted(e207), () => this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit())), this._enabledInConfig = Tc(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(71).enabled), this._isScreenReaderEnabled = Tc(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized()), this._editorDictationInProgress = Tc(this, this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue(`editorDictation.inProgress`) === true), this._enabled = I(this, (e207) => this._enabledInConfig.read(e207) && (!this._isScreenReaderEnabled.read(e207) || !this._editorDictationInProgress.read(e207))), this._debounceValue = this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider, `InlineCompletionsDebounce`, { min: 50, max: 50 }), this._focusIsInMenu = Ic(this, false), this._focusIsInEditorOrMenu = I(this, (e207) => {
      let t11 = this._editorObs.isFocused.read(e207), n11 = this._focusIsInMenu.read(e207);
      return t11 || n11;
    }), this._cursorIsInIndentation = I(this, (e207) => {
      let t11 = this._editorObs.cursorPosition.read(e207);
      if (t11 === null) return false;
      let n11 = this._editorObs.model.read(e207);
      if (!n11) return false;
      this._editorObs.versionId.read(e207);
      let r11 = n11.getLineIndentColumn(t11.lineNumber);
      return t11.column <= r11;
    }), this.model = pc(this, (e207) => {
      if (this._editorObs.isReadonly.read(e207)) return;
      let t11 = this._editorObs.model.read(e207);
      if (t11) return this._instantiationService.createInstance(Z4, t11, this._suggestWidgetAdapter.selectedItem, this._editorObs.versionId, this._positions, this._debounceValue, this._enabled, this.editor);
    }).recomputeInitiallyAndOnChange(this._store), this._playAccessibilitySignal = _D2(this), this._hideInlineEditOnSelectionChange = this._editorObs.getOption(71).map((e207) => true), this._view = this._register(this._instantiationService.createInstance(M8, this.editor, this.model, this._focusIsInMenu)), P8._instances.add(this), this._register(T(() => P8._instances.delete(this))), this._register(hc((e207) => {
      let t11 = this.model.read(e207);
      if (!t11) return;
      let n11 = t11.state.read(e207);
      if (!n11 || !this._focusIsInEditorOrMenu.read(void 0)) return;
      let r11 = n11.kind === `inlineEdit` ? n11.nextEditUri : void 0;
      for (let e208 of P8._instances) if (e208 === this) continue;
      else r11 && Fd(r11, e208.editor.getModel()?.uri) ? e208.model.read(void 0)?.trigger() : e208.reject();
    })), this._register(hc((e207) => {
      let t11 = this.model.read(e207), n11 = this.editor.getModel()?.uri;
      !t11 || !n11 || e207.store.add(t11.onDidAccept(() => {
        for (let e208 of P8._instances) {
          if (e208 === this) continue;
          let t12 = e208.model.read(void 0)?.state.read(void 0);
          t12?.kind === `inlineEdit` && Fd(t12.nextEditUri, n11) && e208.model.read(void 0)?.stop(`automatic`);
        }
      }));
    })), this._register(mw(this._editorObs.onDidType, (e207, t11) => {
      this._enabled.get() && this.model.get()?.trigger();
    })), this._register(mw(this._editorObs.onDidPaste, (e207, t11) => {
      this._enabled.get() && this.model.get()?.trigger();
    }));
    let u10 = /* @__PURE__ */ new Set([jS.Tab.id, jS.DeleteLeft.id, jS.DeleteRight.id, lZ, `acceptSelectedSuggestion`, R2.ID, L2.ID, qZ.NextMatchFindAction, ...Yd.getRegisteredCommands()]);
    this._register(this._commandService.onDidExecuteCommand((t11) => {
      if (u10.has(t11.commandId) && e206.hasTextFocus() && this._enabled.get()) {
        let e207 = false;
        t11.commandId === `editor.action.inlineSuggest.commit` && (e207 = true), this._editorObs.forceUpdate((t12) => {
          this.model.get()?.trigger(t12, { noDelay: e207 });
        });
      }
    })), this._register(mw(this._editorObs.selections, (e207, t11, n11) => {
      if (n11.some((e208) => e208.reason === 3 || e208.source === `api`)) {
        if (!this._hideInlineEditOnSelectionChange.get() && this.model.get()?.state.get()?.kind === `inlineEdit`) return;
        let e208 = this.model.get();
        if (!e208) return;
        e208.state.get()?.kind === `ghostText` && this.model.get()?.stop();
      }
    })), this._register(hc((t11) => {
      let n11 = this._focusIsInEditorOrMenu.read(t11), r11 = this.model.read(void 0);
      if (n11) {
        let e207 = r11?.state.read(void 0);
        (!e207 || e207.kind !== `inlineEdit` || !e207.nextEditUri) && bc((e208) => {
          for (let t12 of P8._instances) t12 !== this && t12.model.read(void 0)?.stop(`automatic`, e208);
        });
        return;
      }
      this._contextKeyService.getContextKeyValue(`accessibleViewIsShown`) || this._configurationService.getValue(`editor.inlineSuggest.keepOnBlur`) || e206.getOption(71).keepOnBlur || vZ.dropDownVisible || r11 && (r11.state.read(void 0)?.inlineCompletion?.isFromExplicitRequest && r11.inlineEditAvailable.read(void 0) || bc((e207) => {
        r11.stop(`automatic`, e207);
      }));
    })), this._register(hc((e207) => {
      let t11 = this.model.read(e207)?.inlineCompletionState.read(e207);
      t11?.suggestItem ? t11.primaryGhostText.lineCount >= 2 && this._suggestWidgetAdapter.forceRenderingAbove() : this._suggestWidgetAdapter.stopForceRenderingAbove();
    })), this._register(T(() => {
      this._suggestWidgetAdapter.stopForceRenderingAbove();
    }));
    let d10 = Ac(this, (e207, t11) => {
      let n11 = this.model.read(e207)?.state.read(e207);
      return this._suggestWidgetAdapter.selectedItem.get() ? t11 : n11?.inlineCompletion?.semanticId;
    });
    this._register(hw(I((e207) => (this._playAccessibilitySignal.read(e207), d10.read(e207), {})), async (e207, t11, n11, r11) => {
      let i11 = this.model.get(), a11 = i11?.state.get();
      if (!a11 || !i11 || (await is(50, mr(r11)), await wK(this._suggestWidgetAdapter.selectedItem, Ge, () => false, mr(r11)), i11 = this.model.get(), a11 = i11?.state.get(), !a11 || !i11)) return;
      let o11 = a11.kind === `ghostText` ? i11.textModel.getLineContent(a11.primaryGhostText.lineNumber) : ``;
      this._accessibilitySignalService.playSignal(a11.kind === `ghostText` ? qW.inlineSuggestion : qW.nextEditSuggestion), this.editor.getOption(12) && (a11.kind === `ghostText` ? this._provideScreenReaderUpdate(a11.primaryGhostText.renderForScreenReader(o11)) : this._provideScreenReaderUpdate(``));
    })), this._register(this._configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(`accessibility.verbosity.inlineCompletions`) && this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue(`accessibility.verbosity.inlineCompletions`) });
    })), this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue(`accessibility.verbosity.inlineCompletions`) });
    let f10 = new sDe(this._contextKeyService);
    this._register(f10.bind(D2.cursorInIndentation, this._cursorIsInIndentation)), this._register(f10.bind(D2.hasSelection, (e207) => !this._editorObs.cursorSelection.read(e207)?.isEmpty())), this._register(f10.bind(D2.cursorAtInlineEdit, this.model.map((e207, t11) => e207?.inlineEditState?.read(t11)?.cursorAtInlineEdit.read(t11)))), this._register(f10.bind(D2.tabShouldAcceptInlineEdit, this.model.map((e207, t11) => !!e207?.tabShouldAcceptInlineEdit.read(t11)))), this._register(f10.bind(D2.tabShouldJumpToInlineEdit, this.model.map((e207, t11) => !!e207?.tabShouldJumpToInlineEdit.read(t11)))), this._register(f10.bind(D2.inlineEditVisible, (e207) => this.model.read(e207)?.inlineEditState.read(e207) !== void 0)), this._register(f10.bind(D2.inlineSuggestionHasIndentation, (e207) => this.model.read(e207)?.getIndentationInfo(e207)?.startsWithIndentation)), this._register(f10.bind(D2.inlineSuggestionHasIndentationLessThanTabSize, (e207) => this.model.read(e207)?.getIndentationInfo(e207)?.startsWithIndentationLessThanTabSize)), this._register(f10.bind(D2.suppressSuggestions, (e207) => {
      let t11 = this.model.read(e207)?.inlineCompletionState.read(e207);
      return t11?.primaryGhostText && t11?.inlineCompletion ? t11.inlineCompletion.source.inlineSuggestions.suppressSuggestions : void 0;
    })), this._register(f10.bind(D2.inlineSuggestionVisible, (e207) => {
      let t11 = this.model.read(e207)?.inlineCompletionState.read(e207);
      return !!t11?.inlineCompletion && t11?.primaryGhostText !== void 0 && !t11?.primaryGhostText.isEmpty();
    }));
    let p10 = I(this, (e207) => {
      let t11 = this.model.read(e207)?.inlineCompletionState.read(e207)?.primaryGhostText;
      if (!(!t11 || t11.isEmpty())) return new j(t11.lineNumber, t11.parts[0].column);
    });
    this._register(f10.bind(D2.cursorBeforeGhostText, (e207) => {
      let t11 = p10.read(e207);
      if (!t11) return false;
      let n11 = this._editorObs.cursorPosition.read(e207);
      return n11 ? t11.equals(n11) : false;
    })), this._register(this._instantiationService.createInstance(X2, this.editor));
  }
  playAccessibilitySignal(e206) {
    this._playAccessibilitySignal.trigger(e206);
  }
  _provideScreenReaderUpdate(e206) {
    let t10 = this._contextKeyService.getContextKeyValue(`accessibleViewIsShown`), n10 = this._keybindingService.lookupKeybinding(`editor.action.accessibleView`), r10;
    !t10 && n10 && this.editor.getOption(169) && (r10 = C(1204, `Inspect this in the accessible view ({0})`, n10.getAriaLabel())), Wg(r10 ? e206 + `, ` + r10 : e206);
  }
  shouldShowHoverAt(e206) {
    let t10 = this.model.get()?.primaryGhostText.get();
    return t10 ? t10.parts.some((n10) => e206.containsPosition(new j(t10.lineNumber, n10.column))) : false;
  }
  shouldShowHoverAtViewZone(e206) {
    return this._view.shouldShowHoverAtViewZone(e206);
  }
  reject() {
    bc((e206) => {
      let t10 = this.model.get();
      if (t10 && (t10.stop(`explicitCancel`, e206), this._focusIsInEditorOrMenu.get())) for (let t11 of P8._instances) t11 !== this && t11.model.get()?.stop(`automatic`, e206);
    });
  }
  jump() {
    let e206 = this.model.get();
    e206 && e206.jump();
  }
}, P8 = _td, _td._instances = /* @__PURE__ */ new Set(), _td.hot = MG(_td), _td.ID = `editor.contrib.inlineCompletionsController`, _td);
F8 = P8 = zke([N8(1, V), N8(2, nd), N8(3, Uf), N8(4, Mu), N8(5, lA), N8(6, X), N8(7, WW), N8(8, Dw), N8(9, e_)], F8);
var Bke = (_ud = class extends G {
  constructor() {
    super({ id: _ud.ID, label: w(1183, `Show Next Inline Suggestion`), precondition: H.and($.writable, D2.inlineSuggestionVisible), kbOpts: { weight: 100, primary: 606 } });
  }
  async run(e206, t10) {
    F8.get(t10)?.model.get()?.next();
  }
}, _ud.ID = dZ, _ud), Vke = (_vd = class extends G {
  constructor() {
    super({ id: _vd.ID, label: w(1184, `Show Previous Inline Suggestion`), precondition: H.and($.writable, D2.inlineSuggestionVisible), kbOpts: { weight: 100, primary: 604 } });
  }
  async run(e206, t10) {
    F8.get(t10)?.model.get()?.previous();
  }
}, _vd.ID = uZ, _vd), Hke = `vscode://schemas/inlineCompletionProviderIdArgs`;
function Uke(e206) {
  let t10 = [];
  return e206.providerId && (t10.push(e206.providerId.toStringWithoutVersion()), t10.push(e206.providerId.extensionId + `:*`)), t10;
}
var I8 = pEe(dEe({ showNoResultNotification: y2(g2()), providerId: y2(hEe(Hke, sEe())), explicit: y2(g2()) }), lEe()), Wke = class extends G {
  constructor() {
    super({ id: `editor.action.inlineSuggest.trigger`, label: w(1185, `Trigger Inline Suggestion`), precondition: $.writable, metadata: { description: C(1172, `Triggers an inline suggestion in the editor.`), args: [{ name: `args`, description: C(1173, `Options for triggering inline suggestions.`), isOptional: true, schema: I8.getJSONSchema() }] } });
  }
  async run(e206, t10, n10) {
    let r10 = e206.get(dw), i10 = e206.get(X), a10 = F8.get(t10), o10 = I8.validateOrThrow(n10), s10 = o10?.providerId ? i10.inlineCompletionsProvider.all(t10.getModel()).find((e207) => Uke(e207).some((e208) => e208 === o10.providerId)) : void 0;
    await sne(async (e207) => {
      await a10?.model.get()?.trigger(e207, { provider: s10, explicit: o10?.explicit ?? true }), a10?.playAccessibilitySignal(e207);
    }), o10?.showNoResultNotification && (a10?.model.get()?.state.get() || r10.notify({ severity: uw.Info, message: C(1174, `No inline suggestion is available.`) }));
  }
}, Gke = class extends G {
  constructor() {
    super({ id: `editor.action.inlineSuggest.acceptNextWord`, label: w(1186, `Accept Next Word Of Inline Suggestion`), precondition: H.and($.writable, D2.inlineSuggestionVisible), kbOpts: { weight: 101, primary: 2065, kbExpr: H.and($.writable, D2.inlineSuggestionVisible, D2.cursorBeforeGhostText, t_.negate()) }, menuOpts: [{ menuId: W.InlineSuggestionToolbar, title: C(1175, `Accept Word`), group: `primary`, order: 2 }] });
  }
  async run(e206, t10) {
    await F8.get(t10)?.model.get()?.acceptNextWord();
  }
}, Kke = class extends G {
  constructor() {
    super({ id: `editor.action.inlineSuggest.acceptNextLine`, label: w(1187, `Accept Next Line Of Inline Suggestion`), precondition: H.and($.writable, D2.inlineSuggestionVisible), kbOpts: { weight: 101 }, menuOpts: [{ menuId: W.InlineSuggestionToolbar, title: C(1176, `Accept Line`), group: `secondary`, order: 2 }] });
  }
  async run(e206, t10) {
    await F8.get(t10)?.model.get()?.acceptNextLine();
  }
}, qke = class extends G {
  constructor() {
    super({ id: lZ, label: w(1188, `Accept Inline Suggestion`), precondition: H.or(D2.inlineSuggestionVisible, D2.inlineEditVisible), menuOpts: [{ menuId: W.InlineSuggestionToolbar, title: C(1177, `Accept`), group: `primary`, order: 2 }, { menuId: W.InlineEditsActions, title: C(1178, `Accept`), group: `primary`, order: 2 }], kbOpts: [{ primary: 2, weight: 200, kbExpr: H.or(H.and(D2.inlineSuggestionVisible, $.tabMovesFocus.toNegated(), b2.Visible.toNegated(), $.hoverFocused.toNegated(), D2.hasSelection.toNegated(), D2.inlineSuggestionHasIndentationLessThanTabSize), H.and(D2.inlineEditVisible, $.tabMovesFocus.toNegated(), b2.Visible.toNegated(), $.hoverFocused.toNegated(), D2.tabShouldAcceptInlineEdit)) }] });
  }
  async run(e206, t10) {
    let n10 = F8.getInFocusedEditorOrParent(e206);
    n10 && (n10.model.get()?.accept(n10.editor), n10.editor.focus());
  }
};
ld.registerKeybindingRule({ id: lZ, weight: 202, primary: 2, when: H.and(D2.inInlineEditsPreviewEditor) });
var Jke = class extends G {
  constructor() {
    super({ id: vSe, label: w(1189, `Jump to next inline edit`), precondition: D2.inlineEditVisible, menuOpts: [{ menuId: W.InlineEditsActions, title: C(1179, `Jump`), group: `primary`, order: 1, when: D2.cursorAtInlineEdit.toNegated() }], kbOpts: { primary: 2, weight: 201, kbExpr: H.and(D2.inlineEditVisible, $.tabMovesFocus.toNegated(), b2.Visible.toNegated(), $.hoverFocused.toNegated(), D2.tabShouldJumpToInlineEdit) } });
  }
  async run(e206, t10) {
    let n10 = F8.get(t10);
    n10 && n10.jump();
  }
}, L8 = (_wd = class extends G {
  constructor() {
    super({ id: _wd.ID, label: w(1190, `Hide Inline Suggestion`), precondition: H.or(D2.inlineSuggestionVisible, D2.inlineEditVisible), kbOpts: { weight: 190, primary: 9 }, menuOpts: [{ menuId: W.InlineEditsActions, title: C(1180, `Reject`), group: `primary`, order: 3 }] });
  }
  async run(e206, t10) {
    let n10 = F8.getInFocusedEditorOrParent(e206);
    bc((e207) => {
      n10?.model.get()?.stop(`explicitCancel`, e207);
    }), n10?.editor.focus();
  }
}, _wd.ID = fZ, _wd), Yke = (_xd = class extends G {
  constructor() {
    super({ id: _xd.ID, label: w(1191, `Toggle Inline Suggestions Show Collapsed`), precondition: H.true() });
  }
  async run(e206, t10) {
    let n10 = e206.get(Uf), r10 = n10.getValue(`editor.inlineSuggest.edits.showCollapsed`);
    n10.updateValue(`editor.inlineSuggest.edits.showCollapsed`, !r10);
  }
}, _xd.ID = pZ, _xd);
ld.registerKeybindingRule({ id: L8.ID, weight: -1, primary: 9, secondary: [1033], when: H.and(D2.inInlineEditsPreviewEditor) });
var Xke = (_yd = class extends vd {
  constructor() {
    super({ id: _yd.ID, title: C(1181, `Always Show Toolbar`), f1: false, precondition: void 0, menu: [{ id: W.InlineSuggestionToolbar, group: `secondary`, order: 10 }], toggled: H.equals(`config.editor.inlineSuggest.showToolbar`, `always`) });
  }
  async run(e206) {
    let t10 = e206.get(Uf), n10 = t10.getValue(`editor.inlineSuggest.showToolbar`) === `always` ? `onHover` : `always`;
    t10.updateValue(`editor.inlineSuggest.showToolbar`, n10);
  }
}, _yd.ID = `editor.action.inlineSuggest.toggleAlwaysShowToolbar`, _yd), Zke = class extends G {
  constructor() {
    super({ id: `editor.action.inlineSuggest.dev.extractRepro`, label: C(1182, `Developer: Extract Inline Suggest State`), alias: `Developer: Inline Suggest Extract Repro`, precondition: H.or(D2.inlineEditVisible, D2.inlineSuggestionVisible) });
  }
  async run(e206, t10) {
    let n10 = e206.get(hW), r10 = F8.get(t10)?.model.get();
    if (!r10) return;
    let i10 = r10.extractReproSample(), a10 = Wa(JSON.stringify({ inlineCompletion: i10.inlineCompletion }, null, 4)).map((e207) => `// ` + e207).join(`
`), o10 = `${i10.documentValue}

// <json>
${a10}
// </json>
`;
    return await n10.writeText(o10), { reproCase: o10 };
  }
}, Qke = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, R8 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, $ke = class {
  constructor(e206, t10, n10) {
    this.owner = e206, this.range = t10, this.controller = n10;
  }
  isValidForHoverAnchor(e206) {
    return e206.type === 1 && this.range.startColumn <= e206.range.startColumn && this.range.endColumn >= e206.range.endColumn;
  }
}, z8 = class {
  constructor(e206, t10, n10, r10, i10) {
    this._editor = e206, this.accessibilityService = t10, this._instantiationService = n10, this._telemetryService = r10, this._markdownRendererService = i10, this.hoverOrdinal = 4;
  }
  suggestHoverAnchor(e206) {
    let t10 = F8.get(this._editor);
    if (!t10) return null;
    let n10 = e206.target;
    if (n10.type === 8) {
      let r10 = n10.detail;
      if (t10.shouldShowHoverAtViewZone(r10.viewZoneId)) return new KX(1e3, this, M.fromPositions(this._editor.getModel().validatePosition(r10.positionBefore || r10.position)), e206.event.posx, e206.event.posy, false);
    }
    if (n10.type === 7 && t10.shouldShowHoverAt(n10.range) || n10.type === 6 && n10.detail.mightBeForeignElement && t10.shouldShowHoverAt(n10.range)) return new KX(1e3, this, n10.range, e206.event.posx, e206.event.posy, false);
    if (n10.type === 9 && n10.element) {
      let r10 = W3.getWarningWidgetContext(n10.element);
      if (r10 && t10.shouldShowHoverAt(r10.range)) return new KX(1e3, this, r10.range, e206.event.posx, e206.event.posy, false);
    }
    return null;
  }
  computeSync(e206, t10) {
    if (this._editor.getOption(71).showToolbar !== `onHover`) return [];
    let n10 = F8.get(this._editor);
    return n10 && n10.shouldShowHoverAt(e206.range) ? [new $ke(this, e206.range, n10)] : [];
  }
  renderHoverParts(e206, t10) {
    let n10 = new E(), r10 = t10[0];
    this._telemetryService.publicLog2(`inlineCompletionHover.shown`), this.accessibilityService.isScreenReaderOptimized() && !this._editor.getOption(12) && n10.add(this.renderScreenReaderText(e206, r10));
    let i10 = r10.controller.model.get(), a10 = document.createElement(`div`);
    return e206.fragment.appendChild(a10), n10.add(vc((t11, n11) => {
      let r11 = n11.add(this._instantiationService.createInstance(vZ.hot.read(t11), this._editor, false, FI(null), i10.selectedInlineCompletionIndex, i10.inlineCompletionsCount, i10.activeCommands, i10.warning, () => {
        e206.onContentsChanged();
      }));
      a10.replaceChildren(r11.getDomNode());
    })), i10.triggerExplicitly(), new qX([{ hoverPart: r10, hoverElement: a10, dispose() {
      n10.dispose();
    } }]);
  }
  getAccessibleContent(e206) {
    return C(1205, `There are inline completions here`);
  }
  renderScreenReaderText(e206, t10) {
    let n10 = new E(), r10 = B, i10 = r10(`div.hover-row.markdown-hover`), a10 = z(i10, r10(`div.hover-contents`, { "aria-live": `assertive` })), o10 = (t11) => {
      let r11 = C(1206, `Suggestion:`), i11 = n10.add(this._markdownRendererService.render(new PM().appendText(r11).appendCodeblock(`text`, t11), { context: this._editor, asyncRenderCallback: () => {
        a10.className = `hover-contents code-hover-contents`, e206.onContentsChanged();
      } }));
      a10.replaceChildren(i11.element);
    };
    return n10.add(hc((e207) => {
      let n11 = t10.controller.model.read(e207)?.primaryGhostText.read(e207);
      if (n11) {
        let e208 = this._editor.getModel().getLineContent(n11.lineNumber);
        o10(n11.renderForScreenReader(e208));
      } else Jl(a10);
    })), e206.fragment.appendChild(i10), n10;
  }
};
z8 = Qke([R8(1, e_), R8(2, V), R8(3, bd), R8(4, LP)], z8);
var eAe = class {
};
af(F8.ID, aEe(F8.hot), 3), q(Wke), q(Bke), q(Vke), q(Gke), q(Kke), q(qke), q(Yke), q(L8), q(Jke), yd(Xke), q(Zke), yd(Nhe), yd(Phe), JX.register(z8), d2.register(new eAe());
var tAe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, B8 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, V8, H8 = (_zd = class {
  constructor(e206, t10, n10, r10) {
    this.textModelResolverService = t10, this.languageService = n10, this.languageFeaturesService = r10, this.toUnhook = new E(), this.toUnhookForKeyboard = new E(), this.currentWordAtPosition = null, this.previousPromise = null, this.editor = e206, this.linkDecorations = this.editor.createDecorationsCollection();
    let i10 = new UQ(e206);
    this.toUnhook.add(i10), this.toUnhook.add(i10.onMouseMoveOrRelevantKeyDown(([e207, t11]) => {
      this.startFindDefinitionFromMouse(e207, t11 ?? void 0);
    })), this.toUnhook.add(i10.onExecute((e207) => {
      this.isEnabled(e207) && this.gotoDefinition(e207.target.position, e207.hasSideBySideModifier).catch((e208) => {
        be(e208);
      }).finally(() => {
        this.removeLinkDecorations();
      });
    })), this.toUnhook.add(i10.onCancel(() => {
      this.removeLinkDecorations(), this.currentWordAtPosition = null;
    }));
  }
  static get(e206) {
    return e206.getContribution(V8.ID);
  }
  async startFindDefinitionFromCursor(e206) {
    await this.startFindDefinition(e206), this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(() => {
      this.currentWordAtPosition = null, this.removeLinkDecorations(), this.toUnhookForKeyboard.clear();
    })), this.toUnhookForKeyboard.add(this.editor.onKeyDown((e207) => {
      e207 && (this.currentWordAtPosition = null, this.removeLinkDecorations(), this.toUnhookForKeyboard.clear());
    }));
  }
  startFindDefinitionFromMouse(e206, t10) {
    if (e206.target.type === 9 && this.linkDecorations.length > 0) return;
    if (!this.editor.hasModel() || !this.isEnabled(e206, t10)) {
      this.currentWordAtPosition = null, this.removeLinkDecorations();
      return;
    }
    let n10 = e206.target.position;
    this.startFindDefinition(n10);
  }
  async startFindDefinition(e206) {
    this.toUnhookForKeyboard.clear();
    let t10 = e206 ? this.editor.getModel()?.getWordAtPosition(e206) : null;
    if (!t10) {
      this.currentWordAtPosition = null, this.removeLinkDecorations();
      return;
    }
    if (this.currentWordAtPosition && this.currentWordAtPosition.startColumn === t10.startColumn && this.currentWordAtPosition.endColumn === t10.endColumn && this.currentWordAtPosition.word === t10.word) return;
    this.currentWordAtPosition = t10;
    let n10 = new eJ(this.editor, 15);
    this.previousPromise && (this.previousPromise = (this.previousPromise.cancel(), null)), this.previousPromise = es((t11) => this.findDefinition(e206, t11));
    let r10;
    try {
      r10 = await this.previousPromise;
    } catch (e207) {
      be(e207);
      return;
    }
    if (!r10 || !r10.length || !n10.validate(this.editor)) {
      this.removeLinkDecorations();
      return;
    }
    let i10 = r10[0].originSelectionRange ? M.lift(r10[0].originSelectionRange) : new M(e206.lineNumber, t10.startColumn, e206.lineNumber, t10.endColumn);
    if (r10.length > 1) {
      let e207 = i10;
      for (let { originSelectionRange: t11 } of r10) t11 && (e207 = M.plusRange(e207, t11));
      this.addDecoration(e207, new PM().appendText(C(1077, `Click to show {0} definitions.`, r10.length)));
    } else {
      let e207 = r10[0];
      return e207.uri ? this.textModelResolverService.createModelReference(e207.uri).then((t11) => {
        if (!t11.object || !t11.object.textEditorModel) {
          t11.dispose();
          return;
        }
        let { object: { textEditorModel: n11 } } = t11, { startLineNumber: r11 } = e207.range;
        if (r11 < 1 || r11 > n11.getLineCount()) {
          t11.dispose();
          return;
        }
        let a10 = this.getPreviewValue(n11, r11, e207), o10 = this.languageService.guessLanguageIdByFilepathOrFirstLine(n11.uri);
        this.addDecoration(i10, a10 ? new PM().appendCodeblock(o10 || ``, a10) : void 0), t11.dispose();
      }) : void 0;
    }
  }
  getPreviewValue(e206, t10, n10) {
    let r10 = n10.range;
    return r10.endLineNumber - r10.startLineNumber >= V8.MAX_SOURCE_PREVIEW_LINES && (r10 = this.getPreviewRangeBasedOnIndentation(e206, t10)), r10 = e206.validateRange(r10), this.stripIndentationFromPreviewRange(e206, t10, r10);
  }
  stripIndentationFromPreviewRange(e206, t10, n10) {
    let r10 = e206.getLineFirstNonWhitespaceColumn(t10);
    for (let i10 = t10 + 1; i10 < n10.endLineNumber; i10++) {
      let t11 = e206.getLineFirstNonWhitespaceColumn(i10);
      r10 = Math.min(r10, t11);
    }
    return e206.getValueInRange(n10).replace(RegExp(`^\\s{${r10 - 1}}`, `gm`), ``).trim();
  }
  getPreviewRangeBasedOnIndentation(e206, t10) {
    let n10 = e206.getLineFirstNonWhitespaceColumn(t10), r10 = Math.min(e206.getLineCount(), t10 + V8.MAX_SOURCE_PREVIEW_LINES), i10 = t10 + 1;
    for (; i10 < r10 && n10 !== e206.getLineFirstNonWhitespaceColumn(i10); i10++) ;
    return new M(t10, 1, i10 + 1, 1);
  }
  addDecoration(e206, t10) {
    let n10 = { range: e206, options: { description: `goto-definition-link`, inlineClassName: `goto-definition-link`, hoverMessage: t10 } };
    this.linkDecorations.set([n10]);
  }
  removeLinkDecorations() {
    this.linkDecorations.clear();
  }
  isEnabled(e206, t10) {
    return this.editor.hasModel() && e206.isLeftClick && e206.isNoneOrSingleMouseDown && e206.target.type === 6 && !(e206.target.detail.injectedText?.options instanceof HO) && (e206.hasTriggerModifier || (t10 ? t10.keyCodeIsTriggerKey : false)) && this.languageFeaturesService.definitionProvider.has(this.editor.getModel());
  }
  findDefinition(e206, t10) {
    let n10 = this.editor.getModel();
    return n10 ? N$(this.languageFeaturesService.definitionProvider, n10, e206, false, t10) : Promise.resolve(null);
  }
  async gotoDefinition(e206, t10) {
    return this.editor.setPosition(e206), this.editor.invokeWithinContext((e207) => new V$({ openToSide: t10, openInPeek: !t10 && this.editor.getOption(101) && !this.isInPeekEditor(e207), muteMessage: true }, { title: { value: ``, original: `` }, id: ``, precondition: void 0 }).run(e207));
  }
  isInPeekEditor(e206) {
    let t10 = e206.get(nd);
    return $Q.inPeekEditor.getValue(t10);
  }
  dispose() {
    this.toUnhook.dispose(), this.toUnhookForKeyboard.dispose();
  }
}, V8 = _zd, _zd.ID = `editor.contrib.gotodefinitionatposition`, _zd.MAX_SOURCE_PREVIEW_LINES = 8, _zd);
H8 = V8 = tAe([B8(1, wu), B8(2, Jf), B8(3, X)], H8), af(H8.ID, H8, 2), q(class extends G {
  constructor() {
    super({ id: `editor.action.debugEditorGpuRenderer`, label: w(1101, `Developer: Debug Editor GPU Renderer`), precondition: H.true() });
  }
  async run(e206, t10) {
    let n10 = e206.get(V), r10 = await e206.get(aF).pick([{ label: C(1098, `Log Texture Atlas Stats`), id: `logTextureAtlasStats` }, { label: C(1099, `Save Texture Atlas`), id: `saveTextureAtlas` }, { label: C(1100, `Draw Glyph`), id: `drawGlyph` }], { canPickMany: false });
    if (r10) switch (r10.id) {
      case `logTextureAtlasStats`:
        n10.invokeFunction((e207) => {
          let t11 = e207.get(Ud), n11 = vw.atlas;
          if (!vw.atlas) {
            t11.error(`No texture atlas found`);
            return;
          }
          let r11 = n11.getStats();
          t11.info([`Texture atlas stats`, ...r11].join(`

`));
        });
        break;
      case `saveTextureAtlas`:
        n10.invokeFunction(async (e207) => {
          let t11 = e207.get(qF), n11 = e207.get(C3), r11 = t11.getWorkspace().folders;
          if (r11.length > 0) {
            let e208 = vw.atlas, t12 = [];
            for (let [i10, a10] of e208.pages.entries()) t12.push(n11.writeFile($r.joinPath(r11[0].uri, `textureAtlasPage${i10}_actual.png`), As.wrap(new Uint8Array(await (await a10.source.convertToBlob()).arrayBuffer()))), n11.writeFile($r.joinPath(r11[0].uri, `textureAtlasPage${i10}_usage.png`), As.wrap(new Uint8Array(await (await a10.getUsagePreview()).arrayBuffer()))));
            await Promise.all(t12);
          }
        });
        break;
      case `drawGlyph`:
        n10.invokeFunction(async (e207) => {
          let t11 = e207.get(Uf), n11 = e207.get(C3), r11 = e207.get(aF), i10 = e207.get(qF).getWorkspace().folders;
          if (i10.length === 0) return;
          let a10 = vw.atlas, o10 = t11.getValue(`editor.fontFamily`), s10 = t11.getValue(`editor.fontSize`), c10 = new $C(s10, o10, Nl().devicePixelRatio, vw.decorationStyleCache), l10 = await r11.input({ prompt: `Enter a character to draw (prefix with 0x for code point))` });
          if (!l10) return;
          let u10 = l10.match(/0x(?<codePoint>[0-9a-f]+)/i)?.groups?.codePoint;
          u10 !== void 0 && (l10 = String.fromCodePoint(parseInt(u10, 16)));
          let d10 = a10.getGlyph(c10, l10, 0, 0, 0);
          if (!d10) return;
          let f10 = a10.pages[d10.pageIndex].source.getContext(`2d`)?.getImageData(d10.x, d10.y, d10.w, d10.h);
          if (!f10) return;
          let p10 = new OffscreenCanvas(f10.width, f10.height);
          ZC(p10.getContext(`2d`)).putImageData(f10, 0, 0);
          let m10 = await p10.convertToBlob({ type: `image/png` }), h10 = $r.joinPath(i10[0].uri, `glyph_${l10}_0_${s10}px_${o10.replaceAll(/[,\\\/\.'\s]/g, `_`)}.png`);
          await n11.writeFile(h10, As.wrap(new Uint8Array(await m10.arrayBuffer())));
        });
        break;
    }
  }
});
var U8;
(function(e206) {
  e206.NoAutoFocus = `noAutoFocus`, e206.FocusIfVisible = `focusIfVisible`, e206.AutoFocusImmediately = `autoFocusImmediately`;
})(U8 || (U8 = {}));
var nAe = class extends G {
  constructor() {
    super({ id: aSe, label: w(1107, `Show or Focus Hover`), metadata: { description: w(1108, `Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position.`), args: [{ name: `args`, schema: { type: `object`, properties: { focus: { description: `Controls if and when the hover should take focus upon being triggered by this action.`, enum: [U8.NoAutoFocus, U8.FocusIfVisible, U8.AutoFocusImmediately], enumDescriptions: [C(1104, `The hover will not automatically take focus.`), C(1105, `The hover will take focus only if it is already visible.`), C(1106, `The hover will automatically take focus when it appears.`)], default: U8.FocusIfVisible } } } }] }, precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: Sr(2089, 2087), weight: 100 } });
  }
  run(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = z1.get(t10);
    if (!r10) return;
    let i10 = n10?.focus, a10 = U8.FocusIfVisible;
    Object.values(U8).includes(i10) ? a10 = i10 : typeof i10 == `boolean` && i10 && (a10 = U8.AutoFocusImmediately);
    let o10 = (e207) => {
      let n11 = t10.getPosition(), i11 = new M(n11.lineNumber, n11.column, n11.lineNumber, n11.column);
      r10.showContentHover(i11, 1, 2, e207);
    }, s10 = t10.getOption(2) === 2;
    r10.isHoverVisible ? a10 === U8.NoAutoFocus ? o10(s10) : r10.focus() : o10(s10 || a10 === U8.AutoFocusImmediately);
  }
}, rAe = class extends G {
  constructor() {
    super({ id: oSe, label: w(1109, `Show Definition Preview Hover`), precondition: void 0, metadata: { description: w(1110, `Show the definition preview hover in the editor.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    if (!n10) return;
    let r10 = t10.getPosition();
    if (!r10) return;
    let i10 = new M(r10.lineNumber, r10.column, r10.lineNumber, r10.column), a10 = H8.get(t10);
    a10 && a10.startFindDefinitionFromCursor(r10).then(() => {
      n10.showContentHover(i10, 1, 2, true);
    });
  }
}, iAe = class extends G {
  constructor() {
    super({ id: sSe, label: w(1111, `Hide Hover`), alias: `Hide Content Hover`, precondition: void 0 });
  }
  run(e206, t10) {
    z1.get(t10)?.hideContentHover();
  }
}, aAe = class extends G {
  constructor() {
    super({ id: cSe, label: w(1112, `Scroll Up Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 16, weight: 100 }, metadata: { description: w(1113, `Scroll up the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.scrollUp();
  }
}, oAe = class extends G {
  constructor() {
    super({ id: lSe, label: w(1114, `Scroll Down Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 18, weight: 100 }, metadata: { description: w(1115, `Scroll down the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.scrollDown();
  }
}, sAe = class extends G {
  constructor() {
    super({ id: uSe, label: w(1116, `Scroll Left Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 15, weight: 100 }, metadata: { description: w(1117, `Scroll left the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.scrollLeft();
  }
}, cAe = class extends G {
  constructor() {
    super({ id: dSe, label: w(1118, `Scroll Right Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 17, weight: 100 }, metadata: { description: w(1119, `Scroll right the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.scrollRight();
  }
}, lAe = class extends G {
  constructor() {
    super({ id: fSe, label: w(1120, `Page Up Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 11, secondary: [528], weight: 100 }, metadata: { description: w(1121, `Page up the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.pageUp();
  }
}, uAe = class extends G {
  constructor() {
    super({ id: pSe, label: w(1122, `Page Down Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 12, secondary: [530], weight: 100 }, metadata: { description: w(1123, `Page down the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.pageDown();
  }
}, dAe = class extends G {
  constructor() {
    super({ id: mSe, label: w(1124, `Go To Top Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 14, secondary: [2064], weight: 100 }, metadata: { description: w(1125, `Go to the top of the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.goToTop();
  }
}, fAe = class extends G {
  constructor() {
    super({ id: hSe, label: w(1126, `Go To Bottom Hover`), precondition: $.hoverFocused, kbOpts: { kbExpr: $.hoverFocused, primary: 13, secondary: [2066], weight: 100 }, metadata: { description: w(1127, `Go to the bottom of the editor hover.`) } });
  }
  run(e206, t10) {
    let n10 = z1.get(t10);
    n10 && n10.goToBottom();
  }
}, pAe = class extends G {
  constructor() {
    super({ id: sZ, label: gSe, alias: `Increase Hover Verbosity Level`, precondition: $.hoverVisible });
  }
  run(e206, t10, n10) {
    let r10 = z1.get(t10);
    if (!r10) return;
    let i10 = n10?.index === void 0 ? r10.focusedHoverPartIndex() : n10.index;
    r10.updateHoverVerbosityLevel(mi.Increase, i10, n10?.focus);
  }
}, mAe = class extends G {
  constructor() {
    super({ id: cZ, label: _Se, alias: `Decrease Hover Verbosity Level`, precondition: $.hoverVisible });
  }
  run(e206, t10, n10) {
    let r10 = z1.get(t10);
    if (!r10) return;
    let i10 = n10?.index === void 0 ? r10.focusedHoverPartIndex() : n10.index;
    z1.get(t10)?.updateHoverVerbosityLevel(mi.Decrease, i10, n10?.focus);
  }
}, hAe = class {
  constructor(e206) {
    this._editor = e206;
  }
  computeSync(e206) {
    let t10 = (e207) => ({ value: e207 }), n10 = this._editor.getLineDecorations(e206.lineNumber), r10 = [], i10 = e206.laneOrLine === `lineNo`;
    if (!n10) return r10;
    for (let a10 of n10) {
      let n11 = a10.options.glyphMargin?.position ?? $p.Center;
      if (!i10 && n11 !== e206.laneOrLine) continue;
      let o10 = i10 ? a10.options.lineNumberHoverMessage : a10.options.glyphMarginHoverMessage;
      !o10 || FM(o10) || r10.push(...re(o10).map(t10));
    }
    return r10;
  }
}, gAe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, _Ae = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, W8, G8 = B, K8 = (_Ad = class extends D {
  constructor(e206, t10) {
    super(), this._markdownRendererService = t10, this.allowEditorOverflow = true, this._renderDisposeables = this._register(new E()), this._editor = e206, this._isVisible = false, this._messages = [], this._hover = this._register(new gj(true)), this._hover.containerDomNode.classList.toggle(`hidden`, !this._isVisible), this._hoverOperation = this._register(new xZ(this._editor, new hAe(this._editor))), this._register(this._hoverOperation.onResult((e207) => this._withResult(e207))), this._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged())), this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(59) && this._updateFont();
    })), this._register(el(this._hover.containerDomNode, `mouseleave`, (e207) => {
      this._onMouseLeave(e207);
    })), this._editor.addOverlayWidget(this);
  }
  dispose() {
    this._hoverComputerOptions = void 0, this._editor.removeOverlayWidget(this), super.dispose();
  }
  getId() {
    return W8.ID;
  }
  getDomNode() {
    return this._hover.containerDomNode;
  }
  getPosition() {
    return null;
  }
  _updateFont() {
    Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName(`code`)).forEach((e206) => this._editor.applyFontInfo(e206));
  }
  _onModelDecorationsChanged() {
    this._isVisible && this._hoverComputerOptions && (this._hoverOperation.cancel(), this._hoverOperation.start(0, this._hoverComputerOptions));
  }
  showsOrWillShow(e206) {
    let t10 = e206.target;
    return t10.type === 2 && t10.detail.glyphMarginLane ? (this._startShowingAt(t10.position.lineNumber, t10.detail.glyphMarginLane), true) : t10.type === 3 ? (this._startShowingAt(t10.position.lineNumber, `lineNo`), true) : false;
  }
  _startShowingAt(e206, t10) {
    this._hoverComputerOptions && this._hoverComputerOptions.lineNumber === e206 && this._hoverComputerOptions.laneOrLine === t10 || (this._hoverOperation.cancel(), this.hide(), this._hoverComputerOptions = { lineNumber: e206, laneOrLine: t10 }, this._hoverOperation.start(0, this._hoverComputerOptions));
  }
  hide() {
    this._hoverComputerOptions = void 0, this._hoverOperation.cancel(), this._isVisible && (this._isVisible = false, this._hover.containerDomNode.classList.toggle(`hidden`, !this._isVisible));
  }
  _withResult(e206) {
    this._messages = e206.value, this._messages.length > 0 ? this._renderMessages(e206.options.lineNumber, e206.options.laneOrLine, this._messages) : this.hide();
  }
  _renderMessages(e206, t10, n10) {
    this._renderDisposeables.clear();
    let r10 = document.createDocumentFragment();
    for (let e207 of n10) {
      let t11 = G8(`div.hover-row.markdown-hover`), n11 = z(t11, G8(`div.hover-contents`)), i10 = this._renderDisposeables.add(this._markdownRendererService.render(e207.value, { context: this._editor }));
      n11.appendChild(i10.element), r10.appendChild(t11);
    }
    this._updateContents(r10), this._showAt(e206, t10);
  }
  _updateContents(e206) {
    this._hover.contentsDomNode.textContent = ``, this._hover.contentsDomNode.appendChild(e206), this._updateFont();
  }
  _showAt(e206, t10) {
    this._isVisible || (this._isVisible = true, this._hover.containerDomNode.classList.toggle(`hidden`, !this._isVisible));
    let n10 = this._editor.getLayoutInfo(), r10 = this._editor.getTopForLineNumber(e206), i10 = this._editor.getScrollTop(), a10 = this._editor.getOption(75), o10 = this._hover.containerDomNode.clientHeight, s10 = r10 - i10 - (o10 - a10) / 2, c10 = n10.glyphMarginLeft + n10.glyphMarginWidth + (t10 === `lineNo` ? n10.lineNumbersWidth : 0), l10 = n10.height - o10, u10 = Math.max(0, Math.min(Math.round(s10), l10));
    if (this._editor.getOption(51)) {
      let e207 = this._editor.getDomNode();
      if (e207) {
        let t11 = _l2(e207);
        this._hover.containerDomNode.style.position = `fixed`, this._hover.containerDomNode.style.left = `${t11.left + c10}px`, this._hover.containerDomNode.style.top = `${t11.top + u10}px`;
      }
    } else this._hover.containerDomNode.style.position = `absolute`, this._hover.containerDomNode.style.left = `${c10}px`, this._hover.containerDomNode.style.top = `${u10}px`;
    this._hover.containerDomNode.style.zIndex = `11`;
  }
  _onMouseLeave(e206) {
    let t10 = this._editor.getDomNode();
    (!t10 || !bZ(t10, e206.x, e206.y)) && this.hide();
  }
}, W8 = _Ad, _Ad.ID = `editor.contrib.modesGlyphHoverWidget`, _Ad);
K8 = W8 = gAe([_Ae(1, LP)], K8);
var vAe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, yAe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, q8 = (_Bd = class extends D {
  constructor(e206, t10) {
    super(), this._editor = e206, this._instantiationService = t10, this.shouldKeepOpenOnEditorMouseMoveOrLeave = false, this._listenersStore = new E(), this._hoverState = { mouseDown: false }, this._reactToEditorMouseMoveRunner = this._register(new us(() => this._reactToEditorMouseMove(this._mouseMoveEvent), 0)), this._hookListeners(), this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(69) && (this._unhookListeners(), this._hookListeners());
    }));
  }
  _hookListeners() {
    let e206 = this._editor.getOption(69);
    this._hoverSettings = { enabled: e206.enabled, sticky: e206.sticky, hidingDelay: e206.hidingDelay }, e206.enabled ? (this._listenersStore.add(this._editor.onMouseDown((e207) => this._onEditorMouseDown(e207))), this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())), this._listenersStore.add(this._editor.onMouseMove((e207) => this._onEditorMouseMove(e207))), this._listenersStore.add(this._editor.onKeyDown((e207) => this._onKeyDown(e207)))) : (this._listenersStore.add(this._editor.onMouseMove((e207) => this._onEditorMouseMove(e207))), this._listenersStore.add(this._editor.onKeyDown((e207) => this._onKeyDown(e207)))), this._listenersStore.add(this._editor.onMouseLeave((e207) => this._onEditorMouseLeave(e207))), this._listenersStore.add(this._editor.onDidChangeModel(() => {
      this._cancelScheduler(), this.hideGlyphHover();
    })), this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())), this._listenersStore.add(this._editor.onDidScrollChange((e207) => this._onEditorScrollChanged(e207)));
  }
  _unhookListeners() {
    this._listenersStore.clear();
  }
  _cancelScheduler() {
    this._mouseMoveEvent = void 0, this._reactToEditorMouseMoveRunner.cancel();
  }
  _onEditorScrollChanged(e206) {
    (e206.scrollTopChanged || e206.scrollLeftChanged) && this.hideGlyphHover();
  }
  _onEditorMouseDown(e206) {
    this._hoverState.mouseDown = true, !this._isMouseOnGlyphHoverWidget(e206) && this.hideGlyphHover();
  }
  _isMouseOnGlyphHoverWidget(e206) {
    let t10 = this._glyphWidget?.getDomNode();
    return t10 ? bZ(t10, e206.event.posx, e206.event.posy) : false;
  }
  _onEditorMouseUp() {
    this._hoverState.mouseDown = false;
  }
  _onEditorMouseLeave(e206) {
    this.shouldKeepOpenOnEditorMouseMoveOrLeave || (this._cancelScheduler(), !this._isMouseOnGlyphHoverWidget(e206) && this.hideGlyphHover());
  }
  _shouldNotRecomputeCurrentHoverWidget(e206) {
    let t10 = this._hoverSettings.sticky, n10 = this._isMouseOnGlyphHoverWidget(e206);
    return t10 && n10;
  }
  _onEditorMouseMove(e206) {
    if (!this.shouldKeepOpenOnEditorMouseMoveOrLeave) {
      if (this._mouseMoveEvent = e206, this._shouldNotRecomputeCurrentHoverWidget(e206)) {
        this._reactToEditorMouseMoveRunner.cancel();
        return;
      }
      this._reactToEditorMouseMove(e206);
    }
  }
  _reactToEditorMouseMove(e206) {
    e206 && (this._tryShowHoverWidget(e206) || this.hideGlyphHover());
  }
  _tryShowHoverWidget(e206) {
    return this._getOrCreateGlyphWidget().showsOrWillShow(e206);
  }
  _onKeyDown(e206) {
    this._editor.hasModel() && (e206.keyCode === 5 || e206.keyCode === 6 || e206.keyCode === 57 || e206.keyCode === 4 || this.hideGlyphHover());
  }
  hideGlyphHover() {
    this._glyphWidget?.hide();
  }
  _getOrCreateGlyphWidget() {
    return this._glyphWidget || (this._glyphWidget = this._instantiationService.createInstance(K8, this._editor)), this._glyphWidget;
  }
  dispose() {
    super.dispose(), this._unhookListeners(), this._listenersStore.dispose(), this._glyphWidget?.dispose();
  }
}, _Bd.ID = `editor.contrib.marginHover`, _Bd);
q8 = vAe([yAe(1, V)], q8);
var bAe = class {
}, xAe = class {
}, SAe = class {
};
af(z1.ID, z1, 2), af(q8.ID, q8, 2), q(nAe), q(rAe), q(iAe), q(aAe), q(oAe), q(sAe), q(cAe), q(lAe), q(uAe), q(dAe), q(fAe), q(pAe), q(mAe), JX.register(TQ), JX.register(D1), JS((e206, t10) => {
  let n10 = e206.getColor(Ov);
  n10 && (t10.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n10.transparent(0.5)}; }`), t10.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${n10.transparent(0.5)}; }`), t10.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${n10.transparent(0.5)}; }`));
}), d2.register(new bAe()), d2.register(new xAe()), d2.register(new SAe());
function J8(e206, t10, n10, r10) {
  if (e206.getLineCount() === 1 && e206.getLineMaxColumn(1) === 1) return [];
  let i10 = t10.getLanguageConfiguration(e206.getLanguageId()).indentRulesSupport;
  if (!i10) return [];
  let a10 = new Zx(e206, i10, t10);
  for (r10 = Math.min(r10, e206.getLineCount()); n10 <= r10 && a10.shouldIgnore(n10); ) n10++;
  if (n10 > r10 - 1) return [];
  let { tabSize: o10, indentSize: s10, insertSpaces: c10 } = e206.getOptions(), l10 = (e207, t11) => (t11 || (t11 = 1), aS.shiftIndent(e207, e207.length + t11, o10, s10, c10)), u10 = (e207, t11) => (t11 || (t11 = 1), aS.unshiftIndent(e207, e207.length + t11, o10, s10, c10)), d10 = [], f10 = Ka(e206.getLineContent(n10)), p10 = f10;
  a10.shouldIncrease(n10) ? (p10 = l10(p10), f10 = l10(f10)) : a10.shouldIndentNextLine(n10) && (p10 = l10(p10)), n10++;
  for (let t11 = n10; t11 <= r10; t11++) {
    if (CAe(e206, t11)) continue;
    let n11 = Ka(e206.getLineContent(t11)), r11 = p10;
    a10.shouldDecrease(t11, r11) && (p10 = u10(p10), f10 = u10(f10)), n11 !== p10 && d10.push(DF.replaceMove(new N(t11, 1, t11, n11.length + 1), Ax(p10, s10, c10))), !a10.shouldIgnore(t11) && (a10.shouldIncrease(t11, r11) ? (f10 = l10(f10), p10 = f10) : p10 = a10.shouldIndentNextLine(t11, r11) ? l10(p10) : f10);
  }
  return d10;
}
function CAe(e206, t10) {
  return e206.tokenization.isCheapToTokenize(t10) ? e206.tokenization.getLineTokens(t10).getStandardTokenType(0) === 2 : false;
}
var wAe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, TAe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, EAe = (_Cd = class extends G {
  constructor() {
    super({ id: _Cd.ID, label: w(1148, `Convert Indentation to Spaces`), precondition: $.writable, metadata: { description: w(1149, `Convert the tab indentation to spaces.`) } });
  }
  run(e206, t10) {
    let n10 = t10.getModel();
    if (!n10) return;
    let r10 = n10.getOptions(), i10 = t10.getSelection();
    if (!i10) return;
    let a10 = new IAe(i10, r10.tabSize);
    t10.pushUndoStop(), t10.executeCommands(this.id, [a10]), t10.pushUndoStop(), n10.updateOptions({ insertSpaces: true });
  }
}, _Cd.ID = `editor.action.indentationToSpaces`, _Cd), DAe = (_Dd = class extends G {
  constructor() {
    super({ id: _Dd.ID, label: w(1150, `Convert Indentation to Tabs`), precondition: $.writable, metadata: { description: w(1151, `Convert the spaces indentation to tabs.`) } });
  }
  run(e206, t10) {
    let n10 = t10.getModel();
    if (!n10) return;
    let r10 = n10.getOptions(), i10 = t10.getSelection();
    if (!i10) return;
    let a10 = new LAe(i10, r10.tabSize);
    t10.pushUndoStop(), t10.executeCommands(this.id, [a10]), t10.pushUndoStop(), n10.updateOptions({ insertSpaces: false });
  }
}, _Dd.ID = `editor.action.indentationToTabs`, _Dd), Y8 = class extends G {
  constructor(e206, t10, n10) {
    super(n10), this.insertSpaces = e206, this.displaySizeOnly = t10;
  }
  run(e206, t10) {
    let n10 = e206.get(aF), r10 = e206.get(Cu), i10 = t10.getModel();
    if (!i10) return;
    let a10 = r10.getCreationOptions(i10.getLanguageId(), i10.uri, i10.isForSimpleWidget), o10 = i10.getOptions(), s10 = [1, 2, 3, 4, 5, 6, 7, 8].map((e207) => ({ id: e207.toString(), label: e207.toString(), description: e207 === a10.tabSize && e207 === o10.tabSize ? C(1144, `Configured Tab Size`) : e207 === a10.tabSize ? C(1145, `Default Tab Size`) : e207 === o10.tabSize ? C(1146, `Current Tab Size`) : void 0 })), c10 = Math.min(i10.getOptions().tabSize - 1, 7);
    setTimeout(() => {
      n10.pick(s10, { placeHolder: C(1147, `Select Tab Size for Current File`), activeItem: s10[c10] }).then((e207) => {
        if (e207 && i10 && !i10.isDisposed()) {
          let t11 = parseInt(e207.label, 10);
          this.displaySizeOnly ? i10.updateOptions({ tabSize: t11 }) : i10.updateOptions({ tabSize: t11, indentSize: t11, insertSpaces: this.insertSpaces });
        }
      });
    }, 50);
  }
}, OAe = (_Ed = class extends Y8 {
  constructor() {
    super(false, false, { id: _Ed.ID, label: w(1152, `Indent Using Tabs`), precondition: void 0, metadata: { description: w(1153, `Use indentation with tabs.`) } });
  }
}, _Ed.ID = `editor.action.indentUsingTabs`, _Ed), kAe = (_Fd = class extends Y8 {
  constructor() {
    super(true, false, { id: _Fd.ID, label: w(1154, `Indent Using Spaces`), precondition: void 0, metadata: { description: w(1155, `Use indentation with spaces.`) } });
  }
}, _Fd.ID = `editor.action.indentUsingSpaces`, _Fd), AAe = (_Gd = class extends Y8 {
  constructor() {
    super(true, true, { id: _Gd.ID, label: w(1156, `Change Tab Display Size`), precondition: void 0, metadata: { description: w(1157, `Change the space size equivalent of the tab.`) } });
  }
}, _Gd.ID = `editor.action.changeTabDisplaySize`, _Gd), jAe = (_Hd = class extends G {
  constructor() {
    super({ id: _Hd.ID, label: w(1158, `Detect Indentation from Content`), precondition: void 0, metadata: { description: w(1159, `Detect the indentation from content.`) } });
  }
  run(e206, t10) {
    let n10 = e206.get(Cu), r10 = t10.getModel();
    if (!r10) return;
    let i10 = n10.getCreationOptions(r10.getLanguageId(), r10.uri, r10.isForSimpleWidget);
    r10.detectIndentation(i10.insertSpaces, i10.tabSize);
  }
}, _Hd.ID = `editor.action.detectIndentation`, _Hd), MAe = class extends G {
  constructor() {
    super({ id: `editor.action.reindentlines`, label: w(1160, `Reindent Lines`), precondition: $.writable, metadata: { description: w(1161, `Reindent the lines of the editor.`) }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = e206.get(bp), r10 = t10.getModel();
    if (!r10) return;
    let i10 = J8(r10, n10, 1, r10.getLineCount());
    i10.length > 0 && (t10.pushUndoStop(), t10.executeEdits(this.id, i10), t10.pushUndoStop());
  }
}, NAe = class extends G {
  constructor() {
    super({ id: `editor.action.reindentselectedlines`, label: w(1162, `Reindent Selected Lines`), precondition: $.writable, metadata: { description: w(1163, `Reindent the selected lines of the editor.`) }, canTriggerInlineEdits: true });
  }
  run(e206, t10) {
    let n10 = e206.get(bp), r10 = t10.getModel();
    if (!r10) return;
    let i10 = t10.getSelections();
    if (i10 === null) return;
    let a10 = [];
    for (let e207 of i10) {
      let t11 = e207.startLineNumber, i11 = e207.endLineNumber;
      if (t11 !== i11 && e207.endColumn === 1 && i11--, t11 === 1) {
        if (t11 === i11) continue;
      } else t11--;
      let o10 = J8(r10, n10, t11, i11);
      a10.push(...o10);
    }
    a10.length > 0 && (t10.pushUndoStop(), t10.executeEdits(this.id, a10), t10.pushUndoStop());
  }
}, PAe = class {
  constructor(e206, t10) {
    this._initialSelection = t10, this._edits = [], this._selectionId = null;
    for (let t11 of e206) t11.range && typeof t11.text == `string` && this._edits.push(t11);
  }
  getEditOperations(e206, t10) {
    for (let e207 of this._edits) t10.addEditOperation(M.lift(e207.range), e207.text);
    let n10 = false;
    Array.isArray(this._edits) && this._edits.length === 1 && this._initialSelection.isEmpty() && (this._edits[0].range.startColumn === this._initialSelection.endColumn && this._edits[0].range.startLineNumber === this._initialSelection.endLineNumber ? (n10 = true, this._selectionId = t10.trackSelection(this._initialSelection, true)) : this._edits[0].range.endColumn === this._initialSelection.startColumn && this._edits[0].range.endLineNumber === this._initialSelection.startLineNumber && (n10 = true, this._selectionId = t10.trackSelection(this._initialSelection, false))), n10 || (this._selectionId = t10.trackSelection(this._initialSelection));
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this._selectionId);
  }
}, X8 = (_Id = class {
  constructor(e206, t10) {
    this.editor = e206, this._languageConfigurationService = t10, this.callOnDispose = new E(), this.callOnModel = new E(), this.callOnDispose.add(e206.onDidChangeConfiguration(() => this.update())), this.callOnDispose.add(e206.onDidChangeModel(() => this.update())), this.callOnDispose.add(e206.onDidChangeModelLanguage(() => this.update()));
  }
  update() {
    this.callOnModel.clear(), !(!this.editor.getOption(17) || this.editor.getOption(16) < 4) && this.editor.hasModel() && this.callOnModel.add(this.editor.onDidPaste(({ range: e206 }) => {
      this.trigger(e206);
    }));
  }
  trigger(e206) {
    let t10 = this.editor.getSelections();
    if (t10 === null || t10.length > 1) return;
    let n10 = this.editor.getModel();
    if (!n10 || this.rangeContainsOnlyWhitespaceCharacters(n10, e206) || !this.editor.getOption(18) && FAe(n10, e206) || !n10.tokenization.isCheapToTokenize(e206.getStartPosition().lineNumber)) return;
    let r10 = this.editor.getOption(16), { tabSize: i10, indentSize: a10, insertSpaces: o10 } = n10.getOptions(), s10 = [], c10 = { shiftIndent: (e207) => aS.shiftIndent(e207, e207.length + 1, i10, a10, o10), unshiftIndent: (e207) => aS.unshiftIndent(e207, e207.length + 1, i10, a10, o10) }, l10 = e206.startLineNumber, u10 = n10.getLineContent(l10);
    if (!/\S/.test(u10.substring(0, e206.startColumn - 1))) {
      let e207 = sS(r10, n10, n10.getLanguageId(), l10, c10, this._languageConfigurationService);
      if (e207 !== null) {
        let t11 = Ka(u10), r11 = k2(e207, i10);
        if (r11 !== k2(t11, i10)) {
          let e208 = A2(r11, i10, o10);
          s10.push({ range: new M(l10, 1, l10, t11.length + 1), text: e208 }), u10 = e208 + u10.substring(t11.length);
        } else {
          let e208 = cS(n10, l10, this._languageConfigurationService);
          if (e208 === 0 || e208 === 8) return;
        }
      }
    }
    let d10 = l10;
    for (; l10 < e206.endLineNumber; ) {
      if (!/\S/.test(n10.getLineContent(l10 + 1))) {
        l10++;
        continue;
      }
      break;
    }
    if (l10 !== e206.endLineNumber) {
      let t11 = sS(r10, { tokenization: { getLineTokens: (e207) => n10.tokenization.getLineTokens(e207), getLanguageId: () => n10.getLanguageId(), getLanguageIdAtPosition: (e207, t12) => n10.getLanguageIdAtPosition(e207, t12) }, getLineContent: (e207) => e207 === d10 ? u10 : n10.getLineContent(e207) }, n10.getLanguageId(), l10 + 1, c10, this._languageConfigurationService);
      if (t11 !== null) {
        let r11 = k2(t11, i10), a11 = k2(Ka(n10.getLineContent(l10 + 1)), i10);
        if (r11 !== a11) {
          let t12 = r11 - a11;
          for (let r12 = l10 + 1; r12 <= e206.endLineNumber; r12++) {
            let e207 = Ka(n10.getLineContent(r12)), a12 = A2(k2(e207, i10) + t12, i10, o10);
            a12 !== e207 && s10.push({ range: new M(r12, 1, r12, e207.length + 1), text: a12 });
          }
        }
      }
    }
    if (s10.length > 0) {
      this.editor.pushUndoStop();
      let e207 = new PAe(s10, this.editor.getSelection());
      this.editor.executeCommand(`autoIndentOnPaste`, e207), this.editor.pushUndoStop();
    }
  }
  rangeContainsOnlyWhitespaceCharacters(e206, t10) {
    let n10 = (e207) => e207.trim().length === 0, r10 = true;
    if (t10.startLineNumber === t10.endLineNumber) r10 = n10(e206.getLineContent(t10.startLineNumber).substring(t10.startColumn - 1, t10.endColumn - 1));
    else for (let i10 = t10.startLineNumber; i10 <= t10.endLineNumber; i10++) {
      let a10 = e206.getLineContent(i10);
      if (r10 = i10 === t10.startLineNumber ? n10(a10.substring(t10.startColumn - 1)) : i10 === t10.endLineNumber ? n10(a10.substring(0, t10.endColumn - 1)) : e206.getLineFirstNonWhitespaceColumn(i10) === 0, !r10) break;
    }
    return r10;
  }
  dispose() {
    this.callOnDispose.dispose(), this.callOnModel.dispose();
  }
}, _Id.ID = `editor.contrib.autoIndentOnPaste`, _Id);
X8 = wAe([TAe(1, bp)], X8);
function FAe(e206, t10) {
  let n10 = (t11) => $ie(e206, t11) === 2;
  return n10(t10.getStartPosition()) || n10(t10.getEndPosition());
}
function Z8(e206, t10, n10, r10) {
  if (e206.getLineCount() === 1 && e206.getLineMaxColumn(1) === 1) return;
  let i10 = ``;
  for (let e207 = 0; e207 < n10; e207++) i10 += ` `;
  let a10 = new RegExp(i10, `gi`);
  for (let n11 = 1, o10 = e206.getLineCount(); n11 <= o10; n11++) {
    let o11 = e206.getLineFirstNonWhitespaceColumn(n11);
    if (o11 === 0 && (o11 = e206.getLineMaxColumn(n11)), o11 === 1) continue;
    let s10 = new M(n11, 1, n11, o11), c10 = e206.getValueInRange(s10), l10 = r10 ? c10.replace(/\t/gi, i10) : c10.replace(a10, `	`);
    t10.addEditOperation(s10, l10);
  }
}
var IAe = class {
  constructor(e206, t10) {
    this.selection = e206, this.tabSize = t10, this.selectionId = null;
  }
  getEditOperations(e206, t10) {
    this.selectionId = t10.trackSelection(this.selection), Z8(e206, t10, this.tabSize, true);
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this.selectionId);
  }
}, LAe = class {
  constructor(e206, t10) {
    this.selection = e206, this.tabSize = t10, this.selectionId = null;
  }
  getEditOperations(e206, t10) {
    this.selectionId = t10.trackSelection(this.selection), Z8(e206, t10, this.tabSize, false);
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this.selectionId);
  }
};
af(X8.ID, X8, 2), q(EAe), q(DAe), q(OAe), q(kAe), q(AAe), q(jAe), q(MAe), q(NAe), af(Z$.ID, Z$, 1), JX.register(e1);
var RAe = class {
  constructor(e206, t10, n10) {
    this._editRange = e206, this._originalSelection = t10, this._text = n10;
  }
  getEditOperations(e206, t10) {
    t10.addTrackedEditOperation(this._editRange, this._text);
  }
  computeCursorState(e206, t10) {
    let n10 = t10.getInverseEditOperations()[0].range;
    return this._originalSelection.isEmpty() ? new N(n10.endLineNumber, Math.min(this._originalSelection.positionColumn, n10.endColumn), n10.endLineNumber, Math.min(this._originalSelection.positionColumn, n10.endColumn)) : new N(n10.endLineNumber, n10.endColumn - this._text.length, n10.endLineNumber, n10.endColumn);
  }
}, zAe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, BAe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Q8, $8 = (_Jd = class {
  static get(e206) {
    return e206.getContribution(Q8.ID);
  }
  constructor(e206, t10) {
    this.editor = e206, this.editorWorkerService = t10, this.decorations = this.editor.createDecorationsCollection();
  }
  dispose() {
  }
  run(e206, t10) {
    this.currentRequest?.cancel();
    let n10 = this.editor.getSelection(), r10 = this.editor.getModel();
    if (!r10 || !n10) return;
    let i10 = n10;
    if (i10.startLineNumber !== i10.endLineNumber) return;
    let a10 = new eJ(this.editor, 5), o10 = r10.uri;
    return this.editorWorkerService.canNavigateValueSet(o10) ? (this.currentRequest = es((e207) => this.editorWorkerService.navigateValueSet(o10, i10, t10)), this.currentRequest.then((t11) => {
      if (!t11 || !t11.range || !t11.value || !a10.validate(this.editor)) return;
      let n11 = M.lift(t11.range), r11 = t11.range, o11 = t11.value.length - (i10.endColumn - i10.startColumn);
      r11 = { startLineNumber: r11.startLineNumber, startColumn: r11.startColumn, endLineNumber: r11.endLineNumber, endColumn: r11.startColumn + t11.value.length }, o11 > 1 && (i10 = new N(i10.startLineNumber, i10.startColumn, i10.endLineNumber, i10.endColumn + o11 - 1));
      let s10 = new RAe(n11, i10, t11.value);
      this.editor.pushUndoStop(), this.editor.executeCommand(e206, s10), this.editor.pushUndoStop(), this.decorations.set([{ range: r11, options: Q8.DECORATION }]), this.decorationRemover?.cancel(), this.decorationRemover = is(350), this.decorationRemover.then(() => this.decorations.clear()).catch(be);
    }).catch(be)) : Promise.resolve(void 0);
  }
}, Q8 = _Jd, _Jd.ID = `editor.contrib.inPlaceReplaceController`, _Jd.DECORATION = UO.register({ description: `in-place-replace`, className: `valueSetReplacement` }), _Jd);
$8 = Q8 = zAe([BAe(1, HL)], $8);
var VAe = class extends G {
  constructor() {
    super({ id: `editor.action.inPlaceReplace.up`, label: w(1240, `Replace with Previous Value`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 3159, weight: 100 } });
  }
  run(e206, t10) {
    let n10 = $8.get(t10);
    return n10 ? n10.run(this.id, false) : Promise.resolve(void 0);
  }
}, HAe = class extends G {
  constructor() {
    super({ id: `editor.action.inPlaceReplace.down`, label: w(1241, `Replace with Next Value`), precondition: $.writable, kbOpts: { kbExpr: $.editorTextFocus, primary: 3161, weight: 100 } });
  }
  run(e206, t10) {
    let n10 = $8.get(t10);
    return n10 ? n10.run(this.id, true) : Promise.resolve(void 0);
  }
};
af($8.ID, $8, 4), q(VAe), q(HAe);
var UAe = class {
  constructor(e206) {
    this._selection = e206, this._selectionId = null;
  }
  getEditOperations(e206, t10) {
    let n10 = WAe(e206);
    n10 && t10.addEditOperation(n10.range, n10.text), this._selectionId = t10.trackSelection(this._selection);
  }
  computeCursorState(e206, t10) {
    return t10.getTrackedSelection(this._selectionId);
  }
};
function WAe(e206) {
  let t10 = e206.getLineCount(), n10 = qa(e206.getLineContent(t10)) === -1;
  if (!(!t10 || n10)) return DF.insert(new j(t10, e206.getLineMaxColumn(t10)), e206.getEOL());
}
q((_Kd = class extends G {
  constructor() {
    super({ id: _Kd.ID, label: w(1242, `Insert Final New Line`), precondition: $.writable });
  }
  run(e206, t10, n10) {
    let r10 = t10.getSelection();
    if (r10 === null) return;
    let i10 = new UAe(r10);
    t10.pushUndoStop(), t10.executeCommands(this.id, [i10]), t10.pushUndoStop();
  }
}, _Kd.ID = `editor.action.insertFinalNewLine`, _Kd)), q(class extends G {
  constructor() {
    super({ id: `expandLineSelection`, label: w(1243, `Expand Line Selection`), precondition: void 0, kbOpts: { weight: 0, kbExpr: $.textInputFocus, primary: 2090 } });
  }
  run(e206, t10, n10) {
    if (n10 || (n10 = {}), !t10.hasModel()) return;
    let r10 = t10._getViewModel();
    r10.model.pushStackElement(), r10.setCursorStates(n10.source, 3, Yx.expandLineSelection(r10, r10.getCursorStates())), r10.revealAllCursors(n10.source, true);
  }
});
var GAe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, e510 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, t5, n5 = new U(`LinkedEditingInputVisible`, false), KAe = `linked-editing-decoration`, r5 = (_Ld = class extends D {
  static get(e206) {
    return e206.getContribution(t5.ID);
  }
  constructor(e206, t10, n10, r10, i10) {
    super(), this.languageConfigurationService = r10, this._syncRangesToken = 0, this._localToDispose = this._register(new E()), this._editor = e206, this._providers = n10.linkedEditingRangeProvider, this._enabled = false, this._visibleContextKey = n5.bindTo(t10), this._debounceInformation = i10.for(this._providers, `Linked Editing`, { max: 200 }), this._currentDecorations = this._editor.createDecorationsCollection(), this._languageWordPattern = null, this._currentWordPattern = null, this._ignoreChangeEvent = false, this._localToDispose = this._register(new E()), this._rangeUpdateTriggerPromise = null, this._rangeSyncTriggerPromise = null, this._currentRequestCts = null, this._currentRequestPosition = null, this._currentRequestModelVersion = null, this._register(this._editor.onDidChangeModel(() => this.reinitialize(true))), this._register(this._editor.onDidChangeConfiguration((e207) => {
      (e207.hasChanged(78) || e207.hasChanged(106)) && this.reinitialize(false);
    })), this._register(this._providers.onDidChange(() => this.reinitialize(false))), this._register(this._editor.onDidChangeModelLanguage(() => this.reinitialize(true))), this.reinitialize(true);
  }
  reinitialize(e206) {
    let t10 = this._editor.getModel(), n10 = t10 !== null && (this._editor.getOption(78) || this._editor.getOption(106)) && this._providers.has(t10);
    if (n10 === this._enabled && !e206 || (this._enabled = n10, this.clearRanges(), this._localToDispose.clear(), !n10 || t10 === null)) return;
    this._localToDispose.add(O.runAndSubscribe(t10.onDidChangeLanguageConfiguration, () => {
      this._languageWordPattern = this.languageConfigurationService.getLanguageConfiguration(t10.getLanguageId()).getWordDefinition();
    }));
    let r10 = new ns(this._debounceInformation.get(t10)), i10 = () => {
      this._rangeUpdateTriggerPromise = r10.trigger(() => this.updateRanges(), this._debounceDuration ?? this._debounceInformation.get(t10));
    }, a10 = new ns(0), o10 = (e207) => {
      this._rangeSyncTriggerPromise = a10.trigger(() => this._syncRanges(e207));
    };
    this._localToDispose.add(this._editor.onDidChangeCursorPosition(() => {
      i10();
    })), this._localToDispose.add(this._editor.onDidChangeModelContent((e207) => {
      if (!this._ignoreChangeEvent && this._currentDecorations.length > 0) {
        let t11 = this._currentDecorations.getRange(0);
        if (t11 && e207.changes.every((e208) => t11.intersectRanges(e208.range))) {
          o10(this._syncRangesToken);
          return;
        }
      }
      i10();
    })), this._localToDispose.add({ dispose: () => {
      r10.dispose(), a10.dispose();
    } }), this.updateRanges();
  }
  _syncRanges(e206) {
    if (!this._editor.hasModel() || e206 !== this._syncRangesToken || this._currentDecorations.length === 0) return;
    let t10 = this._editor.getModel(), n10 = this._currentDecorations.getRange(0);
    if (!n10 || n10.startLineNumber !== n10.endLineNumber) return this.clearRanges();
    let r10 = t10.getValueInRange(n10);
    if (this._currentWordPattern) {
      let e207 = r10.match(this._currentWordPattern);
      if ((e207 ? e207[0].length : 0) !== r10.length) return this.clearRanges();
    }
    let i10 = [];
    for (let e207 = 1, n11 = this._currentDecorations.length; e207 < n11; e207++) {
      let n12 = this._currentDecorations.getRange(e207);
      if (n12) if (n12.startLineNumber !== n12.endLineNumber) i10.push({ range: n12, text: r10 });
      else {
        let e208 = t10.getValueInRange(n12), a10 = r10, o10 = n12.startColumn, s10 = n12.endColumn, c10 = ro(e208, a10);
        o10 += c10, e208 = e208.substr(c10), a10 = a10.substr(c10);
        let l10 = io(e208, a10);
        s10 -= l10, e208 = e208.substr(0, e208.length - l10), a10 = a10.substr(0, a10.length - l10), (o10 !== s10 || a10.length !== 0) && i10.push({ range: new M(n12.startLineNumber, o10, n12.endLineNumber, s10), text: a10 });
      }
    }
    if (i10.length !== 0) try {
      this._editor.popUndoStop(), this._ignoreChangeEvent = true;
      let e207 = this._editor._getViewModel().getPrevEditOperationType();
      this._editor.executeEdits(`linkedEditing`, i10), this._editor._getViewModel().setPrevEditOperationType(e207);
    } finally {
      this._ignoreChangeEvent = false;
    }
  }
  dispose() {
    this.clearRanges(), super.dispose();
  }
  clearRanges() {
    this._visibleContextKey.set(false), this._currentDecorations.clear(), this._currentRequestCts && (this._currentRequestCts.cancel(), this._currentRequestCts = null, this._currentRequestPosition = null);
  }
  async updateRanges(e206 = false) {
    if (!this._editor.hasModel()) {
      this.clearRanges();
      return;
    }
    let t10 = this._editor.getPosition();
    if (!this._enabled && !e206 || this._editor.getSelections().length > 1) {
      this.clearRanges();
      return;
    }
    let n10 = this._editor.getModel(), r10 = n10.getVersionId();
    if (this._currentRequestPosition && this._currentRequestModelVersion === r10) {
      if (t10.equals(this._currentRequestPosition)) return;
      if (this._currentDecorations.length > 0) {
        let e207 = this._currentDecorations.getRange(0);
        if (e207 && e207.containsPosition(t10)) return;
      }
    }
    this._currentRequestPosition?.equals(t10) || this._currentDecorations.getRange(0)?.containsPosition(t10) || this.clearRanges(), this._currentRequestPosition = t10, this._currentRequestModelVersion = r10;
    let i10 = this._currentRequestCts = new pr();
    try {
      let e207 = new $t(false), a10 = await i5(this._providers, n10, t10, i10.token);
      if (this._debounceInformation.update(n10, e207.elapsed()), i10 !== this._currentRequestCts || (this._currentRequestCts = null, r10 !== n10.getVersionId())) return;
      let o10 = [];
      a10?.ranges && (o10 = a10.ranges), this._currentWordPattern = a10?.wordPattern || this._languageWordPattern;
      let s10 = false;
      for (let e208 = 0, n11 = o10.length; e208 < n11; e208++) if (M.containsPosition(o10[e208], t10)) {
        if (s10 = true, e208 !== 0) {
          let t11 = o10[e208];
          o10.splice(e208, 1), o10.unshift(t11);
        }
        break;
      }
      if (!s10) {
        this.clearRanges();
        return;
      }
      let c10 = o10.map((e208) => ({ range: e208, options: t5.DECORATION }));
      this._visibleContextKey.set(true), this._currentDecorations.set(c10), this._syncRangesToken++;
    } catch (e207) {
      we(e207) || be(e207), (this._currentRequestCts === i10 || !this._currentRequestCts) && this.clearRanges();
    }
  }
}, t5 = _Ld, _Ld.ID = `editor.contrib.linkedEditing`, _Ld.DECORATION = UO.register({ description: `linked-editing`, stickiness: 0, className: KAe }), _Ld);
r5 = t5 = GAe([e510(1, nd), e510(2, X), e510(3, bp), e510(4, lA)], r5);
var qAe = class extends G {
  constructor() {
    super({ id: `editor.action.linkedEditing`, label: w(1276, `Start Linked Editing`), precondition: H.and($.writable, $.hasRenameProvider), kbOpts: { kbExpr: $.editorTextFocus, primary: 3132, weight: 100 } });
  }
  runCommand(e206, t10) {
    let n10 = e206.get(Su), [r10, i10] = Array.isArray(t10) && t10 || [void 0, void 0];
    return $r.isUri(r10) && j.isIPosition(i10) ? n10.openCodeEditor({ resource: r10 }, n10.getActiveCodeEditor()).then((e207) => {
      e207 && (e207.setPosition(i10), e207.invokeWithinContext((t11) => (this.reportTelemetry(t11, e207), this.run(t11, e207))));
    }, be) : super.runCommand(e206, t10);
  }
  run(e206, t10) {
    let n10 = r5.get(t10);
    return n10 ? Promise.resolve(n10.updateRanges(true)) : Promise.resolve();
  }
};
K(new ($d.bindToContribution(r5.get))({ id: `cancelLinkedEditingInput`, precondition: n5, handler: (e206) => e206.clearRanges(), kbOpts: { kbExpr: $.editorTextFocus, weight: 199, primary: 9, secondary: [1033] } }));
function i5(e206, t10, n10, r10) {
  return os(e206.ordered(t10).map((e207) => async () => {
    try {
      return await e207.provideLinkedEditingRanges(t10, n10, r10);
    } catch (e208) {
      xe(e208);
      return;
    }
  }), (e207) => !!e207 && v(e207?.ranges));
}
Q(`editor.linkedEditingBackground`, { dark: Y.fromHex(`#f00`).transparent(0.3), light: Y.fromHex(`#f00`).transparent(0.3), hcDark: Y.fromHex(`#f00`).transparent(0.3), hcLight: Y.white }, C(1275, `Background color when the editor auto renames on type.`)), nf(`_executeLinkedEditingProvider`, (e206, t10, n10) => {
  let { linkedEditingRangeProvider: r10 } = e206.get(X);
  return i5(r10, t10, n10, dr.None);
}), af(r5.ID, r5, 1), q(qAe);
var JAe = class {
  constructor(e206, t10) {
    this._link = e206, this._provider = t10;
  }
  toJSON() {
    return { range: this.range, url: this.url, tooltip: this.tooltip };
  }
  get range() {
    return this._link.range;
  }
  get url() {
    return this._link.url;
  }
  get tooltip() {
    return this._link.tooltip;
  }
  async resolve(e206) {
    return this._link.url ? this._link.url : typeof this._provider.resolveLink == `function` ? Promise.resolve(this._provider.resolveLink(this._link, e206)).then((t10) => (this._link = t10 || this._link, this._link.url ? this.resolve(e206) : Promise.reject(Error(`missing`)))) : Promise.reject(Error(`missing`));
  }
}, a5 = (_Md = class {
  constructor(t10) {
    this._disposables = new E();
    let n10 = [];
    for (let [r10, i10] of t10) {
      let t11 = r10.links.map((e206) => new JAe(e206, i10));
      n10 = _Md._union(n10, t11), Gt(r10) && (this._disposables ?? (this._disposables = new E()), this._disposables.add(r10));
    }
    this.links = n10;
  }
  dispose() {
    this._disposables?.dispose(), this.links.length = 0;
  }
  static _union(e206, t10) {
    let n10 = [], r10, i10, a10, o10;
    for (r10 = 0, a10 = 0, i10 = e206.length, o10 = t10.length; r10 < i10 && a10 < o10; ) {
      let i11 = e206[r10], o11 = t10[a10];
      if (M.areIntersectingOrTouching(i11.range, o11.range)) {
        r10++;
        continue;
      }
      M.compareRangesUsingStarts(i11.range, o11.range) < 0 ? (n10.push(i11), r10++) : (n10.push(o11), a10++);
    }
    for (; r10 < i10; r10++) n10.push(e206[r10]);
    for (; a10 < o10; a10++) n10.push(t10[a10]);
    return n10;
  }
}, _Md.Empty = new _Md([]), _Md);
async function o5(e206, t10, n10) {
  let r10 = [], i10 = e206.ordered(t10).reverse().map(async (e207, i11) => {
    try {
      let a11 = await e207.provideLinks(t10, n10);
      a11 && (r10[i11] = [a11, e207]);
    } catch (e208) {
      xe(e208);
    }
  });
  await Promise.all(i10);
  let a10 = new a5(h(r10));
  return n10.isCancellationRequested && (a10.dispose(), a10 = a5.Empty), a10;
}
Nu.registerCommand(`_executeLinkProvider`, async (e206, ...t10) => {
  let [n10, r10] = t10;
  Je(n10 instanceof $r), typeof r10 != `number` && (r10 = 0);
  let { linkProvider: i10 } = e206.get(X), a10 = e206.get(Cu).getModel(n10);
  if (!a10) return [];
  let o10 = await o5(i10, a10, dr.None);
  if (!o10) return [];
  for (let e207 = 0; e207 < Math.min(r10, o10.links.length); e207++) await o10.links[e207].resolve(dr.None);
  let s10 = o10.links.slice(0);
  return o10.dispose(), s10;
});
var YAe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, s5 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, c5, l5 = (_Nd = class extends D {
  static get(e206) {
    return e206.getContribution(c5.ID);
  }
  constructor(e206, t10, n10, r10, i10) {
    super(), this.editor = e206, this.openerService = t10, this.notificationService = n10, this.languageFeaturesService = r10, this.providers = this.languageFeaturesService.linkProvider, this.debounceInformation = i10.for(this.providers, `Links`, { min: 1e3, max: 4e3 }), this.computeLinks = this._register(new us(() => this.computeLinksNow(), 1e3)), this.computePromise = null, this.activeLinksList = null, this.currentOccurrences = {}, this.activeLinkDecorationId = null;
    let a10 = this._register(new UQ(e206));
    this._register(a10.onMouseMoveOrRelevantKeyDown(([e207, t11]) => {
      this._onEditorMouseMove(e207, t11);
    })), this._register(a10.onExecute((e207) => {
      this.onEditorMouseUp(e207);
    })), this._register(a10.onCancel((e207) => {
      this.cleanUpActiveLinkDecoration();
    })), this._register(e206.onDidChangeConfiguration((e207) => {
      e207.hasChanged(79) && (this.updateDecorations([]), this.stop(), this.computeLinks.schedule(0));
    })), this._register(e206.onDidChangeModelContent((e207) => {
      this.editor.hasModel() && this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()));
    })), this._register(e206.onDidChangeModel((e207) => {
      this.currentOccurrences = {}, this.activeLinkDecorationId = null, this.stop(), this.computeLinks.schedule(0);
    })), this._register(e206.onDidChangeModelLanguage((e207) => {
      this.stop(), this.computeLinks.schedule(0);
    })), this._register(this.providers.onDidChange((e207) => {
      this.stop(), this.computeLinks.schedule(0);
    })), this.computeLinks.schedule(0);
  }
  async computeLinksNow() {
    if (!this.editor.hasModel() || !this.editor.getOption(79)) return;
    let e206 = this.editor.getModel();
    if (!e206.isTooLargeForSyncing() && this.providers.has(e206)) {
      this.activeLinksList && (this.activeLinksList = (this.activeLinksList.dispose(), null)), this.computePromise = es((t10) => o5(this.providers, e206, t10));
      try {
        let t10 = new $t(false);
        if (this.activeLinksList = await this.computePromise, this.debounceInformation.update(e206, t10.elapsed()), e206.isDisposed()) return;
        this.updateDecorations(this.activeLinksList.links);
      } catch (e207) {
        be(e207);
      } finally {
        this.computePromise = null;
      }
    }
  }
  updateDecorations(e206) {
    let t10 = this.editor.getOption(86) === `altKey`, n10 = [], r10 = Object.keys(this.currentOccurrences);
    for (let e207 of r10) {
      let t11 = this.currentOccurrences[e207];
      n10.push(t11.decorationId);
    }
    let i10 = [];
    if (e206) for (let n11 of e206) i10.push(d5.decoration(n11, t10));
    this.editor.changeDecorations((t11) => {
      let r11 = t11.deltaDecorations(n10, i10);
      this.currentOccurrences = {}, this.activeLinkDecorationId = null;
      for (let t12 = 0, n11 = r11.length; t12 < n11; t12++) {
        let n12 = new d5(e206[t12], r11[t12]);
        this.currentOccurrences[n12.decorationId] = n12;
      }
    });
  }
  _onEditorMouseMove(e206, t10) {
    let n10 = this.editor.getOption(86) === `altKey`;
    if (this.isEnabled(e206, t10)) {
      this.cleanUpActiveLinkDecoration();
      let t11 = this.getLinkOccurrence(e206.target.position);
      t11 && this.editor.changeDecorations((e207) => {
        t11.activate(e207, n10), this.activeLinkDecorationId = t11.decorationId;
      });
    } else this.cleanUpActiveLinkDecoration();
  }
  cleanUpActiveLinkDecoration() {
    let e206 = this.editor.getOption(86) === `altKey`;
    if (this.activeLinkDecorationId) {
      let t10 = this.currentOccurrences[this.activeLinkDecorationId];
      t10 && this.editor.changeDecorations((n10) => {
        t10.deactivate(n10, e206);
      }), this.activeLinkDecorationId = null;
    }
  }
  onEditorMouseUp(e206) {
    if (!this.isEnabled(e206)) return;
    let t10 = this.getLinkOccurrence(e206.target.position);
    t10 && this.openLinkOccurrence(t10, e206.hasSideBySideModifier, true);
  }
  openLinkOccurrence(e206, t10, n10 = false) {
    if (!this.openerService) return;
    let { link: r10 } = e206;
    r10.resolve(dr.None).then((e207) => {
      if (typeof e207 == `string` && this.editor.hasModel()) {
        let t11 = this.editor.getModel().uri;
        if (t11.scheme === xs.file && e207.startsWith(`${xs.file}:`)) {
          let n11 = $r.parse(e207);
          if (n11.scheme === xs.file) {
            let r11 = Nd(n11), i10 = null;
            r11.startsWith(`/./`) || r11.startsWith(`\\.\\`) ? i10 = `.${r11.substr(1)}` : (r11.startsWith(`//./`) || r11.startsWith(`\\\\.\\`)) && (i10 = `.${r11.substr(2)}`), i10 && (e207 = Rd(t11, i10));
          }
        }
      }
      return this.openerService.open(e207, { openToSide: t10, fromUserGesture: n10, allowContributedOpeners: true, allowCommands: true, fromWorkspace: true });
    }, (e207) => {
      let t11 = e207 instanceof Error ? e207.message : e207;
      t11 === `invalid` ? this.notificationService.warn(C(1277, `Failed to open this link because it is not well-formed: {0}`, r10.url.toString())) : t11 === `missing` ? this.notificationService.warn(C(1278, `Failed to open this link because its target is missing.`)) : be(e207);
    });
  }
  getLinkOccurrence(e206) {
    if (!this.editor.hasModel() || !e206) return null;
    let t10 = this.editor.getModel().getDecorationsInRange({ startLineNumber: e206.lineNumber, startColumn: e206.column, endLineNumber: e206.lineNumber, endColumn: e206.column }, 0, true);
    for (let e207 of t10) {
      let t11 = this.currentOccurrences[e207.id];
      if (t11) return t11;
    }
    return null;
  }
  isEnabled(e206, t10) {
    return !!(e206.target.type === 6 && (e206.hasTriggerModifier || t10 && t10.keyCodeIsTriggerKey || e206.isMiddleClick && e206.mouseMiddleClickAction === `openLink`));
  }
  stop() {
    this.computeLinks.cancel(), this.activeLinksList && (this.activeLinksList = (this.activeLinksList?.dispose(), null)), this.computePromise && (this.computePromise = (this.computePromise.cancel(), null));
  }
  dispose() {
    super.dispose(), this.stop();
  }
}, c5 = _Nd, _Nd.ID = `editor.linkDetector`, _Nd);
l5 = c5 = YAe([s5(1, IP), s5(2, dw), s5(3, X), s5(4, lA)], l5);
var u5 = { general: UO.register({ description: `detected-link`, stickiness: 1, collapseOnReplaceEdit: true, inlineClassName: `detected-link` }), active: UO.register({ description: `detected-link-active`, stickiness: 1, collapseOnReplaceEdit: true, inlineClassName: `detected-link-active` }) }, d5 = class e201 {
  static decoration(t10, n10) {
    return { range: t10.range, options: e201._getOptions(t10, n10, false) };
  }
  static _getOptions(e206, t10, n10) {
    let r10 = { ...n10 ? u5.active : u5.general };
    return r10.hoverMessage = XAe(e206, t10), r10;
  }
  constructor(e206, t10) {
    this.link = e206, this.decorationId = t10;
  }
  activate(t10, n10) {
    t10.changeDecorationOptions(this.decorationId, e201._getOptions(this.link, n10, true));
  }
  deactivate(t10, n10) {
    t10.changeDecorationOptions(this.decorationId, e201._getOptions(this.link, n10, false));
  }
};
function XAe(e206, t10) {
  let n10 = e206.url && /^command:/i.test(e206.url.toString()), r10 = e206.tooltip ? e206.tooltip : n10 ? C(1279, `Execute command`) : C(1280, `Follow link`), i10 = t10 ? Tt ? C(1281, `cmd + click`) : C(1282, `ctrl + click`) : Tt ? C(1283, `option + click`) : C(1284, `alt + click`);
  if (e206.url) {
    let t11 = ``;
    if (/^command:/i.test(e206.url.toString())) {
      let n11 = e206.url.toString().match(/^command:([^?#]+)/);
      if (n11) {
        let e207 = n11[1];
        t11 = C(1285, `Execute command {0}`, e207);
      }
    }
    return new PM(``, true).appendLink(e206.url.toString(true).replace(/ /g, `%20`), r10, t11).appendMarkdown(` (${i10})`);
  } else return new PM().appendText(`${r10} (${i10})`);
}
var ZAe = class extends G {
  constructor() {
    super({ id: `editor.action.openLink`, label: w(1286, `Open Link`), precondition: void 0 });
  }
  run(e206, t10) {
    let n10 = l5.get(t10);
    if (!n10 || !t10.hasModel()) return;
    let r10 = t10.getSelections();
    for (let e207 of r10) {
      let t11 = n10.getLinkOccurrence(e207.getEndPosition());
      t11 && n10.openLinkOccurrence(t11, false);
    }
  }
};
af(l5.ID, l5, 1), q(ZAe);
var f5 = (_Od = class extends D {
  constructor(e206) {
    super(), this._editor = e206, this._register(this._editor.onMouseDown((e207) => {
      let t10 = this._editor.getOption(133);
      t10 >= 0 && e207.target.type === 6 && e207.target.position.column >= t10 && this._editor.updateOptions({ stopRenderingLineAfter: -1 });
    }));
  }
}, _Od.ID = `editor.contrib.longLinesHelper`, _Od);
af(f5.ID, f5, 2);
var p5 = (_Pd = class extends D {
  constructor(e206) {
    super(), this._editor = e206;
    let t10 = WK(this._editor), n10 = t10.getOption(171);
    this._register(hc((e207) => {
      if (!n10.read(e207)) return;
      let r10 = t10.domNode.read(e207);
      if (!r10) return;
      let i10 = e207.store.add(Rc(`scrollingSession`, void 0));
      e207.store.add(this._editor.onMouseDown((e208) => {
        if (i10.read(void 0)) {
          i10.set(void 0, void 0);
          return;
        }
        if (!e208.event.middleButton) return;
        e208.event.stopPropagation(), e208.event.preventDefault();
        let t11 = new E(), n11 = new UK(e208.event.posx, e208.event.posy), a11 = QAe(Vc(r10), n11, t11).map((e209) => e209.subtract(n11).withThreshold(5)), o10 = r10.getBoundingClientRect(), s10 = new UK(n11.x - o10.left, n11.y - o10.top);
        i10.set({ mouseDeltaAfterThreshold: a11, initialMousePosInEditor: s10, didScroll: false, dispose: () => t11.dispose() }, void 0), t11.add(this._editor.onMouseUp((e209) => {
          let t12 = i10.read(void 0);
          t12 && t12.didScroll && i10.set(void 0, void 0);
        })), t11.add(this._editor.onKeyDown((e209) => {
          i10.set(void 0, void 0);
        }));
      })), e207.store.add(hc((e208) => {
        let t11 = i10.read(e208);
        if (!t11) return;
        let n11 = Date.now();
        e208.store.add(hc((e209) => {
          v4.instance.invalidateOnNextAnimationFrame(e209);
          let r11 = Date.now(), i11 = r11 - n11;
          n11 = r11;
          let a12 = t11.mouseDeltaAfterThreshold.read(void 0), o10 = i11 / 32, s10 = a12.scale(o10), c10 = new UK(this._editor.getScrollLeft(), this._editor.getScrollTop());
          this._editor.setScrollPosition($Ae(c10.add(s10))), s10.isZero() || (t11.didScroll = true);
        }));
        let a11 = I((e209) => {
          let n12 = t11.mouseDeltaAfterThreshold.read(e209), r11 = ``;
          return r11 += n12.y < 0 ? `n` : n12.y > 0 ? `s` : ``, r11 += n12.x < 0 ? `w` : n12.x > 0 ? `e` : ``, r11;
        });
        e208.store.add(hc((e209) => {
          r10.setAttribute(`data-scroll-direction`, a11.read(e209));
        }));
      }));
      let a10 = e207.store.add(au.div({ class: [`scroll-editor-on-middle-click-dot`, i10.map((e208) => e208 ? `` : `hidden`)], style: { left: i10.map((e208) => e208 ? e208.initialMousePosInEditor.x : 0), top: i10.map((e208) => e208 ? e208.initialMousePosInEditor.y : 0) } }).toDisposableLiveElement());
      e207.store.add(RG(r10, a10.element)), e207.store.add(hc((e208) => {
        let t11 = i10.read(e208);
        r10.classList.toggle(`scroll-editor-on-middle-click-editor`, !!t11);
      }));
    }));
  }
}, _Pd.ID = `editor.contrib.middleScroll`, _Pd);
function QAe(e206, t10, n10) {
  let r10 = Ic(`pos`, t10);
  return n10.add(L(e206, `mousemove`, (e207) => {
    r10.set(new UK(e207.pageX, e207.pageY), void 0);
  })), r10;
}
function $Ae(e206) {
  return { scrollLeft: e206.x, scrollTop: e206.y };
}
af(p5.ID, p5, 2);
var eje = Q(`editor.wordHighlightBackground`, { dark: `#575757B8`, light: `#57575740`, hcDark: null, hcLight: null }, C(1563, `Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations.`), true);
Q(`editor.wordHighlightStrongBackground`, { dark: `#004972B8`, light: `#0e639c40`, hcDark: null, hcLight: null }, C(1564, `Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations.`), true), Q(`editor.wordHighlightTextBackground`, eje, C(1565, `Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations.`), true);
var tje = Q(`editor.wordHighlightBorder`, { light: null, dark: null, hcDark: J_, hcLight: J_ }, C(1566, `Border color of a symbol during read-access, like reading a variable.`));
Q(`editor.wordHighlightStrongBorder`, { light: null, dark: null, hcDark: J_, hcLight: J_ }, C(1567, `Border color of a symbol during write-access, like writing to a variable.`)), Q(`editor.wordHighlightTextBorder`, tje, C(1568, `Border color of a textual occurrence for a symbol.`));
var nje = Q(`editorOverviewRuler.wordHighlightForeground`, `#A0A0A0CC`, C(1569, `Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations.`), true), rje = Q(`editorOverviewRuler.wordHighlightStrongForeground`, `#C0A0C0CC`, C(1570, `Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations.`), true), ije = Q(`editorOverviewRuler.wordHighlightTextForeground`, sy, C(1571, `Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations.`), true), aje = UO.register({ description: `word-highlight-strong`, stickiness: 1, className: `wordHighlightStrong`, overviewRuler: { color: WS(rje), position: Qp.Center }, minimap: { color: WS(fy), position: 1 } }), oje = UO.register({ description: `word-highlight-text`, stickiness: 1, className: `wordHighlightText`, overviewRuler: { color: WS(ije), position: Qp.Center }, minimap: { color: WS(fy), position: 1 } }), sje = UO.register({ description: `selection-highlight-overview`, stickiness: 1, className: `selectionHighlight`, overviewRuler: { color: WS(sy), position: Qp.Center }, minimap: { color: WS(fy), position: 1 } }), cje = UO.register({ description: `selection-highlight`, stickiness: 1, className: `selectionHighlight` }), lje = UO.register({ description: `word-highlight`, stickiness: 1, className: `wordHighlight`, overviewRuler: { color: WS(nje), position: Qp.Center }, minimap: { color: WS(fy), position: 1 } });
function uje(e206) {
  return e206 === Ci.Write ? aje : e206 === Ci.Text ? oje : lje;
}
function dje(e206) {
  return e206 ? cje : sje;
}
JS((e206, t10) => {
  let n10 = e206.getColor(bv);
  n10 && t10.addRule(`.monaco-editor .selectionHighlight { background-color: ${n10.transparent(0.5)}; }`);
});
var fje = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, pje = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, m5;
function h5(e206, t10) {
  let n10 = t10.filter((t11) => !e206.find((e207) => e207.equals(t11)));
  if (n10.length >= 1) {
    let e207 = n10.map((e208) => `line ${e208.viewState.position.lineNumber} column ${e208.viewState.position.column}`).join(`, `);
    Gg(n10.length === 1 ? C(1288, `Cursor added: {0}`, e207) : C(1289, `Cursors added: {0}`, e207));
  }
}
var mje = class extends G {
  constructor() {
    super({ id: `editor.action.insertCursorAbove`, label: w(1298, `Add Cursor Above`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 2576, linux: { primary: 1552, secondary: [3088] }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `3_multi`, title: C(1290, `&&Add Cursor Above`), order: 2 } });
  }
  run(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = true;
    n10 && n10.logicalLine === false && (r10 = false);
    let i10 = t10._getViewModel();
    if (i10.cursorConfig.readOnly) return;
    i10.model.pushStackElement();
    let a10 = i10.getCursorStates();
    i10.setCursorStates(n10.source, 3, Yx.addCursorUp(i10, a10, r10)), i10.revealTopMostCursor(n10.source), h5(a10, i10.getCursorStates());
  }
}, hje = class extends G {
  constructor() {
    super({ id: `editor.action.insertCursorBelow`, label: w(1299, `Add Cursor Below`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 2578, linux: { primary: 1554, secondary: [3090] }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `3_multi`, title: C(1291, `A&&dd Cursor Below`), order: 3 } });
  }
  run(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = true;
    n10 && n10.logicalLine === false && (r10 = false);
    let i10 = t10._getViewModel();
    if (i10.cursorConfig.readOnly) return;
    i10.model.pushStackElement();
    let a10 = i10.getCursorStates();
    i10.setCursorStates(n10.source, 3, Yx.addCursorDown(i10, a10, r10)), i10.revealBottomMostCursor(n10.source), h5(a10, i10.getCursorStates());
  }
}, gje = class extends G {
  constructor() {
    super({ id: `editor.action.insertCursorAtEndOfEachLineSelected`, label: w(1300, `Add Cursors to Line Ends`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 1575, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `3_multi`, title: C(1292, `Add C&&ursors to Line Ends`), order: 4 } });
  }
  getCursorsForSelection(e206, t10, n10) {
    if (!e206.isEmpty()) {
      for (let r10 = e206.startLineNumber; r10 < e206.endLineNumber; r10++) {
        let e207 = t10.getLineMaxColumn(r10);
        n10.push(new N(r10, e207, r10, e207));
      }
      e206.endColumn > 1 && n10.push(new N(e206.endLineNumber, e206.endColumn, e206.endLineNumber, e206.endColumn));
    }
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getModel(), r10 = t10.getSelections(), i10 = t10._getViewModel(), a10 = i10.getCursorStates(), o10 = [];
    r10.forEach((e207) => this.getCursorsForSelection(e207, n10, o10)), o10.length > 0 && t10.setSelections(o10), h5(a10, i10.getCursorStates());
  }
}, _je = class extends G {
  constructor() {
    super({ id: `editor.action.addCursorsToBottom`, label: w(1301, `Add Cursors to Bottom`), precondition: void 0 });
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getSelections(), r10 = t10.getModel().getLineCount(), i10 = [];
    for (let e207 = n10[0].startLineNumber; e207 <= r10; e207++) i10.push(new N(e207, n10[0].startColumn, e207, n10[0].endColumn));
    let a10 = t10._getViewModel(), o10 = a10.getCursorStates();
    i10.length > 0 && t10.setSelections(i10), h5(o10, a10.getCursorStates());
  }
}, vje = class extends G {
  constructor() {
    super({ id: `editor.action.addCursorsToTop`, label: w(1302, `Add Cursors to Top`), precondition: void 0 });
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getSelections(), r10 = [];
    for (let e207 = n10[0].startLineNumber; e207 >= 1; e207--) r10.push(new N(e207, n10[0].startColumn, e207, n10[0].endColumn));
    let i10 = t10._getViewModel(), a10 = i10.getCursorStates();
    r10.length > 0 && t10.setSelections(r10), h5(a10, i10.getCursorStates());
  }
}, g5 = class {
  constructor(e206, t10, n10) {
    this.selections = e206, this.revealRange = t10, this.revealScrollType = n10;
  }
}, _5 = class e202 {
  static create(t10, n10) {
    if (!t10.hasModel()) return null;
    let r10 = n10.getState();
    if (!t10.hasTextFocus() && r10.isRevealed && r10.searchString.length > 0) return new e202(t10, n10, false, r10.searchString, r10.wholeWord, r10.matchCase, null);
    let i10 = false, a10, o10, s10 = t10.getSelections();
    s10.length === 1 && s10[0].isEmpty() ? (i10 = true, a10 = true, o10 = true) : (a10 = r10.wholeWord, o10 = r10.matchCase);
    let c10 = t10.getSelection(), l10, u10 = null;
    if (c10.isEmpty()) {
      let e206 = t10.getConfiguredWordAtPosition(c10.getStartPosition());
      if (!e206) return null;
      l10 = e206.word, u10 = new N(c10.startLineNumber, e206.startColumn, c10.startLineNumber, e206.endColumn);
    } else l10 = t10.getModel().getValueInRange(c10).replace(/\r\n/g, `
`);
    return new e202(t10, n10, i10, l10, a10, o10, u10);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this._editor = e206, this.findController = t10, this.isDisconnectedFromFindController = n10, this.searchText = r10, this.wholeWord = i10, this.matchCase = a10, this.currentMatch = o10;
  }
  addSelectionToNextFindMatch() {
    if (!this._editor.hasModel()) return null;
    let e206 = this._getNextMatch();
    return e206 ? new g5(this._editor.getSelections().concat(e206), e206, 0) : null;
  }
  moveSelectionToNextFindMatch() {
    if (!this._editor.hasModel()) return null;
    let e206 = this._getNextMatch();
    if (!e206) return null;
    let t10 = this._editor.getSelections();
    return new g5(t10.slice(0, t10.length - 1).concat(e206), e206, 0);
  }
  _getNextMatch() {
    if (!this._editor.hasModel()) return null;
    if (this.currentMatch) {
      let e207 = this.currentMatch;
      return this.currentMatch = null, e207;
    }
    this.findController.highlightFindOptions();
    let e206 = this._editor.getSelections(), t10 = e206[e206.length - 1], n10 = this._editor.getModel().findNextMatch(this.searchText, t10.getEndPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption(148) : null, false);
    return n10 ? new N(n10.range.startLineNumber, n10.range.startColumn, n10.range.endLineNumber, n10.range.endColumn) : null;
  }
  addSelectionToPreviousFindMatch() {
    if (!this._editor.hasModel()) return null;
    let e206 = this._getPreviousMatch();
    return e206 ? new g5(this._editor.getSelections().concat(e206), e206, 0) : null;
  }
  moveSelectionToPreviousFindMatch() {
    if (!this._editor.hasModel()) return null;
    let e206 = this._getPreviousMatch();
    if (!e206) return null;
    let t10 = this._editor.getSelections();
    return new g5(t10.slice(0, t10.length - 1).concat(e206), e206, 0);
  }
  _getPreviousMatch() {
    if (!this._editor.hasModel()) return null;
    if (this.currentMatch) {
      let e207 = this.currentMatch;
      return this.currentMatch = null, e207;
    }
    this.findController.highlightFindOptions();
    let e206 = this._editor.getSelections(), t10 = e206[e206.length - 1], n10 = this._editor.getModel().findPreviousMatch(this.searchText, t10.getStartPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption(148) : null, false);
    return n10 ? new N(n10.range.startLineNumber, n10.range.startColumn, n10.range.endLineNumber, n10.range.endColumn) : null;
  }
  selectAll(e206) {
    if (!this._editor.hasModel()) return [];
    this.findController.highlightFindOptions();
    let t10 = this._editor.getModel();
    return e206 ? t10.findMatches(this.searchText, e206, false, this.matchCase, this.wholeWord ? this._editor.getOption(148) : null, false, 1073741824) : t10.findMatches(this.searchText, true, false, this.matchCase, this.wholeWord ? this._editor.getOption(148) : null, false, 1073741824);
  }
}, v5 = (_Qd = class extends D {
  static get(t10) {
    return t10.getContribution(_Qd.ID);
  }
  constructor(e206) {
    super(), this._sessionDispose = this._register(new E()), this._editor = e206, this._ignoreSelectionChange = false, this._session = null;
  }
  dispose() {
    this._endSession(), super.dispose();
  }
  _beginSessionIfNeeded(e206) {
    if (!this._session) {
      let t10 = _5.create(this._editor, e206);
      if (!t10) return;
      this._session = t10;
      let n10 = { searchString: this._session.searchText };
      this._session.isDisconnectedFromFindController && (n10.wholeWordOverride = 1, n10.matchCaseOverride = 1, n10.isRegexOverride = 2), e206.getState().change(n10, false), this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e207) => {
        this._ignoreSelectionChange || this._endSession();
      })), this._sessionDispose.add(this._editor.onDidBlurEditorText(() => {
        this._endSession();
      })), this._sessionDispose.add(e206.getState().onFindReplaceStateChange((e207) => {
        (e207.matchCase || e207.wholeWord) && this._endSession();
      }));
    }
  }
  _endSession() {
    this._sessionDispose.clear(), this._session && this._session.isDisconnectedFromFindController && this._session.findController.getState().change({ wholeWordOverride: 0, matchCaseOverride: 0, isRegexOverride: 0 }, false), this._session = null;
  }
  _setSelections(e206) {
    this._ignoreSelectionChange = true, this._editor.setSelections(e206), this._ignoreSelectionChange = false;
  }
  _expandEmptyToWord(e206, t10) {
    if (!t10.isEmpty()) return t10;
    let n10 = this._editor.getConfiguredWordAtPosition(t10.getStartPosition());
    return n10 ? new N(t10.startLineNumber, n10.startColumn, t10.startLineNumber, n10.endColumn) : t10;
  }
  _applySessionResult(e206) {
    e206 && (this._setSelections(e206.selections), e206.revealRange && this._editor.revealRangeInCenterIfOutsideViewport(e206.revealRange, e206.revealScrollType));
  }
  getSession(e206) {
    return this._session;
  }
  addSelectionToNextFindMatch(e206) {
    if (this._editor.hasModel()) {
      if (!this._session) {
        let t10 = this._editor.getSelections();
        if (t10.length > 1) {
          let n10 = e206.getState().matchCase;
          if (!x5(this._editor.getModel(), t10, n10)) {
            let e207 = this._editor.getModel(), n11 = [];
            for (let r10 = 0, i10 = t10.length; r10 < i10; r10++) n11[r10] = this._expandEmptyToWord(e207, t10[r10]);
            this._editor.setSelections(n11);
            return;
          }
        }
      }
      this._beginSessionIfNeeded(e206), this._session && this._applySessionResult(this._session.addSelectionToNextFindMatch());
    }
  }
  addSelectionToPreviousFindMatch(e206) {
    this._beginSessionIfNeeded(e206), this._session && this._applySessionResult(this._session.addSelectionToPreviousFindMatch());
  }
  moveSelectionToNextFindMatch(e206) {
    this._beginSessionIfNeeded(e206), this._session && this._applySessionResult(this._session.moveSelectionToNextFindMatch());
  }
  moveSelectionToPreviousFindMatch(e206) {
    this._beginSessionIfNeeded(e206), this._session && this._applySessionResult(this._session.moveSelectionToPreviousFindMatch());
  }
  selectAll(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = null, n10 = e206.getState();
    if (n10.isRevealed && n10.searchString.length > 0 && n10.isRegex) {
      let e207 = this._editor.getModel();
      t10 = n10.searchScope ? e207.findMatches(n10.searchString, n10.searchScope, n10.isRegex, n10.matchCase, n10.wholeWord ? this._editor.getOption(148) : null, false, 1073741824) : e207.findMatches(n10.searchString, true, n10.isRegex, n10.matchCase, n10.wholeWord ? this._editor.getOption(148) : null, false, 1073741824);
    } else {
      if (this._beginSessionIfNeeded(e206), !this._session) return;
      t10 = this._session.selectAll(n10.searchScope);
    }
    if (t10.length > 0) {
      let e207 = this._editor.getSelection();
      for (let n11 = 0, r10 = t10.length; n11 < r10; n11++) {
        let r11 = t10[n11];
        if (r11.range.intersectRanges(e207)) {
          t10[n11] = t10[0], t10[0] = r11;
          break;
        }
      }
      this._setSelections(t10.map((e208) => new N(e208.range.startLineNumber, e208.range.startColumn, e208.range.endLineNumber, e208.range.endColumn)));
    }
  }
}, _Qd.ID = `editor.contrib.multiCursorController`, _Qd), y5 = class extends G {
  run(e206, t10) {
    let n10 = v5.get(t10);
    if (!n10) return;
    let r10 = t10._getViewModel();
    if (r10) {
      let i10 = r10.getCursorStates(), a10 = x0.get(t10);
      if (a10) this._run(n10, a10);
      else {
        let r11 = e206.get(V).createInstance(x0, t10);
        this._run(n10, r11), r11.dispose();
      }
      h5(i10, r10.getCursorStates());
    }
  }
}, yje = class extends y5 {
  constructor() {
    super({ id: `editor.action.addSelectionToNextFindMatch`, label: w(1303, `Add Selection to Next Find Match`), precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 2082, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `3_multi`, title: C(1293, `Add &&Next Occurrence`), order: 5 } });
  }
  _run(e206, t10) {
    e206.addSelectionToNextFindMatch(t10);
  }
}, bje = class extends y5 {
  constructor() {
    super({ id: `editor.action.addSelectionToPreviousFindMatch`, label: w(1304, `Add Selection to Previous Find Match`), precondition: void 0, menuOpts: { menuId: W.MenubarSelectionMenu, group: `3_multi`, title: C(1294, `Add P&&revious Occurrence`), order: 6 } });
  }
  _run(e206, t10) {
    e206.addSelectionToPreviousFindMatch(t10);
  }
}, xje = class extends y5 {
  constructor() {
    super({ id: `editor.action.moveSelectionToNextFindMatch`, label: w(1305, `Move Last Selection to Next Find Match`), precondition: void 0, kbOpts: { kbExpr: $.focus, primary: Sr(2089, 2082), weight: 100 } });
  }
  _run(e206, t10) {
    e206.moveSelectionToNextFindMatch(t10);
  }
}, Sje = class extends y5 {
  constructor() {
    super({ id: `editor.action.moveSelectionToPreviousFindMatch`, label: w(1306, `Move Last Selection to Previous Find Match`), precondition: void 0 });
  }
  _run(e206, t10) {
    e206.moveSelectionToPreviousFindMatch(t10);
  }
}, Cje = class extends y5 {
  constructor() {
    super({ id: `editor.action.selectHighlights`, label: w(1307, `Select All Occurrences of Find Match`), precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 3114, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `3_multi`, title: C(1295, `Select All &&Occurrences`), order: 7 } });
  }
  _run(e206, t10) {
    e206.selectAll(t10);
  }
}, wje = class extends y5 {
  constructor() {
    super({ id: `editor.action.changeAll`, label: w(1308, `Change All Occurrences`), precondition: H.and($.writable, $.editorTextFocus), kbOpts: { kbExpr: $.editorTextFocus, primary: 2108, weight: 100 }, contextMenuOpts: { group: `1_modification`, order: 1.2 } });
  }
  _run(e206, t10) {
    e206.selectAll(t10);
  }
}, Tje = class {
  constructor(e206, t10, n10, r10, i10) {
    this._model = e206, this._searchText = t10, this._matchCase = n10, this._wordSeparators = r10, this._cachedFindMatches = null, this._modelVersionId = this._model.getVersionId(), i10 && this._model === i10._model && this._searchText === i10._searchText && this._matchCase === i10._matchCase && this._wordSeparators === i10._wordSeparators && this._modelVersionId === i10._modelVersionId && (this._cachedFindMatches = i10._cachedFindMatches);
  }
  findMatches() {
    return this._cachedFindMatches === null && (this._cachedFindMatches = this._model.findMatches(this._searchText, true, false, this._matchCase, this._wordSeparators, false).map((e206) => e206.range), this._cachedFindMatches.sort(M.compareRangesUsingStarts)), this._cachedFindMatches;
  }
}, b5 = (_Rd = class extends D {
  constructor(e206, t10) {
    super(), this._languageFeaturesService = t10, this.editor = e206, this._isEnabled = e206.getOption(122), this._isEnabledMultiline = e206.getOption(124), this._maxLength = e206.getOption(123), this._decorations = e206.createDecorationsCollection(), this.updateSoon = this._register(new us(() => this._update(), 300)), this.state = null, this._register(e206.onDidChangeConfiguration((t11) => {
      this._isEnabled = e206.getOption(122), this._isEnabledMultiline = e206.getOption(124), this._maxLength = e206.getOption(123);
    })), this._register(e206.onDidChangeCursorSelection((e207) => {
      this._isEnabled && (e207.selection.isEmpty() ? e207.reason === 3 ? (this.state && this._setState(null), this.updateSoon.schedule()) : this._setState(null) : this._update());
    })), this._register(e206.onDidChangeModel((e207) => {
      this._setState(null);
    })), this._register(e206.onDidChangeModelContent((e207) => {
      this._isEnabled && this.updateSoon.schedule();
    }));
    let n10 = x0.get(e206);
    n10 && this._register(n10.getState().onFindReplaceStateChange((e207) => {
      this._update();
    })), this.updateSoon.schedule();
  }
  _update() {
    this._setState(m5._createState(this.state, this._isEnabled, this._isEnabledMultiline, this._maxLength, this.editor));
  }
  static _createState(e206, t10, n10, r10, i10) {
    if (!t10 || !i10.hasModel()) return null;
    if (!n10) {
      let e207 = i10.getSelection();
      if (e207.startLineNumber !== e207.endLineNumber) return null;
    }
    let a10 = v5.get(i10);
    if (!a10) return null;
    let o10 = x0.get(i10);
    if (!o10) return null;
    let s10 = a10.getSession(o10);
    if (!s10) {
      let e207 = i10.getSelections();
      if (e207.length > 1) {
        let t11 = o10.getState().matchCase;
        if (!x5(i10.getModel(), e207, t11)) return null;
      }
      s10 = _5.create(i10, o10);
    }
    if (!s10 || s10.currentMatch || /^[ \t]+$/.test(s10.searchText) || r10 > 0 && s10.searchText.length > r10) return null;
    let c10 = o10.getState(), l10 = c10.matchCase;
    if (c10.isRevealed) {
      let e207 = c10.searchString;
      l10 || (e207 = e207.toLowerCase());
      let t11 = s10.searchText;
      if (l10 || (t11 = t11.toLowerCase()), e207 === t11 && s10.matchCase === c10.matchCase && s10.wholeWord === c10.wholeWord && !c10.isRegex) return null;
    }
    return new Tje(i10.getModel(), s10.searchText, s10.matchCase, s10.wholeWord ? i10.getOption(148) : null, e206);
  }
  _setState(e206) {
    if (this.state = e206, !this.state) {
      this._decorations.clear();
      return;
    }
    if (!this.editor.hasModel()) return;
    let t10 = this.editor.getModel();
    if (t10.isTooLargeForTokenization()) return;
    let n10 = this.state.findMatches(), r10 = this.editor.getSelections();
    r10.sort(M.compareRangesUsingStarts);
    let i10 = [];
    for (let e207 = 0, t11 = 0, a11 = n10.length, o11 = r10.length; e207 < a11; ) {
      let a12 = n10[e207];
      if (t11 >= o11) i10.push(a12), e207++;
      else {
        let n11 = M.compareRangesUsingStarts(a12, r10[t11]);
        n11 < 0 ? ((r10[t11].isEmpty() || !M.areIntersecting(a12, r10[t11])) && i10.push(a12), e207++) : (n11 > 0 || e207++, t11++);
      }
    }
    let a10 = this.editor.getOption(90) !== `off`, o10 = this._languageFeaturesService.documentHighlightProvider.has(t10) && a10, s10 = i10.map((e207) => ({ range: e207, options: dje(o10) }));
    this._decorations.set(s10);
  }
  dispose() {
    this._setState(null), super.dispose();
  }
}, m5 = _Rd, _Rd.ID = `editor.contrib.selectionHighlighter`, _Rd);
b5 = m5 = fje([pje(1, X)], b5);
function x5(e206, t10, n10) {
  let r10 = S5(e206, t10[0], !n10);
  for (let i10 = 1, a10 = t10.length; i10 < a10; i10++) {
    let a11 = t10[i10];
    if (a11.isEmpty() || r10 !== S5(e206, a11, !n10)) return false;
  }
  return true;
}
function S5(e206, t10, n10) {
  let r10 = e206.getValueInRange(t10);
  return n10 ? r10.toLowerCase() : r10;
}
var Eje = class extends G {
  constructor() {
    super({ id: `editor.action.focusNextCursor`, label: w(1309, `Focus Next Cursor`), metadata: { description: C(1296, `Focuses the next cursor`), args: [] }, precondition: void 0 });
  }
  run(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = t10._getViewModel();
    if (r10.cursorConfig.readOnly) return;
    r10.model.pushStackElement();
    let i10 = Array.from(r10.getCursorStates()), a10 = i10.shift();
    a10 && (i10.push(a10), r10.setCursorStates(n10.source, 3, i10), r10.revealPrimaryCursor(n10.source, true), h5(i10, r10.getCursorStates()));
  }
}, Dje = class extends G {
  constructor() {
    super({ id: `editor.action.focusPreviousCursor`, label: w(1310, `Focus Previous Cursor`), metadata: { description: C(1297, `Focuses the previous cursor`), args: [] }, precondition: void 0 });
  }
  run(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = t10._getViewModel();
    if (r10.cursorConfig.readOnly) return;
    r10.model.pushStackElement();
    let i10 = Array.from(r10.getCursorStates()), a10 = i10.pop();
    a10 && (i10.unshift(a10), r10.setCursorStates(n10.source, 3, i10), r10.revealPrimaryCursor(n10.source, true), h5(i10, r10.getCursorStates()));
  }
};
af(v5.ID, v5, 4), af(b5.ID, b5, 1), q(mje), q(hje), q(gje), q(yje), q(bje), q(xje), q(Sje), q(Cje), q(wje), q(_je), q(vje), q(Eje), q(Dje);
var C5 = { Visible: new U(`parameterHintsVisible`, false), MultipleSignatures: new U(`parameterHintsMultipleSignatures`, false) };
async function w5(e206, t10, n10, r10, i10) {
  let a10 = e206.ordered(t10);
  for (let e207 of a10) try {
    let a11 = await e207.provideSignatureHelp(t10, n10, i10, r10);
    if (a11) return a11;
  } catch (e208) {
    xe(e208);
  }
}
Nu.registerCommand(`_executeSignatureHelpProvider`, async (e206, ...t10) => {
  let [n10, r10, i10] = t10;
  Je($r.isUri(n10)), Je(j.isIPosition(r10)), Je(typeof i10 == `string` || !i10);
  let a10 = e206.get(X), o10 = await e206.get(wu).createModelReference(n10);
  try {
    let e207 = await w5(a10.signatureHelpProvider, o10.object.textEditorModel, j.lift(r10), { triggerKind: Si.Invoke, isRetrigger: false, triggerCharacter: i10 }, dr.None);
    return e207 ? (setTimeout(() => e207.dispose(), 0), e207.value) : void 0;
  } finally {
    o10.dispose();
  }
});
var T5;
(function(e206) {
  e206.Default = { type: 0 };
  class t10 {
    constructor(e207, t11) {
      this.request = e207, this.previouslyActiveHints = t11, this.type = 2;
    }
  }
  e206.Pending = t10;
  class n10 {
    constructor(e207) {
      this.hints = e207, this.type = 1;
    }
  }
  e206.Active = n10;
})(T5 || (T5 = {}));
var Oje = (_Sd = class extends D {
  constructor(t10, n10, r10 = _Sd.DEFAULT_DELAY) {
    super(), this._onChangedHints = this._register(new k()), this.onChangedHints = this._onChangedHints.event, this.triggerOnType = false, this._state = T5.Default, this._pendingTriggers = [], this._lastSignatureHelpResult = this._register(new Jt()), this.triggerChars = new Rp(), this.retriggerChars = new Rp(), this.triggerId = 0, this.editor = t10, this.providers = n10, this.throttledDelayer = new ns(r10), this._register(this.editor.onDidBlurEditorWidget(() => this.cancel())), this._register(this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange())), this._register(this.editor.onDidChangeModel((e206) => this.onModelChanged())), this._register(this.editor.onDidChangeModelLanguage((e206) => this.onModelChanged())), this._register(this.editor.onDidChangeCursorSelection((e206) => this.onCursorChange(e206))), this._register(this.editor.onDidChangeModelContent((e206) => this.onModelContentChange())), this._register(this.providers.onDidChange(this.onModelChanged, this)), this._register(this.editor.onDidType((e206) => this.onDidType(e206))), this.onEditorConfigurationChange(), this.onModelChanged();
  }
  get state() {
    return this._state;
  }
  set state(e206) {
    this._state.type === 2 && this._state.request.cancel(), this._state = e206;
  }
  cancel(e206 = false) {
    this.state = T5.Default, this.throttledDelayer.cancel(), e206 || this._onChangedHints.fire(void 0);
  }
  trigger(e206, t10) {
    let n10 = this.editor.getModel();
    if (!n10 || !this.providers.has(n10)) return;
    let r10 = ++this.triggerId;
    this._pendingTriggers.push(e206), this.throttledDelayer.trigger(() => this.doTrigger(r10), t10).catch(be);
  }
  next() {
    if (this.state.type !== 1) return;
    let e206 = this.state.hints.signatures.length, t10 = this.state.hints.activeSignature, n10 = t10 % e206 === e206 - 1, r10 = this.editor.getOption(98).cycle;
    if ((e206 < 2 || n10) && !r10) {
      this.cancel();
      return;
    }
    this.updateActiveSignature(n10 && r10 ? 0 : t10 + 1);
  }
  previous() {
    if (this.state.type !== 1) return;
    let e206 = this.state.hints.signatures.length, t10 = this.state.hints.activeSignature, n10 = t10 === 0, r10 = this.editor.getOption(98).cycle;
    if ((e206 < 2 || n10) && !r10) {
      this.cancel();
      return;
    }
    this.updateActiveSignature(n10 && r10 ? e206 - 1 : t10 - 1);
  }
  updateActiveSignature(e206) {
    this.state.type === 1 && (this.state = new T5.Active({ ...this.state.hints, activeSignature: e206 }), this._onChangedHints.fire(this.state.hints));
  }
  async doTrigger(e206) {
    let t10 = this.state.type === 1 || this.state.type === 2, n10 = this.getLastActiveHints();
    if (this.cancel(true), this._pendingTriggers.length === 0) return false;
    let r10 = this._pendingTriggers.reduce(kje);
    this._pendingTriggers = [];
    let i10 = { triggerKind: r10.triggerKind, triggerCharacter: r10.triggerCharacter, isRetrigger: t10, activeSignatureHelp: n10 };
    if (!this.editor.hasModel()) return false;
    let a10 = this.editor.getModel(), o10 = this.editor.getPosition();
    this.state = new T5.Pending(es((e207) => w5(this.providers, a10, o10, i10, e207)), n10);
    try {
      let t11 = await this.state.request;
      return e206 === this.triggerId ? !t11 || !t11.value.signatures || t11.value.signatures.length === 0 ? (t11?.dispose(), this._lastSignatureHelpResult.clear(), this.cancel(), false) : (this.state = new T5.Active(t11.value), this._lastSignatureHelpResult.value = t11, this._onChangedHints.fire(this.state.hints), true) : (t11?.dispose(), false);
    } catch (t11) {
      return e206 === this.triggerId && (this.state = T5.Default), be(t11), false;
    }
  }
  getLastActiveHints() {
    switch (this.state.type) {
      case 1:
        return this.state.hints;
      case 2:
        return this.state.previouslyActiveHints;
      default:
        return;
    }
  }
  get isTriggered() {
    return this.state.type === 1 || this.state.type === 2 || this.throttledDelayer.isTriggered();
  }
  onModelChanged() {
    this.cancel(), this.triggerChars.clear(), this.retriggerChars.clear();
    let e206 = this.editor.getModel();
    if (e206) for (let t10 of this.providers.ordered(e206)) {
      for (let e207 of t10.signatureHelpTriggerCharacters || []) if (e207.length) {
        let t11 = e207.charCodeAt(0);
        this.triggerChars.add(t11), this.retriggerChars.add(t11);
      }
      for (let e207 of t10.signatureHelpRetriggerCharacters || []) e207.length && this.retriggerChars.add(e207.charCodeAt(0));
    }
  }
  onDidType(e206) {
    if (!this.triggerOnType) return;
    let t10 = e206.length - 1, n10 = e206.charCodeAt(t10);
    (this.triggerChars.has(n10) || this.isTriggered && this.retriggerChars.has(n10)) && this.trigger({ triggerKind: Si.TriggerCharacter, triggerCharacter: e206.charAt(t10) });
  }
  onCursorChange(e206) {
    e206.source === `mouse` ? this.cancel() : this.isTriggered && this.trigger({ triggerKind: Si.ContentChange });
  }
  onModelContentChange() {
    this.isTriggered && this.trigger({ triggerKind: Si.ContentChange });
  }
  onEditorConfigurationChange() {
    this.triggerOnType = this.editor.getOption(98).enabled, this.triggerOnType || this.cancel();
  }
  dispose() {
    this.cancel(true), super.dispose();
  }
}, _Sd.DEFAULT_DELAY = 120, _Sd);
function kje(e206, t10) {
  switch (t10.triggerKind) {
    case Si.Invoke:
      return t10;
    case Si.ContentChange:
      return e206;
    case Si.TriggerCharacter:
    default:
      return t10;
  }
}
var Aje = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, E5 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, D5, O5 = B, jje = AU(`parameter-hints-next`, F.chevronDown, C(1312, `Icon for show next parameter hint.`)), Mje = AU(`parameter-hints-previous`, F.chevronUp, C(1313, `Icon for show previous parameter hint.`)), k5 = (_Td = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this.editor = e206, this.model = t10, this.markdownRendererService = r10, this.renderDisposeables = this._register(new E()), this.visible = false, this.announcedLabel = null, this.allowEditorOverflow = true, this.keyVisible = C5.Visible.bindTo(n10), this.keyMultipleSignatures = C5.MultipleSignatures.bindTo(n10);
  }
  createParameterHintDOMNodes() {
    let e206 = O5(`.editor-widget.parameter-hints-widget`), t10 = z(e206, O5(`.phwrapper`));
    t10.tabIndex = -1;
    let n10 = z(t10, O5(`.controls`)), r10 = z(n10, O5(`.button` + ju.asCSSSelector(Mje))), i10 = z(n10, O5(`.overloads`)), a10 = z(n10, O5(`.button` + ju.asCSSSelector(jje)));
    this._register(L(r10, `click`, (e207) => {
      Vl.stop(e207), this.previous();
    })), this._register(L(a10, `click`, (e207) => {
      Vl.stop(e207), this.next();
    }));
    let o10 = O5(`.body`), s10 = new hx(o10, { alwaysConsumeMouseWheel: true });
    this._register(s10), t10.appendChild(s10.getDomNode());
    let c10 = z(o10, O5(`.signature`)), l10 = z(o10, O5(`.docs`));
    e206.style.userSelect = `text`, this.domNodes = { element: e206, signature: c10, overloads: i10, docs: l10, scrollbar: s10 }, this.editor.addContentWidget(this), this.hide(), this._register(this.editor.onDidChangeCursorSelection((e207) => {
      this.visible && this.editor.layoutContentWidget(this);
    }));
    let u10 = () => {
      if (!this.domNodes) return;
      let e207 = this.editor.getOption(59), t11 = this.domNodes.element;
      t11.style.fontSize = `${e207.fontSize}px`, t11.style.lineHeight = `${e207.lineHeight / e207.fontSize}`, t11.style.setProperty(`--vscode-parameterHintsWidget-editorFontFamily`, e207.fontFamily), t11.style.setProperty(`--vscode-parameterHintsWidget-editorFontFamilyDefault`, _n.fontFamily);
    };
    u10(), this._register(O.chain(this.editor.onDidChangeConfiguration.bind(this.editor), (e207) => e207.filter((e208) => e208.hasChanged(59)))(u10)), this._register(this.editor.onDidLayoutChange((e207) => this.updateMaxHeight())), this.updateMaxHeight();
  }
  show() {
    this.visible || (this.domNodes || this.createParameterHintDOMNodes(), this.keyVisible.set(true), this.visible = true, setTimeout(() => {
      this.domNodes?.element.classList.add(`visible`);
    }, 100), this.editor.layoutContentWidget(this));
  }
  hide() {
    this.renderDisposeables.clear(), this.visible && (this.keyVisible.reset(), this.visible = false, this.announcedLabel = null, this.domNodes?.element.classList.remove(`visible`), this.editor.layoutContentWidget(this));
  }
  getPosition() {
    return this.visible ? { position: this.editor.getPosition(), preference: [1, 2] } : null;
  }
  render(e206) {
    if (this.renderDisposeables.clear(), !this.domNodes) return;
    let t10 = e206.signatures.length > 1;
    this.domNodes.element.classList.toggle(`multiple`, t10), this.keyMultipleSignatures.set(t10), this.domNodes.signature.innerText = ``, this.domNodes.docs.innerText = ``;
    let n10 = e206.signatures[e206.activeSignature];
    if (!n10) return;
    let r10 = z(this.domNodes.signature, O5(`.code`)), i10 = n10.parameters.length > 0, a10 = n10.activeParameter ?? e206.activeParameter;
    if (i10) this.renderParameters(r10, n10, a10);
    else {
      let e207 = z(r10, O5(`span`));
      e207.textContent = n10.label;
    }
    let o10 = n10.parameters[a10];
    if (o10?.documentation) {
      let e207 = O5(`span.documentation`);
      if (typeof o10.documentation == `string`) e207.textContent = o10.documentation;
      else {
        let t11 = this.renderMarkdownDocs(o10.documentation);
        e207.appendChild(t11.element);
      }
      z(this.domNodes.docs, O5(`p`, {}, e207));
    }
    if (n10.documentation !== void 0) if (typeof n10.documentation == `string`) z(this.domNodes.docs, O5(`p`, {}, n10.documentation));
    else {
      let e207 = this.renderMarkdownDocs(n10.documentation);
      z(this.domNodes.docs, e207.element);
    }
    let s10 = this.hasDocs(n10, o10);
    if (this.domNodes.signature.classList.toggle(`has-docs`, s10), this.domNodes.docs.classList.toggle(`empty`, !s10), this.domNodes.overloads.textContent = String(e206.activeSignature + 1).padStart(e206.signatures.length.toString().length, `0`) + `/` + e206.signatures.length, o10) {
      let e207 = ``, t11 = n10.parameters[a10];
      e207 = Array.isArray(t11.label) ? n10.label.substring(t11.label[0], t11.label[1]) : t11.label, t11.documentation && (e207 += typeof t11.documentation == `string` ? `, ${t11.documentation}` : `, ${t11.documentation.value}`), n10.documentation && (e207 += typeof n10.documentation == `string` ? `, ${n10.documentation}` : `, ${n10.documentation.value}`), this.announcedLabel !== e207 && (Wg(C(1314, `{0}, hint`, e207)), this.announcedLabel = e207);
    }
    this.editor.layoutContentWidget(this), this.domNodes.scrollbar.scanDomNode();
  }
  renderMarkdownDocs(e206) {
    let t10 = this.renderDisposeables.add(this.markdownRendererService.render(e206, { context: this.editor, asyncRenderCallback: () => {
      this.domNodes?.scrollbar.scanDomNode();
    } }));
    return t10.element.classList.add(`markdown-docs`), t10;
  }
  hasDocs(e206, t10) {
    return !!(t10 && typeof t10.documentation == `string` && Ye(t10.documentation).length > 0 || t10 && typeof t10.documentation == `object` && Ye(t10.documentation).value.length > 0 || e206.documentation && typeof e206.documentation == `string` && Ye(e206.documentation).length > 0 || e206.documentation && typeof e206.documentation == `object` && Ye(e206.documentation.value).length > 0);
  }
  renderParameters(e206, t10, n10) {
    let [r10, i10] = this.getParameterLabelOffsets(t10, n10), a10 = document.createElement(`span`);
    a10.textContent = t10.label.substring(0, r10);
    let o10 = document.createElement(`span`);
    o10.textContent = t10.label.substring(r10, i10), o10.className = `parameter active`;
    let s10 = document.createElement(`span`);
    s10.textContent = t10.label.substring(i10), z(e206, a10, o10, s10);
  }
  getParameterLabelOffsets(e206, t10) {
    let n10 = e206.parameters[t10];
    if (!n10) return [0, 0];
    if (Array.isArray(n10.label)) return n10.label;
    if (n10.label.length) {
      let t11 = RegExp(`(\\W|^)${za(n10.label)}(?=\\W|$)`, `g`);
      t11.test(e206.label);
      let r10 = t11.lastIndex - n10.label.length;
      return r10 >= 0 ? [r10, t11.lastIndex] : [0, 0];
    } else return [0, 0];
  }
  next() {
    this.editor.focus(), this.model.next();
  }
  previous() {
    this.editor.focus(), this.model.previous();
  }
  getDomNode() {
    return this.domNodes || this.createParameterHintDOMNodes(), this.domNodes.element;
  }
  getId() {
    return D5.ID;
  }
  updateMaxHeight() {
    if (!this.domNodes) return;
    let e206 = `${Math.max(this.editor.getLayoutInfo().height / 4, 250)}px`;
    this.domNodes.element.style.maxHeight = e206;
    let t10 = this.domNodes.element.getElementsByClassName(`phwrapper`);
    t10.length && (t10[0].style.maxHeight = e206);
  }
}, D5 = _Td, _Td.ID = `editor.widget.parameterHintsWidget`, _Td);
k5 = D5 = Aje([E5(2, nd), E5(3, LP)], k5), Q(`editorHoverWidget.highlightForeground`, ub, C(1315, `Foreground color of the active item in the parameter hint.`));
var Nje = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, A5 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, j5, M5 = (_Ud = class extends D {
  static get(e206) {
    return e206.getContribution(j5.ID);
  }
  constructor(e206, t10, n10) {
    super(), this.editor = e206, this.model = this._register(new Oje(e206, n10.signatureHelpProvider)), this._register(this.model.onChangedHints((e207) => {
      e207 ? (this.widget.value.show(), this.widget.value.render(e207)) : this.widget.rawValue?.hide();
    })), this.widget = new Fa(() => this._register(t10.createInstance(k5, this.editor, this.model)));
  }
  cancel() {
    this.model.cancel();
  }
  previous() {
    this.widget.rawValue?.previous();
  }
  next() {
    this.widget.rawValue?.next();
  }
  trigger(e206) {
    this.model.trigger(e206, 0);
  }
}, j5 = _Ud, _Ud.ID = `editor.controller.parameterHints`, _Ud);
M5 = j5 = Nje([A5(1, V), A5(2, X)], M5);
var Pje = class extends G {
  constructor() {
    super({ id: `editor.action.triggerParameterHints`, label: w(1311, `Trigger Parameter Hints`), precondition: $.hasSignatureHelpProvider, kbOpts: { kbExpr: $.editorTextFocus, primary: 3082, weight: 100 } });
  }
  run(e206, t10) {
    M5.get(t10)?.trigger({ triggerKind: Si.Invoke });
  }
};
af(M5.ID, M5, 2), q(Pje);
var N5 = 175, P5 = $d.bindToContribution(M5.get);
K(new P5({ id: `closeParameterHints`, precondition: C5.Visible, handler: (e206) => e206.cancel(), kbOpts: { weight: N5, kbExpr: $.focus, primary: 9, secondary: [1033] } })), K(new P5({ id: `showPrevParameterHint`, precondition: H.and(C5.Visible, C5.MultipleSignatures), handler: (e206) => e206.previous(), kbOpts: { weight: N5, kbExpr: $.focus, primary: 16, secondary: [528], mac: { primary: 16, secondary: [528, 302] } } })), K(new P5({ id: `showNextParameterHint`, precondition: H.and(C5.Visible, C5.MultipleSignatures), handler: (e206) => e206.next(), kbOpts: { weight: N5, kbExpr: $.focus, primary: 18, secondary: [530], mac: { primary: 18, secondary: [530, 300] } } }));
var F5 = (_Vd = class extends D {
  constructor(e206) {
    super(), this._editor = e206, this._editorObs = WK(this._editor), this._placeholderText = this._editorObs.getOption(100), this._state = dc({ owner: this, equalsFn: Xs }, (e207) => {
      let t10 = this._placeholderText.read(e207);
      if (t10 && this._editorObs.valueIsEmpty.read(e207)) return { placeholder: t10 };
    }), this._shouldViewBeAlive = Fje(this, (e207) => this._state.read(e207)?.placeholder !== void 0), this._view = I((e207) => {
      if (!this._shouldViewBeAlive.read(e207)) return;
      let t10 = nu(`div.editorPlaceholder`);
      e207.store.add(hc((e208) => {
        let n10 = this._state.read(e208), r10 = n10?.placeholder !== void 0;
        t10.root.style.display = r10 ? `block` : `none`, t10.root.innerText = n10?.placeholder ?? ``;
      })), e207.store.add(hc((e208) => {
        let n10 = this._editorObs.layoutInfo.read(e208);
        t10.root.style.left = `${n10.contentLeft}px`, t10.root.style.width = n10.contentWidth - n10.verticalScrollbarWidth + `px`, t10.root.style.top = `${this._editor.getTopForLineNumber(0)}px`;
      })), e207.store.add(hc((e208) => {
        t10.root.style.fontFamily = this._editorObs.getOption(58).read(e208), t10.root.style.fontSize = this._editorObs.getOption(61).read(e208) + `px`, t10.root.style.lineHeight = this._editorObs.getOption(75).read(e208) + `px`;
      })), e207.store.add(this._editorObs.createOverlayWidget({ allowEditorOverflow: false, minContentWidthInPx: FI(0), position: FI(null), domNode: t10.root }));
    }), this._view.recomputeInitiallyAndOnChange(this._store);
  }
}, _Vd.ID = `editor.contrib.placeholderText`, _Vd);
function Fje(e206, t10) {
  return Ac(e206, (e207, n10) => n10 === true ? true : t10(e207));
}
var Ije = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Lje = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, Rje = class {
  constructor(e206) {
    this.instantiationService = e206;
  }
  init(...e206) {
  }
};
function zje(e206) {
  return e206();
}
var I5 = class extends Rje {
  constructor(e206, t10) {
    super(t10), this.init(e206);
  }
};
I5 = Ije([Lje(1, V)], I5), af(F5.ID, zje(() => F5), 0), Q(`editor.placeholder.foreground`, dce, C(1334, `Foreground color of the placeholder text in the editor.`));
var Bje = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, L5 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, R5 = new U(`renameInputVisible`, false, C(1391, `Whether the rename input widget is visible`));
new U(`renameInputFocused`, false, C(1392, `Whether the rename input widget is focused`));
var z5 = class {
  constructor(e206, t10, n10, r10, i10, a10) {
    this._editor = e206, this._acceptKeybindings = t10, this._themeService = n10, this._keybindingService = r10, this._logService = a10, this.allowEditorOverflow = true, this._disposables = new E(), this._visibleContextKey = R5.bindTo(i10), this._isEditingRenameCandidate = false, this._nRenameSuggestionsInvocations = 0, this._hadAutomaticRenameSuggestionsInvocation = false, this._candidates = /* @__PURE__ */ new Set(), this._beforeFirstInputFieldEditSW = new $t(), this._inputWithButton = new Hje(), this._disposables.add(this._inputWithButton), this._editor.addContentWidget(this), this._disposables.add(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(59) && this._updateFont();
    })), this._disposables.add(n10.onDidColorThemeChange(this._updateStyles, this));
  }
  dispose() {
    this._disposables.dispose(), this._editor.removeContentWidget(this);
  }
  getId() {
    return `__renameInputWidget`;
  }
  getDomNode() {
    return this._domNode || (this._domNode = document.createElement(`div`), this._domNode.className = `monaco-editor rename-box`, this._domNode.appendChild(this._inputWithButton.domNode), this._renameCandidateListView = this._disposables.add(new Vje(this._domNode, { fontInfo: this._editor.getOption(59), onFocusChange: (e206) => {
      this._inputWithButton.input.value = e206, this._isEditingRenameCandidate = false;
    }, onSelectionChange: () => {
      this._isEditingRenameCandidate = false, this.acceptInput(false);
    } })), this._disposables.add(this._inputWithButton.onDidInputChange(() => {
      this._renameCandidateListView?.focusedCandidate !== void 0 && (this._isEditingRenameCandidate = true), this._timeBeforeFirstInputFieldEdit ?? (this._timeBeforeFirstInputFieldEdit = this._beforeFirstInputFieldEditSW.elapsed()), this._renameCandidateProvidersCts?.token.isCancellationRequested === false && this._renameCandidateProvidersCts.cancel(), this._renameCandidateListView?.clearFocus();
    })), this._label = document.createElement(`div`), this._label.className = `rename-label`, this._domNode.appendChild(this._label), this._updateFont(), this._updateStyles(this._themeService.getColorTheme())), this._domNode;
  }
  _updateStyles(e206) {
    if (!this._domNode) return;
    let t10 = e206.getColor(Uv), n10 = e206.getColor(Wv);
    this._domNode.style.backgroundColor = String(e206.getColor(av) ?? ``), this._domNode.style.boxShadow = t10 ? ` 0 0 8px 2px ${t10}` : ``, this._domNode.style.border = n10 ? `1px solid ${n10}` : ``, this._domNode.style.color = String(e206.getColor(by) ?? ``);
    let r10 = e206.getColor(xy);
    this._inputWithButton.domNode.style.backgroundColor = String(e206.getColor(yy) ?? ``), this._inputWithButton.input.style.backgroundColor = String(e206.getColor(yy) ?? ``), this._inputWithButton.domNode.style.borderWidth = r10 ? `1px` : `0px`, this._inputWithButton.domNode.style.borderStyle = r10 ? `solid` : `none`, this._inputWithButton.domNode.style.borderColor = r10?.toString() ?? `none`;
  }
  _updateFont() {
    if (this._domNode === void 0) return;
    Je(this._label !== void 0, `RenameWidget#_updateFont: _label must not be undefined given _domNode is defined`), this._editor.applyFontInfo(this._inputWithButton.input);
    let e206 = this._editor.getOption(59);
    this._label.style.fontSize = `${this._computeLabelFontSize(e206.fontSize)}px`;
  }
  _computeLabelFontSize(e206) {
    return e206 * 0.8;
  }
  getPosition() {
    if (!this._visible || !this._editor.hasModel() || !this._editor.getDomNode()) return null;
    let e206 = fl(this.getDomNode().ownerDocument.body), t10 = _l2(this._editor.getDomNode());
    this._nPxAvailableAbove = this._getTopForPosition() + t10.top, this._nPxAvailableBelow = e206.height - this._nPxAvailableAbove;
    let n10 = this._editor.getOption(75), { totalHeight: r10 } = B5.getLayoutInfo({ lineHeight: n10 }), i10 = this._nPxAvailableBelow > r10 * 6 ? [2, 1] : [1, 2];
    return { position: this._position, preference: i10 };
  }
  beforeRender() {
    let [e206, t10] = this._acceptKeybindings;
    return this._label.innerText = C(1393, `{0} to Rename, {1} to Preview`, this._keybindingService.lookupKeybinding(e206)?.getLabel(), this._keybindingService.lookupKeybinding(t10)?.getLabel()), this._domNode.style.minWidth = `200px`, null;
  }
  afterRender(e206) {
    if (e206 === null) {
      this.cancelInput(true, `afterRender (because position is null)`);
      return;
    }
    if (!this._editor.hasModel() || !this._editor.getDomNode()) return;
    Je(this._renameCandidateListView), Je(this._nPxAvailableAbove !== void 0), Je(this._nPxAvailableBelow !== void 0);
    let t10 = Sl(this._inputWithButton.domNode), n10 = Sl(this._label), r10;
    r10 = e206 === 2 ? this._nPxAvailableBelow : this._nPxAvailableAbove, this._renameCandidateListView.layout({ height: r10 - n10 - t10, width: yl(this._inputWithButton.domNode) });
  }
  acceptInput(e206) {
    this._trace(`invoking acceptInput`), this._currentAcceptInput?.(e206);
  }
  cancelInput(e206, t10) {
    this._currentCancelInput?.(e206);
  }
  focusNextRenameSuggestion() {
    this._renameCandidateListView?.focusNext() || (this._inputWithButton.input.value = this._currentName);
  }
  focusPreviousRenameSuggestion() {
    this._renameCandidateListView?.focusPrevious() || (this._inputWithButton.input.value = this._currentName);
  }
  getInput(e206, t10, n10, r10, i10) {
    let { start: a10, end: o10 } = this._getSelection(e206, t10);
    this._renameCts = i10;
    let s10 = new E();
    this._nRenameSuggestionsInvocations = 0, this._hadAutomaticRenameSuggestionsInvocation = false, r10 === void 0 ? this._inputWithButton.button.style.display = `none` : (this._inputWithButton.button.style.display = `flex`, this._requestRenameCandidatesOnce = r10, this._requestRenameCandidates(t10, false), s10.add(L(this._inputWithButton.button, `click`, () => this._requestRenameCandidates(t10, true))), s10.add(L(this._inputWithButton.button, R.KEY_DOWN, (e207) => {
      let n11 = new Jo(e207);
      (n11.equals(3) || n11.equals(10)) && (n11.stopPropagation(), n11.preventDefault(), this._requestRenameCandidates(t10, true));
    }))), this._isEditingRenameCandidate = false, this._domNode.classList.toggle(`preview`, n10), this._position = new j(e206.startLineNumber, e206.startColumn), this._currentName = t10, this._inputWithButton.input.value = t10, this._inputWithButton.input.setAttribute(`selectionStart`, a10.toString()), this._inputWithButton.input.setAttribute(`selectionEnd`, o10.toString()), this._inputWithButton.input.size = Math.max((e206.endColumn - e206.startColumn) * 1.1, 20), this._beforeFirstInputFieldEditSW.reset(), s10.add(T(() => {
      this._renameCts = void 0, i10.dispose(true);
    })), s10.add(T(() => {
      this._renameCandidateProvidersCts !== void 0 && (this._renameCandidateProvidersCts.dispose(true), this._renameCandidateProvidersCts = void 0);
    })), s10.add(T(() => this._candidates.clear()));
    let c10 = new hs();
    return c10.p.finally(() => {
      s10.dispose(), this._hide();
    }), this._currentCancelInput = (e207) => (this._trace(`invoking _currentCancelInput`), this._currentAcceptInput = void 0, this._currentCancelInput = void 0, this._renameCandidateListView?.clearCandidates(), c10.complete(e207), true), this._currentAcceptInput = (e207) => {
      this._trace(`invoking _currentAcceptInput`), Je(this._renameCandidateListView !== void 0);
      let r11 = this._renameCandidateListView.nCandidates, i11, a11, o11 = this._renameCandidateListView.focusedCandidate;
      if (o11 === void 0 ? (this._trace(`using new name from inputField`), i11 = this._inputWithButton.input.value, a11 = this._isEditingRenameCandidate ? { k: `userEditedRenameSuggestion` } : { k: `inputField` }) : (this._trace(`using new name from renameSuggestion`), i11 = o11, a11 = { k: `renameSuggestion` }), i11 === t10 || i11.trim().length === 0) {
        this.cancelInput(true, `_currentAcceptInput (because newName === value || newName.trim().length === 0)`);
        return;
      }
      this._currentAcceptInput = void 0, this._currentCancelInput = void 0, this._renameCandidateListView.clearCandidates(), c10.complete({ newName: i11, wantsPreview: n10 && e207, stats: { source: a11, nRenameSuggestions: r11, timeBeforeFirstInputFieldEdit: this._timeBeforeFirstInputFieldEdit, nRenameSuggestionsInvocations: this._nRenameSuggestionsInvocations, hadAutomaticRenameSuggestionsInvocation: this._hadAutomaticRenameSuggestionsInvocation } });
    }, s10.add(i10.token.onCancellationRequested(() => this.cancelInput(true, `cts.token.onCancellationRequested`))), s10.add(this._editor.onDidBlurEditorWidget(() => this.cancelInput(!this._domNode?.ownerDocument.hasFocus(), `editor.onDidBlurEditorWidget`))), this._show(), c10.p;
  }
  _requestRenameCandidates(e206, t10) {
    if (this._requestRenameCandidatesOnce !== void 0 && (this._renameCandidateProvidersCts !== void 0 && this._renameCandidateProvidersCts.dispose(true), Je(this._renameCts), this._inputWithButton.buttonState !== `stop`)) {
      this._renameCandidateProvidersCts = new pr();
      let n10 = t10 ? Ai.Invoke : Ai.Automatic, r10 = this._requestRenameCandidatesOnce(n10, this._renameCandidateProvidersCts.token);
      if (r10.length === 0) {
        this._inputWithButton.setSparkleButton();
        return;
      }
      t10 || (this._hadAutomaticRenameSuggestionsInvocation = true), this._nRenameSuggestionsInvocations += 1, this._inputWithButton.setStopButton(), this._updateRenameCandidates(r10, e206, this._renameCts.token);
    }
  }
  _getSelection(e206, t10) {
    Je(this._editor.hasModel());
    let n10 = this._editor.getSelection(), r10 = 0, i10 = t10.length;
    return !M.isEmpty(n10) && !M.spansMultipleLines(n10) && M.containsRange(e206, n10) && (r10 = Math.max(0, n10.startColumn - e206.startColumn), i10 = Math.min(e206.endColumn, n10.endColumn) - e206.startColumn), { start: r10, end: i10 };
  }
  _show() {
    this._trace(`invoking _show`), this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber, 0), this._visible = true, this._visibleContextKey.set(true), this._editor.layoutContentWidget(this), setTimeout(() => {
      this._inputWithButton.input.focus(), this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute(`selectionStart`)), parseInt(this._inputWithButton.input.getAttribute(`selectionEnd`)));
    }, 100);
  }
  async _updateRenameCandidates(e206, t10, n10) {
    let r10 = (...e207) => this._trace(`_updateRenameCandidates`, ...e207);
    r10(`start`);
    let i10 = await ts(Promise.allSettled(e206), n10);
    if (this._inputWithButton.setSparkleButton(), i10 === void 0) {
      r10(`returning early - received updateRenameCandidates results - undefined`);
      return;
    }
    let a10 = i10.flatMap((e207) => e207.status === `fulfilled` && Ke(e207.value) ? e207.value : []);
    r10(`received updateRenameCandidates results - total (unfiltered) ${a10.length} candidates.`);
    let o10 = y(a10, (e207) => e207.newSymbolName);
    r10(`distinct candidates - ${o10.length} candidates.`);
    let s10 = o10.filter(({ newSymbolName: e207 }) => e207.trim().length > 0 && e207 !== this._inputWithButton.input.value && e207 !== t10 && !this._candidates.has(e207));
    if (r10(`valid distinct candidates - ${a10.length} candidates.`), s10.forEach((e207) => this._candidates.add(e207.newSymbolName)), s10.length < 1) {
      r10(`returning early - no valid distinct candidates`);
      return;
    }
    r10(`setting candidates`), this._renameCandidateListView.setCandidates(s10), r10(`asking editor to re-layout`), this._editor.layoutContentWidget(this);
  }
  _hide() {
    this._trace(`invoked _hide`), this._visible = false, this._visibleContextKey.reset(), this._editor.layoutContentWidget(this);
  }
  _getTopForPosition() {
    let e206 = this._editor.getVisibleRanges(), t10;
    return e206.length > 0 ? t10 = e206[0].startLineNumber : (this._logService.warn(`RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty`), t10 = Math.max(1, this._position.lineNumber - 5)), this._editor.getTopForLineNumber(this._position.lineNumber) - this._editor.getTopForLineNumber(t10);
  }
  _trace(...e206) {
    this._logService.trace(`RenameWidget`, ...e206);
  }
};
z5 = Bje([L5(2, US), L5(3, Dw), L5(4, nd), L5(5, Ud)], z5);
var Vje = class e203 {
  constructor(t10, n10) {
    this._disposables = new E(), this._availableHeight = 0, this._minimumWidth = 0, this._lineHeight = n10.fontInfo.lineHeight, this._typicalHalfwidthCharacterWidth = n10.fontInfo.typicalHalfwidthCharacterWidth, this._listContainer = document.createElement(`div`), this._listContainer.className = `rename-box rename-candidate-list-container`, t10.appendChild(this._listContainer), this._listWidget = e203._createListWidget(this._listContainer, this._candidateViewHeight, n10.fontInfo), this._disposables.add(this._listWidget.onDidChangeFocus((e206) => {
      e206.elements.length === 1 && n10.onFocusChange(e206.elements[0].newSymbolName);
    }, this._disposables)), this._disposables.add(this._listWidget.onDidChangeSelection((e206) => {
      e206.elements.length === 1 && n10.onSelectionChange();
    }, this._disposables)), this._disposables.add(this._listWidget.onDidBlur((e206) => {
      this._listWidget.setFocus([]);
    })), this._listWidget.style(dL({ listInactiveFocusForeground: hb, listInactiveFocusBackground: _b2 }));
  }
  dispose() {
    this._listWidget.dispose(), this._disposables.dispose();
  }
  layout({ height: e206, width: t10 }) {
    this._availableHeight = e206, this._minimumWidth = t10;
  }
  setCandidates(e206) {
    this._listWidget.splice(0, 0, e206);
    let t10 = this._pickListHeight(this._listWidget.length), n10 = this._pickListWidth(e206);
    this._listWidget.layout(t10, n10), this._listContainer.style.height = `${t10}px`, this._listContainer.style.width = `${n10}px`, Gg(C(1394, `Received {0} rename suggestions`, e206.length));
  }
  clearCandidates() {
    this._listContainer.style.height = `0px`, this._listContainer.style.width = `0px`, this._listWidget.splice(0, this._listWidget.length, []);
  }
  get nCandidates() {
    return this._listWidget.length;
  }
  get focusedCandidate() {
    if (this._listWidget.length === 0) return;
    let e206 = this._listWidget.getSelectedElements()[0];
    if (e206 !== void 0) return e206.newSymbolName;
    let t10 = this._listWidget.getFocusedElements()[0];
    if (t10 !== void 0) return t10.newSymbolName;
  }
  focusNext() {
    if (this._listWidget.length === 0) return false;
    let e206 = this._listWidget.getFocus();
    if (e206.length === 0) return this._listWidget.focusFirst(), this._listWidget.reveal(0), true;
    if (e206[0] === this._listWidget.length - 1) return this._listWidget.setFocus([]), this._listWidget.reveal(0), false;
    {
      this._listWidget.focusNext();
      let e207 = this._listWidget.getFocus()[0];
      return this._listWidget.reveal(e207), true;
    }
  }
  focusPrevious() {
    if (this._listWidget.length === 0) return false;
    let e206 = this._listWidget.getFocus();
    if (e206.length === 0) {
      this._listWidget.focusLast();
      let e207 = this._listWidget.getFocus()[0];
      return this._listWidget.reveal(e207), true;
    } else if (e206[0] === 0) return this._listWidget.setFocus([]), false;
    else {
      this._listWidget.focusPrevious();
      let e207 = this._listWidget.getFocus()[0];
      return this._listWidget.reveal(e207), true;
    }
  }
  clearFocus() {
    this._listWidget.setFocus([]);
  }
  get _candidateViewHeight() {
    let { totalHeight: e206 } = B5.getLayoutInfo({ lineHeight: this._lineHeight });
    return e206;
  }
  _pickListHeight(e206) {
    let t10 = this._candidateViewHeight * e206;
    return Math.min(t10, this._availableHeight, this._candidateViewHeight * 7);
  }
  _pickListWidth(e206) {
    let t10 = Math.ceil(Math.max(...e206.map((e207) => e207.newSymbolName.length)) * this._typicalHalfwidthCharacterWidth);
    return Math.max(this._minimumWidth, 25 + t10 + 10);
  }
  static _createListWidget(e206, t10, n10) {
    return new $I(`NewSymbolNameCandidates`, e206, new class {
      getTemplateId(e207) {
        return `candidate`;
      }
      getHeight(e207) {
        return t10;
      }
    }(), [new class {
      constructor() {
        this.templateId = `candidate`;
      }
      renderTemplate(e207) {
        return new B5(e207, n10);
      }
      renderElement(e207, t11, n11) {
        n11.populate(e207);
      }
      disposeTemplate(e207) {
        e207.dispose();
      }
    }()], { keyboardSupport: false, mouseSupport: true, multipleSelectionSupport: false });
  }
}, Hje = class {
  constructor() {
    this._buttonHoverContent = ``, this._onDidInputChange = new k(), this.onDidInputChange = this._onDidInputChange.event, this._disposables = new E();
  }
  get domNode() {
    return this._domNode || (this._domNode = document.createElement(`div`), this._domNode.className = `rename-input-with-button`, this._domNode.style.display = `flex`, this._domNode.style.flexDirection = `row`, this._domNode.style.alignItems = `center`, this._inputNode = document.createElement(`input`), this._inputNode.className = `rename-input`, this._inputNode.type = `text`, this._inputNode.style.border = `none`, this._inputNode.setAttribute(`aria-label`, C(1395, `Rename input. Type new name and press Enter to commit.`)), this._domNode.appendChild(this._inputNode), this._buttonNode = document.createElement(`div`), this._buttonNode.className = `rename-suggestions-button`, this._buttonNode.setAttribute(`tabindex`, `0`), this._buttonGenHoverText = C(1396, `Generate New Name Suggestions`), this._buttonCancelHoverText = C(1397, `Cancel`), this._buttonHoverContent = this._buttonGenHoverText, this._disposables.add(EI().setupDelayedHover(this._buttonNode, () => ({ content: this._buttonHoverContent, style: 1 }))), this._domNode.appendChild(this._buttonNode), this._disposables.add(L(this.input, R.INPUT, () => this._onDidInputChange.fire())), this._disposables.add(L(this.input, R.KEY_DOWN, (e206) => {
      let t10 = new Jo(e206);
      (t10.keyCode === 15 || t10.keyCode === 17) && this._onDidInputChange.fire();
    })), this._disposables.add(L(this.input, R.CLICK, () => this._onDidInputChange.fire())), this._disposables.add(L(this.input, R.FOCUS, () => {
      this.domNode.style.outlineWidth = `1px`, this.domNode.style.outlineStyle = `solid`, this.domNode.style.outlineOffset = `-1px`, this.domNode.style.outlineColor = `var(--vscode-focusBorder)`;
    })), this._disposables.add(L(this.input, R.BLUR, () => {
      this.domNode.style.outline = `none`;
    }))), this._domNode;
  }
  get input() {
    return Je(this._inputNode), this._inputNode;
  }
  get button() {
    return Je(this._buttonNode), this._buttonNode;
  }
  get buttonState() {
    return this._buttonState;
  }
  setSparkleButton() {
    this._buttonState = `sparkle`, this._sparkleIcon ?? (this._sparkleIcon = wP(F.sparkle)), Xc(this.button), this.button.appendChild(this._sparkleIcon), this.button.setAttribute(`aria-label`, `Generating new name suggestions`), this._buttonHoverContent = this._buttonGenHoverText, this.input.focus();
  }
  setStopButton() {
    this._buttonState = `stop`, this._stopIcon ?? (this._stopIcon = wP(F.stopCircle)), Xc(this.button), this.button.appendChild(this._stopIcon), this.button.setAttribute(`aria-label`, `Cancel generating new name suggestions`), this._buttonHoverContent = this._buttonCancelHoverText, this.input.focus();
  }
  dispose() {
    this._disposables.dispose();
  }
}, B5 = (_Wd = class {
  constructor(t10, n10) {
    this._domNode = document.createElement(`div`), this._domNode.className = `rename-box rename-candidate`, this._domNode.style.display = `flex`, this._domNode.style.columnGap = `5px`, this._domNode.style.alignItems = `center`, this._domNode.style.height = `${n10.lineHeight}px`, this._domNode.style.padding = `${_Wd._PADDING}px`;
    let r10 = document.createElement(`div`);
    r10.style.display = `flex`, r10.style.alignItems = `center`, r10.style.width = r10.style.height = `${n10.lineHeight * 0.8}px`, this._domNode.appendChild(r10), this._icon = wP(F.sparkle), this._icon.style.display = `none`, r10.appendChild(this._icon), this._label = document.createElement(`div`), vu(this._label, n10), this._domNode.appendChild(this._label), t10.appendChild(this._domNode);
  }
  populate(e206) {
    this._updateIcon(e206), this._updateLabel(e206);
  }
  _updateIcon(e206) {
    let t10 = !!e206.tags?.includes(ki.AIGenerated);
    this._icon.style.display = t10 ? `inherit` : `none`;
  }
  _updateLabel(e206) {
    this._label.innerText = e206.newSymbolName;
  }
  static getLayoutInfo({ lineHeight: t10 }) {
    return { totalHeight: t10 + _Wd._PADDING * 2 };
  }
  dispose() {
  }
}, _Wd._PADDING = 2, _Wd), Uje = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, V5 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, H5, U5 = class {
  constructor(e206, t10, n10) {
    this.model = e206, this.position = t10, this._providerRenameIdx = 0, this._providers = n10.ordered(e206);
  }
  hasProvider() {
    return this._providers.length > 0;
  }
  async resolveRenameLocation(e206) {
    let t10 = [];
    for (this._providerRenameIdx = 0; this._providerRenameIdx < this._providers.length; this._providerRenameIdx++) {
      let n11 = this._providers[this._providerRenameIdx];
      if (!n11.resolveRenameLocation) break;
      let r10 = await n11.resolveRenameLocation(this.model, this.position, e206);
      if (r10) {
        if (r10.rejectReason) {
          t10.push(r10.rejectReason);
          continue;
        }
        return r10;
      }
    }
    this._providerRenameIdx = 0;
    let n10 = this.model.getWordAtPosition(this.position);
    return n10 ? { range: new M(this.position.lineNumber, n10.startColumn, this.position.lineNumber, n10.endColumn), text: n10.word, rejectReason: t10.length > 0 ? t10.join(`
`) : void 0 } : { range: M.fromPositions(this.position), text: ``, rejectReason: t10.length > 0 ? t10.join(`
`) : void 0 };
  }
  async provideRenameEdits(e206, t10) {
    return this._provideRenameEdits(e206, this._providerRenameIdx, [], t10);
  }
  async _provideRenameEdits(e206, t10, n10, r10) {
    let i10 = this._providers[t10];
    if (!i10) return { edits: [], rejectReason: n10.join(`
`) };
    let a10 = await i10.provideRenameEdits(this.model, this.position, e206, r10);
    return a10 ? a10.rejectReason ? this._provideRenameEdits(e206, t10 + 1, n10.concat(a10.rejectReason), r10) : a10 : this._provideRenameEdits(e206, t10 + 1, n10.concat(C(1380, `No result.`)), r10);
  }
};
async function Wje(e206, t10, n10, r10) {
  let i10 = new U5(t10, n10, e206), a10 = await i10.resolveRenameLocation(dr.None);
  return a10?.rejectReason ? { edits: [], rejectReason: a10.rejectReason } : i10.provideRenameEdits(r10, dr.None);
}
var W5 = (_Xd = class {
  static get(e206) {
    return e206.getContribution(H5.ID);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this.editor = e206, this._instaService = t10, this._notificationService = n10, this._bulkEditService = r10, this._progressService = i10, this._logService = a10, this._configService = o10, this._languageFeaturesService = s10, this._disposableStore = new E(), this._cts = new pr(), this._renameWidget = this._disposableStore.add(this._instaService.createInstance(z5, this.editor, [`acceptRenameInput`, `acceptRenameInputWithPreview`]));
  }
  dispose() {
    this._disposableStore.dispose(), this._cts.dispose(true);
  }
  async run() {
    let e206 = this._logService.trace.bind(this._logService, `[rename]`);
    if (this._cts.dispose(true), this._cts = new pr(), !this.editor.hasModel()) {
      e206(`editor has no model`);
      return;
    }
    let t10 = this.editor.getPosition(), n10 = new U5(this.editor.getModel(), t10, this._languageFeaturesService.renameProvider);
    if (!n10.hasProvider()) {
      e206(`skeleton has no provider`);
      return;
    }
    let r10 = new tJ(this.editor, 5, void 0, this._cts.token), i10;
    try {
      e206(`resolving rename location`);
      let t11 = n10.resolveRenameLocation(r10.token);
      this._progressService.showWhile(t11, 250), i10 = await t11, e206(`resolved rename location`);
    } catch (n11) {
      n11 instanceof Te ? e206(`resolve rename location cancelled`, JSON.stringify(n11, null, `	`)) : (e206(`resolve rename location failed`, n11 instanceof Error ? n11 : JSON.stringify(n11, null, `	`)), (typeof n11 == `string` || IM(n11)) && QJ.get(this.editor)?.showMessage(n11 || C(1381, `An unknown error occurred while resolving rename location`), t10));
      return;
    } finally {
      r10.dispose();
    }
    if (!i10) {
      e206(`returning early - no loc`);
      return;
    }
    if (i10.rejectReason) {
      e206(`returning early - rejected with reason: ${i10.rejectReason}`, i10.rejectReason), QJ.get(this.editor)?.showMessage(i10.rejectReason, t10);
      return;
    }
    if (r10.token.isCancellationRequested) {
      e206(`returning early - cts1 cancelled`);
      return;
    }
    let a10 = new tJ(this.editor, 5, i10.range, this._cts.token), o10 = this.editor.getModel(), s10 = this._languageFeaturesService.newSymbolNamesProvider.all(o10), c10 = await Promise.all(s10.map(async (e207) => [e207, await e207.supportsAutomaticNewSymbolNamesTriggerKind ?? false])), l10 = (e207, t11) => {
      let n11 = c10.slice();
      return e207 === Ai.Automatic && (n11 = n11.filter(([e208, t12]) => t12)), n11.map(([n12]) => n12.provideNewSymbolNames(o10, i10.range, e207, t11));
    };
    e206(`creating rename input field and awaiting its result`);
    let u10 = this._bulkEditService.hasPreviewHandler() && this._configService.getValue(this.editor.getModel().uri, `editor.rename.enablePreview`), d10 = await this._renameWidget.getInput(i10.range, i10.text, u10, s10.length > 0 ? l10 : void 0, a10);
    if (e206(`received response from rename input field`), typeof d10 == `boolean`) {
      e206(`returning early - rename input field response - ${d10}`), d10 && this.editor.focus(), a10.dispose();
      return;
    }
    this.editor.focus(), e206(`requesting rename edits`);
    let f10 = ts(n10.provideRenameEdits(d10.newName, a10.token), a10.token).then(async (t11) => {
      if (!t11) {
        e206(`returning early - no rename edits result`);
        return;
      }
      if (!this.editor.hasModel()) {
        e206(`returning early - no model after rename edits are provided`);
        return;
      }
      if (t11.rejectReason) {
        e206(`returning early - rejected with reason: ${t11.rejectReason}`), this._notificationService.info(t11.rejectReason);
        return;
      }
      this.editor.setSelection(M.fromPositions(this.editor.getSelection().getPosition())), e206(`applying edits`), this._bulkEditService.apply(t11, { editor: this.editor, showPreview: d10.wantsPreview, label: C(1382, `Renaming '{0}' to '{1}'`, i10?.text, d10.newName), code: `undoredo.rename`, quotableLabel: C(1383, `Renaming {0} to {1}`, i10?.text, d10.newName), respectAutoSaveConfig: true, reason: mE.rename() }).then((t12) => {
        e206(`edits applied`), t12.ariaSummary && Wg(C(1384, `Successfully renamed '{0}' to '{1}'. Summary: {2}`, i10.text, d10.newName, t12.ariaSummary));
      }).catch((t12) => {
        e206(`error when applying edits ${JSON.stringify(t12, null, `	`)}`), this._notificationService.error(C(1385, `Rename failed to apply edits`)), this._logService.error(t12);
      });
    }, (t11) => {
      e206(`error when providing rename edits`, JSON.stringify(t11, null, `	`)), this._notificationService.error(C(1386, `Rename failed to compute edits`)), this._logService.error(t11);
    }).finally(() => {
      a10.dispose();
    });
    return e206(`returning rename operation`), this._progressService.showWhile(f10, 250), f10;
  }
  acceptRenameInput(e206) {
    this._renameWidget.acceptInput(e206);
  }
  cancelRenameInput() {
    this._renameWidget.cancelInput(true, `cancelRenameInput command`);
  }
  focusNextRenameSuggestion() {
    this._renameWidget.focusNextRenameSuggestion();
  }
  focusPreviousRenameSuggestion() {
    this._renameWidget.focusPreviousRenameSuggestion();
  }
}, H5 = _Xd, _Xd.ID = `editor.contrib.renameController`, _Xd);
W5 = H5 = Uje([V5(1, V), V5(2, dw), V5(3, vF), V5(4, UF), V5(5, Ud), V5(6, Uh), V5(7, X)], W5);
var Gje = class extends G {
  constructor() {
    super({ id: `editor.action.rename`, label: w(1388, `Rename Symbol`), precondition: H.and($.writable, $.hasRenameProvider), kbOpts: { kbExpr: $.editorTextFocus, primary: 60, weight: 100 }, contextMenuOpts: { group: `1_modification`, order: 1.1 }, canTriggerInlineEdits: true });
  }
  runCommand(e206, t10) {
    let n10 = e206.get(Su), [r10, i10] = Array.isArray(t10) && t10 || [void 0, void 0];
    return $r.isUri(r10) && j.isIPosition(i10) ? n10.openCodeEditor({ resource: r10 }, n10.getActiveCodeEditor()).then((e207) => {
      e207 && (e207.setPosition(i10), e207.invokeWithinContext((t11) => (this.reportTelemetry(t11, e207), this.run(t11, e207))));
    }, be) : super.runCommand(e206, t10);
  }
  run(e206, t10) {
    let n10 = e206.get(Ud), r10 = W5.get(t10);
    return r10 ? (n10.trace(`[RenameAction] got controller, running...`), r10.run()) : (n10.trace(`[RenameAction] returning early - controller missing`), Promise.resolve());
  }
};
af(W5.ID, W5, 4), q(Gje);
var G5 = $d.bindToContribution(W5.get);
K(new G5({ id: `acceptRenameInput`, precondition: R5, handler: (e206) => e206.acceptRenameInput(false), kbOpts: { weight: 199, kbExpr: H.and($.focus, H.not(`isComposing`)), primary: 3 } })), K(new G5({ id: `acceptRenameInputWithPreview`, precondition: H.and(R5, H.has(`config.editor.rename.enablePreview`)), handler: (e206) => e206.acceptRenameInput(true), kbOpts: { weight: 199, kbExpr: H.and($.focus, H.not(`isComposing`)), primary: 2051 } })), K(new G5({ id: `cancelRenameInput`, precondition: R5, handler: (e206) => e206.cancelRenameInput(), kbOpts: { weight: 199, kbExpr: $.focus, primary: 9, secondary: [1033] } })), yd(class extends vd {
  constructor() {
    super({ id: `focusNextRenameSuggestion`, title: { ...w(1389, `Focus Next Rename Suggestion`) }, precondition: R5, keybinding: [{ primary: 18, weight: 199 }] });
  }
  run(e206) {
    let t10 = e206.get(Su).getFocusedCodeEditor();
    if (!t10) return;
    let n10 = W5.get(t10);
    n10 && n10.focusNextRenameSuggestion();
  }
}), yd(class extends vd {
  constructor() {
    super({ id: `focusPreviousRenameSuggestion`, title: { ...w(1390, `Focus Previous Rename Suggestion`) }, precondition: R5, keybinding: [{ primary: 16, weight: 199 }] });
  }
  run(e206) {
    let t10 = e206.get(Su).getFocusedCodeEditor();
    if (!t10) return;
    let n10 = W5.get(t10);
    n10 && n10.focusPreviousRenameSuggestion();
  }
}), nf(`_executeDocumentRenameProvider`, function(e206, t10, n10, ...r10) {
  let [i10] = r10;
  Je(typeof i10 == `string`);
  let { renameProvider: a10 } = e206.get(X);
  return Wje(a10, t10, n10, i10);
}), nf(`_executePrepareRename`, async function(e206, t10, n10) {
  let { renameProvider: r10 } = e206.get(X), i10 = await new U5(t10, n10, r10).resolveRenameLocation(dr.None);
  if (i10?.rejectReason) throw Error(i10.rejectReason);
  return i10;
}), cd.as(op.Configuration).registerConfiguration({ id: `editor`, properties: { "editor.rename.enablePreview": { scope: 6, description: C(1387, `Enable/disable the ability to preview changes before renaming`), default: true, type: `boolean` } } });
var Kje = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, K5 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, q5 = (_Yd = class extends D {
  constructor(e206, t10, n10) {
    super(), this.editor = e206, this.languageConfigurationService = t10, this.editorWorkerService = n10, this.decorations = this.editor.createDecorationsCollection(), this.options = this.createOptions(e206.getOption(81)), this.computePromise = null, this.currentOccurrences = {}, this._register(e206.onDidChangeModel((t11) => {
      this.currentOccurrences = {}, this.options = this.createOptions(e206.getOption(81)), this.stop(), this.computeSectionHeaders.schedule(0);
    })), this._register(e206.onDidChangeModelLanguage((t11) => {
      this.currentOccurrences = {}, this.options = this.createOptions(e206.getOption(81)), this.stop(), this.computeSectionHeaders.schedule(0);
    })), this._register(t10.onDidChange((t11) => {
      let n11 = this.editor.getModel()?.getLanguageId();
      n11 && t11.affects(n11) && (this.currentOccurrences = {}, this.options = this.createOptions(e206.getOption(81)), this.stop(), this.computeSectionHeaders.schedule(0));
    })), this._register(e206.onDidChangeConfiguration((t11) => {
      this.options && !t11.hasChanged(81) || (this.options = this.createOptions(e206.getOption(81)), this.updateDecorations([]), this.stop(), this.computeSectionHeaders.schedule(0));
    })), this._register(this.editor.onDidChangeModelContent((e207) => {
      this.computeSectionHeaders.schedule();
    })), this._register(e206.onDidChangeModelTokens((e207) => {
      this.computeSectionHeaders.isScheduled() || this.computeSectionHeaders.schedule(1e3);
    })), this.computeSectionHeaders = this._register(new us(() => {
      this.findSectionHeaders();
    }, 250)), this.computeSectionHeaders.schedule(0);
  }
  createOptions(e206) {
    if (!e206 || !this.editor.hasModel()) return;
    let t10 = this.editor.getModel().getLanguageId();
    if (!t10) return;
    let n10 = this.languageConfigurationService.getLanguageConfiguration(t10).comments, r10 = this.languageConfigurationService.getLanguageConfiguration(t10).foldingRules;
    if (!(!n10 && !r10?.markers)) return { foldingRules: r10, markSectionHeaderRegex: e206.markSectionHeaderRegex, findMarkSectionHeaders: e206.showMarkSectionHeaders, findRegionSectionHeaders: e206.showRegionSectionHeaders };
  }
  findSectionHeaders() {
    if (!this.editor.hasModel() || !this.options?.findMarkSectionHeaders && !this.options?.findRegionSectionHeaders) return;
    let e206 = this.editor.getModel();
    if (e206.isDisposed() || e206.isTooLargeForSyncing()) return;
    let t10 = e206.getVersionId();
    this.editorWorkerService.findSectionHeaders(e206.uri, this.options).then((n10) => {
      e206.isDisposed() || e206.getVersionId() !== t10 || this.updateDecorations(n10);
    });
  }
  updateDecorations(e206) {
    let t10 = this.editor.getModel();
    t10 && (e206 = e206.filter((e207) => {
      if (!e207.shouldBeInComments) return true;
      let n11 = t10.validateRange(e207.range), r11 = t10.tokenization.getLineTokens(n11.startLineNumber), i10 = r11.findTokenIndexAtOffset(n11.startColumn - 1), a10 = r11.getStandardTokenType(i10);
      return r11.getLanguageId(i10) === t10.getLanguageId() && a10 === 1;
    }));
    let n10 = Object.values(this.currentOccurrences).map((e207) => e207.decorationId), r10 = e206.map((e207) => qje(e207));
    this.editor.changeDecorations((t11) => {
      let i10 = t11.deltaDecorations(n10, r10);
      this.currentOccurrences = {};
      for (let t12 = 0, n11 = i10.length; t12 < n11; t12++) {
        let n12 = { sectionHeader: e206[t12], decorationId: i10[t12] };
        this.currentOccurrences[n12.decorationId] = n12;
      }
    });
  }
  stop() {
    this.computeSectionHeaders.cancel(), this.computePromise && (this.computePromise = (this.computePromise.cancel(), null));
  }
  dispose() {
    super.dispose(), this.stop(), this.decorations.clear();
  }
}, _Yd.ID = `editor.sectionHeaderDetector`, _Yd);
q5 = Kje([K5(1, bp), K5(2, HL)], q5);
function qje(e206) {
  return { range: e206.range, options: UO.createDynamic({ description: `section-header`, stickiness: 3, collapseOnReplaceEdit: true, minimap: { color: void 0, position: 1, sectionHeaderStyle: e206.hasSeparatorLine ? 2 : 1, sectionHeaderText: e206.text } }) };
}
af(q5.ID, q5, 1);
function Jje(e206) {
  for (let t10 = 0, n10 = e206.length; t10 < n10; t10 += 4) {
    let n11 = e206[t10 + 0], r10 = e206[t10 + 1], i10 = e206[t10 + 2], a10 = e206[t10 + 3];
    e206[t10 + 0] = a10, e206[t10 + 1] = i10, e206[t10 + 2] = r10, e206[t10 + 3] = n11;
  }
}
function Yje(e206) {
  let t10 = new Uint8Array(e206.buffer, e206.byteOffset, e206.length * 4);
  return Lt() || Jje(t10), As.wrap(t10);
}
function J5(e206) {
  let t10 = new Uint32Array(Xje(e206)), n10 = 0;
  if (t10[n10++] = e206.id, e206.type === `full`) t10[n10++] = 1, t10[n10++] = e206.data.length, t10.set(e206.data, n10), n10 += e206.data.length;
  else {
    t10[n10++] = 2, t10[n10++] = e206.deltas.length;
    for (let r10 of e206.deltas) t10[n10++] = r10.start, t10[n10++] = r10.deleteCount, r10.data ? (t10[n10++] = r10.data.length, t10.set(r10.data, n10), n10 += r10.data.length) : t10[n10++] = 0;
  }
  return Yje(t10);
}
function Xje(e206) {
  let t10 = 0;
  if (t10 += 2, e206.type === `full`) t10 += 1 + e206.data.length;
  else {
    t10 += 1, t10 += 3 * e206.deltas.length;
    for (let n10 of e206.deltas) n10.data && (t10 += n10.data.length);
  }
  return t10;
}
function Y5(e206) {
  return e206 && !!e206.data;
}
function X5(e206) {
  return e206 && Array.isArray(e206.edits);
}
var Zje = class {
  constructor(e206, t10, n10) {
    this.provider = e206, this.tokens = t10, this.error = n10;
  }
};
function Z5(e206, t10) {
  return e206.has(t10);
}
function Qje(e206, t10) {
  let n10 = e206.orderedGroups(t10);
  return n10.length > 0 ? n10[0] : [];
}
async function Q5(e206, t10, n10, r10, i10) {
  let a10 = Qje(e206, t10), o10 = await Promise.all(a10.map(async (e207) => {
    let a11, o11 = null;
    try {
      a11 = await e207.provideDocumentSemanticTokens(t10, e207 === n10 ? r10 : null, i10);
    } catch (e208) {
      o11 = e208, a11 = null;
    }
    return (!a11 || !Y5(a11) && !X5(a11)) && (a11 = null), new Zje(e207, a11, o11);
  }));
  for (let e207 of o10) {
    if (e207.error) throw e207.error;
    if (e207.tokens) return e207;
  }
  return o10.length > 0 ? o10[0] : null;
}
function $je(e206, t10) {
  let n10 = e206.orderedGroups(t10);
  return n10.length > 0 ? n10[0] : null;
}
var eMe = class {
  constructor(e206, t10) {
    this.provider = e206, this.tokens = t10;
  }
};
function tMe(e206, t10) {
  return e206.has(t10);
}
function $5(e206, t10) {
  let n10 = e206.orderedGroups(t10);
  return n10.length > 0 ? n10[0] : [];
}
async function e710(e206, t10, n10, r10) {
  let i10 = $5(e206, t10), a10 = await Promise.all(i10.map(async (e207) => {
    let i11;
    try {
      i11 = await e207.provideDocumentRangeSemanticTokens(t10, n10, r10);
    } catch (e208) {
      xe(e208), i11 = null;
    }
    return (!i11 || !Y5(i11)) && (i11 = null), new eMe(e207, i11);
  }));
  for (let e207 of a10) if (e207.tokens) return e207;
  return a10.length > 0 ? a10[0] : null;
}
Nu.registerCommand(`_provideDocumentSemanticTokensLegend`, async (e206, ...t10) => {
  let [n10] = t10;
  Je(n10 instanceof $r);
  let r10 = e206.get(Cu).getModel(n10);
  if (!r10) return;
  let { documentSemanticTokensProvider: i10 } = e206.get(X), a10 = $je(i10, r10);
  return a10 ? a10[0].getLegend() : e206.get(Mu).executeCommand(`_provideDocumentRangeSemanticTokensLegend`, n10);
}), Nu.registerCommand(`_provideDocumentSemanticTokens`, async (e206, ...t10) => {
  let [n10] = t10;
  Je(n10 instanceof $r);
  let r10 = e206.get(Cu).getModel(n10);
  if (!r10) return;
  let { documentSemanticTokensProvider: i10 } = e206.get(X);
  if (!Z5(i10, r10)) return e206.get(Mu).executeCommand(`_provideDocumentRangeSemanticTokens`, n10, r10.getFullModelRange());
  let a10 = await Q5(i10, r10, null, null, dr.None);
  if (!a10) return;
  let { provider: o10, tokens: s10 } = a10;
  if (!s10 || !Y5(s10)) return;
  let c10 = J5({ id: 0, type: `full`, data: s10.data });
  return s10.resultId && o10.releaseDocumentSemanticTokens(s10.resultId), c10;
}), Nu.registerCommand(`_provideDocumentRangeSemanticTokensLegend`, async (e206, ...t10) => {
  let [n10, r10] = t10;
  Je(n10 instanceof $r);
  let i10 = e206.get(Cu).getModel(n10);
  if (!i10) return;
  let { documentRangeSemanticTokensProvider: a10 } = e206.get(X), o10 = $5(a10, i10);
  if (o10.length === 0) return;
  if (o10.length === 1) return o10[0].getLegend();
  if (!r10 || !M.isIRange(r10)) return console.warn(`provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in`), o10[0].getLegend();
  let s10 = await e710(a10, i10, M.lift(r10), dr.None);
  if (s10) return s10.provider.getLegend();
}), Nu.registerCommand(`_provideDocumentRangeSemanticTokens`, async (e206, ...t10) => {
  let [n10, r10] = t10;
  Je(n10 instanceof $r), Je(M.isIRange(r10));
  let i10 = e206.get(Cu).getModel(n10);
  if (!i10) return;
  let { documentRangeSemanticTokensProvider: a10 } = e206.get(X), o10 = await e710(a10, i10, M.lift(r10), dr.None);
  if (!(!o10 || !o10.tokens)) return J5({ id: 0, type: `full`, data: o10.tokens.data });
});
var nMe = `editor.semanticHighlighting`;
function t7(e206, t10, n10) {
  let r10 = n10.getValue(nMe, { overrideIdentifier: e206.getLanguageId(), resource: e206.uri })?.enabled;
  return typeof r10 == `boolean` ? r10 : t10.getColorTheme().semanticHighlighting;
}
var n7 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, r7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, i7, a7 = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._watchers = new wd();
    let o10 = (t11) => {
      this._watchers.get(t11.uri)?.dispose(), this._watchers.set(t11.uri, new o7(t11, e206, n10, i10, a10));
    }, s10 = (e207, t11) => {
      t11.dispose(), this._watchers.delete(e207.uri);
    }, c10 = () => {
      for (let e207 of t10.getModels()) {
        let t11 = this._watchers.get(e207.uri);
        t7(e207, n10, r10) ? t11 || o10(e207) : t11 && s10(e207, t11);
      }
    };
    t10.getModels().forEach((e207) => {
      t7(e207, n10, r10) && o10(e207);
    }), this._register(t10.onModelAdded((e207) => {
      t7(e207, n10, r10) && o10(e207);
    })), this._register(t10.onModelRemoved((e207) => {
      let t11 = this._watchers.get(e207.uri);
      t11 && s10(e207, t11);
    })), this._register(r10.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(`editor.semanticHighlighting`) && c10();
    })), this._register(n10.onDidColorThemeChange(c10));
  }
  dispose() {
    Kt(this._watchers.values()), this._watchers.clear(), super.dispose();
  }
};
a7 = n7([r7(0, wA), r7(1, Cu), r7(2, US), r7(3, Uf), r7(4, lA), r7(5, X)], a7);
var o7 = (_Zd = class extends D {
  constructor(e206, t10, n10, r10, i10) {
    super(), this._semanticTokensStylingService = t10, this._isDisposed = false, this._model = e206, this._provider = i10.documentSemanticTokensProvider, this._debounceInformation = r10.for(this._provider, `DocumentSemanticTokens`, { min: i7.REQUEST_MIN_DELAY, max: i7.REQUEST_MAX_DELAY }), this._fetchDocumentSemanticTokens = this._register(new us(() => this._fetchDocumentSemanticTokensNow(), i7.REQUEST_MIN_DELAY)), this._currentDocumentResponse = null, this._currentDocumentRequestCancellationTokenSource = null, this._documentProvidersChangeListeners = [], this._providersChangedDuringRequest = false, this._register(this._model.onDidChangeContent(() => {
      this._fetchDocumentSemanticTokens.isScheduled() || this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._register(this._model.onDidChangeAttached(() => {
      this._fetchDocumentSemanticTokens.isScheduled() || this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._register(this._model.onDidChangeLanguage(() => {
      this._currentDocumentResponse && (this._currentDocumentResponse = (this._currentDocumentResponse.dispose(), null)), this._currentDocumentRequestCancellationTokenSource && (this._currentDocumentRequestCancellationTokenSource = (this._currentDocumentRequestCancellationTokenSource.cancel(), null)), this._setDocumentSemanticTokens(null, null, null, []), this._fetchDocumentSemanticTokens.schedule(0);
    }));
    let a10 = () => {
      Kt(this._documentProvidersChangeListeners), this._documentProvidersChangeListeners = [];
      for (let t11 of this._provider.all(e206)) typeof t11.onDidChange == `function` && this._documentProvidersChangeListeners.push(t11.onDidChange(() => {
        if (this._currentDocumentRequestCancellationTokenSource) {
          this._providersChangedDuringRequest = true;
          return;
        }
        this._fetchDocumentSemanticTokens.schedule(0);
      }));
    };
    a10(), this._register(this._provider.onDidChange(() => {
      a10(), this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._register(n10.onDidColorThemeChange((e207) => {
      this._setDocumentSemanticTokens(null, null, null, []), this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._fetchDocumentSemanticTokens.schedule(0);
  }
  dispose() {
    this._currentDocumentResponse && (this._currentDocumentResponse = (this._currentDocumentResponse.dispose(), null)), this._currentDocumentRequestCancellationTokenSource && (this._currentDocumentRequestCancellationTokenSource = (this._currentDocumentRequestCancellationTokenSource.cancel(), null)), Kt(this._documentProvidersChangeListeners), this._documentProvidersChangeListeners = [], this._setDocumentSemanticTokens(null, null, null, []), this._isDisposed = true, super.dispose();
  }
  _fetchDocumentSemanticTokensNow() {
    if (this._currentDocumentRequestCancellationTokenSource) return;
    if (!Z5(this._provider, this._model)) {
      this._currentDocumentResponse && this._model.tokenization.setSemanticTokens(null, false);
      return;
    }
    if (!this._model.isAttachedToEditor()) return;
    let e206 = new pr(), t10 = this._currentDocumentResponse ? this._currentDocumentResponse.provider : null, n10 = this._currentDocumentResponse && this._currentDocumentResponse.resultId || null, r10 = Q5(this._provider, this._model, t10, n10, e206.token);
    this._currentDocumentRequestCancellationTokenSource = e206, this._providersChangedDuringRequest = false;
    let i10 = [], a10 = this._model.onDidChangeContent((e207) => {
      i10.push(e207);
    }), o10 = new $t(false);
    r10.then((e207) => {
      if (this._debounceInformation.update(this._model, o10.elapsed()), this._currentDocumentRequestCancellationTokenSource = null, a10.dispose(), !e207) this._setDocumentSemanticTokens(null, null, null, i10);
      else {
        let { provider: t11, tokens: n11 } = e207, r11 = this._semanticTokensStylingService.getStyling(t11);
        this._setDocumentSemanticTokens(t11, n11 || null, r11, i10);
      }
    }, (e207) => {
      e207 && (we(e207) || typeof e207.message == `string` && e207.message.indexOf(`busy`) !== -1) || be(e207), this._currentDocumentRequestCancellationTokenSource = null, a10.dispose(), (i10.length > 0 || this._providersChangedDuringRequest) && (this._fetchDocumentSemanticTokens.isScheduled() || this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)));
    });
  }
  static _copy(e206, t10, n10, r10, i10) {
    i10 = Math.min(i10, n10.length - r10, e206.length - t10);
    for (let a10 = 0; a10 < i10; a10++) n10[r10 + a10] = e206[t10 + a10];
  }
  _setDocumentSemanticTokens(e206, t10, n10, r10) {
    let i10 = this._currentDocumentResponse, a10 = () => {
      (r10.length > 0 || this._providersChangedDuringRequest) && !this._fetchDocumentSemanticTokens.isScheduled() && this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    };
    if (this._currentDocumentResponse && (this._currentDocumentResponse = (this._currentDocumentResponse.dispose(), null)), this._isDisposed) {
      e206 && t10 && e206.releaseDocumentSemanticTokens(t10.resultId);
      return;
    }
    if (!e206 || !n10) {
      this._model.tokenization.setSemanticTokens(null, false);
      return;
    }
    if (!t10) {
      this._model.tokenization.setSemanticTokens(null, true), a10();
      return;
    }
    if (X5(t10)) {
      if (!i10) {
        this._model.tokenization.setSemanticTokens(null, true);
        return;
      }
      if (t10.edits.length === 0) t10 = { resultId: t10.resultId, data: i10.data };
      else {
        let e207 = 0;
        for (let n11 of t10.edits) e207 += (n11.data ? n11.data.length : 0) - n11.deleteCount;
        let r11 = i10.data, a11 = new Uint32Array(r11.length + e207), o10 = r11.length, s10 = a11.length;
        for (let e208 = t10.edits.length - 1; e208 >= 0; e208--) {
          let c10 = t10.edits[e208];
          if (c10.start > r11.length) {
            n10.warnInvalidEditStart(i10.resultId, t10.resultId, e208, c10.start, r11.length), this._model.tokenization.setSemanticTokens(null, true);
            return;
          }
          let l10 = o10 - (c10.start + c10.deleteCount);
          l10 > 0 && (i7._copy(r11, o10 - l10, a11, s10 - l10, l10), s10 -= l10), c10.data && (i7._copy(c10.data, 0, a11, s10 - c10.data.length, c10.data.length), s10 -= c10.data.length), o10 = c10.start;
        }
        o10 > 0 && i7._copy(r11, 0, a11, 0, o10), t10 = { resultId: t10.resultId, data: a11 };
      }
    }
    if (Y5(t10)) {
      this._currentDocumentResponse = new rMe(e206, t10.resultId, t10.data);
      let i11 = xA(t10, n10, this._model.getLanguageId());
      if (r10.length > 0) for (let e207 of r10) for (let t11 of i11) for (let n11 of e207.changes) t11.applyEdit(n11.range, n11.text);
      this._model.tokenization.setSemanticTokens(i11, true);
    } else this._model.tokenization.setSemanticTokens(null, true);
    a10();
  }
}, i7 = _Zd, _Zd.REQUEST_MIN_DELAY = 300, _Zd.REQUEST_MAX_DELAY = 2e3, _Zd);
o7 = i7 = n7([r7(1, wA), r7(2, US), r7(3, lA), r7(4, X)], o7);
var rMe = class {
  constructor(e206, t10, n10) {
    this.provider = e206, this.resultId = t10, this.data = n10;
  }
  dispose() {
    this.provider.releaseDocumentSemanticTokens(this.resultId);
  }
};
XW(a7);
var iMe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, s7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, c7 = (__d = class extends D {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(), this._semanticTokensStylingService = t10, this._themeService = n10, this._configurationService = r10, this._editor = e206, this._provider = a10.documentRangeSemanticTokensProvider, this._debounceInformation = i10.for(this._provider, `DocumentRangeSemanticTokens`, { min: 100, max: 500 }), this._tokenizeViewport = this._register(new us(() => this._tokenizeViewportNow(), 100)), this._outstandingRequests = [], this._rangeProvidersChangeListeners = [];
    let o10 = () => {
      this._editor.hasModel() && this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()));
    }, s10 = () => {
      if (this._cleanupProviderListeners(), this._editor.hasModel()) {
        let e207 = this._editor.getModel();
        for (let t11 of this._provider.all(e207)) {
          let e208 = t11.onDidChange?.(() => {
            this._cancelAll(), o10();
          });
          e208 && this._rangeProvidersChangeListeners.push(e208);
        }
      }
    };
    this._register(this._editor.onDidScrollChange(() => {
      o10();
    })), this._register(this._editor.onDidChangeModel(() => {
      s10(), this._cancelAll(), o10();
    })), this._register(this._editor.onDidChangeModelLanguage(() => {
      s10(), this._cancelAll(), o10();
    })), this._register(this._editor.onDidChangeModelContent((e207) => {
      this._cancelAll(), o10();
    })), s10(), this._register(this._provider.onDidChange(() => {
      s10(), this._cancelAll(), o10();
    })), this._register(this._configurationService.onDidChangeConfiguration((e207) => {
      e207.affectsConfiguration(`editor.semanticHighlighting`) && (this._cancelAll(), o10());
    })), this._register(this._themeService.onDidColorThemeChange(() => {
      this._cancelAll(), o10();
    })), o10();
  }
  dispose() {
    this._cleanupProviderListeners(), super.dispose();
  }
  _cleanupProviderListeners() {
    Kt(this._rangeProvidersChangeListeners), this._rangeProvidersChangeListeners = [];
  }
  _cancelAll() {
    for (let e206 of this._outstandingRequests) e206.cancel();
    this._outstandingRequests = [];
  }
  _removeOutstandingRequest(e206) {
    for (let t10 = 0, n10 = this._outstandingRequests.length; t10 < n10; t10++) if (this._outstandingRequests[t10] === e206) {
      this._outstandingRequests.splice(t10, 1);
      return;
    }
  }
  _tokenizeViewportNow() {
    if (!this._editor.hasModel()) return;
    let e206 = this._editor.getModel();
    if (e206.tokenization.hasCompleteSemanticTokens()) return;
    if (!t7(e206, this._themeService, this._configurationService)) {
      e206.tokenization.hasSomeSemanticTokens() && e206.tokenization.setSemanticTokens(null, false);
      return;
    }
    if (!tMe(this._provider, e206)) {
      e206.tokenization.hasSomeSemanticTokens() && e206.tokenization.setSemanticTokens(null, false);
      return;
    }
    let t10 = this._editor.getVisibleRangesPlusViewportAboveBelow();
    this._outstandingRequests = this._outstandingRequests.concat(t10.map((t11) => this._requestRange(e206, t11)));
  }
  _requestRange(e206, t10) {
    let n10 = e206.getVersionId(), r10 = es((n11) => Promise.resolve(e710(this._provider, e206, t10, n11))), i10 = new $t(false);
    return r10.then((r11) => {
      if (this._debounceInformation.update(e206, i10.elapsed()), !r11 || !r11.tokens || e206.isDisposed() || e206.getVersionId() !== n10) return;
      let { provider: a10, tokens: o10 } = r11, s10 = this._semanticTokensStylingService.getStyling(a10);
      e206.tokenization.setPartialSemanticTokens(t10, xA(o10, s10, e206.getLanguageId()));
    }).then(() => this._removeOutstandingRequest(r10), () => this._removeOutstandingRequest(r10)), r10;
  }
}, __d.ID = `editor.contrib.viewportSemanticTokens`, __d);
c7 = iMe([s7(1, wA), s7(2, US), s7(3, Uf), s7(4, lA), s7(5, X)], c7), af(c7.ID, c7, 1);
var aMe = class {
  constructor(e206 = true) {
    this.selectSubwords = e206;
  }
  provideSelectionRanges(e206, t10) {
    let n10 = [];
    for (let r10 of t10) {
      let t11 = [];
      n10.push(t11), this.selectSubwords && this._addInWordRanges(t11, e206, r10), this._addWordRanges(t11, e206, r10), this._addWhitespaceLine(t11, e206, r10), t11.push({ range: e206.getFullModelRange() });
    }
    return n10;
  }
  _addInWordRanges(e206, t10, n10) {
    let r10 = t10.getWordAtPosition(n10);
    if (!r10) return;
    let { word: i10, startColumn: a10 } = r10, o10 = n10.column - a10, s10 = o10, c10 = o10, l10 = 0;
    for (; s10 >= 0; s10--) {
      let e207 = i10.charCodeAt(s10);
      if (s10 !== o10 && (e207 === 95 || e207 === 45) || $a(e207) && eo(l10)) break;
      l10 = e207;
    }
    for (s10 += 1; c10 < i10.length; c10++) {
      let e207 = i10.charCodeAt(c10);
      if (eo(e207) && $a(l10) || e207 === 95 || e207 === 45) break;
      l10 = e207;
    }
    s10 < c10 && e206.push({ range: new M(n10.lineNumber, a10 + s10, n10.lineNumber, a10 + c10) });
  }
  _addWordRanges(e206, t10, n10) {
    let r10 = t10.getWordAtPosition(n10);
    r10 && e206.push({ range: new M(n10.lineNumber, r10.startColumn, n10.lineNumber, r10.endColumn) });
  }
  _addWhitespaceLine(e206, t10, n10) {
    t10.getLineLength(n10.lineNumber) > 0 && t10.getLineFirstNonWhitespaceColumn(n10.lineNumber) === 0 && t10.getLineLastNonWhitespaceColumn(n10.lineNumber) === 0 && e206.push({ range: new M(n10.lineNumber, 1, n10.lineNumber, t10.getLineMaxColumn(n10.lineNumber)) });
  }
}, oMe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, sMe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, l7, cMe = class e204 {
  constructor(e206, t10) {
    this.index = e206, this.ranges = t10;
  }
  mov(t10) {
    let n10 = this.index + (t10 ? 1 : -1);
    if (n10 < 0 || n10 >= this.ranges.length) return this;
    let r10 = new e204(n10, this.ranges);
    return r10.ranges[n10].equalsRange(this.ranges[this.index]) ? r10.mov(t10) : r10;
  }
}, u7 = (_$d = class {
  static get(e206) {
    return e206.getContribution(l7.ID);
  }
  constructor(e206, t10) {
    this._editor = e206, this._languageFeaturesService = t10, this._ignoreSelection = false;
  }
  dispose() {
    this._selectionListener?.dispose();
  }
  async run(e206) {
    if (!this._editor.hasModel()) return;
    let t10 = this._editor.getSelections(), n10 = this._editor.getModel();
    if (this._state || await f7(this._languageFeaturesService.selectionRangeProvider, n10, t10.map((e207) => e207.getPosition()), this._editor.getOption(129), dr.None).then((e207) => {
      if (!(!v(e207) || e207.length !== t10.length) && !(!this._editor.hasModel() || !o(this._editor.getSelections(), t10, (e208, t11) => e208.equalsSelection(t11)))) {
        for (let n11 = 0; n11 < e207.length; n11++) e207[n11] = e207[n11].filter((e208) => e208.containsPosition(t10[n11].getStartPosition()) && e208.containsPosition(t10[n11].getEndPosition())), e207[n11].unshift(t10[n11]);
        this._state = e207.map((e208) => new cMe(0, e208)), this._selectionListener?.dispose(), this._selectionListener = this._editor.onDidChangeCursorPosition(() => {
          this._ignoreSelection || (this._selectionListener?.dispose(), this._state = void 0);
        });
      }
    }), !this._state) return;
    this._state = this._state.map((t11) => t11.mov(e206));
    let r10 = this._state.map((e207) => N.fromPositions(e207.ranges[e207.index].getStartPosition(), e207.ranges[e207.index].getEndPosition()));
    this._ignoreSelection = true;
    try {
      this._editor.setSelections(r10);
    } finally {
      this._ignoreSelection = false;
    }
  }
}, l7 = _$d, _$d.ID = `editor.contrib.smartSelectController`, _$d);
u7 = l7 = oMe([sMe(1, X)], u7);
var d7 = class extends G {
  constructor(e206, t10) {
    super(t10), this._forward = e206;
  }
  async run(e206, t10) {
    let n10 = u7.get(t10);
    n10 && await n10.run(this._forward);
  }
}, lMe = class extends d7 {
  constructor() {
    super(true, { id: `editor.action.smartSelect.expand`, label: w(1400, `Expand Selection`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 1553, mac: { primary: 3345, secondary: [1297] }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `1_basic`, title: C(1398, `&&Expand Selection`), order: 2 } });
  }
};
Nu.registerCommandAlias(`editor.action.smartSelect.grow`, `editor.action.smartSelect.expand`);
var uMe = class extends d7 {
  constructor() {
    super(false, { id: `editor.action.smartSelect.shrink`, label: w(1401, `Shrink Selection`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 1551, mac: { primary: 3343, secondary: [1295] }, weight: 100 }, menuOpts: { menuId: W.MenubarSelectionMenu, group: `1_basic`, title: C(1399, `&&Shrink Selection`), order: 3 } });
  }
};
af(u7.ID, u7, 4), q(lMe), q(uMe);
async function f7(e206, t10, n10, r10, i10) {
  let a10 = e206.all(t10).concat(new aMe(r10.selectSubwords));
  a10.length === 1 && a10.unshift(new u3());
  let o10 = [], s10 = [];
  for (let e207 of a10) o10.push(Promise.resolve(e207.provideSelectionRanges(t10, n10, i10)).then((e208) => {
    if (v(e208) && e208.length === n10.length) for (let t11 = 0; t11 < n10.length; t11++) {
      s10[t11] || (s10[t11] = []);
      for (let r11 of e208[t11]) M.isIRange(r11.range) && M.containsPosition(r11.range, n10[t11]) && s10[t11].push(M.lift(r11.range));
    }
  }, xe));
  return await Promise.all(o10), s10.map((e207) => {
    if (e207.length === 0) return [];
    e207.sort((e208, t11) => j.isBefore(e208.getStartPosition(), t11.getStartPosition()) ? 1 : j.isBefore(t11.getStartPosition(), e208.getStartPosition()) || j.isBefore(e208.getEndPosition(), t11.getEndPosition()) ? -1 : +!!j.isBefore(t11.getEndPosition(), e208.getEndPosition()));
    let n11 = [], i11;
    for (let t11 of e207) (!i11 || M.containsRange(t11, i11) && !M.equalsRange(t11, i11)) && (n11.push(t11), i11 = t11);
    if (!r10.selectLeadingAndTrailingWhitespace) return n11;
    let a11 = [n11[0]];
    for (let e208 = 1; e208 < n11.length; e208++) {
      let r11 = n11[e208 - 1], i12 = n11[e208];
      if (i12.startLineNumber !== r11.startLineNumber || i12.endLineNumber !== r11.endLineNumber) {
        let e209 = new M(r11.startLineNumber, t10.getLineFirstNonWhitespaceColumn(r11.startLineNumber), r11.endLineNumber, t10.getLineLastNonWhitespaceColumn(r11.endLineNumber));
        e209.containsRange(r11) && !e209.equalsRange(r11) && i12.containsRange(e209) && !i12.equalsRange(e209) && a11.push(e209);
        let n12 = new M(r11.startLineNumber, 1, r11.endLineNumber, t10.getLineMaxColumn(r11.endLineNumber));
        n12.containsRange(r11) && !n12.equalsRange(e209) && i12.containsRange(n12) && !i12.equalsRange(n12) && a11.push(n12);
      }
      a11.push(i12);
    }
    return a11;
  });
}
Nu.registerCommand(`_executeSelectionRangeProvider`, async function(e206, ...t10) {
  let [n10, r10] = t10;
  Je($r.isUri(n10)), Je(ze(r10, (e207) => j.isIPosition(e207)));
  let i10 = e206.get(X).selectionRangeProvider, a10 = await e206.get(wu).createModelReference(n10);
  try {
    return f7(i10, a10.object.textEditorModel, r10.map(j.lift), { selectLeadingAndTrailingWhitespace: true, selectSubwords: true }, dr.None);
  } finally {
    a10.dispose();
  }
});
var p7 = Object.freeze({ View: w(1638, `View`), Help: w(1639, `Help`), Test: w(1640, `Test`), File: w(1641, `File`), Preferences: w(1642, `Preferences`), Developer: w(1643, `Developer`) }), dMe = class extends tf {
  constructor() {
    super({ id: `editor.action.toggleStickyScroll`, title: { ...w(1448, `Toggle Editor Sticky Scroll`), mnemonicTitle: C(1444, `&&Toggle Editor Sticky Scroll`) }, metadata: { description: w(1449, `Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport`) }, category: p7.View, toggled: { condition: H.equals(`config.editor.stickyScroll.enabled`, true), title: C(1445, `Sticky Scroll`), mnemonicTitle: C(1446, `&&Sticky Scroll`) }, menu: [{ id: W.CommandPalette }, { id: W.MenubarAppearanceMenu, group: `4_editor`, order: 3 }, { id: W.StickyScrollContext }] });
  }
  async runEditorCommand(e206, t10) {
    let n10 = e206.get(Uf), r10 = !n10.getValue(`editor.stickyScroll.enabled`), i10 = b6.get(t10)?.isFocused();
    n10.updateValue(`editor.stickyScroll.enabled`, r10), i10 && t10.focus();
  }
}, m7 = 100, fMe = class extends tf {
  constructor() {
    super({ id: `editor.action.focusStickyScroll`, title: { ...w(1450, `Focus Editor Sticky Scroll`), mnemonicTitle: C(1447, `&&Focus Editor Sticky Scroll`) }, precondition: H.and(H.has(`config.editor.stickyScroll.enabled`), $.stickyScrollVisible), menu: [{ id: W.CommandPalette }] });
  }
  runEditorCommand(e206, t10) {
    b6.get(t10)?.focus();
  }
}, pMe = class extends tf {
  constructor() {
    super({ id: `editor.action.selectNextStickyScrollLine`, title: w(1451, `Select the next editor sticky scroll line`), precondition: $.stickyScrollFocused.isEqualTo(true), keybinding: { weight: m7, primary: 18 } });
  }
  runEditorCommand(e206, t10) {
    b6.get(t10)?.focusNext();
  }
}, mMe = class extends tf {
  constructor() {
    super({ id: `editor.action.selectPreviousStickyScrollLine`, title: w(1452, `Select the previous sticky scroll line`), precondition: $.stickyScrollFocused.isEqualTo(true), keybinding: { weight: m7, primary: 16 } });
  }
  runEditorCommand(e206, t10) {
    b6.get(t10)?.focusPrevious();
  }
}, hMe = class extends tf {
  constructor() {
    super({ id: `editor.action.goToFocusedStickyScrollLine`, title: w(1453, `Go to the focused sticky scroll line`), precondition: $.stickyScrollFocused.isEqualTo(true), keybinding: { weight: m7, primary: 3 } });
  }
  runEditorCommand(e206, t10) {
    b6.get(t10)?.goToFocused();
  }
}, gMe = class extends tf {
  constructor() {
    super({ id: `editor.action.selectEditor`, title: w(1454, `Select Editor`), precondition: $.stickyScrollFocused.isEqualTo(true), keybinding: { weight: m7, primary: 9 } });
  }
  runEditorCommand(e206, t10) {
    b6.get(t10)?.selectEditor();
  }
};
af(b6.ID, b6, 1), yd(dMe), yd(fMe), yd(mMe), yd(pMe), yd(hMe), yd(gMe);
var h7 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, g7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, _Me = class {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    this.range = e206, this.insertText = t10, this.filterText = n10, this.additionalTextEdits = r10, this.command = i10, this.gutterMenuLinkAction = a10, this.completion = o10;
  }
}, _7 = class extends Yt {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(i10.disposable), this.model = e206, this.line = t10, this.word = n10, this.completionModel = r10, this._suggestMemoryService = a10;
  }
  canBeReused(e206, t10, n10) {
    return this.model === e206 && this.line === t10 && this.word.word.length > 0 && this.word.startColumn === n10.startColumn && this.word.endColumn < n10.endColumn && this.completionModel.getIncompleteProvider().size === 0;
  }
  get items() {
    let e206 = [], { items: t10 } = this.completionModel, n10 = this._suggestMemoryService.select(this.model, { lineNumber: this.line, column: this.word.endColumn + this.completionModel.lineContext.characterCountDelta }, t10), r10 = Ut.slice(t10, n10), i10 = Ut.slice(t10, 0, n10), a10 = 5;
    for (let t11 of Ut.concat(r10, i10)) {
      if (t11.score === CM.Default) continue;
      let n11 = new M(t11.editStart.lineNumber, t11.editStart.column, t11.editInsertEnd.lineNumber, t11.editInsertEnd.column + this.completionModel.lineContext.characterCountDelta), r11 = t11.completion.insertTextRules && t11.completion.insertTextRules & 4 ? { snippet: t11.completion.insertText } : t11.completion.insertText;
      e206.push(new _Me(n11, r11, t11.filterTextLow ?? t11.labelLow, t11.completion.additionalTextEdits, t11.completion.command, t11.completion.action, t11)), a10-- >= 0 && t11.resolve(dr.None);
    }
    return e206;
  }
};
_7 = h7([g7(5, a3)], _7);
var v7 = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._languageFeatureService = e206, this._clipboardService = t10, this._suggestMemoryService = n10, this._editorService = r10, this._store.add(e206.inlineCompletionsProvider.register(`*`, this));
  }
  async provideInlineCompletions(e206, t10, n10, r10) {
    if (n10.selectedSuggestionInfo) return;
    let i10;
    for (let t11 of this._editorService.listCodeEditors()) if (t11.getModel() === e206) {
      i10 = t11;
      break;
    }
    if (!i10) return;
    let a10 = i10.getOption(102);
    if (E2.isAllOff(a10)) return;
    e206.tokenization.tokenizeIfCheap(t10.lineNumber);
    let o10 = e206.tokenization.getLineTokens(t10.lineNumber), s10 = o10.getStandardTokenType(o10.findTokenIndexAtOffset(Math.max(t10.column - 1 - 1, 0)));
    if (E2.valueFor(a10, s10) !== `inline`) return;
    let c10 = e206.getWordAtPosition(t10), l10;
    if (c10?.word || (l10 = this._getTriggerCharacterInfo(e206, t10)), !c10?.word && !l10 || (c10 || (c10 = e206.getWordUntilPosition(t10)), c10.endColumn !== t10.column)) return;
    let u10, d10 = e206.getValueInRange(new M(t10.lineNumber, 1, t10.lineNumber, t10.column));
    if (!l10 && this._lastResult?.canBeReused(e206, t10.lineNumber, c10)) {
      let e207 = new f3(d10, t10.column - this._lastResult.word.endColumn);
      this._lastResult.completionModel.lineContext = e207, this._lastResult.acquire(), u10 = this._lastResult;
    } else {
      let n11 = await C2(this._languageFeatureService.completionProvider, e206, t10, new S2(void 0, _3.createSuggestFilter(i10).itemKind, l10?.providers), l10 && { triggerKind: 1, triggerCharacter: l10.ch }, r10), a11;
      n11.needsClipboard && (a11 = await this._clipboardService.readText());
      let o11 = new p3(n11.items, t10.column, new f3(d10, 0), d3.None, i10.getOption(134), i10.getOption(128), { boostFullMatch: false, firstMatchCanBeWeak: false }, a11);
      u10 = new _7(e206, t10.lineNumber, c10, o11, n11, this._suggestMemoryService);
    }
    return this._lastResult = u10, u10;
  }
  handleItemDidShow(e206, t10) {
    t10.completion.resolve(dr.None);
  }
  disposeInlineCompletions(e206) {
    e206.release();
  }
  _getTriggerCharacterInfo(e206, t10) {
    let n10 = e206.getValueInRange(M.fromPositions({ lineNumber: t10.lineNumber, column: t10.column - 1 }, t10)), r10 = /* @__PURE__ */ new Set();
    for (let t11 of this._languageFeatureService.completionProvider.all(e206)) t11.triggerCharacters?.includes(n10) && r10.add(t11);
    if (r10.size !== 0) return { providers: r10, ch: n10 };
  }
};
v7 = h7([g7(0, X), g7(1, hW), g7(2, a3), g7(3, Su)], v7), XW(v7), q(class extends G {
  constructor() {
    super({ id: `editor.action.forceRetokenize`, label: w(1532, `Developer: Force Retokenize`), precondition: void 0 });
  }
  run(e206, t10) {
    if (!t10.hasModel()) return;
    let n10 = t10.getModel();
    n10.tokenization.resetTokenization();
    let r10 = new $t();
    n10.tokenization.forceTokenization(n10.getLineCount()), r10.stop(), console.log(`tokenization took ${r10.elapsed()}`);
  }
}), yd((_ae2 = class extends vd {
  constructor() {
    super({ id: _ae2.ID, title: w(1530, `Toggle Tab Key Moves Focus`), precondition: void 0, keybinding: { primary: 2091, mac: { primary: 1323 }, weight: 100 }, metadata: { description: w(1531, `Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.`) }, f1: true });
  }
  run() {
    let e206 = !$g.getTabFocusMode();
    $g.setTabFocusMode(e206), Wg(e206 ? C(1528, `Pressing Tab will now move focus to the next focusable element`) : C(1529, `Pressing Tab will now insert the tab character`));
  }
}, _ae2.ID = `editor.action.toggleTabFocusMode`, _ae2));
var vMe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, y7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, b7 = class extends D {
  get enabled() {
    return this._enabled;
  }
  set enabled(e206) {
    e206 ? (this.el.setAttribute(`aria-disabled`, `false`), this.el.tabIndex = 0, this.el.style.pointerEvents = `auto`, this.el.style.opacity = `1`, this.el.style.cursor = `pointer`, this._enabled = false) : (this.el.setAttribute(`aria-disabled`, `true`), this.el.tabIndex = -1, this.el.style.pointerEvents = `none`, this.el.style.opacity = `0.4`, this.el.style.cursor = `default`, this._enabled = true), this._enabled = e206;
  }
  constructor(e206, t10, n10 = {}, r10, i10) {
    super(), this._link = t10, this._hoverService = r10, this._enabled = true, this.el = z(e206, B(`a.monaco-link`, { tabIndex: t10.tabIndex ?? 0, href: t10.href }, t10.label)), this.hoverDelegate = n10.hoverDelegate ?? CI(`mouse`), this.setTooltip(t10.title), this.el.setAttribute(`role`, `button`);
    let a10 = this._register(new yx(this.el, `click`)), o10 = this._register(new yx(this.el, `keypress`)), s10 = O.chain(o10.event, (e207) => e207.map((e208) => new Jo(e208)).filter((e208) => e208.keyCode === 3)), c10 = this._register(new yx(this.el, tx.Tap)).event;
    this._register(nx.addTarget(this.el));
    let l10 = O.any(a10.event, s10, c10);
    this._register(l10((e207) => {
      this.enabled && (Vl.stop(e207, true), n10?.opener ? n10.opener(this._link.href) : i10.open(this._link.href, { allowCommands: true }));
    })), this.enabled = true;
  }
  setTooltip(e206) {
    !this.hover && e206 ? this.hover = this._register(this._hoverService.setupManagedHover(this.hoverDelegate, this.el, e206)) : this.hover && this.hover.update(e206);
  }
};
b7 = vMe([y7(3, uj), y7(4, IP)], b7);
var x7 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, S7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, yMe = 26, C7 = class extends D {
  constructor(e206, t10) {
    super(), this._editor = e206, this.instantiationService = t10, this.banner = this._register(this.instantiationService.createInstance(w7));
  }
  hide() {
    this._editor.setBanner(null, 0), this.banner.clear();
  }
  show(e206) {
    this.banner.show({ ...e206, onClose: () => {
      this.hide(), e206.onClose?.();
    } }), this._editor.setBanner(this.banner.element, yMe);
  }
};
C7 = x7([S7(1, V)], C7);
var w7 = class extends D {
  constructor(e206, t10) {
    super(), this.instantiationService = e206, this.markdownRendererService = t10, this.element = B(`div.editor-banner`), this.element.tabIndex = 0;
  }
  getAriaLabel(e206) {
    if (e206.ariaLabel) return e206.ariaLabel;
    if (typeof e206.message == `string`) return e206.message;
  }
  getBannerMessage(e206) {
    if (typeof e206 == `string`) {
      let t10 = B(`span`);
      return t10.innerText = e206, t10;
    }
    return this.markdownRendererService.render(e206).element;
  }
  clear() {
    Xc(this.element);
  }
  show(e206) {
    Xc(this.element);
    let t10 = this.getAriaLabel(e206);
    t10 && this.element.setAttribute(`aria-label`, t10);
    let n10 = z(this.element, B(`div.icon-container`));
    n10.setAttribute(`aria-hidden`, `true`), e206.icon && n10.appendChild(B(`div${ju.asCSSSelector(e206.icon)}`));
    let r10 = z(this.element, B(`div.message-container`));
    if (r10.setAttribute(`aria-hidden`, `true`), r10.appendChild(this.getBannerMessage(e206.message)), this.messageActionsContainer = z(this.element, B(`div.message-actions-container`)), e206.actions) for (let t11 of e206.actions) this._register(this.instantiationService.createInstance(b7, this.messageActionsContainer, { ...t11, tabIndex: -1 }, {}));
    let i10 = z(this.element, B(`div.action-container`));
    this.actionBar = this._register(new CL(i10)), this.actionBar.push(this._register(new Tu(`banner.close`, C(1533, `Close Banner`), ju.asClassName(IU), true, () => {
      typeof e206.onClose == `function` && e206.onClose();
    })), { icon: true, label: false }), this.actionBar.setFocusable(false);
  }
};
w7 = x7([S7(0, V), S7(1, LP)], w7);
var T7 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, E7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, bMe = AU(`extensions-warning-message`, F.warning, C(1534, `Icon shown with a warning message in the extensions editor.`)), D7 = (_be2 = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._editorWorkerService = t10, this._workspaceTrustService = n10, this._highlighter = null, this._bannerClosed = false, this._updateState = (e207) => {
      if (e207 && e207.hasMore) {
        if (this._bannerClosed) return;
        let t11 = Math.max(e207.ambiguousCharacterCount, e207.nonBasicAsciiCharacterCount, e207.invisibleCharacterCount), n11;
        if (e207.nonBasicAsciiCharacterCount >= t11) n11 = { message: C(1535, `This document contains many non-basic ASCII unicode characters`), command: new L7() };
        else if (e207.ambiguousCharacterCount >= t11) n11 = { message: C(1536, `This document contains many ambiguous unicode characters`), command: new F7() };
        else if (e207.invisibleCharacterCount >= t11) n11 = { message: C(1537, `This document contains many invisible unicode characters`), command: new I7() };
        else throw Error(`Unreachable`);
        this._bannerController.show({ id: `unicodeHighlightBanner`, message: n11.message, icon: bMe, actions: [{ label: n11.command.shortLabel, href: `command:${n11.command.desc.id}` }], onClose: () => {
          this._bannerClosed = true;
        } });
      } else this._bannerController.hide();
    }, this._bannerController = this._register(r10.createInstance(C7, e206)), this._register(this._editor.onDidChangeModel(() => {
      this._bannerClosed = false, this._updateHighlighter();
    })), this._options = e206.getOption(142), this._register(n10.onDidChangeTrust((e207) => {
      this._updateHighlighter();
    })), this._register(e206.onDidChangeConfiguration((t11) => {
      t11.hasChanged(142) && (this._options = e206.getOption(142), this._updateHighlighter());
    })), this._updateHighlighter();
  }
  dispose() {
    this._highlighter && (this._highlighter = (this._highlighter.dispose(), null)), super.dispose();
  }
  _updateHighlighter() {
    if (this._updateState(null), this._highlighter && (this._highlighter = (this._highlighter.dispose(), null)), !this._editor.hasModel()) return;
    let e206 = xMe(this._workspaceTrustService.isWorkspaceTrusted(), this._options);
    if ([e206.nonBasicASCII, e206.ambiguousCharacters, e206.invisibleCharacters].every((e207) => e207 === false)) return;
    let t10 = { nonBasicASCII: e206.nonBasicASCII, ambiguousCharacters: e206.ambiguousCharacters, invisibleCharacters: e206.invisibleCharacters, includeComments: e206.includeComments, includeStrings: e206.includeStrings, allowedCodePoints: Object.keys(e206.allowedCharacters).map((e207) => e207.codePointAt(0)), allowedLocales: Object.keys(e206.allowedLocales).map((e207) => e207 === `_os` ? Jp.NumberFormat().value.resolvedOptions().locale : e207 === `_vscode` ? nee : e207) };
    this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri) ? this._highlighter = new O7(this._editor, t10, this._updateState, this._editorWorkerService) : this._highlighter = new SMe(this._editor, t10, this._updateState);
  }
  getDecorationInfo(e206) {
    return this._highlighter ? this._highlighter.getDecorationInfo(e206) : null;
  }
}, _be2.ID = `editor.contrib.unicodeHighlighter`, _be2);
D7 = T7([E7(1, HL), E7(2, iI), E7(3, V)], D7);
function xMe(e206, t10) {
  return { nonBasicASCII: t10.nonBasicASCII === `inUntrustedWorkspace` ? !e206 : t10.nonBasicASCII, ambiguousCharacters: t10.ambiguousCharacters, invisibleCharacters: t10.invisibleCharacters, includeComments: t10.includeComments === `inUntrustedWorkspace` ? !e206 : t10.includeComments, includeStrings: t10.includeStrings === `inUntrustedWorkspace` ? !e206 : t10.includeStrings, allowedCharacters: t10.allowedCharacters, allowedLocales: t10.allowedLocales };
}
var O7 = class extends D {
  constructor(e206, t10, n10, r10) {
    super(), this._editor = e206, this._options = t10, this._updateState = n10, this._editorWorkerService = r10, this._model = this._editor.getModel(), this._decorations = this._editor.createDecorationsCollection(), this._updateSoon = this._register(new us(() => this._update(), 250)), this._register(this._editor.onDidChangeModelContent(() => {
      this._updateSoon.schedule();
    })), this._updateSoon.schedule();
  }
  dispose() {
    this._decorations.clear(), super.dispose();
  }
  _update() {
    if (this._model.isDisposed()) return;
    if (!this._model.mightContainNonBasicASCII()) {
      this._decorations.clear();
      return;
    }
    let e206 = this._model.getVersionId();
    this._editorWorkerService.computedUnicodeHighlights(this._model.uri, this._options).then((t10) => {
      if (this._model.isDisposed() || this._model.getVersionId() !== e206) return;
      this._updateState(t10);
      let n10 = [];
      if (!t10.hasMore) for (let e207 of t10.ranges) n10.push({ range: e207, options: P7.instance.getDecorationFromOptions(this._options) });
      this._decorations.set(n10);
    });
  }
  getDecorationInfo(e206) {
    if (!this._decorations.has(e206)) return null;
    let t10 = this._editor.getModel();
    return NC(t10, e206) ? { reason: N7(t10.getValueInRange(e206.range), this._options), inComment: PC(t10, e206), inString: FC(t10, e206) } : null;
  }
};
O7 = T7([E7(3, HL)], O7);
var SMe = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._options = t10, this._updateState = n10, this._model = this._editor.getModel(), this._decorations = this._editor.createDecorationsCollection(), this._updateSoon = this._register(new us(() => this._update(), 250)), this._register(this._editor.onDidLayoutChange(() => {
      this._updateSoon.schedule();
    })), this._register(this._editor.onDidScrollChange(() => {
      this._updateSoon.schedule();
    })), this._register(this._editor.onDidChangeHiddenAreas(() => {
      this._updateSoon.schedule();
    })), this._register(this._editor.onDidChangeModelContent(() => {
      this._updateSoon.schedule();
    })), this._updateSoon.schedule();
  }
  dispose() {
    this._decorations.clear(), super.dispose();
  }
  _update() {
    if (this._model.isDisposed()) return;
    if (!this._model.mightContainNonBasicASCII()) {
      this._decorations.clear();
      return;
    }
    let e206 = this._editor.getVisibleRanges(), t10 = [], n10 = { ranges: [], ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0, hasMore: false };
    for (let t11 of e206) {
      let e207 = ym.computeUnicodeHighlights(this._model, this._options, t11);
      for (let t12 of e207.ranges) n10.ranges.push(t12);
      n10.ambiguousCharacterCount += n10.ambiguousCharacterCount, n10.invisibleCharacterCount += n10.invisibleCharacterCount, n10.nonBasicAsciiCharacterCount += n10.nonBasicAsciiCharacterCount, n10.hasMore = n10.hasMore || e207.hasMore;
    }
    if (!n10.hasMore) for (let e207 of n10.ranges) t10.push({ range: e207, options: P7.instance.getDecorationFromOptions(this._options) });
    this._updateState(n10), this._decorations.set(t10);
  }
  getDecorationInfo(e206) {
    if (!this._decorations.has(e206)) return null;
    let t10 = this._editor.getModel(), n10 = t10.getValueInRange(e206.range);
    return NC(t10, e206) ? { reason: N7(n10, this._options), inComment: PC(t10, e206), inString: FC(t10, e206) } : null;
  }
}, k7 = C(1538, `Configure Unicode Highlight Options`), A7 = class {
  constructor(e206, t10) {
    this._editor = e206, this._markdownRendererService = t10, this.hoverOrdinal = 5;
  }
  computeSync(e206, t10) {
    if (!this._editor.hasModel() || e206.type !== 1) return [];
    let n10 = this._editor.getModel(), r10 = this._editor.getContribution(D7.ID);
    if (!r10) return [];
    let i10 = [], a10 = /* @__PURE__ */ new Set(), o10 = 300;
    for (let e207 of t10) {
      let t11 = r10.getDecorationInfo(e207);
      if (!t11) continue;
      let s10 = n10.getValueInRange(e207.range).codePointAt(0), c10 = M7(s10), l10;
      switch (t11.reason.kind) {
        case 0:
          l10 = go(t11.reason.confusableWith) ? C(1539, `The character {0} could be confused with the ASCII character {1}, which is more common in source code.`, c10, M7(t11.reason.confusableWith.codePointAt(0))) : C(1540, `The character {0} could be confused with the character {1}, which is more common in source code.`, c10, M7(t11.reason.confusableWith.codePointAt(0)));
          break;
        case 1:
          l10 = C(1541, `The character {0} is invisible.`, c10);
          break;
        case 2:
          l10 = C(1542, `The character {0} is not a basic ASCII character.`, c10);
          break;
      }
      if (a10.has(l10)) continue;
      a10.add(l10);
      let u10 = { codePoint: s10, reason: t11.reason, inComment: t11.inComment, inString: t11.inString }, d10 = C(1543, `Adjust settings`), f10 = zM(R7.ID, u10), p10 = new PM(``, true).appendMarkdown(l10).appendText(` `).appendLink(f10, d10, k7);
      i10.push(new CQ(this, e207.range, [p10], false, o10++));
    }
    return i10;
  }
  renderHoverParts(e206, t10) {
    return vCe(e206, t10, this._editor, this._markdownRendererService);
  }
  getAccessibleContent(e206) {
    return e206.contents.map((e207) => e207.value).join(`
`);
  }
};
A7 = T7([E7(1, LP)], A7);
function j7(e206) {
  return `U+${e206.toString(16).padStart(4, `0`)}`;
}
function M7(e206) {
  let t10 = `\`${j7(e206)}\``;
  return Do.isInvisibleCharacter(e206) || (t10 += ` "${`${CMe(e206)}`}"`), t10;
}
function CMe(e206) {
  return e206 === 96 ? "`` ` ``" : "`" + String.fromCodePoint(e206) + "`";
}
function N7(e206, t10) {
  return ym.computeUnicodeHighlightReason(e206, t10);
}
var P7 = (_ce2 = class {
  constructor() {
    this.map = /* @__PURE__ */ new Map();
  }
  getDecorationFromOptions(e206) {
    return this.getDecoration(!e206.includeComments, !e206.includeStrings);
  }
  getDecoration(e206, t10) {
    let n10 = `${e206}${t10}`, r10 = this.map.get(n10);
    return r10 || (r10 = UO.createDynamic({ description: `unicode-highlight`, stickiness: 1, className: `unicode-highlight`, showIfCollapsed: true, overviewRuler: null, minimap: null, hideInCommentTokens: e206, hideInStringTokens: t10 }), this.map.set(n10, r10)), r10;
  }
}, _ce2.instance = new _ce2(), _ce2), wMe = class extends G {
  constructor() {
    super({ id: F7.ID, label: w(1552, `Disable highlighting of characters in comments`), precondition: void 0 }), this.shortLabel = C(1544, `Disable Highlight In Comments`);
  }
  async run(e206, t10, n10) {
    let r10 = e206.get(Uf);
    r10 && this.runAction(r10);
  }
  async runAction(e206) {
    await e206.updateValue(or.includeComments, false, 2);
  }
}, TMe = class extends G {
  constructor() {
    super({ id: F7.ID, label: w(1553, `Disable highlighting of characters in strings`), precondition: void 0 }), this.shortLabel = C(1545, `Disable Highlight In Strings`);
  }
  async run(e206, t10, n10) {
    let r10 = e206.get(Uf);
    r10 && this.runAction(r10);
  }
  async runAction(e206) {
    await e206.updateValue(or.includeStrings, false, 2);
  }
}, F7 = (_de2 = class extends vd {
  constructor() {
    super({ id: _de2.ID, title: w(1554, `Disable highlighting of ambiguous characters`), precondition: void 0, f1: false }), this.shortLabel = C(1546, `Disable Ambiguous Highlight`);
  }
  async run(e206, t10, n10) {
    let r10 = e206.get(Uf);
    r10 && this.runAction(r10);
  }
  async runAction(e206) {
    await e206.updateValue(or.ambiguousCharacters, false, 2);
  }
}, _de2.ID = `editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters`, _de2), I7 = (_ee2 = class extends vd {
  constructor() {
    super({ id: _ee2.ID, title: w(1555, `Disable highlighting of invisible characters`), precondition: void 0, f1: false }), this.shortLabel = C(1547, `Disable Invisible Highlight`);
  }
  async run(e206, t10, n10) {
    let r10 = e206.get(Uf);
    r10 && this.runAction(r10);
  }
  async runAction(e206) {
    await e206.updateValue(or.invisibleCharacters, false, 2);
  }
}, _ee2.ID = `editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters`, _ee2), L7 = (_fe2 = class extends vd {
  constructor() {
    super({ id: _fe2.ID, title: w(1556, `Disable highlighting of non basic ASCII characters`), precondition: void 0, f1: false }), this.shortLabel = C(1548, `Disable Non ASCII Highlight`);
  }
  async run(e206, t10, n10) {
    let r10 = e206.get(Uf);
    r10 && this.runAction(r10);
  }
  async runAction(e206) {
    await e206.updateValue(or.nonBasicASCII, false, 2);
  }
}, _fe2.ID = `editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters`, _fe2), R7 = (_ge2 = class extends vd {
  constructor() {
    super({ id: _ge2.ID, title: w(1557, `Show Exclude Options`), precondition: void 0, f1: false });
  }
  async run(e206, t10) {
    let { codePoint: n10, reason: r10, inString: i10, inComment: a10 } = t10, o10 = String.fromCodePoint(n10), s10 = e206.get(aF), c10 = e206.get(Uf);
    function l10(e207) {
      return Do.isInvisibleCharacter(e207) ? C(1549, `Exclude {0} (invisible character) from being highlighted`, j7(e207)) : C(1550, `Exclude {0} from being highlighted`, `${j7(e207)} "${o10}"`);
    }
    let u10 = [];
    if (r10.kind === 0) for (let e207 of r10.notAmbiguousInLocales) u10.push({ label: C(1551, `Allow unicode characters that are more common in the language "{0}".`, e207), run: async () => {
      DMe(c10, [e207]);
    } });
    if (u10.push({ label: l10(n10), run: () => EMe(c10, [n10]) }), a10) {
      let e207 = new wMe();
      u10.push({ label: e207.label, run: async () => e207.runAction(c10) });
    } else if (i10) {
      let e207 = new TMe();
      u10.push({ label: e207.label, run: async () => e207.runAction(c10) });
    }
    function d10(e207) {
      return typeof e207.desc.title == `string` ? e207.desc.title : e207.desc.title.value;
    }
    if (r10.kind === 0) {
      let e207 = new F7();
      u10.push({ label: d10(e207), run: async () => e207.runAction(c10) });
    } else if (r10.kind === 1) {
      let e207 = new I7();
      u10.push({ label: d10(e207), run: async () => e207.runAction(c10) });
    } else if (r10.kind === 2) {
      let e207 = new L7();
      u10.push({ label: d10(e207), run: async () => e207.runAction(c10) });
    } else OMe(r10);
    let f10 = await s10.pick(u10, { title: k7 });
    f10 && await f10.run();
  }
}, _ge2.ID = `editor.action.unicodeHighlight.showExcludeOptions`, _ge2);
async function EMe(e206, t10) {
  let n10 = e206.getValue(or.allowedCharacters), r10;
  r10 = typeof n10 == `object` && n10 ? n10 : {};
  for (let e207 of t10) r10[String.fromCodePoint(e207)] = true;
  await e206.updateValue(or.allowedCharacters, r10, 2);
}
async function DMe(e206, t10) {
  let n10 = e206.inspect(or.allowedLocales).user?.value, r10;
  r10 = typeof n10 == `object` && n10 ? Object.assign({}, n10) : {};
  for (let e207 of t10) r10[e207] = true;
  await e206.updateValue(or.allowedLocales, r10, 2);
}
function OMe(e206) {
  throw Error(`Unexpected value: ${e206}`);
}
yd(F7), yd(I7), yd(L7), yd(R7), af(D7.ID, D7, 1), JX.register(A7);
var kMe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, z7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, B7 = `ignoreUnusualLineTerminators`;
function AMe(e206, t10, n10) {
  e206.setModelProperty(t10.uri, B7, n10);
}
function jMe(e206, t10) {
  return e206.getModelProperty(t10.uri, B7);
}
var V7 = (_he2 = class extends D {
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._dialogService = t10, this._codeEditorService = n10, this._isPresentingDialog = false, this._config = this._editor.getOption(143), this._register(this._editor.onDidChangeConfiguration((e207) => {
      e207.hasChanged(143) && (this._config = this._editor.getOption(143), this._checkForUnusualLineTerminators());
    })), this._register(this._editor.onDidChangeModel(() => {
      this._checkForUnusualLineTerminators();
    })), this._register(this._editor.onDidChangeModelContent((e207) => {
      e207.isUndoing || this._checkForUnusualLineTerminators();
    })), this._checkForUnusualLineTerminators();
  }
  async _checkForUnusualLineTerminators() {
    if (this._config === `off` || !this._editor.hasModel()) return;
    let e206 = this._editor.getModel();
    if (!e206.mightContainUnusualLineTerminators() || jMe(this._codeEditorService, e206) === true || this._editor.getOption(104)) return;
    if (this._config === `auto`) {
      e206.removeUnusualLineTerminators(this._editor.getSelections());
      return;
    }
    if (this._isPresentingDialog) return;
    let t10;
    try {
      this._isPresentingDialog = true, t10 = await this._dialogService.confirm({ title: C(1558, `Unusual Line Terminators`), message: C(1559, `Detected unusual line terminators`), detail: C(1560, `The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).

It is recommended to remove them from the file. This can be configured via \`editor.unusualLineTerminators\`.`, Id(e206.uri)), primaryButton: C(1561, `&&Remove Unusual Line Terminators`), cancelButton: C(1562, `Ignore`) });
    } finally {
      this._isPresentingDialog = false;
    }
    if (!t10.confirmed) {
      AMe(this._codeEditorService, e206, true);
      return;
    }
    e206.removeUnusualLineTerminators(this._editor.getSelections());
  }
}, _he2.ID = `editor.contrib.unusualLineTerminatorsDetector`, _he2);
V7 = kMe([z7(1, Gk), z7(2, Su)], V7), af(V7.ID, V7, 1);
var MMe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, NMe = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, H7 = class {
  constructor() {
    this.selector = { language: `*` };
  }
  provideDocumentHighlights(e206, t10, n10) {
    let r10 = [], i10 = e206.getWordAtPosition({ lineNumber: t10.lineNumber, column: t10.column });
    if (!i10) return Promise.resolve(r10);
    if (!e206.isDisposed()) return e206.findMatches(i10.word, true, false, true, yn, false).map((e207) => ({ range: e207.range, kind: Ci.Text }));
  }
  provideMultiDocumentHighlights(e206, t10, n10, r10) {
    let i10 = new wd(), a10 = e206.getWordAtPosition({ lineNumber: t10.lineNumber, column: t10.column });
    if (!a10) return Promise.resolve(i10);
    for (let t11 of [e206, ...n10]) {
      if (t11.isDisposed()) continue;
      let e207 = t11.findMatches(a10.word, true, false, true, yn, false).map((e208) => ({ range: e208.range, kind: Ci.Text }));
      e207 && i10.set(t11.uri, e207);
    }
    return i10;
  }
}, U7 = class extends D {
  constructor(e206) {
    super(), this._register(e206.documentHighlightProvider.register(`*`, new H7())), this._register(e206.multiDocumentHighlightProvider.register(`*`, new H7()));
  }
};
U7 = MMe([NMe(0, X)], U7);
var W7 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, G7 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, K7, q7, J7 = new U(`hasWordHighlights`, false);
function Y7(e206, t10, n10, r10) {
  return os(e206.ordered(t10).map((e207) => () => Promise.resolve(e207.provideDocumentHighlights(t10, n10, r10)).then(void 0, xe)), (e207) => e207 != null).then((e207) => {
    if (e207) {
      let n11 = new wd();
      return n11.set(t10.uri, e207), n11;
    }
    return new wd();
  });
}
function PMe(e206, t10, n10, r10, i10) {
  return os(e206.ordered(t10).map((e207) => () => {
    let a10 = i10.filter((e208) => cm(e208)).filter((t11) => rj(e207.selector, t11.uri, t11.getLanguageId(), true, void 0, void 0) > 0);
    return Promise.resolve(e207.provideMultiDocumentHighlights(t10, n10, a10, r10)).then(void 0, xe);
  }), (e207) => e207 != null);
}
var X7 = class {
  constructor(e206, t10, n10) {
    this._model = e206, this._selection = t10, this._wordSeparators = n10, this._wordRange = this._getCurrentWordRange(e206, t10), this._result = null;
  }
  get result() {
    return this._result || (this._result = es((e206) => this._compute(this._model, this._selection, this._wordSeparators, e206))), this._result;
  }
  _getCurrentWordRange(e206, t10) {
    let n10 = e206.getWordAtPosition(t10.getPosition());
    return n10 ? new M(t10.startLineNumber, n10.startColumn, t10.startLineNumber, n10.endColumn) : null;
  }
  cancel() {
    this.result.cancel();
  }
}, FMe = class extends X7 {
  constructor(e206, t10, n10, r10) {
    super(e206, t10, n10), this._providers = r10;
  }
  _compute(e206, t10, n10, r10) {
    return Y7(this._providers, e206, t10.getPosition(), r10).then((e207) => e207 || new wd());
  }
}, IMe = class extends X7 {
  constructor(e206, t10, n10, r10, i10) {
    super(e206, t10, n10), this._providers = r10, this._otherModels = i10;
  }
  _compute(e206, t10, n10, r10) {
    return PMe(this._providers, e206, t10.getPosition(), r10, this._otherModels).then((e207) => e207 || new wd());
  }
};
function LMe(e206, t10, n10, r10) {
  return new FMe(t10, n10, r10, e206);
}
function RMe(e206, t10, n10, r10, i10) {
  return new IMe(t10, n10, r10, e206, i10);
}
nf(`_executeDocumentHighlights`, async (e206, t10, n10) => (await Y7(e206.get(X).documentHighlightProvider, t10, n10, dr.None))?.get(t10.uri));
var Z7 = (_ie2 = class {
  constructor(e206, t10, n10, r10, i10, a10, o10, s10) {
    this.toUnhook = new E(), this.workerRequestTokenId = 0, this.workerRequestCompleted = false, this.workerRequestValue = new wd(), this.lastCursorPositionChangeTime = 0, this.renderDecorationsTimer = void 0, this.runDelayer = this.toUnhook.add(new ns(50)), this.editor = e206, this.providers = t10, this.multiDocumentProviders = n10, this.codeEditorService = a10, this.textModelService = i10, this.configurationService = o10, this.logService = s10, this._hasWordHighlights = J7.bindTo(r10), this._ignorePositionChangeEvent = false, this.occurrencesHighlightEnablement = this.editor.getOption(90), this.occurrencesHighlightDelay = this.configurationService.getValue(`editor.occurrencesHighlightDelay`), this.model = this.editor.getModel(), this.toUnhook.add(e206.onDidChangeCursorPosition((e207) => {
      this._ignorePositionChangeEvent || this.occurrencesHighlightEnablement !== `off` && this.runDelayer.trigger(() => {
        this._onPositionChanged(e207);
      });
    })), this.toUnhook.add(e206.onDidFocusEditorText((e207) => {
      this.occurrencesHighlightEnablement !== `off` && (this.workerRequest || this.runDelayer.trigger(() => {
        this._run();
      }));
    })), this.toUnhook.add(e206.onDidChangeModelContent((e207) => {
      Ss(this.model.uri, `output`) || this._stopAll();
    })), this.toUnhook.add(e206.onDidChangeModel((e207) => {
      !e207.newModelUrl && e207.oldModelUrl ? this._stopSingular() : K7.query && this._run();
    })), this.toUnhook.add(e206.onDidChangeConfiguration((e207) => {
      let t11 = this.editor.getOption(90);
      if (this.occurrencesHighlightEnablement !== t11) switch (this.occurrencesHighlightEnablement = t11, t11) {
        case `off`:
          this._stopAll();
          break;
        case `singleFile`:
          this._stopAll(K7.query?.modelInfo?.modelURI);
          break;
        case `multiFile`:
          K7.query && this._run(true);
          break;
        default:
          console.warn(`Unknown occurrencesHighlight setting value:`, t11);
          break;
      }
    })), this.toUnhook.add(this.configurationService.onDidChangeConfiguration((e207) => {
      if (e207.affectsConfiguration(`editor.occurrencesHighlightDelay`)) {
        let e208 = o10.getValue(`editor.occurrencesHighlightDelay`);
        this.occurrencesHighlightDelay !== e208 && (this.occurrencesHighlightDelay = e208);
      }
    })), this.toUnhook.add(e206.onDidBlurEditorWidget(() => {
      let e207 = this.codeEditorService.getFocusedCodeEditor();
      e207 ? e207.getModel()?.uri.scheme === xs.vscodeNotebookCell && this.editor.getModel()?.uri.scheme !== xs.vscodeNotebookCell && this._stopAll() : this._stopAll();
    })), this.decorations = this.editor.createDecorationsCollection(), this.workerRequestTokenId = 0, this.workerRequest = null, this.workerRequestCompleted = false, this.lastCursorPositionChangeTime = 0, this.renderDecorationsTimer = void 0, K7.query && this._run();
  }
  hasDecorations() {
    return this.decorations.length > 0;
  }
  restore(e206) {
    this.occurrencesHighlightEnablement !== `off` && (this.runDelayer.cancel(), this.runDelayer.trigger(() => {
      this._run(false, e206);
    }));
  }
  stop() {
    this.occurrencesHighlightEnablement !== `off` && this._stopAll();
  }
  _getSortedHighlights() {
    return this.decorations.getRanges().sort(M.compareRangesUsingStarts);
  }
  moveNext() {
    let e206 = this._getSortedHighlights(), t10 = (e206.findIndex((e207) => e207.containsPosition(this.editor.getPosition())) + 1) % e206.length, n10 = e206[t10];
    try {
      this._ignorePositionChangeEvent = true, this.editor.setPosition(n10.getStartPosition()), this.editor.revealRangeInCenterIfOutsideViewport(n10);
      let r10 = this._getWord();
      r10 && Wg(`${this.editor.getModel().getLineContent(n10.startLineNumber)}, ${t10 + 1} of ${e206.length} for '${r10.word}'`);
    } finally {
      this._ignorePositionChangeEvent = false;
    }
  }
  moveBack() {
    let e206 = this._getSortedHighlights(), t10 = (e206.findIndex((e207) => e207.containsPosition(this.editor.getPosition())) - 1 + e206.length) % e206.length, n10 = e206[t10];
    try {
      this._ignorePositionChangeEvent = true, this.editor.setPosition(n10.getStartPosition()), this.editor.revealRangeInCenterIfOutsideViewport(n10);
      let r10 = this._getWord();
      r10 && Wg(`${this.editor.getModel().getLineContent(n10.startLineNumber)}, ${t10 + 1} of ${e206.length} for '${r10.word}'`);
    } finally {
      this._ignorePositionChangeEvent = false;
    }
  }
  _removeSingleDecorations() {
    if (!this.editor.hasModel()) return;
    let e206 = K7.storedDecorationIDs.get(this.editor.getModel().uri);
    e206 && (this.editor.removeDecorations(e206), K7.storedDecorationIDs.delete(this.editor.getModel().uri), this.decorations.length > 0 && (this.decorations.clear(), this._hasWordHighlights.set(false)));
  }
  _removeAllDecorations(e206) {
    let t10 = this.codeEditorService.listCodeEditors(), n10 = [];
    for (let r10 of t10) {
      if (!r10.hasModel() || Fd(r10.getModel().uri, e206)) continue;
      let t11 = K7.storedDecorationIDs.get(r10.getModel().uri);
      if (!t11) continue;
      r10.removeDecorations(t11), n10.push(r10.getModel().uri);
      let i10 = Q7.get(r10);
      i10?.wordHighlighter && i10.wordHighlighter.decorations.length > 0 && (i10.wordHighlighter.decorations.clear(), i10.wordHighlighter.workerRequest = null, i10.wordHighlighter._hasWordHighlights.set(false));
    }
    for (let e207 of n10) K7.storedDecorationIDs.delete(e207);
  }
  _stopSingular() {
    this._removeSingleDecorations(), this.editor.hasTextFocus() && (this.editor.getModel()?.uri.scheme !== xs.vscodeNotebookCell && K7.query?.modelInfo?.modelURI.scheme !== xs.vscodeNotebookCell ? (K7.query = null, this._run()) : K7.query?.modelInfo && (K7.query.modelInfo = null)), this.renderDecorationsTimer !== void 0 && (clearTimeout(this.renderDecorationsTimer), this.renderDecorationsTimer = void 0), this.workerRequest !== null && (this.workerRequest.cancel(), this.workerRequest = null), this.workerRequestCompleted || (this.workerRequestCompleted = (this.workerRequestTokenId++, true));
  }
  _stopAll(e206) {
    this._removeAllDecorations(e206), this.renderDecorationsTimer !== void 0 && (clearTimeout(this.renderDecorationsTimer), this.renderDecorationsTimer = void 0), this.workerRequest !== null && (this.workerRequest.cancel(), this.workerRequest = null), this.workerRequestCompleted || (this.workerRequestCompleted = (this.workerRequestTokenId++, true));
  }
  _onPositionChanged(e206) {
    if (this.occurrencesHighlightEnablement === `off`) {
      this._stopAll();
      return;
    }
    if (e206.source !== `api` && e206.reason !== 3) {
      this._stopAll();
      return;
    }
    this._run();
  }
  _getWord() {
    let e206 = this.editor.getSelection(), t10 = e206.startLineNumber, n10 = e206.startColumn;
    return this.model.isDisposed() ? null : this.model.getWordAtPosition({ lineNumber: t10, column: n10 });
  }
  getOtherModelsToHighlight(e206) {
    if (!e206) return [];
    if (e206.uri.scheme === xs.vscodeNotebookCell) {
      let t11 = [], n11 = this.codeEditorService.listCodeEditors();
      for (let r10 of n11) {
        let n12 = r10.getModel();
        n12 && n12 !== e206 && n12.uri.scheme === xs.vscodeNotebookCell && t11.push(n12);
      }
      return t11;
    }
    let t10 = [], n10 = this.codeEditorService.listCodeEditors();
    for (let r10 of n10) {
      if (!Cq(r10)) continue;
      let n11 = r10.getModel();
      n11 && e206 === n11.modified && t10.push(n11.modified);
    }
    if (t10.length) return t10;
    if (this.occurrencesHighlightEnablement === `singleFile`) return [];
    for (let r10 of n10) {
      let n11 = r10.getModel();
      n11 && n11 !== e206 && t10.push(n11);
    }
    return t10;
  }
  async _run(e206, t10) {
    if (this.editor.hasTextFocus()) {
      let e207 = this.editor.getSelection();
      if (!e207 || e207.startLineNumber !== e207.endLineNumber) {
        K7.query = null, this._stopAll();
        return;
      }
      let t11 = e207.startColumn, n10 = e207.endColumn, r10 = this._getWord();
      if (!r10 || r10.startColumn > t11 || r10.endColumn < n10) {
        K7.query = null, this._stopAll();
        return;
      }
      K7.query = { modelInfo: { modelURI: this.model.uri, selection: e207 } };
    } else if (!K7.query) {
      this._stopAll();
      return;
    }
    if (this.lastCursorPositionChangeTime = (/* @__PURE__ */ new Date()).getTime(), Fd(this.editor.getModel().uri, K7.query.modelInfo?.modelURI)) {
      if (!e206) {
        let e207 = this.decorations.getRanges();
        for (let t11 of e207) if (t11.containsPosition(this.editor.getPosition())) return;
      }
      this._stopAll(e206 ? this.model.uri : void 0);
      let n10 = ++this.workerRequestTokenId;
      this.workerRequestCompleted = false;
      let r10 = this.getOtherModelsToHighlight(this.editor.getModel());
      if (!K7.query || !K7.query.modelInfo) return;
      let i10 = await this.textModelService.createModelReference(K7.query.modelInfo.modelURI);
      try {
        this.workerRequest = this.computeWithModel(i10.object.textEditorModel, K7.query.modelInfo.selection, r10), this.workerRequest?.result.then((e207) => {
          n10 === this.workerRequestTokenId && (this.workerRequestCompleted = true, this.workerRequestValue = e207 || [], this._beginRenderDecorations(t10 ?? this.occurrencesHighlightDelay));
        }, be);
      } catch (e207) {
        this.logService.error(`Unexpected error during occurrence request. Log: `, e207);
      } finally {
        i10.dispose();
      }
    } else if (this.model.uri.scheme === xs.vscodeNotebookCell) {
      let e207 = ++this.workerRequestTokenId;
      if (this.workerRequestCompleted = false, !K7.query || !K7.query.modelInfo) return;
      let n10 = await this.textModelService.createModelReference(K7.query.modelInfo.modelURI);
      try {
        this.workerRequest = this.computeWithModel(n10.object.textEditorModel, K7.query.modelInfo.selection, [this.model]), this.workerRequest?.result.then((n11) => {
          e207 === this.workerRequestTokenId && (this.workerRequestCompleted = true, this.workerRequestValue = n11 || [], this._beginRenderDecorations(t10 ?? this.occurrencesHighlightDelay));
        }, be);
      } catch (e208) {
        this.logService.error(`Unexpected error during occurrence request. Log: `, e208);
      } finally {
        n10.dispose();
      }
    }
  }
  computeWithModel(e206, t10, n10) {
    return n10.length ? RMe(this.multiDocumentProviders, e206, t10, this.editor.getOption(148), n10) : LMe(this.providers, e206, t10, this.editor.getOption(148));
  }
  _beginRenderDecorations(e206) {
    let t10 = (/* @__PURE__ */ new Date()).getTime(), n10 = this.lastCursorPositionChangeTime + e206;
    t10 >= n10 ? (this.renderDecorationsTimer = void 0, this.renderDecorations()) : this.renderDecorationsTimer = setTimeout(() => {
      this.renderDecorations();
    }, n10 - t10);
  }
  renderDecorations() {
    this.renderDecorationsTimer = void 0;
    let e206 = this.codeEditorService.listCodeEditors();
    for (let t10 of e206) {
      let e207 = Q7.get(t10);
      if (!e207) continue;
      let n10 = [], r10 = t10.getModel()?.uri;
      if (r10 && this.workerRequestValue.has(r10)) {
        let i10 = K7.storedDecorationIDs.get(r10), a10 = this.workerRequestValue.get(r10);
        if (a10) for (let e208 of a10) e208.range && n10.push({ range: e208.range, options: uje(e208.kind) });
        let o10 = [];
        t10.changeDecorations((e208) => {
          o10 = e208.deltaDecorations(i10 ?? [], n10);
        }), K7.storedDecorationIDs = K7.storedDecorationIDs.set(r10, o10), n10.length > 0 && (e207.wordHighlighter?.decorations.set(n10), e207.wordHighlighter?._hasWordHighlights.set(true));
      }
    }
    this.workerRequest = null;
  }
  dispose() {
    this._stopSingular(), this.toUnhook.dispose();
  }
}, K7 = _ie2, _ie2.storedDecorationIDs = new wd(), _ie2.query = null, _ie2);
Z7 = K7 = W7([G7(4, wu), G7(5, Su), G7(6, Uf), G7(7, Ud)], Z7);
var Q7 = (_je2 = class extends D {
  static get(e206) {
    return e206.getContribution(q7.ID);
  }
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(), this._wordHighlighter = null;
    let s10 = () => {
      e206.hasModel() && !e206.getModel().isTooLargeForTokenization() && e206.getModel().uri.scheme !== xs.accessibleView && (this._wordHighlighter = new Z7(e206, n10.documentHighlightProvider, n10.multiDocumentHighlightProvider, t10, i10, r10, a10, o10));
    };
    this._register(e206.onDidChangeModel((e207) => {
      this._wordHighlighter && (this._wordHighlighter = (!e207.newModelUrl && e207.oldModelUrl?.scheme !== xs.vscodeNotebookCell && this.wordHighlighter?.stop(), this._wordHighlighter.dispose(), null)), s10();
    })), s10();
  }
  get wordHighlighter() {
    return this._wordHighlighter;
  }
  saveViewState() {
    return !!(this._wordHighlighter && this._wordHighlighter.hasDecorations());
  }
  moveNext() {
    this._wordHighlighter?.moveNext();
  }
  moveBack() {
    this._wordHighlighter?.moveBack();
  }
  restoreViewState(e206) {
    this._wordHighlighter && e206 && this._wordHighlighter.restore(250);
  }
  dispose() {
    this._wordHighlighter && (this._wordHighlighter = (this._wordHighlighter.dispose(), null)), super.dispose();
  }
}, q7 = _je2, _je2.ID = `editor.contrib.wordHighlighter`, _je2);
Q7 = q7 = W7([G7(1, nd), G7(2, X), G7(3, Su), G7(4, wu), G7(5, Uf), G7(6, Ud)], Q7);
var $7 = class extends G {
  constructor(e206, t10) {
    super(t10), this._isNext = e206;
  }
  run(e206, t10) {
    let n10 = Q7.get(t10);
    n10 && (this._isNext ? n10.moveNext() : n10.moveBack());
  }
}, zMe = class extends $7 {
  constructor() {
    super(true, { id: `editor.action.wordHighlight.next`, label: w(1572, `Go to Next Symbol Highlight`), precondition: J7, kbOpts: { kbExpr: $.editorTextFocus, primary: 65, weight: 100 } });
  }
}, BMe = class extends $7 {
  constructor() {
    super(false, { id: `editor.action.wordHighlight.prev`, label: w(1573, `Go to Previous Symbol Highlight`), precondition: J7, kbOpts: { kbExpr: $.editorTextFocus, primary: 1089, weight: 100 } });
  }
}, VMe = class extends G {
  constructor() {
    super({ id: `editor.action.wordHighlight.trigger`, label: w(1574, `Trigger Symbol Highlight`), precondition: void 0, kbOpts: { kbExpr: $.editorTextFocus, primary: 0, weight: 100 } });
  }
  run(e206, t10, n10) {
    let r10 = Q7.get(t10);
    r10 && r10.restoreViewState(true);
  }
};
af(Q7.ID, Q7, 0), q(zMe), q(BMe), q(VMe), XW(U7);
var e910 = class extends $d {
  constructor(e206) {
    super(e206), this._inSelectionMode = e206.inSelectionMode, this._wordNavigationType = e206.wordNavigationType;
  }
  runEditorCommand(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = Zp(t10.getOption(148), t10.getOption(147)), i10 = t10.getModel(), a10 = t10.getSelections(), o10 = a10.length > 1, s10 = a10.map((e207) => {
      let t11 = new j(e207.positionLineNumber, e207.positionColumn), n11 = this._move(r10, i10, t11, this._wordNavigationType, o10);
      return this._moveTo(e207, n11, this._inSelectionMode);
    });
    if (i10.pushStackElement(), t10._getViewModel().setCursorStates(`moveWordCommand`, 3, s10.map((e207) => Mx.fromModelSelection(e207))), s10.length === 1) {
      let e207 = new j(s10[0].positionLineNumber, s10[0].positionColumn);
      t10.revealPosition(e207, 0);
    }
  }
  _moveTo(e206, t10, n10) {
    return n10 ? new N(e206.selectionStartLineNumber, e206.selectionStartColumn, t10.lineNumber, t10.column) : new N(t10.lineNumber, t10.column, t10.lineNumber, t10.column);
  }
}, t9 = class extends e910 {
  _move(e206, t10, n10, r10, i10) {
    return Kx.moveWordLeft(e206, t10, n10, r10, i10);
  }
}, n9 = class extends e910 {
  _move(e206, t10, n10, r10, i10) {
    return Kx.moveWordRight(e206, t10, n10, r10);
  }
}, HMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 0, id: `cursorWordStartLeft`, precondition: void 0 });
  }
}, UMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 2, id: `cursorWordEndLeft`, precondition: void 0 });
  }
}, WMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 1, id: `cursorWordLeft`, precondition: void 0, kbOpts: { kbExpr: H.and($.textInputFocus, H.and(t_, $B)?.negate()), primary: 2063, mac: { primary: 527 }, weight: 100 } });
  }
}, GMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 0, id: `cursorWordStartLeftSelect`, precondition: void 0 });
  }
}, KMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 2, id: `cursorWordEndLeftSelect`, precondition: void 0 });
  }
}, qMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 1, id: `cursorWordLeftSelect`, precondition: void 0, kbOpts: { kbExpr: H.and($.textInputFocus, H.and(t_, $B)?.negate()), primary: 3087, mac: { primary: 1551 }, weight: 100 } });
  }
}, JMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 3, id: `cursorWordAccessibilityLeft`, precondition: void 0 });
  }
  _move(e206, t10, n10, r10, i10) {
    return super._move(Zp(lr.wordSeparators.defaultValue, e206.intlSegmenterLocales), t10, n10, r10, i10);
  }
}, YMe = class extends t9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 3, id: `cursorWordAccessibilityLeftSelect`, precondition: void 0 });
  }
  _move(e206, t10, n10, r10, i10) {
    return super._move(Zp(lr.wordSeparators.defaultValue, e206.intlSegmenterLocales), t10, n10, r10, i10);
  }
}, XMe = class extends n9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 0, id: `cursorWordStartRight`, precondition: void 0 });
  }
}, ZMe = class extends n9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 2, id: `cursorWordEndRight`, precondition: void 0, kbOpts: { kbExpr: H.and($.textInputFocus, H.and(t_, $B)?.negate()), primary: 2065, mac: { primary: 529 }, weight: 100 } });
  }
}, QMe = class extends n9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 2, id: `cursorWordRight`, precondition: void 0 });
  }
}, $Me = class extends n9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 0, id: `cursorWordStartRightSelect`, precondition: void 0 });
  }
}, eNe = class extends n9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 2, id: `cursorWordEndRightSelect`, precondition: void 0, kbOpts: { kbExpr: H.and($.textInputFocus, H.and(t_, $B)?.negate()), primary: 3089, mac: { primary: 1553 }, weight: 100 } });
  }
}, tNe = class extends n9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 2, id: `cursorWordRightSelect`, precondition: void 0 });
  }
}, nNe = class extends n9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 3, id: `cursorWordAccessibilityRight`, precondition: void 0 });
  }
  _move(e206, t10, n10, r10, i10) {
    return super._move(Zp(lr.wordSeparators.defaultValue, e206.intlSegmenterLocales), t10, n10, r10, i10);
  }
}, rNe = class extends n9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 3, id: `cursorWordAccessibilityRightSelect`, precondition: void 0 });
  }
  _move(e206, t10, n10, r10, i10) {
    return super._move(Zp(lr.wordSeparators.defaultValue, e206.intlSegmenterLocales), t10, n10, r10, i10);
  }
}, r9 = class extends $d {
  constructor(e206) {
    super({ canTriggerInlineEdits: true, ...e206 }), this._whitespaceHeuristics = e206.whitespaceHeuristics, this._wordNavigationType = e206.wordNavigationType;
  }
  runEditorCommand(e206, t10, n10) {
    let r10 = e206?.get(bp);
    if (!t10.hasModel() || !r10) return;
    let i10 = Zp(t10.getOption(148), t10.getOption(147)), a10 = t10.getModel(), o10 = t10.getSelections(), s10 = t10.getOption(10), c10 = t10.getOption(15), l10 = r10.getLanguageConfiguration(a10.getLanguageId()).getAutoClosingPairs(), u10 = t10._getViewModel(), d10 = o10.map((e207) => new Lx(this._delete({ wordSeparators: i10, model: a10, selection: e207, whitespaceHeuristics: this._whitespaceHeuristics, autoClosingDelete: t10.getOption(13), autoClosingBrackets: s10, autoClosingQuotes: c10, autoClosingPairs: l10, autoClosedCharacters: u10.getCursorAutoClosedCharacters() }, this._wordNavigationType), ``));
    t10.pushUndoStop(), t10.executeCommands(this.id, d10), t10.pushUndoStop();
  }
}, i9 = class extends r9 {
  _delete(e206, t10) {
    return Kx.deleteWordLeft(e206, t10) || new M(1, 1, 1, 1);
  }
}, a9 = class extends r9 {
  _delete(e206, t10) {
    let n10 = Kx.deleteWordRight(e206, t10);
    if (n10) return n10;
    let r10 = e206.model.getLineCount(), i10 = e206.model.getLineMaxColumn(r10);
    return new M(r10, i10, r10, i10);
  }
}, iNe = class extends i9 {
  constructor() {
    super({ whitespaceHeuristics: false, wordNavigationType: 0, id: `deleteWordStartLeft`, precondition: $.writable });
  }
}, aNe = class extends i9 {
  constructor() {
    super({ whitespaceHeuristics: false, wordNavigationType: 2, id: `deleteWordEndLeft`, precondition: $.writable });
  }
}, oNe = class extends i9 {
  constructor() {
    super({ whitespaceHeuristics: true, wordNavigationType: 0, id: `deleteWordLeft`, precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 2049, mac: { primary: 513 }, weight: 100 } });
  }
}, sNe = class extends a9 {
  constructor() {
    super({ whitespaceHeuristics: false, wordNavigationType: 0, id: `deleteWordStartRight`, precondition: $.writable });
  }
}, cNe = class extends a9 {
  constructor() {
    super({ whitespaceHeuristics: false, wordNavigationType: 2, id: `deleteWordEndRight`, precondition: $.writable });
  }
}, lNe = class extends a9 {
  constructor() {
    super({ whitespaceHeuristics: true, wordNavigationType: 2, id: `deleteWordRight`, precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 2068, mac: { primary: 532 }, weight: 100 } });
  }
}, uNe = class extends G {
  constructor() {
    super({ id: `deleteInsideWord`, precondition: $.writable, label: w(1575, `Delete Word`) });
  }
  run(e206, t10, n10) {
    if (!t10.hasModel()) return;
    let r10 = Zp(t10.getOption(148), t10.getOption(147)), i10 = t10.getModel(), a10 = t10.getSelections().map((e207) => new Lx(Kx.deleteInsideWord(r10, i10, e207), ``));
    t10.pushUndoStop(), t10.executeCommands(this.id, a10), t10.pushUndoStop();
  }
};
K(new HMe()), K(new UMe()), K(new WMe()), K(new GMe()), K(new KMe()), K(new qMe()), K(new XMe()), K(new ZMe()), K(new QMe()), K(new $Me()), K(new eNe()), K(new tNe()), K(new JMe()), K(new YMe()), K(new nNe()), K(new rNe()), K(new iNe()), K(new aNe()), K(new oNe()), K(new sNe()), K(new cNe()), K(new lNe()), q(uNe);
var dNe = class extends r9 {
  constructor() {
    super({ whitespaceHeuristics: true, wordNavigationType: 0, id: `deleteWordPartLeft`, precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 769 }, weight: 100 } });
  }
  _delete(e206, t10) {
    return qx.deleteWordPartLeft(e206) || new M(1, 1, 1, 1);
  }
}, fNe = class extends r9 {
  constructor() {
    super({ whitespaceHeuristics: true, wordNavigationType: 2, id: `deleteWordPartRight`, precondition: $.writable, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 788 }, weight: 100 } });
  }
  _delete(e206, t10) {
    let n10 = qx.deleteWordPartRight(e206);
    if (n10) return n10;
    let r10 = e206.model.getLineCount(), i10 = e206.model.getLineMaxColumn(r10);
    return new M(r10, i10, r10, i10);
  }
}, o9 = class extends e910 {
  _move(e206, t10, n10, r10, i10) {
    return qx.moveWordPartLeft(e206, t10, n10, i10);
  }
}, pNe = class extends o9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 0, id: `cursorWordPartLeft`, precondition: void 0, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 783 }, weight: 100 } });
  }
};
Nu.registerCommandAlias(`cursorWordPartStartLeft`, `cursorWordPartLeft`);
var mNe = class extends o9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 0, id: `cursorWordPartLeftSelect`, precondition: void 0, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 1807 }, weight: 100 } });
  }
};
Nu.registerCommandAlias(`cursorWordPartStartLeftSelect`, `cursorWordPartLeftSelect`);
var s9 = class extends e910 {
  _move(e206, t10, n10, r10, i10) {
    return qx.moveWordPartRight(e206, t10, n10);
  }
}, hNe = class extends s9 {
  constructor() {
    super({ inSelectionMode: false, wordNavigationType: 2, id: `cursorWordPartRight`, precondition: void 0, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 785 }, weight: 100 } });
  }
}, gNe = class extends s9 {
  constructor() {
    super({ inSelectionMode: true, wordNavigationType: 2, id: `cursorWordPartRightSelect`, precondition: void 0, kbOpts: { kbExpr: $.textInputFocus, primary: 0, mac: { primary: 1809 }, weight: 100 } });
  }
};
K(new dNe()), K(new fNe()), K(new pNe()), K(new mNe()), K(new hNe()), K(new gNe());
var c9 = (_ke2 = class extends D {
  constructor(e206) {
    super(), this.editor = e206, this._register(this.editor.onDidAttemptReadOnlyEdit(() => this._onDidAttemptReadOnlyEdit()));
  }
  _onDidAttemptReadOnlyEdit() {
    let e206 = QJ.get(this.editor);
    if (e206 && this.editor.hasModel()) {
      let t10 = this.editor.getOptions().get(105);
      t10 || (t10 = this.editor.isSimpleWidget ? new PM(C(1378, `Cannot edit in read-only input`)) : new PM(C(1379, `Cannot edit in read-only editor`))), e206.showMessage(t10, this.editor.getPosition());
    }
  }
}, _ke2.ID = `editor.contrib.readOnlyMessageController`, _ke2);
af(c9.ID, c9, 2);
var _Ne = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, l9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, u9 = class extends D {
  constructor(e206, t10, n10) {
    super(), this._textModel = e206, this._languageFeaturesService = t10, this._outlineModelService = n10, this._currentModel = Ic(this, void 0);
    let r10 = TK(`documentSymbolProvider.onDidChange`, this._languageFeaturesService.documentSymbolProvider.onDidChange), i10 = TK(`_textModel.onDidChangeContent`, O.debounce((e207) => this._textModel.onDidChangeContent(e207), () => void 0, 100));
    this._register(vc(async (e207, t11) => {
      r10.read(e207), i10.read(e207);
      let n11 = t11.add(new JG()), a10 = await this._outlineModelService.getOrCreate(this._textModel, n11.token);
      t11.isDisposed || this._currentModel.set(a10, void 0);
    }));
  }
  getBreadcrumbItems(e206, t10) {
    let n10 = this._currentModel.read(t10);
    if (!n10) return [];
    let r10 = n10.asListOfDocumentSymbols().filter((t11) => e206.contains(t11.range.startLineNumber) && !e206.contains(t11.range.endLineNumber));
    return r10.sort(fe(ce((e207) => e207.range.endLineNumber - e207.range.startLineNumber, ue))), r10.map((e207) => ({ name: e207.name, kind: e207.kind, startLineNumber: e207.range.startLineNumber }));
  }
};
u9 = _Ne([l9(1, X), l9(2, l2)], u9), hq.setBreadcrumbsSourceFactory((e206, t10) => t10.createInstance(u9, e206));
var vNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, d9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, f9 = (_le2 = class extends D {
  constructor(e206, t10, n10, r10) {
    super();
    let i10 = this._register(WK(e206)), a10 = this._register(r10.createMenu(W.EditorContent, e206.contextKeyService)), o10 = Tc(this, a10.onDidChange, () => a10.getActions().length === 0);
    this._register(hc((e207) => {
      if (o10.read(e207)) return;
      let r11 = nu(`div.floating-menu-overlay-widget`);
      r11.root.style.height = `28px`;
      let a11 = t10.createInstance(iq, r11.root, W.EditorContent, { actionViewItemProvider: (e208, r12) => {
        if (!(e208 instanceof _d2)) return;
        let i11 = n10.lookupKeybinding(e208.id);
        if (i11) return t10.createInstance(class extends vL {
          updateLabel() {
            this.options.label && this.label && (this.label.textContent = `${this._commandAction.label} (${i11.getLabel()})`);
          }
        }, e208, { ...r12, keybindingNotRenderedWithLabel: true });
      }, hiddenItemStrategy: 0, menuOptions: { shouldForwardArgs: true }, telemetrySource: `editor.overlayToolbar`, toolbarOptions: { primaryGroup: () => true, useSeparatorsInPrimaryActions: true } });
      e207.store.add(a11), e207.store.add(hc((e208) => {
        a11.context = i10.model.read(e208)?.uri;
      })), e207.store.add(i10.createOverlayWidget({ allowEditorOverflow: false, domNode: r11.root, minContentWidthInPx: FI(0), position: FI({ preference: 1 }) }));
    }));
  }
}, _le2.ID = `editor.contrib.floatingToolbar`, _le2);
f9 = vNe([d9(1, V), d9(2, Dw), d9(3, pd)], f9), af(f9.ID, f9, 1);
var p9 = (_me2 = class extends D {
  constructor(e206) {
    super(), this.editor = e206, this.widget = null, kt && (this._register(e206.onDidChangeConfiguration(() => this.update())), this.update());
  }
  update() {
    let e206 = !this.editor.getOption(104);
    !this.widget && e206 ? this.widget = new yNe(this.editor) : this.widget && !e206 && (this.widget.dispose(), this.widget = null);
  }
  dispose() {
    super.dispose(), this.widget && (this.widget = (this.widget.dispose(), null));
  }
}, _me2.ID = `editor.contrib.iPadShowKeyboard`, _me2), yNe = (_ne2 = class extends D {
  constructor(e206) {
    super(), this.editor = e206, this._domNode = document.createElement(`textarea`), this._domNode.className = `iPadShowKeyboard`, this._register(L(this._domNode, `touchstart`, (e207) => {
      this.editor.focus();
    })), this._register(L(this._domNode, `focus`, (e207) => {
      this.editor.focus();
    })), this.editor.addOverlayWidget(this);
  }
  dispose() {
    this.editor.removeOverlayWidget(this), super.dispose();
  }
  getId() {
    return _ne2.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return { preference: 1 };
  }
}, _ne2.ID = `editor.contrib.ShowKeyboardWidget`, _ne2);
af(p9.ID, p9, 3);
var bNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, m9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, h9, g9 = (_oe2 = class extends D {
  static get(e206) {
    return e206.getContribution(h9.ID);
  }
  constructor(e206, t10, n10) {
    super(), this._editor = e206, this._languageService = n10, this._widget = null, this._register(this._editor.onDidChangeModel((e207) => this.stop())), this._register(this._editor.onDidChangeModelLanguage((e207) => this.stop())), this._register(Pi.onDidChange((e207) => this.stop())), this._register(this._editor.onKeyUp((e207) => e207.keyCode === 9 && this.stop()));
  }
  dispose() {
    this.stop(), super.dispose();
  }
  launch() {
    this._widget || this._editor.hasModel() && (this._widget = new wNe(this._editor, this._languageService));
  }
  stop() {
    this._widget && (this._widget = (this._widget.dispose(), null));
  }
}, h9 = _oe2, _oe2.ID = `editor.contrib.inspectTokens`, _oe2);
g9 = h9 = bNe([m9(1, YU), m9(2, Jf)], g9);
var xNe = class extends G {
  constructor() {
    super({ id: `editor.action.inspectTokens`, label: XF.inspectTokensAction, alias: `Developer: Inspect Tokens`, precondition: void 0 });
  }
  run(e206, t10) {
    g9.get(t10)?.launch();
  }
};
function SNe(e206) {
  let t10 = ``;
  for (let n10 = 0, r10 = e206.length; n10 < r10; n10++) {
    let r11 = e206.charCodeAt(n10);
    switch (r11) {
      case 9:
        t10 += `\u2192`;
        break;
      case 32:
        t10 += `\xB7`;
        break;
      default:
        t10 += String.fromCharCode(r11);
    }
  }
  return t10;
}
function CNe(e206, t10) {
  let n10 = Pi.get(t10);
  if (n10) return n10;
  let r10 = e206.encodeLanguageId(t10);
  return { getInitialState: () => $h, tokenize: (e207, n11, r11) => eg(t10, r11), tokenizeEncoded: (e207, t11, n11) => tg(r10, n11) };
}
var wNe = (_pe2 = class extends D {
  constructor(e206, t10) {
    super(), this.allowEditorOverflow = true, this._editor = e206, this._languageService = t10, this._model = this._editor.getModel(), this._domNode = document.createElement(`div`), this._domNode.className = `tokens-inspect-widget`, this._tokenizationSupport = CNe(this._languageService.languageIdCodec, this._model.getLanguageId()), this._compute(this._editor.getPosition()), this._register(this._editor.onDidChangeCursorPosition((e207) => this._compute(this._editor.getPosition()))), this._editor.addContentWidget(this);
  }
  dispose() {
    this._editor.removeContentWidget(this), super.dispose();
  }
  getId() {
    return _pe2._ID;
  }
  _compute(e206) {
    let t10 = this._getTokensAtLine(e206.lineNumber), n10 = 0;
    for (let r11 = t10.tokens1.length - 1; r11 >= 0; r11--) {
      let i11 = t10.tokens1[r11];
      if (e206.column - 1 >= i11.offset) {
        n10 = r11;
        break;
      }
    }
    let r10 = 0;
    for (let n11 = t10.tokens2.length >>> 1; n11 >= 0; n11--) if (e206.column - 1 >= t10.tokens2[n11 << 1]) {
      r10 = n11;
      break;
    }
    let i10 = this._model.getLineContent(e206.lineNumber), a10 = ``;
    if (n10 < t10.tokens1.length) {
      let e207 = t10.tokens1[n10].offset, r11 = n10 + 1 < t10.tokens1.length ? t10.tokens1[n10 + 1].offset : i10.length;
      a10 = i10.substring(e207, r11);
    }
    Jl(this._domNode, B(`h2.tm-token`, void 0, SNe(a10), B(`span.tm-token-length`, void 0, `${a10.length} ${a10.length === 1 ? `char` : `chars`}`))), z(this._domNode, B(`hr.tokens-inspect-separator`, { style: `clear:both` }));
    let o10 = (r10 << 1) + 1 < t10.tokens2.length ? this._decodeMetadata(t10.tokens2[(r10 << 1) + 1]) : null;
    z(this._domNode, B(`table.tm-metadata-table`, void 0, B(`tbody`, void 0, B(`tr`, void 0, B(`td.tm-metadata-key`, void 0, `language`), B(`td.tm-metadata-value`, void 0, `${o10 ? o10.languageId : `-?-`}`)), B(`tr`, void 0, B(`td.tm-metadata-key`, void 0, `token type`), B(`td.tm-metadata-value`, void 0, `${o10 ? this._tokenTypeToString(o10.tokenType) : `-?-`}`)), B(`tr`, void 0, B(`td.tm-metadata-key`, void 0, `font style`), B(`td.tm-metadata-value`, void 0, `${o10 ? this._fontStyleToString(o10.fontStyle) : `-?-`}`)), B(`tr`, void 0, B(`td.tm-metadata-key`, void 0, `foreground`), B(`td.tm-metadata-value`, void 0, `${o10 ? Y.Format.CSS.formatHex(o10.foreground) : `-?-`}`)), B(`tr`, void 0, B(`td.tm-metadata-key`, void 0, `background`), B(`td.tm-metadata-value`, void 0, `${o10 ? Y.Format.CSS.formatHex(o10.background) : `-?-`}`))))), z(this._domNode, B(`hr.tokens-inspect-separator`)), n10 < t10.tokens1.length && z(this._domNode, B(`span.tm-token-type`, void 0, t10.tokens1[n10].type)), this._editor.layoutContentWidget(this);
  }
  _decodeMetadata(e206) {
    let t10 = Pi.getColorMap(), n10 = ng.getLanguageId(e206), r10 = ng.getTokenType(e206), i10 = ng.getFontStyle(e206), a10 = ng.getForeground(e206), o10 = ng.getBackground(e206);
    return { languageId: this._languageService.languageIdCodec.decodeLanguageId(n10), tokenType: r10, fontStyle: i10, foreground: t10[a10], background: t10[o10] };
  }
  _tokenTypeToString(e206) {
    switch (e206) {
      case 0:
        return `Other`;
      case 1:
        return `Comment`;
      case 2:
        return `String`;
      case 3:
        return `RegEx`;
      default:
        return `??`;
    }
  }
  _fontStyleToString(e206) {
    let t10 = ``;
    return e206 & 1 && (t10 += `italic `), e206 & 2 && (t10 += `bold `), e206 & 4 && (t10 += `underline `), e206 & 8 && (t10 += `strikethrough `), t10.length === 0 && (t10 = `---`), t10;
  }
  _getTokensAtLine(e206) {
    let t10 = this._getStateBeforeLine(e206), n10 = this._tokenizationSupport.tokenize(this._model.getLineContent(e206), true, t10), r10 = this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e206), true, t10);
    return { startState: t10, tokens1: n10.tokens, tokens2: r10.tokens, endState: n10.endState };
  }
  _getStateBeforeLine(e206) {
    let t10 = this._tokenizationSupport.getInitialState();
    for (let n10 = 1; n10 < e206; n10++) t10 = this._tokenizationSupport.tokenize(this._model.getLineContent(n10), true, t10).endState;
    return t10;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return { position: this._editor.getPosition(), preference: [2, 1] };
  }
}, _pe2._ID = `editor.contrib.inspectTokensWidget`, _pe2);
af(g9.ID, g9, 4), q(xNe);
var TNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, _9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, v9, y9 = (_qe = class {
  constructor(e206, t10) {
    this.quickInputService = e206, this.keybindingService = t10, this.registry = cd.as($L.Quickaccess);
  }
  provide(e206) {
    let t10 = new E();
    return t10.add(e206.onDidAccept(() => {
      let [t11] = e206.selectedItems;
      t11 && this.quickInputService.quickAccess.show(t11.prefix, { preserveValue: true });
    })), t10.add(e206.onDidChangeValue((e207) => {
      let t11 = this.registry.getQuickAccessProvider(e207.substr(v9.PREFIX.length));
      t11 && t11.prefix && t11.prefix !== v9.PREFIX && this.quickInputService.quickAccess.show(t11.prefix, { preserveValue: true });
    })), e206.items = this.getQuickAccessProviders().filter((e207) => e207.prefix !== v9.PREFIX), t10;
  }
  getQuickAccessProviders() {
    return this.registry.getQuickAccessProviders().sort((e206, t10) => e206.prefix.localeCompare(t10.prefix)).flatMap((e206) => this.createPicks(e206));
  }
  createPicks(e206) {
    return e206.helpEntries.map((t10) => {
      let n10 = t10.prefix || e206.prefix, r10 = n10 || `\u2026`;
      return { prefix: n10, label: r10, keybinding: t10.commandId ? this.keybindingService.lookupKeybinding(t10.commandId) : void 0, ariaLabel: C(1747, `{0}, {1}`, r10, t10.description), description: t10.description };
    });
  }
}, v9 = _qe, _qe.PREFIX = `?`, _qe);
y9 = v9 = TNe([_9(0, aF), _9(1, Dw)], y9), cd.as($L.Quickaccess).registerQuickAccessProvider({ ctor: y9, prefix: ``, helpEntries: [{ description: QF.helpQuickAccessActionLabel }] });
var b9 = class {
  constructor(e206) {
    this.options = e206, this.rangeHighlightDecorationId = void 0;
  }
  provide(e206, t10, n10) {
    let r10 = new E();
    e206.canAcceptInBackground = !!this.options?.canAcceptInBackground, e206.matchOnLabel = e206.matchOnDescription = e206.matchOnDetail = e206.sortByLabel = false;
    let i10 = r10.add(new Jt());
    return i10.value = this.doProvide(e206, t10, n10), r10.add(this.onDidActiveTextEditorControlChange(() => {
      i10.value = void 0, i10.value = this.doProvide(e206, t10);
    })), r10;
  }
  doProvide(e206, t10, n10) {
    let r10 = new E(), i10 = this.activeTextEditorControl;
    if (i10 && this.canProvideWithTextEditor(i10)) {
      let a10 = { editor: i10 }, o10 = wq(i10);
      if (o10) {
        let e207 = i10.saveViewState() ?? void 0;
        r10.add(o10.onDidChangeCursorPosition(() => {
          e207 = i10.saveViewState() ?? void 0;
        })), a10.restoreViewState = () => {
          e207 && i10 === this.activeTextEditorControl && i10.restoreViewState(e207);
        }, r10.add(Ht(t10.onCancellationRequested)(() => a10.restoreViewState?.()));
      }
      r10.add(T(() => this.clearDecorations(i10))), r10.add(this.provideWithTextEditor(a10, e206, t10, n10));
    } else r10.add(this.provideWithoutTextEditor(e206, t10));
    return r10;
  }
  canProvideWithTextEditor(e206) {
    return true;
  }
  gotoLocation({ editor: e206 }, t10) {
    e206.setSelection(t10.range, `code.jump`), e206.revealRangeInCenter(t10.range, 0), t10.preserveFocus || e206.focus();
    let n10 = e206.getModel();
    n10 && `getLineContent` in n10 && Gg(`${n10.getLineContent(t10.range.startLineNumber)}`);
  }
  getModel(e206) {
    return Cq(e206) ? e206.getModel()?.modified : e206.getModel();
  }
  addDecorations(e206, t10) {
    e206.changeDecorations((e207) => {
      let n10 = [];
      this.rangeHighlightDecorationId && (this.rangeHighlightDecorationId = (n10.push(this.rangeHighlightDecorationId.overviewRulerDecorationId), n10.push(this.rangeHighlightDecorationId.rangeHighlightId), void 0));
      let r10 = [{ range: t10, options: { description: `quick-access-range-highlight`, className: `rangeHighlight`, isWholeLine: true } }, { range: t10, options: { description: `quick-access-range-highlight-overview`, overviewRuler: { color: WS(iC), position: Qp.Full } } }], [i10, a10] = e207.deltaDecorations(n10, r10);
      this.rangeHighlightDecorationId = { rangeHighlightId: i10, overviewRulerDecorationId: a10 };
    });
  }
  clearDecorations(e206) {
    let t10 = this.rangeHighlightDecorationId;
    t10 && (e206.changeDecorations((e207) => {
      e207.deltaDecorations([t10.overviewRulerDecorationId, t10.rangeHighlightId], []);
    }), this.rangeHighlightDecorationId = void 0);
  }
}, ENe = (_re2 = class extends b9 {
  constructor() {
    super({ canAcceptInBackground: true });
  }
  get useZeroBasedOffset() {
    return this.storageService.getBoolean(_re2.ZERO_BASED_OFFSET_STORAGE_KEY, -1, false);
  }
  set useZeroBasedOffset(t10) {
    this.storageService.store(_re2.ZERO_BASED_OFFSET_STORAGE_KEY, t10, -1, 0);
  }
  provideWithoutTextEditor(e206) {
    let t10 = C(1335, `Open a text editor first to go to a line.`);
    return e206.items = [{ label: t10 }], e206.ariaLabel = t10, D.None;
  }
  provideWithTextEditor(t10, n10, r10) {
    let i10 = t10.editor, a10 = new E();
    a10.add(n10.onDidAccept((e206) => {
      let [r11] = n10.selectedItems;
      if (r11) {
        if (!r11.lineNumber) return;
        this.gotoLocation(t10, { range: this.toRange(r11.lineNumber, r11.column), keyMods: n10.keyMods, preserveFocus: e206.inBackground }), e206.inBackground || n10.hide();
      }
    }));
    let o10 = () => {
      let t11 = n10.value.trim().substring(_re2.PREFIX.length), { inOffsetMode: r11, lineNumber: a11, column: o11, label: c11 } = this.parsePosition(i10, t11);
      if (s10.visible = !!r11, n10.items = [{ lineNumber: a11, column: o11, label: c11 }], n10.ariaLabel = c11, !a11) {
        this.clearDecorations(i10);
        return;
      }
      let l10 = this.toRange(a11, o11);
      i10.revealRangeInCenter(l10, 0), this.addDecorations(i10, l10);
    }, s10 = new rR({ title: C(1336, `Use Zero-Based Offset`), icon: F.indexZero, isChecked: this.useZeroBasedOffset, inputActiveOptionBorder: Z(Sy), inputActiveOptionForeground: Z(Ty), inputActiveOptionBackground: Z(wy) });
    a10.add(s10.onChange(() => {
      this.useZeroBasedOffset = !this.useZeroBasedOffset, o10();
    })), n10.toggles = [s10], o10(), a10.add(n10.onDidChangeValue(() => o10()));
    let c10 = wq(i10);
    return c10 && c10.getOptions().get(76).renderType === 2 && (c10.updateOptions({ lineNumbers: `on` }), a10.add(T(() => c10.updateOptions({ lineNumbers: `relative` })))), a10;
  }
  toRange(e206 = 1, t10 = 1) {
    return { startLineNumber: e206, startColumn: t10, endLineNumber: e206, endColumn: t10 };
  }
  parsePosition(e206, t10) {
    let n10 = this.getModel(e206);
    if (!n10) return { label: C(1337, `Open a text editor first to go to a line.`) };
    if (t10.startsWith(`:`)) {
      let e207 = parseInt(t10.substring(1), 10), r10 = n10.getValueLength();
      if (isNaN(e207)) return { inOffsetMode: true, label: this.useZeroBasedOffset ? C(1338, `Type a character position to go to (from 0 to {0}).`, r10 - 1) : C(1339, `Type a character position to go to (from 1 to {0}).`, r10) };
      {
        let t11 = e207 < 0;
        this.useZeroBasedOffset || (e207 -= Math.sign(e207)), t11 && (e207 += r10);
        let i10 = n10.getPositionAt(e207);
        return { ...i10, inOffsetMode: true, label: C(1340, `Press 'Enter' to go to line {0} at column {1}.`, i10.lineNumber, i10.column) };
      }
    } else {
      let e207 = t10.split(/,|:|#/), r10 = n10.getLineCount(), i10 = parseInt(e207[0]?.trim(), 10);
      if (e207.length < 1 || isNaN(i10)) return { label: C(1341, `Type a line number to go to (from 1 to {0}).`, r10) };
      i10 = i10 >= 0 ? i10 : r10 + 1 + i10, i10 = Math.min(Math.max(1, i10), r10);
      let a10 = n10.getLineMaxColumn(i10), o10 = parseInt(e207[1]?.trim(), 10);
      return e207.length < 2 || isNaN(o10) ? { lineNumber: i10, column: 1, label: e207.length < 2 ? C(1342, `Press 'Enter' to go to line {0} or enter : to add a column number.`, i10) : C(1343, `Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).`, i10, a10) } : (o10 = o10 >= 0 ? o10 : a10 + o10, o10 = Math.min(Math.max(1, o10), a10), { lineNumber: i10, column: o10, label: C(1344, `Press 'Enter' to go to line {0} at column {1}.`, i10, o10) });
    }
  }
}, _re2.PREFIX = `:`, _re2.ZERO_BASED_OFFSET_STORAGE_KEY = `gotoLine.useZeroBasedOffset`, _re2), DNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, x9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, S9 = class extends ENe {
  constructor(e206, t10) {
    super(), this.editorService = e206, this.storageService = t10, this.onDidActiveTextEditorControlChange = O.None;
  }
  get activeTextEditorControl() {
    return this.editorService.getFocusedCodeEditor() ?? void 0;
  }
};
S9 = DNe([x9(0, Su), x9(1, dF)], S9);
var C9 = (_se2 = class extends G {
  constructor() {
    super({ id: _se2.ID, label: ZF.gotoLineActionLabel, alias: `Go to Line/Column...`, precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 2085, mac: { primary: 293 }, weight: 100 } });
  }
  run(e206) {
    e206.get(aF).quickAccess.show(S9.PREFIX);
  }
}, _se2.ID = `editor.action.gotoLine`, _se2);
q(C9), cd.as($L.Quickaccess).registerQuickAccessProvider({ ctor: S9, prefix: S9.PREFIX, helpEntries: [{ description: ZF.gotoLineActionLabel, commandId: C9.ID }] });
var w9 = [void 0, []];
function T9(e206, t10, n10 = 0, r10 = 0) {
  let i10 = t10;
  return i10.values && i10.values.length > 1 ? ONe(e206, i10.values, n10, r10) : E9(e206, t10, n10, r10);
}
function ONe(e206, t10, n10, r10) {
  let i10 = 0, a10 = [];
  for (let o10 of t10) {
    let [t11, s10] = E9(e206, o10, n10, r10);
    if (typeof t11 != `number`) return w9;
    i10 += t11, a10.push(...s10);
  }
  return [i10, kNe(a10)];
}
function E9(e206, t10, n10, r10) {
  let i10 = TM(t10.original, t10.originalLowercase, n10, e206, e206.toLowerCase(), r10, { firstMatchCanBeWeak: true, boostFullMatch: true });
  return i10 ? [i10[0], uM(i10)] : w9;
}
function kNe(e206) {
  let t10 = e206.sort((e207, t11) => e207.start - t11.start), n10 = [], r10;
  for (let e207 of t10) !r10 || !ANe(r10, e207) ? (r10 = e207, n10.push(e207)) : (r10.start = Math.min(r10.start, e207.start), r10.end = Math.max(r10.end, e207.end));
  return n10;
}
function ANe(e206, t10) {
  return !(e206.end < t10.start || t10.end < e206.start);
}
function D9(e206) {
  return e206.startsWith(`"`) && e206.endsWith(`"`);
}
var O9 = ` `;
function k9(e206) {
  typeof e206 != `string` && (e206 = ``);
  let t10 = e206.toLowerCase(), { pathNormalized: n10, normalized: r10, normalizedLowercase: i10 } = A9(e206), a10 = n10.indexOf(Xr) >= 0, o10 = D9(e206), s10, c10 = e206.split(O9);
  if (c10.length > 1) for (let e207 of c10) {
    let t11 = D9(e207), { pathNormalized: n11, normalized: r11, normalizedLowercase: i11 } = A9(e207);
    r11 && (s10 || (s10 = []), s10.push({ original: e207, originalLowercase: e207.toLowerCase(), pathNormalized: n11, normalized: r11, normalizedLowercase: i11, expectContiguousMatch: t11 }));
  }
  return { original: e206, originalLowercase: t10, pathNormalized: n10, normalized: r10, normalizedLowercase: i10, values: s10, containsPathSeparator: a10, expectContiguousMatch: o10 };
}
function A9(e206) {
  let t10;
  t10 = wt ? e206.replace(/\//g, Xr) : e206.replace(/\\/g, Xr);
  let n10 = t10.replace(/[\*\u2026\s"]/g, ``);
  return { pathNormalized: t10, normalized: n10, normalizedLowercase: n10.toLowerCase() };
}
function j9(e206) {
  return k9(Array.isArray(e206) ? e206.map((e207) => e207.original).join(O9) : e206.original);
}
var jNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, M9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, N9, P9 = (_te2 = class extends b9 {
  constructor(e206, t10, n10 = /* @__PURE__ */ Object.create(null)) {
    super(n10), this._languageFeaturesService = e206, this._outlineModelService = t10, this.options = n10, this.options.canAcceptInBackground = true;
  }
  provideWithoutTextEditor(e206) {
    return this.provideLabelPick(e206, C(1345, `To go to a symbol, first open a text editor with symbol information.`)), D.None;
  }
  provideWithTextEditor(e206, t10, n10, r10) {
    let i10 = e206.editor, a10 = this.getModel(i10);
    return a10 ? this._languageFeaturesService.documentSymbolProvider.has(a10) ? this.doProvideWithEditorSymbols(e206, a10, t10, n10, r10) : this.doProvideWithoutEditorSymbols(e206, a10, t10, n10) : D.None;
  }
  doProvideWithoutEditorSymbols(e206, t10, n10, r10) {
    let i10 = new E();
    return this.provideLabelPick(n10, C(1346, `The active text editor does not provide symbol information.`)), (async () => {
      !await this.waitForLanguageSymbolRegistry(t10, i10) || r10.isCancellationRequested || i10.add(this.doProvideWithEditorSymbols(e206, t10, n10, r10));
    })(), i10;
  }
  provideLabelPick(e206, t10) {
    e206.items = [{ label: t10, index: 0, kind: 14 }], e206.ariaLabel = t10;
  }
  async waitForLanguageSymbolRegistry(e206, t10) {
    if (this._languageFeaturesService.documentSymbolProvider.has(e206)) return true;
    let n10 = new hs(), r10 = t10.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(() => {
      this._languageFeaturesService.documentSymbolProvider.has(e206) && (r10.dispose(), n10.complete(true));
    }));
    return t10.add(T(() => n10.complete(false))), n10.p;
  }
  doProvideWithEditorSymbols(e206, t10, n10, r10, i10) {
    let a10 = e206.editor, o10 = new E();
    o10.add(n10.onDidAccept((t11) => {
      let [r11] = n10.selectedItems;
      r11 && r11.range && (this.gotoLocation(e206, { range: r11.range.selection, keyMods: n10.keyMods, preserveFocus: t11.inBackground }), i10?.handleAccept?.(r11, t11.inBackground), t11.inBackground || n10.hide());
    })), o10.add(n10.onDidTriggerItemButton(({ item: t11 }) => {
      t11 && t11.range && (this.gotoLocation(e206, { range: t11.range.selection, keyMods: n10.keyMods, forceSideBySide: true }), n10.hide());
    }));
    let s10 = this.getDocumentSymbols(t10, r10), c10 = o10.add(new Jt()), l10 = async (e207) => {
      c10?.value?.cancel(), n10.busy = false, c10.value = new pr(), n10.busy = true;
      try {
        let i11 = k9(n10.value.substr(N9.PREFIX.length).trim()), a11 = await this.doGetSymbolPicks(s10, i11, void 0, c10.value.token, t10);
        if (r10.isCancellationRequested) return;
        if (a11.length > 0) {
          if (n10.items = a11, e207 && i11.original.length === 0) {
            let t11 = Dm(a11, (t12) => !!(t12.type !== `separator` && t12.range && M.containsPosition(t12.range.decoration, e207)));
            t11 && (n10.activeItems = [t11]);
          }
        } else i11.original.length > 0 ? this.provideLabelPick(n10, C(1347, `No matching editor symbols`)) : this.provideLabelPick(n10, C(1348, `No editor symbols`));
      } finally {
        r10.isCancellationRequested || (n10.busy = false);
      }
    };
    return o10.add(n10.onDidChangeValue(() => l10(void 0))), l10(a10.getSelection()?.getPosition()), o10.add(n10.onDidChangeActive(() => {
      let [e207] = n10.activeItems;
      e207 && e207.range && (a10.revealRangeInCenter(e207.range.selection, 0), this.addDecorations(a10, e207.range.decoration));
    })), o10;
  }
  async doGetSymbolPicks(e206, t10, n10, r10, i10) {
    let a10 = await e206;
    if (r10.isCancellationRequested) return [];
    let o10 = t10.original.indexOf(N9.SCOPE_PREFIX) === 0, s10 = +!!o10, c10, l10;
    t10.values && t10.values.length > 1 ? (c10 = j9(t10.values[0]), l10 = j9(t10.values.slice(1))) : c10 = t10;
    let u10, d10 = this.options?.openSideBySideDirection?.();
    d10 && (u10 = [{ iconClass: d10 === `right` ? ju.asClassName(F.splitHorizontal) : ju.asClassName(F.splitVertical), tooltip: d10 === `right` ? C(1349, `Open to the Side`) : C(1350, `Open to the Bottom`) }]);
    let f10 = [];
    for (let e207 = 0; e207 < a10.length; e207++) {
      let r11 = a10[e207], o11 = bte(r11.name), d11 = `$(${Di.toIcon(r11.kind).id}) ${o11}`, p11 = d11.length - o11.length, m11 = r11.containerName;
      n10?.extraContainerLabel && (m11 = m11 ? `${n10.extraContainerLabel} \u2022 ${m11}` : n10.extraContainerLabel);
      let h10, g10, _10, v10;
      if (t10.original.length > s10) {
        let e208 = false;
        if (c10 !== t10 && ([h10, g10] = T9(d11, { ...t10, values: void 0 }, s10, p11), typeof h10 == `number` && (e208 = true)), typeof h10 != `number` && ([h10, g10] = T9(d11, c10, s10, p11), typeof h10 != `number`)) continue;
        if (!e208 && l10) {
          if (m11 && l10.original.length > 0 && ([_10, v10] = T9(m11, l10)), typeof _10 != `number`) continue;
          typeof h10 == `number` && (h10 += _10);
        }
      }
      let y10 = r11.tags && r11.tags.indexOf(1) >= 0;
      f10.push({ index: e207, kind: r11.kind, score: h10, label: d11, ariaLabel: Ei(r11.name, r11.kind), description: m11, highlights: y10 ? void 0 : { label: g10, description: v10 }, range: { selection: M.collapseToStart(r11.selectionRange), decoration: r11.range }, uri: i10.uri, symbolName: o11, strikethrough: y10, buttons: u10 });
    }
    let p10 = f10.sort((e207, t11) => o10 ? this.compareByKindAndScore(e207, t11) : this.compareByScore(e207, t11)), m10 = [];
    if (o10) {
      let r11 = function() {
        t11 && typeof e207 == `number` && n11 > 0 && (t11.label = La(I9[e207] || F9, n11));
      };
      let e207, t11, n11 = 0;
      for (let i11 of p10) e207 === i11.kind ? n11++ : (r11(), e207 = i11.kind, n11 = 1, t11 = { type: `separator` }, m10.push(t11)), m10.push(i11);
      r11();
    } else p10.length > 0 && (m10 = [{ label: C(1351, `symbols ({0})`, f10.length), type: `separator` }, ...p10]);
    return m10;
  }
  compareByScore(e206, t10) {
    if (typeof e206.score != `number` && typeof t10.score == `number`) return 1;
    if (typeof e206.score == `number` && typeof t10.score != `number`) return -1;
    if (typeof e206.score == `number` && typeof t10.score == `number`) {
      if (e206.score > t10.score) return -1;
      if (e206.score < t10.score) return 1;
    }
    return e206.index < t10.index ? -1 : +(e206.index > t10.index);
  }
  compareByKindAndScore(e206, t10) {
    let n10 = I9[e206.kind] || F9, r10 = I9[t10.kind] || F9, i10 = n10.localeCompare(r10);
    return i10 === 0 ? this.compareByScore(e206, t10) : i10;
  }
  async getDocumentSymbols(e206, t10) {
    let n10 = await this._outlineModelService.getOrCreate(e206, t10);
    return t10.isCancellationRequested ? [] : n10.asListOfDocumentSymbols();
  }
}, N9 = _te2, _te2.PREFIX = `@`, _te2.SCOPE_PREFIX = `:`, _te2.PREFIX_BY_CATEGORY = `${_te2.PREFIX}${_te2.SCOPE_PREFIX}`, _te2);
P9 = N9 = jNe([M9(0, X), M9(1, l2)], P9);
var F9 = C(1352, `properties ({0})`), I9 = { 5: C(1353, `methods ({0})`), 11: C(1354, `functions ({0})`), 8: C(1355, `constructors ({0})`), 12: C(1356, `variables ({0})`), 4: C(1357, `classes ({0})`), 22: C(1358, `structs ({0})`), 23: C(1359, `events ({0})`), 24: C(1360, `operators ({0})`), 10: C(1361, `interfaces ({0})`), 2: C(1362, `namespaces ({0})`), 3: C(1363, `packages ({0})`), 25: C(1364, `type parameters ({0})`), 1: C(1365, `modules ({0})`), 6: C(1366, `properties ({0})`), 9: C(1367, `enumerations ({0})`), 21: C(1368, `enumeration members ({0})`), 14: C(1369, `strings ({0})`), 0: C(1370, `files ({0})`), 17: C(1371, `arrays ({0})`), 15: C(1372, `numbers ({0})`), 16: C(1373, `booleans ({0})`), 18: C(1374, `objects ({0})`), 19: C(1375, `keys ({0})`), 7: C(1376, `fields ({0})`), 13: C(1377, `constants ({0})`) }, MNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, L9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, R9 = class extends P9 {
  constructor(e206, t10, n10) {
    super(t10, n10), this.editorService = e206, this.onDidActiveTextEditorControlChange = O.None;
  }
  get activeTextEditorControl() {
    return this.editorService.getFocusedCodeEditor() ?? void 0;
  }
};
R9 = MNe([L9(0, Su), L9(1, X), L9(2, l2)], R9);
var z9 = (_ue2 = class extends G {
  constructor() {
    super({ id: _ue2.ID, label: eI.quickOutlineActionLabel, alias: `Go to Symbol...`, precondition: $.hasDocumentSymbolProvider, kbOpts: { kbExpr: $.focus, primary: 3117, weight: 100 }, contextMenuOpts: { group: `navigation`, order: 3 } });
  }
  run(e206) {
    e206.get(aF).quickAccess.show(P9.PREFIX, { itemActivation: nF.NONE });
  }
}, _ue2.ID = `editor.action.quickOutline`, _ue2);
q(z9), cd.as($L.Quickaccess).registerQuickAccessProvider({ ctor: R9, prefix: P9.PREFIX, helpEntries: [{ description: eI.quickOutlineActionLabel, prefix: P9.PREFIX, commandId: z9.ID }, { description: eI.quickOutlineByCategoryActionLabel, prefix: P9.PREFIX_BY_CATEGORY }] });
function NNe(e206) {
  let t10 = /* @__PURE__ */ new Map();
  for (let n10 of e206) t10.set(n10, (t10.get(n10) ?? 0) + 1);
  return t10;
}
var PNe = class e205 {
  constructor() {
    this.chunkCount = 0, this.chunkOccurrences = /* @__PURE__ */ new Map(), this.documents = /* @__PURE__ */ new Map();
  }
  calculateScores(e206, t10) {
    let n10 = this.computeEmbedding(e206), r10 = /* @__PURE__ */ new Map(), i10 = [];
    for (let [e207, a10] of this.documents) {
      if (t10.isCancellationRequested) return [];
      for (let t11 of a10.chunks) {
        let a11 = this.computeSimilarityScore(t11, n10, r10);
        a11 > 0 && i10.push({ key: e207, score: a11 });
      }
    }
    return i10;
  }
  static termFrequencies(t10) {
    return NNe(e205.splitTerms(t10));
  }
  static *splitTerms(e206) {
    let t10 = (e207) => e207.toLowerCase();
    for (let [n10] of e206.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)) {
      yield t10(n10);
      let e207 = n10.replace(/([a-z])([A-Z])/g, `$1 $2`).split(/\s+/g);
      if (e207.length > 1) for (let n11 of e207) n11.length > 2 && /\p{Letter}{3,}/gu.test(n11) && (yield t10(n11));
    }
  }
  updateDocuments(t10) {
    for (let { key: e206 } of t10) this.deleteDocument(e206);
    for (let n10 of t10) {
      let t11 = [];
      for (let r10 of n10.textChunks) {
        let n11 = e205.termFrequencies(r10);
        for (let e206 of n11.keys()) this.chunkOccurrences.set(e206, (this.chunkOccurrences.get(e206) ?? 0) + 1);
        t11.push({ text: r10, tf: n11 });
      }
      this.chunkCount += t11.length, this.documents.set(n10.key, { chunks: t11 });
    }
    return this;
  }
  deleteDocument(e206) {
    let t10 = this.documents.get(e206);
    if (t10) {
      this.documents.delete(e206), this.chunkCount -= t10.chunks.length;
      for (let e207 of t10.chunks) for (let t11 of e207.tf.keys()) {
        let e208 = this.chunkOccurrences.get(t11);
        if (typeof e208 == `number`) {
          let n10 = e208 - 1;
          n10 <= 0 ? this.chunkOccurrences.delete(t11) : this.chunkOccurrences.set(t11, n10);
        }
      }
    }
  }
  computeSimilarityScore(e206, t10, n10) {
    let r10 = 0;
    for (let [i10, a10] of Object.entries(t10)) {
      let t11 = e206.tf.get(i10);
      if (!t11) continue;
      let o10 = n10.get(i10);
      typeof o10 != `number` && (o10 = this.computeIdf(i10), n10.set(i10, o10));
      let s10 = t11 * o10;
      r10 += s10 * a10;
    }
    return r10;
  }
  computeEmbedding(t10) {
    let n10 = e205.termFrequencies(t10);
    return this.computeTfidf(n10);
  }
  computeIdf(e206) {
    let t10 = this.chunkOccurrences.get(e206) ?? 0;
    return t10 > 0 ? Math.log((this.chunkCount + 1) / t10) : 0;
  }
  computeTfidf(e206) {
    let t10 = /* @__PURE__ */ Object.create(null);
    for (let [n10, r10] of e206) {
      let e207 = this.computeIdf(n10);
      e207 > 0 && (t10[n10] = r10 * e207);
    }
    return t10;
  }
};
function FNe(e206) {
  let t10 = e206.slice(0);
  t10.sort((e207, t11) => t11.score - e207.score);
  let n10 = t10[0]?.score ?? 0;
  if (n10 > 0) for (let e207 of t10) e207.score /= n10;
  return t10;
}
var B9;
(function(e206) {
  e206[e206.NO_ACTION = 0] = `NO_ACTION`, e206[e206.CLOSE_PICKER = 1] = `CLOSE_PICKER`, e206[e206.REFRESH_PICKER = 2] = `REFRESH_PICKER`, e206[e206.REMOVE_ITEM = 3] = `REMOVE_ITEM`;
})(B9 || (B9 = {}));
function V9(e206) {
  let t10 = e206;
  return Array.isArray(t10.items);
}
function H9(e206) {
  let t10 = e206;
  return !!t10.picks && t10.additionalPicks instanceof Promise;
}
var INe = class extends D {
  constructor(e206, t10) {
    super(), this.prefix = e206, this.options = t10;
  }
  provide(e206, t10, n10) {
    let r10 = new E();
    e206.canAcceptInBackground = !!this.options?.canAcceptInBackground, e206.matchOnLabel = e206.matchOnDescription = e206.matchOnDetail = e206.sortByLabel = false;
    let i10, a10 = r10.add(new Jt()), o10 = async () => {
      i10?.dispose(true), e206.busy = false;
      let r11 = a10.value = new E();
      i10 = r11.add(new pr(t10));
      let o11 = i10.token, s11 = e206.value.substring(this.prefix.length);
      this.options?.shouldSkipTrimPickFilter || (s11 = s11.trim());
      let c10 = this._getPicks(s11, r11, o11, n10), l10 = (t11, n11) => {
        let r12, i11;
        if (V9(t11) ? (r12 = t11.items, i11 = t11.active) : r12 = t11, r12.length === 0) {
          if (n11) return false;
          (s11.length > 0 || e206.hideInput) && this.options?.noResultsPick && (r12 = Xe(this.options.noResultsPick) ? [this.options.noResultsPick(s11)] : [this.options.noResultsPick]);
        }
        return e206.items = r12, i11 && (e206.activeItems = [i11]), true;
      }, u10 = async (t11) => {
        let n11 = false, r12 = false;
        await Promise.all([(async () => {
          typeof t11.mergeDelay == `number` && (await is(t11.mergeDelay), o11.isCancellationRequested) || r12 || (n11 = l10(t11.picks, true));
        })(), (async () => {
          e206.busy = true;
          try {
            let r13 = await t11.additionalPicks;
            if (o11.isCancellationRequested) return;
            let i11, a11;
            V9(t11.picks) ? (i11 = t11.picks.items, a11 = t11.picks.active) : i11 = t11.picks;
            let s12, c11;
            if (V9(r13) ? (s12 = r13.items, c11 = r13.active) : s12 = r13, s12.length > 0 || !n11) {
              let t12;
              if (!a11 && !c11) {
                let n12 = e206.activeItems[0];
                n12 && i11.indexOf(n12) !== -1 && (t12 = n12);
              }
              l10({ items: [...i11, ...s12], active: a11 || c11 || t12 });
            }
          } finally {
            o11.isCancellationRequested || (e206.busy = false), r12 = true;
          }
        })()]);
      };
      if (c10 !== null) if (H9(c10)) await u10(c10);
      else if (!(c10 instanceof Promise)) l10(c10);
      else {
        e206.busy = true;
        try {
          let e207 = await c10;
          if (o11.isCancellationRequested) return;
          H9(e207) ? await u10(e207) : l10(e207);
        } finally {
          o11.isCancellationRequested || (e206.busy = false);
        }
      }
    };
    r10.add(e206.onDidChangeValue(() => o10())), o10(), r10.add(e206.onDidAccept((t11) => {
      if (n10?.handleAccept) {
        t11.inBackground || e206.hide(), n10.handleAccept?.(e206.activeItems[0], t11.inBackground);
        return;
      }
      let [r11] = e206.selectedItems;
      typeof r11?.accept == `function` && (t11.inBackground || e206.hide(), r11.accept(e206.keyMods, t11));
    }));
    let s10 = async (n11, r11) => {
      if (typeof r11.trigger != `function`) return;
      let i11 = r11.buttons?.indexOf(n11) ?? -1;
      if (i11 >= 0) {
        let n12 = r11.trigger(i11, e206.keyMods), a11 = typeof n12 == `number` ? n12 : await n12;
        if (t10.isCancellationRequested) return;
        switch (a11) {
          case B9.NO_ACTION:
            break;
          case B9.CLOSE_PICKER:
            e206.hide();
            break;
          case B9.REFRESH_PICKER:
            o10();
            break;
          case B9.REMOVE_ITEM: {
            let t11 = e206.items.indexOf(r11);
            if (t11 !== -1) {
              let n13 = e206.items.slice(), r12 = n13.splice(t11, 1), i12 = e206.activeItems.filter((e207) => e207 !== r12[0]), a12 = e206.keepScrollPosition;
              e206.keepScrollPosition = true, e206.items = n13, i12 && (e206.activeItems = i12), e206.keepScrollPosition = a12;
            }
            break;
          }
        }
      }
    };
    return r10.add(e206.onDidTriggerItemButton(({ button: e207, item: t11 }) => s10(e207, t11))), r10.add(e206.onDidTriggerSeparatorButton(({ button: e207, separator: t11 }) => s10(e207, t11))), r10;
  }
};
new Td(1e4);
var LNe = new Td(1e4);
function RNe(e206) {
  return BNe(e206, `NFD`, LNe);
}
var zNe = /[^\u0000-\u0080]/;
function BNe(e206, t10, n10) {
  if (!e206) return e206;
  let r10 = n10.get(e206);
  if (r10) return r10;
  let i10;
  return i10 = zNe.test(e206) ? e206.normalize(t10) : e206, n10.set(e206, i10), i10;
}
var VNe = /* @__PURE__ */ (function() {
  let e206 = /[\u0300-\u036f]/g;
  return function(t10) {
    return RNe(t10).replace(e206, ``);
  };
})(), U9 = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, W9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, G9, K9, q9 = (_ve2 = class extends INe {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(G9.PREFIX, e206), this.keybindingService = n10, this.commandService = r10, this.telemetryService = i10, this.dialogService = a10, this.commandsHistory = this._register(t10.createInstance(J9)), this.options = e206;
  }
  async _getPicks(e206, t10, n10, r10) {
    let i10 = await this.getCommandPicks(n10);
    if (n10.isCancellationRequested) return [];
    let a10 = Ht(() => {
      let t11 = new PNe();
      return t11.updateDocuments(i10.map((e207) => ({ key: e207.commandId, textChunks: [this.getTfIdfChunk(e207)] }))), FNe(t11.calculateScores(e206, n10)).filter((e207) => e207.score > G9.TFIDF_THRESHOLD).slice(0, G9.TFIDF_MAX_RESULTS);
    }), o10 = this.normalizeForFiltering(e206), s10 = [];
    for (let t11 of i10) {
      t11.labelNoAccents ?? (t11.labelNoAccents = this.normalizeForFiltering(t11.label));
      let r11 = G9.WORD_FILTER(o10, t11.labelNoAccents) ?? void 0, i11;
      if (t11.commandAlias && (t11.aliasNoAccents ?? (t11.aliasNoAccents = this.normalizeForFiltering(t11.commandAlias)), i11 = G9.WORD_FILTER(o10, t11.aliasNoAccents) ?? void 0), r11 || i11) t11.highlights = { label: r11, detail: this.options.showAlias ? i11 : void 0 }, s10.push(t11);
      else if (e206 === t11.commandId) s10.push(t11);
      else if (e206.length >= 3) {
        let e207 = a10();
        if (n10.isCancellationRequested) return [];
        let r12 = e207.find((e208) => e208.key === t11.commandId);
        r12 && (t11.tfIdfScore = r12.score, s10.push(t11));
      }
    }
    let c10 = /* @__PURE__ */ new Map();
    for (let e207 of s10) {
      let t11 = c10.get(e207.label);
      t11 ? (e207.description = e207.commandId, t11.description = t11.commandId) : c10.set(e207.label, e207);
    }
    s10.sort((e207, t11) => {
      if (e207.tfIdfScore && t11.tfIdfScore) return e207.tfIdfScore === t11.tfIdfScore ? e207.label.localeCompare(t11.label) : t11.tfIdfScore - e207.tfIdfScore;
      if (e207.tfIdfScore) return 1;
      if (t11.tfIdfScore) return -1;
      let n11 = this.commandsHistory.peek(e207.commandId), r11 = this.commandsHistory.peek(t11.commandId);
      if (n11 && r11) return n11 > r11 ? -1 : 1;
      if (n11) return -1;
      if (r11) return 1;
      if (this.options.suggestedCommandIds) {
        let n12 = this.options.suggestedCommandIds.has(e207.commandId), r12 = this.options.suggestedCommandIds.has(t11.commandId);
        if (n12 && r12) return 0;
        if (n12) return -1;
        if (r12) return 1;
      }
      let i11 = e207.commandCategory === p7.Developer.value, a11 = t11.commandCategory === p7.Developer.value;
      return i11 && !a11 ? 1 : !i11 && a11 ? -1 : e207.label.localeCompare(t11.label);
    });
    let l10 = [], u10 = false, d10 = true, f10 = !!this.options.suggestedCommandIds;
    for (let e207 = 0; e207 < s10.length; e207++) {
      let t11 = s10[e207];
      e207 === 0 && this.commandsHistory.peek(t11.commandId) && (l10.push({ type: `separator`, label: C(1740, `recently used`) }), u10 = true), d10 && t11.tfIdfScore !== void 0 && (l10.push({ type: `separator`, label: C(1741, `similar commands`) }), d10 = false), f10 && t11.tfIdfScore === void 0 && !this.commandsHistory.peek(t11.commandId) && this.options.suggestedCommandIds?.has(t11.commandId) && (l10.push({ type: `separator`, label: C(1742, `commonly used`) }), u10 = true, f10 = false), u10 && t11.tfIdfScore === void 0 && !this.commandsHistory.peek(t11.commandId) && !this.options.suggestedCommandIds?.has(t11.commandId) && (l10.push({ type: `separator`, label: C(1743, `other commands`) }), u10 = false), l10.push(this.toCommandPick(t11, r10));
    }
    return this.hasAdditionalCommandPicks(e206, n10) ? { picks: l10, additionalPicks: (async () => {
      let t11 = await this.getAdditionalCommandPicks(i10, s10, e206, n10);
      if (n10.isCancellationRequested) return [];
      let a11 = t11.map((e207) => this.toCommandPick(e207, r10));
      return d10 && a11[0]?.type !== `separator` && a11.unshift({ type: `separator`, label: C(1744, `similar commands`) }), a11;
    })() } : l10;
  }
  toCommandPick(e206, t10) {
    if (e206.type === `separator`) return e206;
    let n10 = this.keybindingService.lookupKeybinding(e206.commandId), r10 = n10 ? C(1745, `{0}, {1}`, e206.label, n10.getAriaLabel()) : e206.label;
    return { ...e206, ariaLabel: r10, detail: this.options.showAlias && e206.commandAlias !== e206.label ? e206.commandAlias : void 0, keybinding: n10, accept: async () => {
      this.commandsHistory.push(e206.commandId), this.telemetryService.publicLog2(`workbenchActionExecuted`, { id: e206.commandId, from: t10?.from ?? `quick open` });
      try {
        e206.args?.length ? await this.commandService.executeCommand(e206.commandId, ...e206.args) : await this.commandService.executeCommand(e206.commandId);
      } catch (t11) {
        we(t11) || this.dialogService.error(C(1746, `Command '{0}' resulted in an error`, e206.label), TY(t11));
      }
    } };
  }
  getTfIdfChunk({ label: e206, commandAlias: t10, commandDescription: n10 }) {
    let r10 = e206;
    return t10 && t10 !== e206 && (r10 += ` - ${t10}`), n10 && n10.value !== e206 && (r10 += ` - ${n10.value === n10.original ? n10.value : `${n10.value} (${n10.original})`}`), r10;
  }
  normalizeForFiltering(e206) {
    let t10 = VNe(e206);
    return t10.length === e206.length ? t10 : (this.telemetryService.publicLog2(`QuickAccess:FilterLengthMismatch`, { originalLength: e206.length, normalizedLength: t10.length }), e206);
  }
}, G9 = _ve2, _ve2.PREFIX = `>`, _ve2.TFIDF_THRESHOLD = 0.5, _ve2.TFIDF_MAX_RESULTS = 5, _ve2.WORD_FILTER = jj(Mj, tM, Pj), _ve2);
q9 = G9 = U9([W9(1, V), W9(2, Dw), W9(3, Mu), W9(4, bd), W9(5, Gk)], q9);
var J9 = (_we2 = class extends D {
  constructor(e206, t10, n10) {
    super(), this.storageService = e206, this.configurationService = t10, this.logService = n10, this.configuredCommandsHistoryLength = 0, this.updateConfiguration(), this.load(), this.registerListeners();
  }
  registerListeners() {
    this._register(this.configurationService.onDidChangeConfiguration((e206) => this.updateConfiguration(e206))), this._register(this.storageService.onWillSaveState((e206) => {
      e206.reason === fF.SHUTDOWN && this.saveState();
    }));
  }
  updateConfiguration(e206) {
    e206 && !e206.affectsConfiguration(`workbench.commandPalette.history`) || (this.configuredCommandsHistoryLength = K9.getConfiguredCommandHistoryLength(this.configurationService), K9.cache && K9.cache.limit !== this.configuredCommandsHistoryLength && (K9.cache.limit = this.configuredCommandsHistoryLength, K9.hasChanges = true));
  }
  load() {
    let e206 = this.storageService.get(K9.PREF_KEY_CACHE, 0), t10;
    if (e206) try {
      t10 = JSON.parse(e206);
    } catch (e207) {
      this.logService.error(`[CommandsHistory] invalid data: ${e207}`);
    }
    let n10 = K9.cache = new Td(this.configuredCommandsHistoryLength, 1);
    if (t10) {
      let e207;
      e207 = t10.usesLRU ? t10.entries : t10.entries.sort((e208, t11) => e208.value - t11.value), e207.forEach((e208) => n10.set(e208.key, e208.value));
    }
    K9.counter = this.storageService.getNumber(K9.PREF_KEY_COUNTER, 0, K9.counter);
  }
  push(e206) {
    K9.cache && (K9.cache.set(e206, K9.counter++), K9.hasChanges = true);
  }
  peek(e206) {
    return K9.cache?.peek(e206);
  }
  saveState() {
    if (!K9.cache || !K9.hasChanges) return;
    let e206 = { usesLRU: true, entries: [] };
    K9.cache.forEach((t10, n10) => e206.entries.push({ key: n10, value: t10 })), this.storageService.store(K9.PREF_KEY_CACHE, JSON.stringify(e206), 0, 0), this.storageService.store(K9.PREF_KEY_COUNTER, K9.counter, 0, 0), K9.hasChanges = false;
  }
  static getConfiguredCommandHistoryLength(e206) {
    let t10 = e206.getValue().workbench?.commandPalette?.history;
    return typeof t10 == `number` ? t10 : K9.DEFAULT_COMMANDS_HISTORY_LENGTH;
  }
}, K9 = _we2, _we2.DEFAULT_COMMANDS_HISTORY_LENGTH = 50, _we2.PREF_KEY_CACHE = `commandPalette.mru.cache`, _we2.PREF_KEY_COUNTER = `commandPalette.mru.counter`, _we2.counter = 1, _we2.hasChanges = false, _we2);
J9 = K9 = U9([W9(0, dF), W9(1, Uf), W9(2, Ud)], J9);
var HNe = class extends q9 {
  constructor(e206, t10, n10, r10, i10, a10) {
    super(e206, t10, n10, r10, i10, a10);
  }
  getCodeEditorCommandPicks() {
    let e206 = this.activeTextEditorControl;
    if (!e206) return [];
    let t10 = [];
    for (let n10 of e206.getSupportedActions()) {
      let e207;
      n10.metadata?.description && (e207 = t_e(n10.metadata.description) ? n10.metadata.description : { original: n10.metadata.description, value: n10.metadata.description }), t10.push({ commandId: n10.id, commandAlias: n10.alias, commandDescription: e207, label: kM(n10.label) || n10.id });
    }
    return t10;
  }
}, UNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Y9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, X9 = class extends HNe {
  get activeTextEditorControl() {
    return this.codeEditorService.getFocusedCodeEditor() ?? void 0;
  }
  constructor(e206, t10, n10, r10, i10, a10) {
    super({ showAlias: false }, e206, n10, r10, i10, a10), this.codeEditorService = t10;
  }
  async getCommandPicks() {
    return this.getCodeEditorCommandPicks();
  }
  hasAdditionalCommandPicks() {
    return false;
  }
  async getAdditionalCommandPicks() {
    return [];
  }
};
X9 = UNe([Y9(0, V), Y9(1, Su), Y9(2, Dw), Y9(3, Mu), Y9(4, bd), Y9(5, Gk)], X9);
var Z9 = (_xe2 = class extends G {
  constructor() {
    super({ id: _xe2.ID, label: $F.quickCommandActionLabel, alias: `Command Palette`, precondition: void 0, kbOpts: { kbExpr: $.focus, primary: 59, weight: 100 }, contextMenuOpts: { group: `z_commands`, order: 1 } });
  }
  run(e206) {
    e206.get(aF).quickAccess.show(X9.PREFIX);
  }
}, _xe2.ID = `editor.action.quickCommand`, _xe2);
q(Z9), cd.as($L.Quickaccess).registerQuickAccessProvider({ ctor: X9, prefix: X9.PREFIX, helpEntries: [{ description: $F.quickCommandHelp, commandId: Z9.ID }] });
var WNe = function(e206, t10, n10, r10) {
  var i10 = arguments.length, a10 = i10 < 3 ? t10 : r10 === null ? r10 = Object.getOwnPropertyDescriptor(t10, n10) : r10, o10;
  if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a10 = Reflect.decorate(e206, t10, n10, r10);
  else for (var s10 = e206.length - 1; s10 >= 0; s10--) (o10 = e206[s10]) && (a10 = (i10 < 3 ? o10(a10) : i10 > 3 ? o10(t10, n10, a10) : o10(t10, n10)) || a10);
  return i10 > 3 && a10 && Object.defineProperty(t10, n10, a10), a10;
}, Q9 = function(e206, t10) {
  return function(n10, r10) {
    t10(n10, r10, e206);
  };
}, $9 = class extends C$ {
  constructor(e206, t10, n10, r10, i10, a10, o10) {
    super(true, e206, t10, n10, r10, i10, a10, o10);
  }
};
$9 = WNe([Q9(1, nd), Q9(2, Su), Q9(3, dw), Q9(4, V), Q9(5, dF), Q9(6, Uf)], $9), af(C$.ID, $9, 4), q(class extends G {
  constructor() {
    super({ id: `editor.action.toggleHighContrast`, label: nI.toggleHighContrast, alias: `Toggle High Contrast Theme`, precondition: void 0 }), this._originalThemeName = null;
  }
  run(e206, t10) {
    let n10 = e206.get(YU), r10 = n10.getColorTheme();
    Fb(r10.type) ? (n10.setTheme(this._originalThemeName || (Ib(r10.type) ? `vs-dark` : `vs`)), this._originalThemeName = null) : (n10.setTheme(Ib(r10.type) ? BU : VU), this._originalThemeName = r10.themeName);
  }
});
export {
  vJ as a,
  hJ as c,
  xJ as d,
  bJ as f,
  CJ as h,
  pJ as i,
  gJ as l,
  Dbe as m,
  dJ as n,
  yJ as o,
  SJ as p,
  fJ as r,
  mJ as s,
  uJ as t,
  _J2 as u
};
